Open and answer this issue on GitHub.
blocked, solver · opened 2026-11-15 · updated 2026-11-23 · 7 comments
Part of #1053. Found while building #1630 „bounds walk: a method’s found facts, preconditions over self, a term’s type as its range (ADR-306 D34)“; three of its F sites were left.
Decision: none yet for an invariant that ties one list’s elements to another list’s length. ADR-306 D34 (derived preconditions over self’s fields) covers a caller’s guard, not a relation kept across methods. If the build needs a new rule, it stops and asks (Needs: supervisor decision).
type Heap { heap: List[i64], place: List[i64] }
impl Heap {
fn up(mut self, i: i64) sync { print(self.heap[i]) }
fn touch(mut self, v: i64) sync {
if v >= 0 and v < self.place.len() { self.up(self.place[v]) } // place[v] < heap.len() is never said
}
}
heap_up at sv_sat.nika 960, 967, 971 is called with self.place[v]; that every element of place is a valid index of heap holds by how the methods keep the two lists, and nothing states it.
place is below heap.len()"; if none, stop and report the gap with this probe.tests/compiler/ with its .bounds.sv_sat.nika 960, 967, 971 are proved, or the report names the missing rule.
Generated by Claude Code
Brief queued: issue-1668
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1668, 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/1668/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.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-1668.md.report.md)Fields: Result, Files, Commit, Body (optional), Fixes, Pushed, Tests, Gate, Deviation, Found, Needs, Changelog, Issue, Owner (a question for the owner), 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. 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 ;.done <sha>, report <path> (or BLOCKED: ... / PUSH REJECTED ...).Generated by Claude Code
Run: issue-1668, Result: partial: sv_sat.nika 960, 967, 971 stay checked; no existing rule states them (gap below), and the call-argument defect found on the way is fixed
Tokens: input 110, cache read 3567771, cache write 80270, output 21940 Cost: 3.64 USD, time 11 min 59 s, turns 55
Result: partial: sv_sat.nika 960, 967, 971 stay checked; no existing rule states them (gap below), and the call-argument defect found on the way is fixed
Files: crates/nikaia-std/src/compiler/bounds_walk.nika crates/nikaia-std/src/compiler/lowered/bounds_walk.rs crates/nikaia-std/src/compiler/lowered.rs tests/compiler/tests/an_element_of_a_list_of_positions_proves_a_callees_precondition.nika tests/compiler/tests/an_element_of_a_list_of_positions_proves_a_callees_precondition.bounds tests/compiler/tests/an_element_of_a_list_of_positions_proves_a_callees_precondition.stdout
Commit: bounds: an argument read out of a list of positions proves a callee’s derived precondition
Part: #1668
Body: The walk proved self.heap[self.place[v]] from the found index rule (ADR-306 D22) but not the same element handed to a method whose derived precondition is i < self.heap.len() (ADR-306 D34, ADR-391 D1). bounding_derived_side now takes such an argument as every element of the list, as rules_element_inside and rules_position already do; a claim whose two sides would be reads out of the same list is skipped, since f(xs[a], xs[b]) would otherwise prove xs[a] <= xs[b] as each <= each. The test pins both cases.
Tests: new test an_element_of_a_list_of_positions_proves_a_callees_precondition: fails on the before binary (line 12 self.heap[i] checked), proved now, and between derives no from <= to; nikaia test –both-settings with filters derived/element/position (104 ok) and bounds/precondition/heap/list_of/proof (58 ok, 1 failed: the_packages_proofs_are_current, because 6 ledgers are already stale with the before binary, see ledgers.nika --check --exe old); lower-std fixpoint reached (second lower-std changed nothing); cargo fmt, clippy and pre-push green
Gate: green
Deviation: item 2 not built: no existing form states the sv_sat invariant. lowered.rs’s LOWERED_DIGEST also covers another agent’s uncommitted emit_core_flow/emit_core_match lowered files; the driver’s relower corrects it
Found: 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
Needs: 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
Changelog: Bounds: an argument read out of a list of positions proves a callee’s derived precondition (ADR-306 D22, D34; part of #1668)
Issue: rules-gap: To build step 1 asks for an “element precondition on the field” without noting that place holds -1 and that heap shrinks, both of which the existing index rule excludes; the probe in the issue does not compile as written (type for struct, and, no writes so no rule can be found)
Owner: none
Friction: none
Disk freed: none
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDwk9ubq9teP7QCErff
Pushed: local 0ac0d0ac01784c3b366def7eabc5f49fcb2b3803
lower-std and build cycle after editing bounds_walk.nika (about 15 minutes of waiting). After that, the ledger check: I ran it once without --exe, and its usage text only showed later that the binary is passed with --exe.bounds_rules.nika, and that truncate drops it), and where a call’s derived precondition is asked (bounding_derived_call and bounding_derived_side). The brief could have named D22’s index rule and its conditions: no negative elements, the end list never shrinks.--both-settings runs, ledgers --check (three times; one wasted on the wrong flag), fmt, clippy and pre-push. The second filtered run spent time on the_packages_proofs_are_current, which was already red on develop.check --bounds --bounds-trace LINE on the old binary before reading any ADR. The trace’s rules: line shows at once which found rules exist and why a site stays checked.wrong I5: the probe does not compile (type instead of struct, and instead of &&), and it has no writes, so no rule can be found from it.rules-gap: it did not say that place holds -1 and that heap_pop truncates heap. Both rule out the existing index rule; stating them would have answered step 1 directly.broke I6: no path was ruled out. D22’s index rule should have been named as the obvious candidate.Fact: Core | ledgers.nika takes the before binary as --exe PATH; a bare path is read as the mode and only prints the usage line.Fact: Core | the_packages_proofs_are_current and ledgers --check can already be red before your change; run ledgers --check --exe $S/old/nikaia before you blame yourself.Fact: Core | lowered.rs's LOWERED_DIGEST also counts other agents' uncommitted lowered files, so the committed digest may not match the commit; say so under Deviation.Fact: bounds | an index rule (ADR-306 D22) is dropped when the list holds negative sentinels or the end list is truncated; check both before promising a proof.Generated by Claude Code
From the report of the run of issue-1719 (#1719):
The run’s Needs (an element rule “every non-negative element of a is below b.len()” kept across a truncate of b, or leave the three sv_sat sites checked) is a supervisor decision (CLAUDE.md, A missing form stops the work, kind 2); #1719 closed it there, and added I8a’s rule that such an item checks sentinel and shrinking writes first.
Generated by Claude Code
Brief queued: issue-1668
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1668, 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/1668/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.suspected, or does not mark (docs/issues.md I7), is a hypothesis: run the check that settles it (nikaia run scripts/where.nika -- NAME, the probe with a trace, callgrind for a cost) before you build on it (owner, 2026-11-16). Shown false: say so in Issue: as wrong I7: <what the check showed> (the driver comments it on the issue) and follow the real cause.Result: partial with what you ruled out, the probe, and the suspected file and function./home/user/Nikaia/docs/briefs/solver/issue-1668.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. complete is the bare word: prose after it (complete; the earlier runs ...) is filed as an improvement issue (#1931); history or a note for your own issue goes into Body: or Comment: #N <text>.done <sha>, report <path> (or BLOCKED: ... / PUSH REJECTED ...).Generated by Claude Code
Run: issue-1668, Result: blocked
Tokens: input 22, cache read 327499, cache write 25423, output 4163 Cost: 0.39 USD, time 2 min 1 s, turns 11
Result: blocked
Files: none
Commit: none
Body: nikaia check --bounds src/sv_sat.nika in packages/logic on target/fast/nikaia (built after HEAD’s last crates/ commit), 2026-11-23: 967 and 971 self.heap[i] print proved. 960 self.heap[i] (heap_up’s let v = self.heap[i], i == start) prints checked: no fact bounds what it reads. --bounds-trace 960 shows goal i >= 0 && i < self.heap.len(): open. The rules found include index heap place (heap’s elements index place) but no place-to-heap rule, and heap_up gets no derived precondition, since bump_var 916 self.heap_up(self.place[v]) cannot prove place[v] < heap.len(). No existing form states it: the found index rules (ADR-306 D22) come from writes, and heap_pop writes place[top] = -1 after heap.truncate(last), so only the pair link heap[place[v]] == v keeps the rule (I8a, the induction step from f8da435f0).
Fixes: none
Pushed: none
Tests: none run; nothing changed. Probe: the –bounds run and –bounds-trace 960 of packages/logic/src/sv_sat.nika, output above
Gate: green
Deviation: none
Found: none
Needs: #1890 (supervisor decision: a permutation-pair rule heap[place[v]] == v the bounds walk can state and keep across heap_pop’s truncate, or leave sv_sat 960 checked); 967 and 971 are already proved, so 960 is the only site left
Changelog: none
Issue: wrong I8: the line numbers moved; 967 and 971 are already proved, and only 960 (heap_up’s first read, start unbounded) is open; issue: the decision it waits for is #1890, named only in a comment and not as Needs #1890 in the body, so the driver ran it again
Owner: none
Comment: #1668 Run 2026-11-23: sv_sat 967 and 971 now print proved. Only 960 self.heap[i] in heap_up is left (goal start < self.heap.len() open; the walk finds no place-to-heap element rule). It waits for the decision in #1890 (a permutation-pair rule, or leave it checked).
Friction: none
Disk freed: none (target/nikaia-project-tests as printed at the end of the run)
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDwk9ubq9teP7QCErff
nikaia check --bounds runs on sv_sat.nika, a few minutes each. The --help lookup to find the flag cost one more turn. Everything else was quick.git log --grep and commit f8da435f0’s message. I also had to find that sv_sat.nika lives in packages/logic/src/, not under compiler/, and the bounds command plus its --bounds-trace LINE flag.git log for #1668, #1719 and #1890; --bounds on sv_sat.nika; --bounds-trace 960. None was wasted, though the first grep of the bounds output used the wrong pattern and cost a turn. One mistake to own: my report’s Issue: field says wrong I8 for the stale line numbers without my checking which rule that is, so that tag may be wrong. I also wrote Fixes: none, which builder.md forbids. Nothing was committed, so it does no harm here.Needs #1890 to the issue’s text. Then this run would not have started.broke I6: the issue says “decision: none yet” but never names #1890, the decision issue that holds it.wrong I7 (stale): it names sites 960, 967 and 971 as open, but 967 and 971 have been proved since 0ac0d0ac0. Only 960 is left.knowledge: Core | sv_sat.nika is packages/logic/src/sv_sat.nika, and its bounds are run as nikaia check --bounds src/sv_sat.nika from packages/logic.| Fact: Ledger and bounds proofs | --bounds-trace LINE prints the rules the walk found as index A B (A’s elements index B), so a missing element rule is visible there in one run, without reading bounds_walk.nika. |
| Fact: Core | An issue whose decision was filed as a separate issue in a comment is blocked until that issue is closed; check its comments for #N before running the probe. |
| Fact: Ledger and bounds proofs | Command: cd packages/logic && nikaia check --bounds src/sv_sat.nika, a few minutes. Figure: 159 indexes, 69 proved; 132 operations, 53 proved (2026-11-23, develop HEAD, target/fast/nikaia). |
| Fact: Ledger and bounds proofs | sv_sat heap_up line 960 is the only #1668 site left; it waits for #1890’s place-to-heap rule (heap[place[v]] == v) (2026-11-23). |
Generated by Claude Code
From the report of the run of issue-1668 (#1668):
Run 2026-11-23: sv_sat 967 and 971 now print proved. Only 960 self.heap[i] in heap_up is left (goal start < self.heap.len() open; the walk finds no place-to-heap element rule). It waits for the decision in #1890 (a permutation-pair rule, or leave it checked).
Generated by Claude Code
Driver: not queued, this issue waits for #1890, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code