generated from coulomb/repo-seed
feat(doi): Repository DoI automated gate and dashboard integration (CUST-WP-0024)
Implements the 14-criterion DoI checklist as a runnable gate with API,
MCP tools, CLI script, and dashboard integration.
Core components:
- api/doi_engine.py — async engine evaluating all 14 criteria (asyncio.to_thread
for non-blocking HTTP self-calls), shared by API and CLI
- api/schemas/doi.py — DoICriterion, DoIReport, DoISummaryEntry schemas
- api/routers/repos.py — GET /repos/{slug}/doi + GET /repos/doi/summary
- scripts/check_doi.py — CLI: make check-doi REPO=<slug> / check-doi-all
- mcp_server/server.py — check_repo_doi(), get_doi_summary() tools
Dashboard (repos.md):
- DoI tier badge per repo (None/Core/Standard/Full) colour-coded red→green
- Domain block shows lowest DoI tier across its repos
- DoI KPI card in summary row
- DoI filter in All Repos Table
- Link to Repository DoI policy page
Also fixes: TPSC snapshots 500 error (missing nested selectinload for
catalog_entry relationship in list_snapshots endpoint).
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2045,6 +2045,40 @@ def get_gdpr_report() -> str:
|
||||
return json.dumps(_get("/tpsc/report/gdpr"), indent=2)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Repository Definition of Integrated (DoI)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@mcp.tool()
|
||||
def check_repo_doi(repo_slug: str) -> str:
|
||||
"""Evaluate the 14 DoI criteria for a repo and return a full report.
|
||||
|
||||
Criteria are grouped into three tiers:
|
||||
Core (C1–C4): registered, domain, path, remote URL
|
||||
Standard (C5–C9): SCOPE.md, CLAUDE.md, workplan, SBOM, TPSC
|
||||
Full (C10–C14): repo goal, capabilities, agents, clean consistency, host paths
|
||||
|
||||
Status values: pass | fail | warn | skip
|
||||
|
||||
The 'tier' field shows the highest tier where ALL criteria pass or warn:
|
||||
none | core | standard | full
|
||||
|
||||
Args:
|
||||
repo_slug: Registered repo slug (e.g. 'llm-connect', 'the-custodian')
|
||||
"""
|
||||
return json.dumps(_get(f"/repos/{repo_slug}/doi"), indent=2)
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def get_doi_summary() -> str:
|
||||
"""Return DoI tier for all active repos, sorted worst-first.
|
||||
|
||||
Useful at session start to spot repos that need integration work.
|
||||
Tiers: none (red) → core → standard → full (green).
|
||||
"""
|
||||
return json.dumps(_get("/repos/doi/summary"), indent=2)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Entry point
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user