CACG provides kb verify --round-summary as a CLI-only handshake into humanize's ## Knowledge Consulted contract. The integration adds content verification on top of humanize's existing provenance check (which only verifies that the section exists and lists concrete paths).
A round summary is any Markdown file produced by humanize's RLCR loop. The integration looks for a ## Knowledge Consulted heading; the section body extends until the next ## heading or end of file. Valid section bodies are one of:
- The exact sentinel line:
Exits 0. Stdout:
N/A -- task not KB-relevant this roundN/A acknowledged. - A list of card paths, one per Markdown bullet (
-or*). Bullets may include trailing prose after--,—,-, or(. The first token is the path. Each cited path runs throughkb lint+kb verify. Exit codes:- 0 if every cited path is
VERIFIED. - 1 if any cited path is
STALE(lint or verify failed; file present) orMISSING(file does not resolve).
- 0 if every cited path is
If the ## Knowledge Consulted section is absent and the surrounding round summary text contains references to cards/ or .claude/knowledge/, the integration exits 2 with CACG-RS-001. If the section is absent and no KB-relevant work is mentioned, the integration exits 0 with an informational note.
The KB-relevant heuristic is a single regex: (?:cards/|\.claude/knowledge/). Humanize integrators that want a different heuristic can run their own pass before calling CACG.
| Section state | Result | Exit |
|---|---|---|
## Knowledge Consulted present, lists VERIFIED paths |
per-path VERIFIED lines |
0 |
## Knowledge Consulted present, exact N/A sentinel, body NOT KB-relevant |
N/A acknowledged |
0 |
## Knowledge Consulted present, any STALE/MISSING path |
per-path verdicts on stderr | 1 |
## Knowledge Consulted present, exact N/A sentinel BUT body mentions cards/ or .claude/knowledge/ |
CACG-RS-003 STALE |
1 |
## Knowledge Consulted present, no paths and no N/A, body KB-relevant |
CACG-RS-004 STALE |
1 |
## Knowledge Consulted present, mixed N/A sentinel + cited paths |
CACG-RS-002 STALE + per-path verdicts |
1 |
Section missing AND text mentions cards/ or .claude/knowledge/ |
CACG-RS-001 |
2 |
| Section missing AND no KB-relevant mention | informational note | 0 |
kb verify --round-summary path/to/round-N-summary.md \
--chunks-manifest out/chunks_manifest.json \
--source-matrix out/source_matrix.jsonThe --chunks-manifest defaults to ./out/chunks_manifest.json. --source-matrix is MANDATORY (per Round 6 Trust-Depth contract). Cards are resolved relative to the round summary's parent directory; paths that fail to resolve there are tried relative to CWD before being reported as MISSING.
Phase 3 Milestone 4 adds two mutually-exclusive flags that compose with --round-summary:
# B1: cache-as-oracle (deterministic, opt-in)
kb verify --round-summary path/to/round-N-summary.md \
--chunks-manifest out/chunks_manifest.json \
--source-matrix out/source_matrix.json \
--semantic out/semantic_cache.json
# B2: LLM-judge via Claude Haiku (non-deterministic, CI-only)
kb verify --round-summary path/to/round-N-summary.md \
--chunks-manifest out/chunks_manifest.json \
--source-matrix out/source_matrix.json \
--semantic-judgeLayer-3 fires per cited card iff Layer-2 exact-match fails AND --fuzzy rejects. The verdict rides inside the same command="verify" journal event as the Layer-2 diagnostic (one event per card; AC-V1 cardinality). See docs/semantic-verifier.md for the contract.
# Round 3 Summary
## Work Completed
- Implemented kb verify --round-summary
## Knowledge Consulted
- cards/reading_01/g.md -- canonical golden card
- cards/reading_01/h.md -- determinism reference
## BitLesson Delta
- Action: none
- Lesson ID(s): NONEPer T37 analysis (see docs/analyses/T37-cfa-smoke-verifier.md), the recommended pattern for stress-testing the verifier against a real read-only KB is:
- Copy or symlink the source PDF into
tests/fixtures/<name>/. - Run
kb ingest tests/fixtures/<name>/source.pdf --source-id <slug>. - Author a
cacg.v0companion card whosecitationsuse the chunk_id, chunk_hash, page_range, and an actual quote from the chunk text (not the external card's inline**Source:**labels). - Run
kb verifyto learn which claims map cleanly, which need--fuzzy, and which the framework cannot verify mechanically.
This pattern enables CACG to participate in any knowledge-base ecosystem without ever modifying the source repo.
--source-matrix is MANDATORY on kb lint, kb verify, and kb verify --round-summary. Invocations without it exit 2 with a clear "the following arguments are required: --source-matrix" message from argparse. This is a deliberate break-compat change in the trust-depth phase to ensure every CLI invocation explicitly states its authorization posture.
Deployment posture:
- Commit a
source_matrix.jsonto the repository (canonical JSON viacacg.hash.canonical_json, schema documented indocs/schema.md). - Bootstrap the matrix from an existing indexed corpus with
kb scaffold-matrix --cards-manifest <path> --chunks-manifest <path> --out <path>. The scaffold-matrix subcommand walks each card's citations and buildsallowed[reading_id] = [every source_id actually cited], producing a permissive starting matrix that operators tighten as needed. Retracted cards are excluded from the scaffold output. - Run
kb verify --source-matrix <path>(andkb verify --round-summary --source-matrix <path>) in CI so unauthorized citations fail closed before merge.
See AC-5 / AC-6 in .humanize/plans/cacg-trust-depth-plan.md for the full contract; DEC-2 (Round 6) for the break-compat rationale.
CACG supports three retraction granularities. All three are atomic via a tmp/bak/replace publish discipline; physical artifacts are preserved on disk for audit.
Card retraction: kb retract <card> --out <out_dir>
- Appends a tombstone history event (sentinel marker
__cacg_retracted__infrontmatter_field_changes,is_retracted=true) and atomically rewritescards_manifest.jsonto remove the card fromcardsand add itsidtoretracted_cards. - The physical
.mdfile is preserved on disk as a historical artifact. - Any subsequent
kb verify --round-summarywhose Knowledge Consulted section cites the retracted card emitsCACG-RETR-001. The round summary'sSTALEverdict reflects the rejection. --allow-retracteddowngrades the diagnostic severity from"error"to"warning". The diagnostic is still emitted and journaled; only the exit code changes. Note:--allow-retractedonly applies to RETR-001 (card-level); RETR-002 and RETR-003 (source / chunk) are always"error".- Re-running
kb indexpreserves the retracted state; un-retraction requires explicitly re-authoring the card so itsidre-enterscards_manifest.cards.
Source retraction: kb retract-source <source_id> --out <out_dir>
- Atomically rewrites
chunks_manifest.jsonto remove every chunk with the targetsource_idfromchunks_manifest.chunksand add thesource_idtochunks_manifest.retracted_source_ids. - Any card citing the retracted source fails verify with
CACG-RETR-002at both the layer-1 trust boundary (normal verify) and the layer-2 trust boundary (kb verify --unsafe-skip-lint). - The Pydantic disjointness invariant on
ChunksManifestrejects manifests where asource_idappears in bothchunks[*].source_idANDretracted_source_ids.
Chunk retraction: kb retract-chunk <chunk_id> --out <out_dir>
- Atomically rewrites
chunks_manifest.jsonto remove the matching chunk and add itschunk_idtochunks_manifest.retracted_chunk_ids. - Citations of the retracted chunk fail verify with
CACG-RETR-003at both layer-1 and layer-2. - Same disjointness invariant applies to
chunk_id.
All three retraction kinds compose: a corpus can have card-level retractions in cards_manifest.retracted_cards, source-level in chunks_manifest.retracted_source_ids, and chunk-level in chunks_manifest.retracted_chunk_ids simultaneously without cross-coupling.
kb scaffold-matrix --cards-manifest <path> --chunks-manifest <path> --out <path> synthesizes a permissive source_matrix.json by walking each card's citations to discover which (reading_id, source_id) pairs are actually used. The output is canonical JSON. Retracted cards (those in cards_manifest.retracted_cards) are excluded from the scaffold walk. Operators typically run scaffold-matrix once after kb index, then tighten the matrix manually (e.g., removing source_ids that should not be authorized for a given reading).