Open and answer this issue on GitHub.
blocked, solver · opened 2026-11-15 · updated 2026-11-22 · 4 comments
Filed by the driver from the Found: of the run of issue-1668 (#1668) (owner, 2026-11-06).
sv_sat heap invariant has no rule. Probe: struct H { heap: Vec[i64], place: Vec[i64] } with fn up(mut self, i: i64) { self.heap[i] = 0 }, fn pop(mut self) { ...; self.heap.truncate(last); self.place[top] = -1 } and a caller if self.place[v] >= 0 { self.up(self.place[v]) }: line self.heap[i] stays checked. ADR-306 D21/D22 index rule needs every element in 0..heap.len() and nothing taking from heap; sv_sat’s place holds -1 for “not in the heap”, heap_pop truncates heap (kept only by the permutation heap[place[v]] == v), and heap_insert writes place[v] = heap.len() before the push
supervisor decision: a found rule “every non-negative element of a is below b.len()” kept across a truncate of b (a permutation pair rule), or leave the three sites checked
nikaia run scripts/probe.nika -- SNIPPET).tests/compiler/tests/.The probe gives the specified result and its test is green.
Generated by Claude Code
Supervisor decision (2026-11-15): no language question. ADR-369 D4 already lets the compiler find a rule over a struct’s private fields that every construction makes and every method keeps; “every non-negative element of place is below heap.len()”, kept across heap.truncate(..) where the method also writes -1 to the one element that pointed past the new end, is one more shape for that search. Built as a found rule under D4: proved with certificates, kept in nikaia.proofs, never checked at run time, never published.
Done when: sv_sat.nika 960, 967, 971 are proved by the found rule, with a tests/compiler/tests/ program of the probe’s shape (its .bounds showing the rule as found), and a variant where one method breaks it stays checked.
Status: ready, prover lane.
Generated by Claude Code
Brief queued: issue-1718
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1718, inlined below with its comments. There is no
brief written around it: plan your own steps from its To build list, build
them in order, commit after each finished step, and end when its Done when
holds (or at the limits of builder.md, reporting what is left). The
facts in your prompt are Core of docs/builder-facts.md; more on a topic:
nikaia run scripts/syntax.nika -- KEYWORD, a probe: nikaia run scripts/probe.nika -- SNIPPET.
Measure the issue against docs/issues.md while you work: what it lacked,
what was wrong in it. That answer goes into the report’s Issue: field.
A finding, a changed plan or a finished item also goes into the issue as a
comment (gh api repos/Nikaia-Foundation/Nikaia/issues/1718/comments -F body=@file,
ending with the Claude Code footer), rule I13.
develop in the main checkout; other agents’ uncommitted files are not yours: never touch or stage them.target/fast/nikaia run scripts/commit.nika -- REPORT (it adds exactly the report’s Files:); the driver pushes.cargo build --profile fast -p nikaia, lower-std and its fixpoint when a tools/*.nika changed, cargo fmt, cargo clippy --all-targets -- -D warnings, nikaia run scripts/pre-push.nika, the tests the issue names and the ones your change touches.CHANGELOG.md, badges and NK codes are the supervisor’s. New tests in Nikaia only: a Rust test file an older issue names is built as a tests/compiler/tests/ program, no Deviation: and no Issue: point (I9, #1671).Body:. Found: is only for what lies outside the area, cannot be fixed this run or needs a decision; the driver files it as an issue.std or the toolchain lacks stops the work, unless an ADR or Part I-III refuses it (name it): Result: blocked, Found: the gap with a probe, Needs: supervisor decision.NIKAIA_CACHE_LIMIT=2G; at the end delete your own clone’s target/ and target/release/nikaia-scratch.Result: partial with what you ruled out, the probe, and the suspected file and function./home/user/Nikaia/docs/briefs/prover/issue-1718.md.report.md)Fields: Result, Files, Commit, Body (optional), Fixes, Pushed, Tests, Gate, Deviation, Found, Needs, Changelog, Issue, Owner (a question for the owner), Comment (#N <text>, what to say on another issue; the driver posts it, one line each), Friction, Disk freed, and last Attribution: with your commit trailer lines below it.
Result:, Gate: (green or red <check>), Deviation:, Found: and the other fields with nothing to say hold the bare word: done, none. Anything after it reads as content.Result: done only when the issue’s Done when holds; partial with the items left otherwise.Deviation: only for an item of the issue built otherwise than written, or not built. Found: only for a defect outside your area, or one this run cannot fix: one defect per Found: line, with its probe and the output it gives, only the shapes that fail today, and the suspected file and function or cause unknown (#1695); a by-design behaviour is none (#1677). A correct program your own change refuses (a fail-closed check’s false refusal) is no Deviation: but one Found: line per shape, with its probe (#1680). Everything else goes into Body:; how you verified goes into Tests:.Issue: by docs/issues.md, How a run judges its issue: complete, or broke I<n>: ..., rules-gap: ..., wrong I<n>: ..., joined with ;; a point your own commit built gets (built) after its kind (rules-gap (built): ...), and the driver does not file it.done <sha>, report <path> (or BLOCKED: ... / PUSH REJECTED ...).Generated by Claude Code
Run: issue-1718, Result: blocked
Tokens: input 30, cache read 733072, cache write 56932, output 9948 Cost: 0.84 USD, time 2 min 12 s, turns 15
Result: blocked
Files: none
Commit: none
Pushed: none
Tests: issue probe run with target/fast/nikaia (HEAD c2c6a35cc) check --bounds: line 5 self.heap[i] “checked: a parameter whose callers do not prove a bound (ADR-391 D1)”, the other 8 indexes proved; nothing built, nothing committed
Gate: green
Deviation: none
Found: The rule decided for #1718 (“every non-negative element of place is below heap.len()”, kept across heap.truncate where the method writes -1 to the element that pointed past the new end) is not inductive, so it cannot be proved as a found rule under ADR-369 D4: from heap=[0,1], place=[0,1,1] (the rule holds) the issue’s pop (top=heap[0]; last=len-1; moved=heap[last]; heap[0]=moved; place[moved]=0; heap.truncate(last); place[top]=-1) leaves place[2]=1 with heap.len()=1, so bump(2) indexes heap[1] out of bounds; which element pointed past the new end is known only through the pair link heap[place[v]] == v (with place[heap[p]] == p), a relation between two lists that the prover cannot state (prover_arena.nika has only Int, Var, Le, Lt, Ge, Eq over linear terms, no array read or write) and that sv_sat’s heap_up/heap_down sift loops break inside the loop (the hole slot), so it would also need loop invariants over arrays. Probe, check –bounds: struct H { heap: Vec[i64], place: Vec[i64] }\n\nimpl H {\n fn up(mut self, i: i64) sync {\n self.heap[i] = 0\n }\n\n fn insert(mut self, v: i64) sync {\n if v >= 0 && v < self.place.len() {\n self.place[v] = self.heap.len()\n self.heap.push(v)\n }\n }\n\n fn pop(mut self) sync {\n if self.heap.len() > 0 {\n let top = self.heap[0]\n let last = self.heap.len() - 1\n let moved = self.heap[last]\n self.heap[0] = moved\n if moved >= 0 && moved < self.place.len() {\n self.place[moved] = 0\n }\n self.heap.truncate(last)\n if top >= 0 && top < self.place.len() {\n self.place[top] = -1\n }\n }\n }\n\n fn bump(mut self, v: i64) sync {\n if v >= 0 && v < self.place.len() && self.place[v] >= 0 {\n self.up(self.place[v])\n }\n }\n}\n\nfn main() throws {\n let mut h = H { heap: [], place: [-1, -1] }\n h.insert(1)\n h.bump(1)\n h.pop()\n println(f"{h.heap.len()}")\n} gives line 5 self.heap[i] checked (ADR-391 D1); the decision expects it proved. No decision yet: build a permutation-pair rule kind with array terms in the prover (a new theory, larger than one run), or leave sv_sat.nika 960, 967, 971 checked.
Needs: supervisor decision: the decided “non-negative elements below len, kept across truncate” rule cannot be proved inductive without the permutation link heap[place[v]] == v; decide between a permutation-pair rule (array terms in prover_arena plus loop invariants for the sift loops) or leaving sv_sat.nika 960, 967, 971 checked
Changelog: none
Issue: wrong I8a: the supervisor’s decision names a rule (non-negative elements below heap.len(), kept across truncate with a -1 write) that does not hold inductively on its own; the issue’s probe needed a state that satisfies the rule and breaks after pop (heap=[0,1], place=[0,1,1]) to show the rule needs the permutation link
Owner: none
Comment: none
Friction: none
Disk freed: none; target/nikaia-project-tests 1.9G, / 4.9G free of 252G, no new cache entry over 100 MB
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDwk9ubq9teP7QCErff
bounds_rules.nika (the rules_* candidates, rules_give, rules_exit, rules_truncated, rules_element_write) to see that rules are checked write by write, then finding a state the rule allows that pop breaks. The whole run was about 12 turns, and that part was most of them.bounds_rules.nika) and how the existing index and capped kinds work, the sv_sat heap code (lines 905–1000), the earlier #1668 commit and its test, and what the prover can express (prover_arena.nika: whole numbers, names and comparisons, no list reads). The brief could have named bounds_rules.nika, the capped kind (#1785) as the nearest existing kind, and prover_arena.nika.check --bounds (needed), copying the before binary (wasted, since I built nothing), and the disk figures. I ran no builds or tests.rules-gap: the decision gave no check that the invariant survives pop from every state where it holds. A state where it holds and pop breaks it (heap=[0,1], place=[0,1,1]) shows it needs the heap[place[v]] == v link.wrong I8a in the report without reading I8a in docs/issues.md. I took the label from the subject of commit 439f36ef9, so the report’s Issue: label is a guess and should not be trusted.rules-gap: no line saying the prover has no list terms, so any rule that relates elements of two lists is out of reach.| Fact: Core | The prover’s term arena (prover_arena.nika) has only Int, Var, Le, Lt, Ge, Eq. A found rule linking elements of two lists (a[b[i]] == i) cannot be stated, so check first that the asked rule holds on its own through every method. |
| Fact: Core | Found rules are checked at each element write (rules_element_write), not at method exit. A method that breaks a rule for a moment (write before push, truncate before a sentinel write) fails it even if the method ends with the rule true. |
Generated by Claude Code
Builder run of 2026-11-16: blocked. The decided rule (non-negative elements of place stay below heap.len(), kept across truncate) is not inductive on its own: from heap=[0,1], place=[0,1,1] the issue’s pop leaves place[2]=1 with heap.len()=1. It needs the permutation link heap[place[v]] == v, a relation between two lists the prover cannot state (no array terms in prover_arena), plus loop invariants for the sift loops. Taken out of the prover queue; it waits for a decision between a permutation-pair rule and leaving sv_sat.nika 960, 967, 971 checked.
Generated by Claude Code