Issue #2873: The toolchain’s answers are not the in-process tests’ claims, so a “same…

Open and answer this issue on GitHub.

blocked, ci · opened 2026-11-28 · updated 2026-11-29 · 7 comments

Filed by the driver from the Found: of the run of issue-2862 (#2862) (owner, 2026-11-06). Needs #2887 Needs #2888 Needs #2889 Needs #2890

Found

The toolchain’s answers are not the in-process tests’ claims, so a “same claims” move needs a decision on what to assert. (a) nikaia check examples/foreign-runtime/crossing/src/main.nika and .../smuggled/src/main.nika are refused error[NK2502]: handle can't move to another thread on purpose (the file’s header: “expected to be refused”), but bytes.rs asserts that no examples/ program has an NK25.. refusal; that holds only because Ledger::infer alone does not read their contracts/. (b) hello-http’s counters come out plain under the project’s user-parallelism = "no" and word ... crosses: a kept lambda only with --user-parallelism yes, while sharing.rs asserts Count::Atomic (the ledger’s switch-independent floor, sharing::infer). (c) benches/brc/fast.nika is refused NK1300 by the CLI. Proposal: assert crossing/smuggled refused exactly NK2502, and run the sharing claim with --user-parallelism yes; no decision yet

Cause not marked

The Found does not say how sure its cause is (docs/issues.md I7): a cause it names is a hypothesis, unknown until checked. The second item checks it (nikaia run scripts/where.nika, a probe, callgrind) before anything is built on it; a cause shown false is answered wrong I7: ... in the report.

To build

Done when

The probe or check gives the expected output the first item names from its ADR or Part I-III section, and a tests/compiler/tests/ test (or the named check) that failed on the unfixed tree is green; or the probe already passes on develop and a test pins it, naming the commit that fixed it; or the issue is closed as by design, naming the function or ADR.


Generated by Claude Code

Comments

keywan-ghadami, 2026-11-28

Supervisor decision: the toolchain’s answer is the claim, and the proposal is approved.

Done when: the Nikaia ledger test for (a) and (b) is green with the committed books, and nikaia check benches/brc/fast.nika is clean.


Generated by Claude Code

keywan-ghadami, 2026-11-28

Brief queued: issue-2873


agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —

Issue #2873

Your work order is issue #2873, 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/2873/comments -F body=@file, ending with the Claude Code footer), rule I13.

Rules (CLAUDE.md; shared checkout)

Report (at most 15 lines, to exactly /home/user/Nikaia/docs/briefs/ci/issue-2873.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.


Generated by Claude Code

keywan-ghadami, 2026-11-28

Run: issue-2873, ESCALATE timed out after 150 minutes

Tokens: input 0, cache read 0, cache write 0, output 0 Cost: 0.00 USD, time 0 min 0 s, turns 0

Report

(none)


Generated by Claude Code

keywan-ghadami, 2026-11-28

State after the first run (timed out at 150 min, its two steps committed by the supervisor, d269ad1ea and 35f8ef158, local, pushed with the next batch):

For the next run: do not run bytes::the_corpus_needs_no_tether, sharing::... or tethers::... locally (30-40 minutes each, they cost the first run its time); CI runs them on runners of their own.


Generated by Claude Code

keywan-ghadami, 2026-11-28

Run: issue-2873, refused: /home/user/Nikaia/docs/briefs/ci/issue-2873.md is still running (pid 1925, its session in /home/user/Nikaia/docs/briefs/ci/issue-2873.md.session); wait for it to end or kill it

Tokens: input 0, cache read 0, cache write 0, output 0 Cost: 0.00 USD, time 0 min 0 s, turns 0

Report

(none)


Generated by Claude Code

keywan-ghadami, 2026-11-28

Run: issue-2873, refused: docs/briefs/ci/ESCALATE exists

Tokens: input 0, cache read 0, cache write 0, output 0 Cost: 0.00 USD, time 0 min 0 s, turns 0

Report

(none)


Generated by Claude Code

keywan-ghadami, 2026-11-28

Run: issue-2873, Result: partial

Tokens: input 306, cache read 11230970, cache write 204387, output 59715 Cost: 0.25 USD, time 0 min 42 s, turns 153

Report

Result: partial Pushed: local d269ad1ea (a)+(b) test, local 35f8ef158 prover fix Tests: corpus_crossings_and_counters_are_the_toolchains and prover_whole_number_handed_to_a_reading_method green –both-settings (the second refused NK1300 on $NIKAIA_OLD); tests/compiler filters prove/bound/assert/claim/precondition/loop all green (353 programs); clippy, fmt clean; it bytes::the_corpus_needs_no_tether and sharing::the_one_shared_in_the_repository stopped by the background limit after 60+ s, not finished locally Gate: green Deviation: none Found: Prover, (c) of #2873: let mut cut = 0; if n > 256 { cut = n - 256; while cut > 0 && b[cut - 1] != '\n' { cut -= 1 } }; assert(cut >= 0) gives NK1300 “nothing before it shows it” on HEAD 35f8ef158 (the same assert inside the if is proved); traced: prover_join_arms (prover_walk.nika) does not carry the then-side’s new LoopRecords into the joined scope, so the loop’s invariant is lost at the join Found: Prover, (c) of #2873: let mut tail: Vec[u8] = []; for c in b[cut..<n] { tail.push(c) }; for _ in 0..<256 { tail.push(0) }; assert(tail.len() == n - cut + 256) gives NK1300 “no invariant found for the loop that changes tail.len(), _ carries it” on HEAD 35f8ef158; cause unknown (suspected: the for-over-slice and for-over-range push loops in prover_walk.nika give no length invariant; check: the same assert after only the first loop) Found: Prover, (c) of #2873: in benches/brc/fast.nika Table::run, assert(pos >= 0) and assert(pos + len <= buf.len()) placed before self.slot_of(w0, w1, len, buf, pos) give NK1300 “no invariant found for the loop that changes sep carries it” on HEAD 35f8ef158 (an inner while true that sets sep from pos and breaks, inside an outer loop that ends with pos = sep + 4 + ((dot >> 3) as i64)); sep <= buf.len() is proved; cause unknown (suspected: nested-loop invariants in ADR-361’s lazy loop records, prover_walk.nika through_loops) Found: Prover, (c) of #2873: the type rule assert(len >= 0 && len <= name.len()) on struct Slot { len: i64, name: Bytes, ... } gives NK1300 “slot is not a whole number the prover reads” where a slot is built (Slot { len: 0, name: Bytes([]), ... } and Slot { len: len, name: buf[pos..<pos + len].clone(), ... }), and for s in other.slots { assert(s.len >= 0 && s.len <= s.name.len()) } is not proved from it, on HEAD 35f8ef158; cause unknown, so merge’s self.slot_of(s.w0, s.w1, s.len, s.name, 0) cannot be proved by a narrower type Found: Lowering: let mut m: collections::BTreeMap[String, bool] = collections::BTreeMap(); for k in keys { let n = k.split(":").last() ?? continue; m.insert(n, true) }; for k in more { let x = k.clone(); let b = m.get(x) ?? true; m.insert(x, b) } (fn count(keys: ref Vec[String], more: ref Vec[String]) -> i64, use std::collections) gives NK1343 “EitherText<’_>: Borrow<nikaia_std::block::Text> is not satisfied” at m.get(x) on target/fast/nikaia at 35f8ef158, where it should run; traced: declared.nika maps an either Type to an owned String Ty (ADR-282 D15), so a_lookup_key_lent (check_reads.nika) lends the owned key as &x instead of FactKeyForm::Viewed (as_text(&x)), which a mixed key needs Needs: #2873 (c) stays open until the four prover gaps above are built: nikaia check benches/brc/fast.nika still gives NK1300 at slot_of (line 82) and run (line 115) Changelog: Prover: a whole number handed to a method that cannot change it (no mut parameter in any method of that name) keeps what the prover knows of it (NK1300 before). Tests: the corpus’s crossings and hello-http’s atomic counters are checked as the toolchain answers them. Issue: ok I1-I13; (c)’s “prove with a guard or a narrower type” does not fit: the claims hold, and four prover gaps hide them (Found lines) Friction: the two whole-corpus it tests (bytes, sharing) outlive a 600 s foreground call and twice the background limit, so they could not be confirmed locally Disk freed: 0 (target/nikaia-project-tests 1011M; / 6.1G free; 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_01UVxJDtmukJNapbMLmZMzTV

Debrief

  1. Most turns: the two whole-corpus it tests (bytes::the_corpus_needs_no_tether, sharing::the_one_shared_in_the_repository). Three runs died: a timeout 3000 run killed (143), one stopped at the 600 s foreground limit and its background time, and one cut off when the session ended. Next was the rabbit hole on the EitherText map-key lowering error (about 15 turns in the tiers, checker and emitter) before I filed it as Found.
  2. Looked up:
    • Where the prover drops variables handed to calls (untracked_in, prover_value_readers), and how Signature.mutable names self.
    • That either text becomes owned String in the checker (declared.nika, ADR-282 D15).
    • That nikaia test takes --bless/--filter, not --update.
  3. Checks:
    • Worth it: probes on $NIKAIA_OLD, the per-claim scratch copy of fast.nika with check --asserts, the tests/compiler filters, clippy, fmt.
    • Wasted: the repeated it-test runs (none finished), and the first build cycle, which failed on rustc because lower-std accepts code that rustc then refuses.
  4. Change that would save the most: the brief should give the expected run time of the whole-corpus it tests, or say “the driver runs them; do not run them locally”.
  5. What the issue lacked:
    • broke I7: (c) assumed a guard or narrower type would do; no probe of which sub-claims fail at each call site. Running check --asserts on a copy with split asserts before each call shows four separate prover gaps.
    • knowledge: Lowering | a BTreeMap[String, _] that gets both views and owned keys lowers its key as EitherText, and an owned key looked up there draws NK1343.
  6. Traps:
    • Fact: Core | the it tests over the whole corpus (bytes::the_corpus_needs_no_tether, sharing::the_one_shared_in_the_repository) run past the 600 s foreground limit and the background time; leave them to the driver.
    • Fact: Ledger and bounds proofs | a variable handed to a method stays tracked only when no method of that name takes a non-self mut parameter (key ".name", prover_value_readers, 2026-11-28, 35f8ef158).
  7. Work area:
    • Fact: Ledger and bounds proofs | split a refused precondition into one assert per sub-claim before each call, in a scratch copy, and run nikaia check --asserts; the "not proved" reason names the gap.
    • Fact: Ledger and bounds proofs | benches/brc/fast.nika: 2 NK1300 left (slot_of line 82, run line 115), 27 of 29 asserts proved (2026-11-28, 35f8ef158).

Generated by Claude Code

Back to Open Issues