Open and answer this issue on GitHub.
ready, solver · opened 2026-11-23 · updated 2026-11-23 · 0 comments
Filed by the driver from the Found: of the run of issue-2766 (#2766). Decided by the solver supervisor on 2026-11-23 from ADR-369 D2, which already lists the points.
ADR-369 D2 says a type’s rule is established by every construction (a literal, a with copy, the constructor’s result) and after every write to a field from outside a method of the type. Part I 4.1 now says what a write is (commit 686b36041):
A write to a field is any change to it:
x.f = v,x.f op= v, a method that takesmut selfcalled onx.f, andx.fpassed as amutargument, where the rule holds once the call returns.
So all four points the run left open are checked: a mutating method on a pub field, a mut argument, a with copy, and, at every point, the warn mode. Part III, unproved-claims, already decides the warn mode: “at warn the program builds, each such claim a warning and a check where it is reached”. How that check is emitted is not a language question. Under CLAUDE.md it is emitted from Nikaia. The part of type_rules.rs it needs is moved into Nikaia rather than extended.
prover_field_write and prover_rule_literal (crates/nikaia-std/src/compiler/prover_walk.nika) check x.f = v, x.f op= v and literals. They do not check these:
r.slots.pop() under assert(slots.len() <= cap) (the 5b7643ab probe);f(mut r.n);r with { n: v }.Under unproved-claims = "warn" an unproved write is a warning with no run-time check behind it.
The run also found that a mut parameter’s field paths are not prover names. fn g(mut p: P) { if p.n > 0 { assert(p.n > 0) } } gives NK1300 “p is not a whole number the prover reads”, while fn f(p: P) proves. The cause is not marked (docs/issues.md I7).
mut self method called on a pub field of a dependency’s type, after the field is passed as a mut argument, and at a with copy, the same way prover_rule_kept checks a write. Add one refusal test and one passing test for each in tests/compiler/tests/.unproved-claims = "warn", emit the rule’s claim as a run-time check at each unproved point, from Nikaia. Move the emitting part of type_rules.rs into type_rules.nika or prover_walk.nika. Add a test that runs a program whose unproved write breaks the rule and expects the rule’s message.mut parameter’s field paths prover names, so that the fn g(mut p: P) probe proves. Trace the cause first (I7). Add a test.tr_declared_rules open) with its test “a function that relies on the entry fact proves”.Each listed point is refused when shown false, passes when proved, and is checked at run time under warn, each with a green test. The mut p probe proves, and #2766 item 3 is built.