Open and answer this issue on GitHub.
performance, blocked, ci · opened 2026-11-16 · updated 2026-11-19 · 9 comments
Filed by the driver from the Found: of the run of issue-1308 (#1308) (owner, 2026-11-06).
a per-function or per-unit ledger store that outlives one lower-std process needs on-disk forms nobody has decided: crate::check::Checked (findings, CheckFacts, methods, stored_code; crates/nikaia/src/check/mod.rs:77) has no text or byte form, and the passes the issue wants woken per function (sync, throws, touch, keeps, locks, panics, tether in crates/nikaia/src/contracts/*.rs, 1743 lines, plus views::result_sources_in/places_stored_in) are Rust with whole-package infer(ledger, units, ...) entry points, so giving each one a per-function call is new Rust in Rust passes; CLAUDE.md “no new Rust” makes that a supervisor decision (move each pass into Nikaia first, or allow the Rust plumbing as #1277 did); no decision yet
develop first: the run that wrote it may have used a binary older than the tip, so it may be fixed already (#1822: #1788 was filed from a probe a fix under #1754 had already made pass). A probe that passes there names the commit that fixed it (git log -400 --grep by topic, since a fix often lands under another issue’s number), and the run builds only a tests/compiler/tests/ test that pins it (docs/issues.md I13).std defect with a probe (nikaia run scripts/probe.nika -- SNIPPET; a lowered file that differs, with an uncached lower-std of a git archive HEAD copy, NIKAIA_LOWER_CACHE_SALT fresh and --sysroot COPY/crates, its lowered/ diffed against the copy’s, never the shared working tree’s, #1793), a defect in docs/, guide/, website/ or scripts/ (a stale example, a wrong rule) with the command or check that shows it; a behaviour the code does on purpose (name the function or ADR) closes it as by design. The Found line may lack them (#1710): the commit message, or the report’s Body: when closed, gives the probe or check with its expected output, the ADR or Part I-III section that says so, and its actual output (docs/issues.md I5, I6), and the cause, file and function, traced or suspected (I7).std defect in the compiler, a stale page example or rule in its page or docs/ file, a script defect in the script. Add a test in tests/compiler/tests/ unless a check that already runs turns red on it (name it: pre-push’s page-examples for guide/ and website/, check-adr-refs.py for a docs citation).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
Measured cost (the full table is on “lower-std: key each file on the interface entries it reads” (#1307)):
infer_package_parallel) re-runs over the whole package on every miss. It takes about 90% of lower-std’s wall time on a body-only change.Proposal, not yet decided: move the remaining Rust passes of the ledger into Nikaia first, then build the store in Nikaia.
Generated by Claude Code
Order: first move the ledger’s Rust passes into Nikaia, then build the persistent store in Nikaia. The store is a new feature, and under “no new Rust” it cannot be written into crates/nikaia/src/contracts/ (15 files). The move is part of self-hosting anyway (ADR-294, “Self-hosting” #125).
Finding that shapes the store: infer_package_parallel (crates/nikaia/src/contracts/mod.rs) also runs the checker over every unit (check::Checked). Storing the ledger rows alone saves little; an unchanged unit must skip its check as well. So the store keeps, per unit, the ledger rows and whatever later passes take from Checked (trust, the graphs).
contracts/ to crates/nikaia-std/src/compiler/*.nika, file by file, smallest first (ty, locks, panics, maps, order, sharing, keeps, send, touch, sync, throws, tether, trust, keep, then mod). Each step must give byte-identical lower-std output and an identical nikaia.ledger for the corpus. Each step is its own commit; a missing form stops the step (CLAUDE.md, Moving Rust into Nikaia).target/ beside the lowering cache and outlives the process. A unit whose key matches is neither checked nor inferred again.heavy-sysroot-pair stays green.Step 1 is large; the driver gets it in parts that fit a run.
Generated by Claude Code
Brief queued: issue-1913
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1913, 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/1913/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/ci/issue-1913.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-1913, Result: partial: step 1 has done ty (afb5d7ca) and locks (00cabd66, report issue-1913.md.step2.report.md; its Body says 47 lines, really 55); left: step 1’s panics (its glue calls the Rust prover crate::bounds::proven in parallel through crate::proofs::in_parallel, so the Nikaia panics_infer needs a prover callback in the adapter), maps, order, sharing, keeps, send, touch, sync, throws, tether, trust, keep, mod; step 2 (the store, waits for #1909’s name-based key); step 3 (the measurement)
Tokens: input 138, cache read 5215855, cache write 122444, output 38310 Cost: 2.94 USD, time 0 min 4 s, turns 69
Result: partial: step 1 has done ty (afb5d7ca) and locks (00cabd66, report issue-1913.md.step2.report.md; its Body says 47 lines, really 55); left: step 1’s panics (its glue calls the Rust prover crate::bounds::proven in parallel through crate::proofs::in_parallel, so the Nikaia panics_infer needs a prover callback in the adapter), maps, order, sharing, keeps, send, touch, sync, throws, tether, trust, keep, mod; step 2 (the store, waits for #1909’s name-based key); step 3 (the measurement)
Files: crates/nikaia-std/src/compiler/check_types.nika crates/nikaia-std/src/compiler/ty.nika crates/nikaia-std/src/compiler/lowered.rs crates/nikaia-std/src/compiler/lowered/check_types.rs crates/nikaia-std/src/compiler/lowered/ty.rs crates/nikaia/src/contracts/send.rs crates/nikaia/src/contracts/ty.rs
Commit: contracts/ty: the type constructors and the last-segment rule move into Nikaia
Part: #1913
Body: The last logic of contracts/ty.rs moves into Nikaia: ty.nika gains a_named_ty, a_view_ty, a_seen_ty (with their ADR-278 D19 and ADR-281 D22 docs), and TyOps now only calls them, ty.nika’s parse and declared.nika’s written_ty; it goes when its Rust callers move. Rust base (one caller, a send.rs unit test) is replaced by the twin that already existed, check_types.nika’s type_last_segment, now pub for that test. The FIELD and VARIANT constants had no Rust reader and are dropped (the Nikaia checker writes $Variant itself). ty.rs: 146 to about 66 lines. The ledger’s values are the same: the constructors build the same Ty::Named, and no other lowered file changed.
Tests: lower-std fixpoint (second run of the new binary changes nothing; only ty.rs, check_types.rs and lowered.rs moved); cargo test --lib contracts:: 3 passed, including send::tests::nothing_but_a_lock_or_a_count_is_refused_at_either_destination; it send:: held_across_a_pause:: sequences:: foreign_pointers:: nullable:: pausing_steps:: sequence_shapes:: fixed_size_array:: channels:: function_types:: 204 passed; clippy and fmt clean; pre-push green. No new test: a move with no change of behaviour
Gate: green
Deviation: none
Found: none
Needs: #1909 (step 2, the per-unit store, needs its name-based key)
Changelog: none
Issue: broke I11: step 2 says “the name-based key decided in #1909” but has no Needs #1909 line, so a run cannot tell whether the store waits for #1909 to close or only for its decision
Friction: none
Disk freed: none; target/nikaia-project-tests 1.6G, / 5.1G free (87% used), 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
Reviewed: 3a408d4244f18a04eb74ba8e3f0097332f9922de214e293e1ab0f5b95f443c67
Pushed: local afb5d7cae7b0ef7e32207187ae6cebe927310dbb
[ test, so it never fired and ran until its time limit. I also spent turns finding each Rust function’s Nikaia twin (for example type_last_segment for base) before I could delete anything.contracts/*.rs functions have Rust callers outside contracts/ (free_calls from check/host.rs, task_facts).panics and the files after it call the Rust prover (crate::bounds::proven, crate::proofs::in_parallel), which still has no Nikaia form.contracts:: unit tests, it filters (204 tests for ty, 70 for locks), tests/compiler --filter lock, clippy, fmt and pre-push. All were needed. The only waste was the hand-written wait loop.panics needs a callback adapter.broke I11: step 2 names #1909 but has no Needs #1909 line.rules-gap: step 1 orders “byte-identical lower-std output” but gives no probe or command that checks the ledger is identical. I used “no other lowered file changed” as a stand-in.| Fact: Core | A background wait on the cycle should be one run_in_background call with timeout: 3600000, never a hand-written until grep ...; sleep loop: one wrong [ test makes it spin until its time limit. |
| Fact: slices | Returning a text view as String (e.g. rsplit("::").next() ?? name) draws NK1104; reuse a cloning twin such as check_types.nika’s type_last_segment. |
| Fact: lowering | A contracts/*.rs pass that needs Rust-only values (the emitter’s literal_expressions, the prover’s Proven) moves as a Nikaia *_infer taking a fn(...) sync callback, with the Rust file kept as the adapter that builds the ParsedViews. |
Generated by Claude Code
The report of the run of issue-1913 (#1913) judged this issue against docs/issues.md; the author fixes the issue by the rule it names (How a run judges its issue):
Needs #1909 line, so a run cannot tell whether the store waits for #1909 to close or only for its decisionGenerated by Claude Code
Driver: not queued, this issue waits for #1909, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
The owner decided on 2026-11-17: option A. The contract passes move into Nikaia first, and the per-function entry and the stored form of their facts are built there. No new Rust plumbing is allowed this time, unlike #1277.
The move is filed as “The contract passes (sync, throws, touch, keeps, locks, panics, tether) move into Nikaia, each with a per-function entry” (#1982).
Needs #1982
This issue stays blocked until #1982 is done. “lower-std: incremental ledger, facts per function and per unit…” (#1308) and “lower-std: key each file on the interface entries it reads…” (#1307) wait on it too.
Generated by Claude Code
From the report of the run of issue-1982 (#1982):
#1982’s run found the seven contract passes already in Nikaia with Rust adapters; what is left is the adapters’ glue (bounds proving, parallel proofs, ledger writes) and a per-function entry whose meaning for a fixpoint pass and whose test route are undecided.
Generated by Claude Code
From the report of the run of issue-1308 (#1308):
ADR-100 D7 (from #1984) decided the per-function contract entry; what is still open for #1308 is the on-disk form of the stored per-function columns and the per-unit Checked (file layout, key, where it lives under target/); once that is written down, #1913 can close
Generated by Claude Code