Repository navigation
ledger-signals: witness verify-report false-positives on a legitimate historical report (issue #188) - #189
Draft
ruvnet wants to merge 2 commits into
Draft
ledger-signals: witness verify-report false-positives on a legitimate historical report (issue #188)#189ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
… historical report (issue #188) splitAtWitnessSection/witness verify-report throws "ambiguous... expected exactly one" on docs/dream-cycle/2026-09-10-compiler-parity-report.md, which has two "## Witness" heading lines — the first a pre-tooling forward-reference placeholder, the second the real trailing section. The file's published witness is independently reproducible by hand; this is a tool false-positive, not a corrupted report. Adds scripts/witness-corpus.test.mjs: a new test:governance gate asserting no committed report has more than one "## Witness" heading unless on an explicit, hash-verified grandfather list (currently one entry, generic/ data-driven so a future stale or fabricated entry fails closed). Does not touch splitAtWitnessSection's existing fail-closed ambiguity behavior, and does not edit any already-merged historical report's content. npm test: 809 vitest (unchanged) + 198 governance (+3 new), 0 regressions. lint/typecheck clean. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WLunD924RoaiUkFET9A8hG
Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WLunD924RoaiUkFET9A8hG
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #188.
Hypothesis
Given the committed report corpus under
docs/dream-cycle/, when a new governance test iterates every file and asserts any file with more than one literal## Witnessheading line is on an explicit, documented, hash-verified grandfather list (and that the list contains no stale/unreproducible entry), then the test should fail today pointing at2026-09-10-compiler-parity-report.md's ambiguous heading, and pass once that one entry is added — without changingsplitAtWitnessSection's existing fail-closed ambiguity behavior (a separate, already-passing test deliberately locks that in for a genuinely adversarial duplicate-heading case) and without editing any already-merged historical report's content. Confirmed, not amended after evaluation began.Candidate
New file only:
scripts/witness-corpus.test.mjs(+105 lines, 1 file, 0 deletions), wired automatically into the existingnpm run test:governanceglob. Threenode:testcases:## Witnessheading unless on the grandfather map.@dream-machine/ledger'slegacyPrefixDigestfail-closed design (added after an independent critic's review, see Reward-Hack Check).The grandfather map has exactly one entry today:
2026-09-10-compiler-parity-report.md, predatingsplitAtWitnessSection/witness verify-report(2026-09-15, PR #111). Its first## Witnessoccurrence (line 93) is a forward-reference placeholder ("See STEP 16 below...") written before the tool existed, not a real second section (the real one is line 118). The originally-publishedreport_sha256is independently, byte-level reproducible from the file's current content.Evaluation Receipt
Real evaluator:
npm test(vitest run && npm run test:governance), run live before (file absent) and after (file present).b2abcc1)npm run lintnpm run typecheckNon-tautology (4 live negative controls, each restored and diff-verified byte-identical afterward):
Credentials reality check:
OPENROUTER_API_KEYpresent tonight —LLM_EVALnot blocked. This candidate makes no model calls; verified entirely by the real test suite and direct cryptographic re-derivation.Baseline
Parent commit
b2abcc14a632d7e0948962065a7c6c8920cf306c(main), measured live before the candidate file existed (nothing to stash). Session's checkout started shallow; unshallowed viagit fetch --unshallowfirst (same already-tracked class as issue #149/PR #150) before any measurement.Darwin Lineage
DARWIN=not-applicable— a single new regression test over a fixed document corpus has no evolvable population or numeric objective, consistent with unbroken precedent on this surface (#116/#127/#132/#137/#145/#154/#167/#176). Entrypoint probed live (npx --yes @metaharness/darwin --versionresponds; reachable, not blocked).Evidence
OBSERVATION (manual corpus audit finds exactly one ambiguous-heading file) → OBSERVATION (live repro) → OBSERVATION (byte-level hand reproduction proves the published hash correct — tool false-positive, not corruption) → HYPOTHESIS (frozen above) → MEASUREMENT (1004→1007 tests live before/after, 0 regressions) → MEASUREMENT (4 live negative controls) → INFERENCE (independent critic, separate subagent context) → DECISION (critic: CLEAR + 1 disclosed non-blocking gap) → DECISION (gap closed same session) → DECISION (ship; ACCEPT).
Reward-Hack Check
Independent adversarial critic (separate subagent context, no authorship stake, instructed to try to break the candidate): CLEAR, one disclosed non-blocking gap found and closed same session.
git status --porcelain/git diff --statshowed only the one new file throughout); independently re-readpackages/witness/src/report-witness.test.tsin full and confirmed its duplicate-heading-rejection tests are untouched/unweakened.Set— tests 1/2 would pass for a future fabricated entry with a plausible comment but no automatic proof of authenticity. Closed same session: converted to aMapcarrying each entry's own byte marker + expected hash; the reproducibility test is now generic/data-driven over every entry. Re-verified the critic's own named attack (a fabricated entry with a wrong hash) now fails tests 2 and 3 mechanically, then removed and the file restored to its real, single-entry state.Security Review
No prompt-injection, MCP-authority, or credential surface touched. No new filesystem-write surface (read-only, fixed repo-relative path via
fileURLToPath(new URL(...)), no traversal surface). No network/execsurface. No regex used (no ReDoS exposure on file content — exact-string===/indexOf/lastIndexOfonly). No production/runtime code path changed — new test infrastructure only.Regression Analysis
0 pre-existing tests modified, removed, or weakened anywhere in the repo. vitest count unchanged (809); governance count increased only by the 3 new tests (195→198). Lint/typecheck clean. No wasm/NAPI degradation (build was clean, not run again tonight since nothing in
packages/changed).ADR
None — a new governance/regression-test addition, not an architectural decision (consistent with every prior correctness/coverage fix on this surface having no ADR).
Gist
GIST=LOCAL— noghCLI gist capability this session (GH_TOKENinvalid) and no gist-creation MCP tool available. GitHub MCP access itself works fine (get_me, issue/PR tools all succeeded) —FALLBACK=false. Full report committed atdocs/dream-cycle/2026-10-16-ledger-signals-report.md.Issue
#188
Witness
Reproduce:
dream-machine witness verify-report docs/dream-cycle/2026-10-16-ledger-signals-report.md --commit b2abcc14a632d7e0948962065a7c6c8920cf306cMerge Policy
Human review required. This session never self-merges and never autonomously promotes candidate state.
dream.config.json'sautoMerge: false; noautomerge-safelabel applied.🤖 Generated with Claude Code
https://claude.ai/code/session_01WLunD924RoaiUkFET9A8hG
Generated by Claude Code