Complete WP-0006 through WP-0009: registry expansion, catalog, graph, tests
Some checks failed
ci / validate-registry (push) Has been cancelled

Register six new capabilities (12 total), add searchable catalog UI and graph
explorer, introduce pytest suite with CI fail-on-warnings, and close gap
analysis priorities 13 and 16. WP-0010 remains backlog for network federation.
This commit is contained in:
2026-06-15 02:24:20 +02:00
parent 399690a5b6
commit e766f38e6f
30 changed files with 1632 additions and 80 deletions

View File

@@ -64,7 +64,7 @@ def cmd_validate(args: argparse.Namespace) -> int:
for error in errors:
print(f"error: {error}", file=sys.stderr)
if errors:
if errors or (args.fail_on_warnings and warnings):
return 1
print(f"ok: validated {len(paths)} capability entr{'y' if len(paths) == 1 else 'ies'}")
return 0
@@ -167,18 +167,27 @@ def cmd_graph(args: argparse.Namespace) -> int:
print(content, end="")
else:
path = write_graph()
from reuse_surface.catalog import GRAPH_HTML, render_graph_explorer
GRAPH_HTML.parent.mkdir(parents=True, exist_ok=True)
GRAPH_HTML.write_text(render_graph_explorer(content), encoding="utf-8")
print(f"ok: wrote {path.relative_to(ROOT)}")
print(f"ok: wrote {GRAPH_HTML.relative_to(ROOT)}")
for warning in warnings:
print(f"warning: {warning}", file=sys.stderr)
if args.fail_on_warnings and warnings:
return 1
return 0
def cmd_catalog(args: argparse.Namespace) -> int:
index = load_index()
indexed_entries = _load_indexed_entries()
md_path, html_path = write_catalog(index, indexed_entries)
print(f"ok: wrote {md_path.relative_to(ROOT)}")
print(f"ok: wrote {html_path.relative_to(ROOT)}")
paths = write_catalog(
index, indexed_entries, mermaid_source=render_mermaid()
)
for path in paths:
print(f"ok: wrote {path.relative_to(ROOT)}")
return 0
@@ -237,6 +246,11 @@ def main(argv: list[str] | None = None) -> int:
action="store_true",
help="check relation cycles and broken references",
)
validate.add_argument(
"--fail-on-warnings",
action="store_true",
help="exit non-zero when warnings are present",
)
validate.set_defaults(func=cmd_validate)
federation = subparsers.add_parser(
@@ -290,6 +304,11 @@ def main(argv: list[str] | None = None) -> int:
action="store_true",
help="report depends_on cycles and broken relation references",
)
graph.add_argument(
"--fail-on-warnings",
action="store_true",
help="exit non-zero when relation warnings are present",
)
graph.set_defaults(func=cmd_graph)
args = parser.parse_args(argv)