Implement REUSE-WP-0013 registry establish, update, and stats
Some checks failed
ci / validate-registry (push) Has been cancelled

Add stats, establish (scaffold, publish-check, discover), and update CLI
commands with optional llm-connect bridge, validate --root for sibling repos,
pytest coverage, and documentation for sibling registry onboarding.
This commit is contained in:
2026-06-16 01:21:01 +02:00
parent fb712b4b98
commit 70a5003f6e
19 changed files with 1740 additions and 30 deletions

View File

@@ -60,4 +60,31 @@ def parse_vector(vector: str) -> dict[str, str]:
def level_at_least(dimension: str, current: str, minimum: str) -> bool:
order = LEVEL_ORDERS[dimension]
return order.index(current) >= order.index(minimum)
return order.index(current) >= order.index(minimum)
def registry_paths(repo_root: Path) -> dict[str, Path]:
registry = repo_root / "registry"
return {
"registry": registry,
"capabilities": registry / "capabilities",
"index": registry / "indexes" / "capabilities.yaml",
"sources": registry / "federation" / "sources.yaml",
}
def load_index_at(path: Path) -> dict[str, Any]:
with path.open(encoding="utf-8") as handle:
return yaml.safe_load(handle)
def entry_vector(front_matter: dict[str, Any]) -> str:
discovery = front_matter["maturity"]["discovery"]["current"]
availability = front_matter["maturity"]["availability"]["current"]
completeness = front_matter["external_evidence"]["completeness"]["level"]
reliability = front_matter["external_evidence"]["reliability"]["level"]
return f"{discovery} / {availability} / {completeness} / {reliability}"
def vectors_match(index_vector: str, front_matter: dict[str, Any]) -> bool:
return index_vector.replace(" ", "") == entry_vector(front_matter).replace(" ", "")