Open and answer this issue on GitHub.
blocked, solver · opened 2026-11-22 · updated 2026-11-23 · 4 comments
Part of #714 (ADR-369 D2, ADR-269 D18-D19). Filed by the driver from the Found: of the run of issue-714. The mechanism was decided by the supervisor on 2026-11-22; see the comment below.
Since 667df1fd1, a pub struct’s written rule is published in the ledger (TypeContract.rules). On the consumer side nothing checks it yet:
x.f = e to a pub field of a dependency’s type with a rule produces no obligation. Today the type-rule pass (crates/nikaia/src/type_rules.rs, across_files) runs before checking, so it does not know the base’s type.The checker emits the obligation. It already knows the base’s type through field_owners (check_facts.nika, prover_calls.nika, prover_state.nika). type_rules.rs is neither extended nor re-run, per CLAUDE.md, “Written in Nikaia only”.
pub field whose owner per field_owners is a foreign type with a published rule: emit the rule, with the written field replaced by the new value, as an obligation. Its error is the one the local rule check already gives.tests/compiler/tests/ with .stdout/.stderr, each a package with a dependency:
All four tests are green, and type_rules.rs gained no lines.
Supervisor decision (2026-11-22): the checker emits the obligation.
The obligation for a write to a foreign (dependency) type’s pub field comes from the checker, which already knows the base’s type through field_owners (check_facts.nika, prover_calls.nika). It is written in Nikaia. crates/nikaia/src/type_rules.rs is neither extended nor run a second time. CLAUDE.md, “Written in Nikaia only”: a new feature adds no Rust, and a second pass over the Rust would be new Rust.
This also unblocks the consumer literal check and the open type’s entry fact that 5b7643ab dropped. That fact is sound once every write is checked.
Generated by Claude Code
Brief queued: issue-2766
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2766, 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/2766/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-2766.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-2766, Result: partial: items 1 and 2 built with three of the four tests; item 3 (restore the entry fact of an open type, type_rules.nika tr_declared_rules open) and its test “a function that relies on the entry fact proves” left, see Needs
Tokens: input 226, cache read 9158742, cache write 225433, output 66471 Cost: 5.16 USD, time 0 min 39 s, turns 113
Result: partial: items 1 and 2 built with three of the four tests; item 3 (restore the entry fact of an open type, type_rules.nika tr_declared_rules open) and its test “a function that relies on the entry fact proves” left, see Needs
Files: crates/nikaia-std/src/compiler/prover_walk.nika crates/nikaia-std/src/compiler/lowered/prover_walk.rs crates/nikaia-std/src/compiler/lowered.rs tests/compiler/tests/a_write_that_keeps_a_dependency_types_rule_passes.nika tests/compiler/tests/a_write_that_keeps_a_dependency_types_rule_passes.stdout tests/compiler/tests/a_write_that_breaks_a_dependency_types_rule_is_refused.nika tests/compiler/tests/a_write_that_breaks_a_dependency_types_rule_is_refused.stdout tests/compiler/tests/a_literal_that_breaks_a_dependency_types_rule_is_refused.nika tests/compiler/tests/a_literal_that_breaks_a_dependency_types_rule_is_refused.stdout
Commit: The prover checks a dependency type’s published rule at a pub field write and at a literal (ADR-369 D2)
Body: prover_walk.nika: prover_field_write (Stmt::Assign on x.f, owner from the checker’s field_owners) and prover_rule_literal (StructLit in prover_calls_in) ask each rule another package’s ledger publishes for the type, through prover_rule_kept: the rule read back with condition, the written field the new value (x.f op= v as x.f op v), the other fields self.g read through the base’s path, asked with precondition_call as a std precondition: proved, carried back to the function’s entry, NK1207 “This write/literal breaks T’s rule …”, or a claim held at run time, which NK1300 refuses. A type of this program is left to its own rule’s rewrite; type_rules.rs is untouched (0 lines). Part of #2766.
Part: #2766
Tests: the three new programs pass (nikaia test --project tests/compiler --filter dependency_types_rule); on the unfixed compiler ($NIKAIA_OLD) all three printed exit 0, so the two refusal tests failed there; filters rule 39, precondition 28, literal 78 passed
Gate: green
Deviation: the NK1207 wording is “This write breaks level::Level’s rule 0 <= v && v <= 10 every time it is reached.” (NK1207 as the local rule’s, worded for the write; the local one prints the substituted claim)
Found: under unproved-claims = "warn" an unproved rule at a consumer’s write or literal is a warning with no run-time check behind it: the claim’s terms are rarely readable (a mut value’s field paths are never prover names: fn g(mut p: P) { if p.n > 0 { assert(p.n > 0) } } NK1300 “p is not a whole number the prover reads”, while fn f(p: P) proves), and no emitter path writes the rule’s text as a check after a field write; the local type’s check is the Rust rewrite of type_rules.rs, which the decision on #2766 forbids extending; no decision yet
Needs: supervisor decision: restoring the entry fact (item 3) is sound only when every way a consumer changes an open type’s field is held to the rule; this run checks writes (x.f = v, x.f op= v) and literals, not a mutating method on a pub field (r.slots.pop() under assert(slots.len() <= cap), the 5b7643ab probe), a mut argument f(mut r.n), a with copy, nor (under unproved-claims = "warn") any unproved write at run time; which of these is checked, and how the warn-mode run-time check is emitted without type_rules.rs, is not decided
Changelog: A write to a pub field of a dependency’s type, and a literal of one, is held to the rule the type publishes (ADR-369 D2): shown false is NK1207, not proved NK1300, a write a guard or the caller’s argument proves passes
Issue: meets I1-I13; item 3 needs the soundness preconditions above stated in the issue (it names only writes and literals)
Owner: none
Comment: none
Friction: none
Disk freed: none; nikaia-project-tests 1.8G, disk 11G free, no new entry over 100 MB
Reviewed: 771c69bd9e0d42f536adc15b43213e84abddca72966cd456d1479ddb7798e688
Pushed: local e98b76b0459b5fe794f593f3c1429ca2725d626f
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDwk9ubq9teP7QCErff
std precondition becomes a claim (precondition_call, std_claims/held, check_claims_unproved, the emitter’s reaches). Then I had to work out why the consumer could prove nothing: a mut value’s field paths are never prover names. After that it took two builds.assert(claim; message: "…") in TypeContract.rules, keyed pkg::Type). Also where field_owners reaches the prover (ProverState.field_owners), and that open in tr_declared_rules is the one switch item 3 flips. The brief could have named all three.rule, precondition and literal filters;Wasted: my first test run used nikaia run on a test file, which refuses it, so I reran with nikaia test --filter. The scratch copy for fmt was wasted too, because test .nika files may be formatted in place.
nikaia test --project tests/compiler --filter X --bless. Run with the old binary, that also gives the “failed before the fix” evidence in one step.broke I7: item 3 does not say which consumer changes must be checked before the entry fact can come back. 5b7643ab’s own probe was r.slots.pop(), which is not a write or a literal. Item 3 needs those preconditions stated, or an explicit decision.rules-gap: the issue does not say how the rule is checked at run time under unproved-claims = "warn" when type_rules.rs is off limits.knowledge: Lowering | a mut binding's or mut parameter's field paths are never prover names, so a consumer's rule obligation over the other fields is unproved (NK1300) unless the written value alone settles it| Fact: Core | Test programs in tests/compiler/tests/ cannot be started with nikaia run FILE; use nikaia test --project tests/compiler --filter NAME, and --bless writes the .stdout. |
| Fact: Ledger and bounds proofs | A dependency type’s rule is in own.types["pkg::Type"].rules as the text assert(claim; message: "…"); the prover reads it back with the condition callback over the field names. |
| Fact: Ledger and bounds proofs | The consumer-side rule checks (prover_field_write, prover_rule_literal, prover_rule_kept) are in prover_walk.nika, commit e98b76b0, 2026-11-23. The entry-fact switch is open in type_rules.nika tr_declared_rules. A body change to prover_walk.nika needs one lower-std plus a build plus a fixpoint lower-std, under 10 minutes (2026-11-23, e98b76b0). |
Generated by Claude Code
Items 1 and 2 are built (e98b76b04): prover_field_write, prover_rule_literal and prover_rule_kept in prover_walk.nika, with 3 tests. Item 3, restoring the open type’s entry fact, waits on the write points that are still unchecked. A mutating method on a pub field, a mut argument, a with copy and the warn-mode check are now one build, “Prover: a dependency type’s rule holds after every change to a pub field, checked at run time under unproved-claims = “warn”” (#2816). That build was decided from ADR-369 D2 and Part I 4.1 (686b36041), and item 3 is the last item on its list. This issue is set to blocked until #2816 lands.
Generated by Claude Code