| name | verify-kb |
| description | Audit an OKF knowledge base for integrity before it ships. Use to verify a generated/edited KB — checks OKF compliance, atomicity, link integrity, provenance/confidence, coverage gaps, and stale content. Produces a severity-ranked report; does not silently fix. |
Verify Knowledge Base
Adversarially audit an OKF knowledge base (Dossier's own knowledge/, or a client KB). Assume it's incomplete or subtly wrong until proven otherwise. Read knowledge/model/index.md for the rules you're enforcing.
Checks
- OKF compliance — every
.md has valid YAML frontmatter and a type. Reserved filenames index.md/log.md used correctly. Glob all concepts; flag any missing/invalid frontmatter.
- Atomicity & single-source — one concept per file. Flag files bundling multiple independent concepts, and the same fact stated in multiple places (should be one source + links).
- Link integrity — every
[[id]] and every frontmatter edge resolves to an existing concept id. Report orphans (nothing links to them) and dangling links (point to nothing).
- Provenance & trust —
source, confidence, timestamp present. Flag inferred content presented as fact, and missing provenance. List stale atoms (old timestamp).
- Coverage gaps — roles with no processes, workflows with no decisions behind them, processes with no owner, ingested areas with thin coverage. Name what's missing.
- Security — secrets/PII leaked into content; any sign of cross-tenant bleed.
How to run
- Deterministic first. If the KB is in a repo with
@dossier/okf wired (Dossier's own, or any provisioned tenant), run pnpm kb:check — it does parse/schema validation, dangling frontmatter edges, and [[wiki-link]] rot deterministically in <1 s (DEC-0060). Treat its output as ground truth for checks 1 & 3; don't hand-walk what it already verifies.
- Then the judgment checks (2, 4, 5, 6) by hand:
Glob **/*.md, Read/Grep frontmatter and [[links]]. For a KB without the okf gate, fall back to building the id/edge sets yourself and diffing for breaks.
- Be specific: cite
file:line. Reproducible findings only.
Output
A severity-ranked report (blocker → warning → nit), each finding with file, evidence, and a suggested fix. End with a one-line verdict: ship / fix-first. Hand fixes to the owning agent — do not edit silently.