Skip to content

fix(verdict): show kernel failure details (#1535) - #1536

Merged
Lorenzobattistela merged 2 commits into
bendlang:mainfrom
viridale:fix-1535-verdict-diagnostics
Oct 13, 2026
Merged

Lorenzobattistela merged 2 commits into
bendlang:mainfrom
viridale:fix-1535-verdict-diagnostics

Conversation

@viridale

@viridale viridale commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1535.

When the kernel rejects a book, --verdict printed only SOME PROOFS FAIL and the mismatch notice, so you couldn't see which def failed or why. Now it prints the kernel's why between the two lines. The notice stays on every failure, out of fuel included.

Before:

SOME PROOFS FAIL
Sorry - this is a mismatch between the TypeScript implementation, ...

After (out of fuel):

SOME PROOFS FAIL
In LAWS.copy_long:
out of fuel
Sorry - this is a mismatch between the TypeScript implementation, ...

After (a def out of the kernel's scope; these are the same lines -o prints):

SOME PROOFS FAIL
BendTT: out of scope:
- reflexive: names reflexive_7e_n, out of scope: no model for reflexive~n
Sorry - this is a mismatch between the TypeScript implementation, ...

A type rejection shows the kernel's In <def>: and expected: / observed: lines the same way. If the kernel fails without giving a why, the line says how it exited (kernel exited 1 after ALL PROOFS CHECK).

Nothing else changes. Exit codes, stdout, the unsafe/foreign list, passing output and infrastructure errors are the same as on main. Everything still goes to stderr. gates/safe.ts and gates/safe_node.ts are untouched.

Changes:

  • safe.ts: kernel_check and safe_check return null on a pass, else the why.
  • main.ts: cli_verdict prints the why above the notice.
  • gates/ping.ts: one test. A stub kernel reports out of fuel, and the test checks for exit 1, empty stdout, and the why above the notice.

Checks (on main 213cd5e; test and safe gates on the minis, the rest on macOS arm64):

  • repo 54/54, test 1614/1614, ping 57/57 (main 56/56).
  • Safe gate, tests corpus (real kernel): same table as main (1042 agree, 88 unsafe, 490 bend2 rejects, 4 out of scope, 1 false reject). Same exit code on all 1625 files. Only the 5 failing files' text changes, by gaining the why.
  • 60 hub package files: same exit codes as main. Only the 4 out-of-scope failures change.
  • The ping test fails if the why is dropped, the notice is dropped on fuel, the why goes to stdout, the exit code changes, or the code is reverted to main.

Not run: Linux, Windows, the safe gate's hub corpus.

@Lorenzobattistela Lorenzobattistela self-assigned this Oct 13, 2026
@Lorenzobattistela
Lorenzobattistela force-pushed the fix-1535-verdict-diagnostics branch from 2b3398c to e82d6c0 Compare October 13, 2026 14:16
@Lorenzobattistela
Lorenzobattistela merged commit f846cb5 into bendlang:main Oct 13, 2026
1 check passed
@Lorenzobattistela Lorenzobattistela mentioned this pull request Oct 20, 2026
viridale added a commit to viridale/bend-cli that referenced this pull request Oct 20, 2026
Records lessons from commits since 9f7b840 that AGENTS.md lacked:
planting bugs against a new law; the kernel's missing eta and tab_cons;
ctorarms.py and charsplit.py for heads a wildcard arm refined;
chk-expected.tsv rows and CI cases for files reaching run.bend; #ifdef
CID guards in .c effects; consing then reversing over List.append;
Bool.or and Bool.and as eager; FID names from the harness path and _C
closures; peerbench.sh; test_tools.py; where the minimum Bend is pinned;
e2e's build/ inputs.

Updates what changed: PROOF.bend takes ~40 s and --verdict ~3 min; native
IO.exit on 2.0.37 exits with its code, not 141, after a print to a
closed pipe (checked today), so run.bend keeps Sys.exit until
bendlang/bend#1519 ships; kernel.sh retires with bendlang/bend#1536; 1.0
waits on bendlang/bend#1466, as the README now says.
viridale added a commit to viridale/bend-cli that referenced this pull request Oct 21, 2026
Since bendlang/bend#1536, in Bend 2.0.38, a failing --verdict prints the
kernel's "In <def>:" line and its reason ("out of fuel", or the expected
and observed terms) above the mismatch notice, which is what
tools/kernel.sh ran the cached kernel by hand to show. AGENTS.md now says
where to read them.

Checked on Bend 2.0.38 with stub kernels reporting out of fuel and a type
mismatch: --verdict prints each one's def and reason and exits 1.
python3 tests/test_tools.py: 17 tests OK.

Co-Authored-By: Claude <[email protected]>
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.

--verdict reports a kernel "out of fuel" as a TypeScript/kernel mismatch, without the def or the reason (2.0.36)

2 participants