zettelkasten.dashboard.backend.routes.coverage¶
zettelkasten.dashboard.backend.routes.coverage ¶
Source coverage + source-DOI routes.
Split out of the former flat routes.py; behaviour is unchanged.
set_graph_coverage ¶
Set a source's coverage.{human,agent} and invalidate the papers cache.
The source to update is req.source (defaulting to the path name);
name itself is validated/resolved so federated (read-only) graphs are
rejected. Reuses the same write_coverage seam as the MCP set_coverage
tool so the two writers cannot diverge. Invalid levels → 400; unknown
source → 404.
Source code in zettelkasten/dashboard/backend/routes/coverage.py
set_graph_source_doi ¶
Set a promoted source's bibliographic doi in its _meta.yaml.
Mirrors the coverage endpoint: req.source (defaulting to the path
name) is the source to edit, while name is resolved so federated
(read-only) graphs are rejected. Writing the DOI lets a subsequent Refresh
citation metrics resolve a previously DOI-less work, so its Influence stops
reading as unknown. The value is normalized (URL/doi: prefixes stripped);
an empty string clears it. Unknown source → 404.
Clears the papers/claims caches: the _meta signature already keys on
doi (so a stale payload can't be served), this just stops stale entries
lingering — exactly as the coverage write does.