Skip to content

fix(truth): ERP witness verdicts gate on log pass-markers, not exit code alone - #88

Merged
red1oon merged 1 commit into
masterfrom
fix/witness-log-marker-gate
Aug 23, 2026
Merged

fix(truth): ERP witness verdicts gate on log pass-markers, not exit code alone#88
red1oon merged 1 commit into
masterfrom
fix/witness-log-marker-gate

Conversation

@red1oon

@red1oon red1oon commented Aug 23, 2026

Copy link
Copy Markdown
Owner

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 primitive build/erp/run_witness.sh were the two remaining exit-code-only verdicts: a witness that silently no-ops and exits 0 was reported erp PASS.

The change (two layers, one agreed marker contract)

Layer 2 — build/erp/run_witness.sh: after running node "$SCRIPT" into build/erp/<base>.log, the verdict is decided from the LOG:

  • exit ≠ 0 → FAIL (unchanged);
  • exit 0 but a printed fail marker (🔴/❌ … FAIL) → FAIL (new — catches a script that prints a red verdict yet exits 0);
  • exit 0 AND a pass marker → PASS. Pass-marker regex covers the surveyed final-verdict conventions across all 243 scripts/poc_*.js: 🟢 W-XXX PASS, ✅ … PASS, ALL PASS, OVERALL=PASS, §XXX PASS;
  • exit 0 and NO marker → FAIL (new — "a silent no-op is not a 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.sh regime (c): erp PASS now requires exit 0 AND §RUN_WITNESS <base> VERDICT=PASS in 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/)

Case BEFORE AFTER
layer 2, real witness (poc_fold_complete.js) exit 0 (before_run_witness.log) exit 0 + §RUN_WITNESS poc_fold_complete VERDICT=PASS (after_run_witness.log)
layer 2, artificial silent-noop (exits 0, prints nothing) exit 0 — reported as a pass (before_run_witness_noop.log) exit 1, VERDICT=FAIL … NO pass marker (after_run_witness_noop.log)
layer 1 ERP stanza (extracted verbatim by awk from the live script, same verdict scaffolding), real witness 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)
layer 1 ERP stanza, silent-noop 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.sh runs (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 uploaded system_is_real.log artifact 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.js prints 🟢 W-FOLD-COMPLETE PASS and 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.sh directly, they now report FAIL despite completing meaningfully:

    • scripts/poc_legacy_ab.js (§AB DONE / §AB PARTIAL (PG skipped)) and scripts/poc_remote_pos.js (§RPOS DONE) — benchmarks; DONE is their deliberate completion marker, they never claim PASS.
    • scripts/poc_sap_fold.js (BLOCKED-is-graceful process.exit(0)) and scripts/poc_b1_fold.js (§B1-FOLD BLOCKED — awaiting a REAL B1 export).
    • scripts/poc_odoo_fold.js BOUNDED branch (§ODOO-FOLD BOUNDED — … a valid, reportable result).
    • scripts/poc_genesis_minimal.js — its pass line says ✅ … WITNESSED with 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

…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
red1oon merged commit d7229ed into master Aug 23, 2026
1 check failed
@red1oon
red1oon deleted the fix/witness-log-marker-gate branch August 23, 2026 06:46
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant