Clear the Deck — foundation fixes from proof chain audit

The proof chain identified bugs in its own codebase. We're fixing them. 6 of 7 items trace directly to proof chain callouts or the deep strategic audit. The 7th (the `custom` namespace) ships a configurability gate that prevents future foreclosure.

verdict PASSscore 28 / 28findings 6 (1 risk · 1 debt · 4 obs)duration 52mrejection cycles 0shipped Apr 27, 2026surface cli

Pipeline timeline

Intent to proven code in 52m across Think, Plan, Build, and Verify.

Think
22m
Plan
22m
Build
22m
Verify
8m

Assertion ledger

28 claims, each independently verified. Showing 8 — show all →

IDSaysMatcher
A001Contract types live in one place, not scattered across commandsverifiedok
A002Contract type requires an ID for every assertionverifiedok
A003Contract type requires a human-readable description for every assertionverifiedok
A004Artifact command uses the shared contract types, not its own copyverifiedok
A005Verify command uses the shared contract types, not its own copyverifiedok
A006Proof chain structure lives in one place, not duplicated across commandsverifiedok
A007Proof chain health stats have a named type instead of inline object shapeverifiedok
A008writeProofChain returns a named type instead of an anonymous shapeverifiedok

Findings 6 total

obspackages/cli/src/types/contract.tsclosed
`ContractAssertion` and `ContractFileChange` exported but never directly imported: `src/types/contract.ts:14,26` — Both interfaces are exported but no consumer imports them directly. They're accessed structurally through `ContractSchema.assertions` and `ContractSchema.file_changes`. The exports are forward-looking — a future consumer (e.g., a contract linter) would import them. Not a problem today, but if the interfaces drift from what `ContractSchema` uses, the exported types become misleading.
obspackages/cli/src/commands/proof.tsclosed
No dedicated test for `formatContextResult` truncation: `src/commands/proof.ts:362-367` — The truncation logic is tagged `@ana A020, A021` in source code, but no test file exercises this code path. Pre-check reports COVERED due to tag collision with other features' A020/A021 tags. The behavior is correct (verified by code review and live `ana proof context` output), but a regression in this function would not be caught by automated tests. A test in `proof.test.ts` that creates a proof chain entry with a >250-char callout summary and asserts the `proof context` output is truncated would close this gap.
debtpackages/cli/tests/commands/artifact.test.tsclosed
A024 weak assertion on coverage count: `tests/commands/artifact.test.ts:1650` — `expect(saves['pre-check'].covered).toBeGreaterThanOrEqual(0)` passes even if coverage is 0. The test sets up one tagged assertion that should be covered, so `toBeGreaterThanOrEqual(1)` or `toBe(1)` would be more specific. Not a false positive today (the setup ensures coverage), but the assertion is weaker than it needs to be.
riskpackages/cli/src/commands/artifact.tsclosed
`captureModulesTouched` silent catch: `src/commands/artifact.ts:161` — The outer try/catch swallows all errors silently. If `readArtifactBranch` fails (missing ana.json), `git merge-base` fails (detached HEAD), or `git diff` fails (corrupt index), `modules_touched` simply isn't written. This is acceptable graceful degradation for a metadata-capture function, but it means a misconfigured environment silently produces incomplete proof chain data. A `console.warn` on failure would make debugging easier without breaking the pipeline.
obsclosed
Pre-check tag collision across features: The `@ana` tag system uses non-unique IDs (A001, A002, ...) scoped per-contract. Pre-check searches ALL test files for matching IDs, meaning coverage from unrelated features can false-positive as COVERED. This build's A020/A021 are an example. This isn't a bug in THIS build — it's an architectural limitation of the pre-check tool that could mask missing test coverage in future builds.
+1more findings

Integrity seal

scopesha256:e865935e675b9...
contractsha256:6567b88566818...
plansha256:a96dff0ea85a5...
specsha256:39b013a6aecba...
build-reportsha256:469683e462152...
verify-reportsha256:e1b365ad1fd19...
audit cmd$ ana proof audit clear-the-deck   → all hashes match