Open and answer this issue on GitHub.
blocked, bugs · opened 2026-11-17 · updated 2026-11-20 · 3 comments
Filed by the driver from the Found: of the run of issue-2015 (#2015) (owner, 2026-11-06).
The run bundle lowers a script again whenever it is called by a different spelling of its path. nikaia run scripts/slot.nika -- B true then nikaia run $PWD/scripts/slot.nika -- B true, alternated, traces slot_e610388cf78b9045 lowered + rustc reused on every run (about 2.1 s vs 1.4 s when cached). Runs with the same spelling in a row trace nothing. It should be one entry per canonical file. Cause suspected: the shown path or the source spelling is part of the lowering cache key in project_drive.nika / project.rs, although project_drive_kept_for_file keys the dir by the canonical path. A NIKAIA_WRAPPER_TRACE run with both spellings and a diff of the two cache keys would settle it.
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
Brief queued: issue-2038
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2038, 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/2038/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/performance/issue-2038.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-2038, Result: blocked
Tokens: input 56, cache read 1279398, cache write 49363, output 12110 Cost: 0.93 USD, time 6 min 29 s, turns 28
Result: blocked
Files: none
Commit: none
Body: Reproduced on HEAD 602011cb0 (fresh fast build): alternating NIKAIA_WRAPPER_TRACE=$T target/fast/nikaia run scripts/slot.nika -- B true and ... run $PWD/scripts/slot.nika -- B true writes slot_e610388cf78b9045 lowered + slot_e610388cf78b9045 rustc reused on every run (0.26-0.31 s); the same spelling twice in a row writes nothing (0.05 s, the cargo-fresh path). Cause traced: the ADR-300 D9 abort table __NIKAIA_PLACES in the generated target/nikaia/gen/slot/slot.rs holds the entry under the spelling the user typed ((90, "scripts/slot.nika", 23) against (90, "/home/user/Nikaia/scripts/slot.nika", 23), 38 lines differ, nothing else does). nikaia run hands that spelling to the wrapper as NIKAIA_SHOWN_AS (project_drive_cargo_env, read in project_drive_wrapper), so every switch rewrites slot.rs, which the dep-info lists. Cargo then runs the wrapper again and the rustc store keeps one entry per spelling (two entries under ~/.cache/nikaia/rustc with identical .d files). The kept project dir and the lowering are keyed canonically; only the shown name differs.
Fixes: none
Pushed: none
Tests: probe above run on a fresh cargo build --profile fast -p nikaia of HEAD; nothing built, so no tests run
Gate: green
Deviation: none
Found: nikaia run builds a loose file again whenever it is called by a different spelling of its path (nikaia run scripts/slot.nika -- B true, then nikaia run $PWD/scripts/slot.nika -- B true, alternated, traces slot_e610388cf78b9045 lowered + rustc reused on every run, 0.28 s against 0.05 s). Traced cause: the ADR-300 D9 table __NIKAIA_PLACES bakes the entry’s shown spelling (NIKAIA_SHOWN_AS, project_drive_cargo_env in project_drive.nika) into the generated Rust. No decision yet: making the generated Rust independent of the spelling needs one of (a) the table holds the canonical path and nikaia run passes the spelling to the running program, so the panic hook in crates/nikaia-std/src/abort.rs (Rust runtime, new Rust) prints it, which keeps today’s output; (b) the table always holds the canonical path, so a loose file aborts as /abs/path.nika:N, against the relative src/main.nika:2 of ADR-300 D10’s example; (c) by design, one relink per spelling switch. Expected: one build per canonical file (#2038) and the abort line still as given.
Needs: supervisor decision
Changelog: none
Issue: wrong I7: the lowering cache key does not hold the spelling. The kept dir and the lowering are canonical; the shown spelling reaches the generated Rust through the ADR-300 D9 abort table, and the wrapper’s lowered trace is written on every invocation, cache hit or not
Owner: none
Comment: none
Friction: NIKAIA_WRAPPER_TRACE takes a file path to append to, not a switch (=1 writes the file ./1); neither the issue nor the facts say so
Disk freed: none; target/nikaia-project-tests 989M, / 7.3G 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_01UVxJDukWgopUzVU2M1TjK7
NIKAIA_WRAPPER_TRACE=1, which writes to a file named 1 instead of switching tracing on.project_settings_trace appends to a file path), where the run cache lives (~/.cache/nikaia/run/<stem>-<key>/target/nikaia/gen/), and the ADR-300 D9/D10 text on the abort table..d files (ruled out env-dep and input differences); the diff of the generated slot.rs for each spelling (found the cause). Wasted: the first probe loop with =1, and grepping .d files for env-dep.target/nikaia/gen/<name>/<name>.rs between the two runs. That would have found the cause in about 3 turns.wrong I7: it suspected the lowering cache key; the spelling actually reaches the generated Rust through the ADR-300 D9 abort table.broke I5: it gave no expected output from an ADR. ADR-300 D10 shows aborts under the path as given, which turns the fix into a design choice.knowledge: Probes | NIKAIA_WRAPPER_TRACE takes a file path to append to; its "lowered" line means the wrapper ran, not that the lowering cache missed.Fact: Probes | NIKAIA_WRAPPER_TRACE=PATH appends one line per wrapper call to PATH (a value of 1 creates ./1 in the checkout); "lowered" is written on every wrapper call, cache hit or not.Fact: Probes | a loose file's generated Rust is ~/.cache/nikaia/run/<stem>-<key>/target/nikaia/gen/<stem>/<stem>.rs; diff it between two runs to see why Cargo rebuilt.Generated by Claude Code
Driver: not queued, this issue waits for #2449, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code