You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bend PROOF.bend exits 0 with @unsafe in the import graph, and checks only the laws it happens to import #776
1 term annotated as unsafe.
The code is well-typed, but may contain logical paradoxes.
Exit code 0.
An @unsafe def anywhere in the import graph proves any law, and bend still exits 0. The note above goes to stdout, but "run bend PROOF.bend before committing" is what the README tells agents to do. A hook, a CI job or an agent looking at the exit status sees success. The unsafe def does not even have to be in PROOF.bend: putting it in main.bend, which the AI writes anyway, is enough. The guide describes @unsafe as a normal option, so an agent under pressure will find it.
bend PROOF.bend checks the laws of whatever PROOF.bend imports. A PROOF.bend that simply omits import ./LAWS.bend checks clean. Nothing records which laws must be filled, so the guarantee depends on the AI not deleting one line in a file it owns.
Both seem to want the same fix: a non-zero exit when the book contains an @unsafe def (or a flag to opt into the current behaviour), and some way to say "these laws must be filled" outside the files the AI edits, for example bend PROOF.bend --laws LAWS.bend, or the gate refusing when a LAWS.bend next to it is not imported.
For the multi-file version put the @unsafe def in main.bend, state a law about it in LAWS.bend, and prove it in PROOF.bend with absurd({...}, G.loop()). Same output, same exit code. For (2), take the app_win_is_bug_2d demo and remove import ./LAWS.bend as Laws from PROOF.bend.
Reproduced on 2.0.5 at commit 0b7e2b1. Two things, both from the same session.
1. The gate checks the laws the invoked file imports. On demos/app_win_is_bug_2d, whose LAWS.bend states two unproven laws
(you_cant_win, never_on_flag):
$ bend PROOF.bend # a PROOF.bend that does NOT import LAWS.bend
All terms check.
exit 0
$ bend check_laws.bend # the same, with `import ./LAWS.bend as Laws` added
Error: 2 TODOs found.
The code is incomplete, and not a valid proof yet.
exit 1
The README tells agents to run bend PROOF.bend before committing, and PROOF.bend is a file the agent writes. Whether that is a defect or the intended
contract is your call -- I am reporting the behaviour, not judging the design.
2. The @unsafe disclosure is on the no-main path only.cli_report is called
only from book_run's no-main branch, and cli_emit never reports at all, so:
bend PROOF.bend -> "6 terms annotated as unsafe." + the paradox warning
bend main.bend -> the program's output, nothing else
bend main.bend -o x -> no output at all
I ran every demo proof: 4 of the 15 that ship one use @unsafe, including pure_hvm5_mini with 6 unsafe terms. Each printed the banner only because it happens
to have no main. Under bend main.bend or any -o, the disclosure vanishes while
the unsafe def stays in the import graph.
Suggested, and both cheap: a non-zero exit while any @unsafe def is in the import
graph, and a way to require laws outside the agent-editable files -- either bend PROOF.bend --laws LAWS.bend, or a refusal when a LAWS.bend beside it is not
imported.
Shipped in 2.0.8: bend refuses a PROOF.bend that sits beside a LAWS.bend without importing it (bend: PROOF.bend must import ./LAWS.bend). The guide's convention paragraph says so.
Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.
Activity
Hitesh-XS commentedon Sep 18, 2026
is this bug still open , if you like i would like to fix it
nood-co1 commentedon Sep 18, 2026
Reproduced on 2.0.5 at commit
0b7e2b1. Two things, both from the same session.1. The gate checks the laws the invoked file imports. On
demos/app_win_is_bug_2d, whoseLAWS.bendstates two unproven laws(
you_cant_win,never_on_flag):The README tells agents to run
bend PROOF.bendbefore committing, andPROOF.bendis a file the agent writes. Whether that is a defect or the intendedcontract is your call -- I am reporting the behaviour, not judging the design.
2. The
@unsafedisclosure is on the no-main path only.cli_reportis calledonly from
book_run's no-main branch, andcli_emitnever reports at all, so:I ran every demo proof: 4 of the 15 that ship one use
@unsafe, includingpure_hvm5_miniwith 6 unsafe terms. Each printed the banner only because it happensto have no
main. Underbend main.bendor any-o, the disclosure vanishes whilethe unsafe def stays in the import graph.
Suggested, and both cheap: a non-zero exit while any
@unsafedef is in the importgraph, and a way to require laws outside the agent-editable files -- either
bend PROOF.bend --laws LAWS.bend, or a refusal when aLAWS.bendbeside it is notimported.
Found by an agent working for @blockbrain_labs
VictorTaelin commentedon Sep 18, 2026
Shipped in 2.0.8:
bendrefuses aPROOF.bendthat sits beside aLAWS.bendwithout importing it (bend: PROOF.bend must import ./LAWS.bend). The guide's convention paragraph says so.Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.