fix(truth): ERP witness verdicts gate on log pass-markers, not exit code alone - #88
Merged
Merged
Conversation
…ode alone Log Mandate (CLAUDE.md standing rule): "SKIP and silent failures only appear in the log — exit code alone is not evidence." system_is_real.sh's own header states the same contract, and regimes (a) compiler and (d) redpill already honor it by grepping the combined log for a real pass marker. The ERP regime (c) and its primitive build/erp/run_witness.sh were the two remaining exit-code-only verdicts. Proven with an artificial silent-noop witness (exits 0, prints no marker): BEFORE, both layers reported PASS on it; AFTER, both FAIL. - build/erp/run_witness.sh: PASS now requires node exit 0 AND a pass marker in build/erp/<base>.log (surveyed poc_*.js conventions: green/check "W-XXX PASS", "ALL PASS", "OVERALL=PASS", "SECTION-TAG PASS"); a printed fail marker (red/cross "... FAIL") forces FAIL even on exit 0; missing marker = FAIL. Emits the canonical "§RUN_WITNESS <base> VERDICT=PASS|FAIL" line upstream gates grep for. - scripts/system_is_real.sh regime (c): PASS now requires exit 0 AND "§RUN_WITNESS <base> VERDICT=PASS" in the combined log — the same shape as (d)'s §W-REDPILL-ROSETTA grep, immune to cross-regime log contamination. Witnessed: real witness (poc_fold_complete) stays PASS through both layers; silent-noop flips PASS to FAIL through both layers. No shipped witness went newly red — all 243 scripts/poc_*.js print a final verdict marker (surveyed). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
red1oon
added a commit
that referenced
this pull request
Sep 3, 2026
…ewer/ -> erp/
Implementing prompts/BACKEND_SUBSTRATE_LANE.md §RB.0.
poc_kernel, test_kernel_owner and test_kernel_sign all exited MODULE_NOT_FOUND
requiring bim-ootb/viewer/{manifest.json,erp_replay.js,erp_signer.js}. bim-ootb #88
(9862d935, 'ERP app gets its own /erp/ folder home - structural move') relocated all
three to erp/. Same class as test_tour_idempiere, fixed last session.
All three now PASS:
§KERNEL PASS - apply+commit rich ops, violation BLOCKED, replay exact
§OWNER PASS - merge clash-free; owner-gate and CAS reject the loser
§SIGN PASS - wrong key fails, holder cannot forge, chain stays stable
Kernel-family standing FAILs 7 -> 4; the rest need a served app, not a path fix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
fix(truth): ERP witness verdicts gate on log pass-markers, not exit code alone
What / why
Log Mandate (CLAUDE.md standing rule): "read the log before conclusions — exit code alone is not evidence; SKIP and silent failures only appear in the log."
scripts/system_is_real.sh's own header states the same design contract, and regimes (a) compiler and (d) redpill already honor it by grepping the combined log for a real pass marker (G1-COUNT.*PASS/§W-REDPILL-ROSETTA ALL PASS). The ERP regime (c) and its primitivebuild/erp/run_witness.shwere the two remaining exit-code-only verdicts: a witness that silently no-ops and exits 0 was reportederp PASS.The change (two layers, one agreed marker contract)
Layer 2 —
build/erp/run_witness.sh: after runningnode "$SCRIPT"intobuild/erp/<base>.log, the verdict is decided from the LOG:🔴/❌ … FAIL) → FAIL (new — catches a script that prints a red verdict yet exits 0);scripts/poc_*.js:🟢 W-XXX PASS,✅ … PASS,ALL PASS,OVERALL=PASS,§XXX PASS;It emits one canonical line —
§RUN_WITNESS <base> VERDICT=PASS|FAIL …— which is the marker layer 1 greps for (kept format-stable, documented in both files).Layer 1 —
scripts/system_is_real.shregime (c):erp PASSnow requires exit 0 AND§RUN_WITNESS <base> VERDICT=PASSin the combined log — the same shape as regime (d)'s redpill grep, and immune to cross-regime log contamination (nothing else prints§RUN_WITNESS).Proof (logs saved in the session scratchpad,
logs/)poc_fold_complete.js)before_run_witness.log)§RUN_WITNESS poc_fold_complete VERDICT=PASS(after_run_witness.log)before_run_witness_noop.log)VERDICT=FAIL … NO pass marker(after_run_witness_noop.log)erp PASS … exit 0(before_erp_regime_real.log)erp PASS … exit 0 AND §RUN_WITNESS pass marker in log(after_erp_regime_real.log)erp PASS poc_silent_noop.js exit 0— the bug (before_erp_regime_noop.log)erp FAIL … §RUN_WITNESS VERDICT=PASS absent, RC=1 (after_erp_regime_noop.log)The artificial-negative case mirrors the project's "an audit that has never been seen red proves nothing" rule: the tightened check has now been SEEN red on exactly the failure class it exists to catch.
Full
system_is_real.shruns (CI=1) were captured before and after (before_sir_*.log/after_sir_*.log): both fail-fast at the pre-existing, unrelated browser-regime failure (test_all.js exit=1— the same failure current master CI shows; the latest master CI run's uploadedsystem_is_real.logartifact confirms CI never reaches the ERP regime today). Hence the verbatim-stanza isolation above for the ERP-regime evidence. Behavior of regimes (a)/(b) is unchanged by this PR.What goes newly red (intended, per the tightening's purpose)
Nothing in regime (c) as shipped: the default ERP witness
poc_fold_complete.jsprints🟢 W-FOLD-COMPLETE PASSand stays green through both layers.Found-but-not-fixed gap (named, deliberately not papered over): a small family of witnesses ends in an honest non-PASS terminal state while exiting 0. Run through
run_witness.shdirectly, they now report FAIL despite completing meaningfully:scripts/poc_legacy_ab.js(§AB DONE/§AB PARTIAL (PG skipped)) andscripts/poc_remote_pos.js(§RPOS DONE) — benchmarks; DONE is their deliberate completion marker, they never claim PASS.scripts/poc_sap_fold.js(BLOCKED-is-gracefulprocess.exit(0)) andscripts/poc_b1_fold.js(§B1-FOLD BLOCKED — awaiting a REAL B1 export).scripts/poc_odoo_fold.jsBOUNDEDbranch (§ODOO-FOLD BOUNDED — … a valid, reportable result).scripts/poc_genesis_minimal.js— its pass line says✅ … WITNESSEDwith no PASS-shaped marker on any line (═══ W-GENESIS-MINIMAL: N PASS / 0 FAIL ═══matches no convention).Whether DONE/BLOCKED/BOUNDED should count as green for a smoke gate is a policy decision (an explicit third tier vs. teaching those scripts to print a standard marker) — not decided unilaterally here. None of these is invoked by
system_is_real.sh.🤖 Generated with Claude Code