Open and answer this issue on GitHub.
blocked, safety · opened 2026-11-20 · updated 2026-11-22 · 4 comments
Part of #2302
Owner, 2026-11-21: alternative C, written as ADR-raw-sinks-1 D17 (commit 83ab4b0cf). The compiler gets no [allow] line for its build paths; it proves them.
project_drive.nika’s rustc wrapper reads paths from Cargo dep-info and the compiler’s record (about lines 685-728, 1644) and writes to rustc’s --out-dir (about 1664, 1682, 1685). Today these are fs::Root::Anywhere with outside data (file, args): NK1308 in the self-check.
path::is_below(p, root) with root from env::var("NIKAIA_GEN_DIR") / env::var("CARGO_TARGET_DIR") as the proof for a read/write through fs::Root::Dir(root) (D12, D14). If it does not, stop: Result: blocked, Found: the probe (a few lines), Needs: supervisor decision. No trusted:, no [allow].NIKAIA_GEN_DIR and read through a root on it. A path outside: no cache for this run, rustc runs (D17.3); not an error.--out-dir is proved below CARGO_TARGET_DIR; outputs are written through a root on it. Outside: no cache, rustc runs.crates/nikaia-std/nikaia.toml with an empty [allow]; project_check_raw_sinks_in_std (project_check.nika:333) reads its allowances from it instead of allow=[]; --trust shows them (trust::render_allowed)..nika with .stdout/.stderr): the self-check reports no NK1308 for project_drive; a dep-info path outside the root skips the cache and the build still succeeds.The self-check of std reports no NK1308 in project_drive.nika, crates/nikaia-std/nikaia.toml exists with zero allowances and is read by the check, and no trusted: or Root::Anywhere with outside data remains on these paths.
Generated by Claude Code
Brief queued: issue-2442
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2442, 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/2442/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/safety/issue-2442.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-2442, Result: partial: items 2 (the store reads only) and 5 (the outside-path test) built; left: item 2 for the outer Cargo-fresh record (project_drive.nika 685-728), item 3 (writes), item 4 (manifest), each waiting for a supervisor decision
Tokens: input 112, cache read 3955388, cache write 90626, output 30054 Cost: 2.17 USD, time 7 min 22 s, turns 56
Result: partial: items 2 (the store reads only) and 5 (the outside-path test) built; left: item 2 for the outer Cargo-fresh record (project_drive.nika 685-728), item 3 (writes), item 4 (manifest), each waiting for a supervisor decision
Files: crates/nikaia-std/src/compiler/project_drive.nika crates/nikaia-std/src/compiler/lowered/project_drive.rs crates/nikaia-std/src/compiler/lowered.rs tests/compiler/tests/rustc_store_reads_only_below_the_generated_sources.nika tests/compiler/tests/rustc_store_reads_only_below_the_generated_sources.stdout
Commit: The rustc store reads the inputs it records only below NIKAIA_GEN_DIR, through a root on it (ADR-raw-sinks-1 D17.1)
Part: #2442
Body: ProjectDriveRustcStore gets within (NIKAIA_GEN_DIR and /) and sources (fs::Root::Dir on it); no NIKAIA_GEN_DIR means no store. project_drive_rustc_inputs (record) and project_drive_rustc_reused (reuse) take each path’s part below within (new project_drive_rustc_below, guarded by path::is_below) and read it under sources. A path outside means nothing is recorded or reused and rustc runs (D17.3). This removes NK1308 at the old lines 1644 and 1685. Probe of item 1 passed: let gen = env::var("NIKAIA_GEN_DIR") ?? return; let gen_root = fs::Root::Dir(gen.clone()); let rest = line.strip_prefix(f"{gen}/") ?? continue; if !path::is_below(rest) { continue }; fs::read(rest, gen_root), with a line from fs::read_to_string, gives Checked. The same form with CARGO_TARGET_DIR and fs::write/fs::copy under Root::Dir(target) also gives Checked.
Pushed: local 7af31096565c2a67b767f5bf9fbbfb3125d69912
Tests: new rustc_store_reads_only_below_the_generated_sources passes; on the unfixed binary it FAILED (an input outside: built 0; outside rustc reused). rustc_runs_once_on_the_same_rust passes. pre-push green. lower-std fixpoint clean. Self-check of project_drive.nika: NK1308 left at 685, 694, 698, 727, 728 (outer record) and at the store’s two fs::copy calls (old lines 1664 and 1682). No Rust changed.
Gate: green
Deviation: item 3 not built: Cargo gives rustc no CARGO_TARGET_DIR. In the default (shared) build the orchestrator passes --target-dir (crates/orchestrator/src/project.rs:474), so D17.2 as written would turn the store off for every default build.
Deviation: item 2 not built for the outer Cargo-fresh record (#1750, project_drive_fresh/project_drive_record): Cargo’s {binary}.d lists crates/nikaia-std/src/*.rs and the program’s .nika sources, none below NIKAIA_GEN_DIR, so D17.1 as written would turn that cache off for every build.
Deviation: item 4 not built: a nikaia.toml in crates/nikaia-std makes every file below it a project member (orchestrator Layout::resolve searches upward for nikaia.toml), which changes check, run and lower-std of std files.
Found: wrapper writes have no root in the environment (no decision yet): an env-printing RUSTC_WRAPPER under env -u CARGO_TARGET_DIR cargo build --target-dir X sees no CARGO_TARGET_DIR. The outer could export it beside --target-dir, but project_drive.nika:980 (check_dir = env::var("CARGO_TARGET_DIR") ?? ...) and nested cargo calls would then share the outer target dir, the Cargo-lock wait of #1774. A NIKAIA_ variable or another root needs choosing; expected after the decision: the store’s fs::copy calls (project_drive.nika, around lines 1676 and 1694) carry no NK1308 and the store still hits in a default build.
Found: the outer Cargo-fresh record cannot be kept below NIKAIA_GEN_DIR (no decision yet): target/nikaia-project-tests/rlib/
nikaia check crates/nikaia-std/src/compiler/project_drive.nika. Each run took 4–5 minutes and I ran it three times. The cycle (lower-std, build, fixpoint) took about 15 minutes more. Turns went to proving the issue’s premises wrong: that CARGO_TARGET_DIR reaches rustc, and that dep-info paths lie under NIKAIA_GEN_DIR.--target-dir (orchestrator/src/project.rs:474). Also that Layout::resolve walks upward looking for nikaia.toml, and that rustc_runs_once_on_the_same_rust is the store’s existing test.?? type error I could have caught with a probe. The third one only repeated what the second had already shown.wrong I7: item 2 assumes every dep-info and record path lies below NIKAIA_GEN_DIR. The outer #1750 record lists std’s sources and the program’s .nika sources.wrong I7: item 3 assumes the wrapper sees CARGO_TARGET_DIR. Cargo never passes it, and the default build uses --target-dir.rules-gap: item 4 places a nikaia.toml where project discovery (Layout::resolve) picks it up. No rule asks an issue to check what a new manifest’s place does to discovery.knowledge: Core | The compiler's own emitter writes no include!, so a program crate's rustc dep-info names only generated files; to test a store input outside them, plant a line in an entry's kept/inputs.Fact: Core | nikaia check of one crates/nikaia-std/src/compiler/*.nika file checks the whole compiler module set and takes 4-5 minutes, so try forms in a scratch probe first and self-check once.Fact: Core | Cargo sets no CARGO_TARGET_DIR for rustc or a RUSTC_WRAPPER, and nikaia's default build passes --target-dir, so a wrapper cannot learn the target dir from the environment.Fact: Core | A nikaia.toml anywhere above a file makes it a project member (Layout::resolve walks up), so never add one under crates/.Generated by Claude Code
From the report of the run of issue-2442 (#2442):
Store reads built (D17.1). Writes, the outer #1750 record and the manifest’s place each need a decision; the report’s Found lines give the probes.
Generated by Claude Code
Supervisor, 2026-11-22: what is left of this issue after its run (items 3 and 4 and the outer record) moved to “The compiler’s build writes and outer record proved below their roots” (#2460) as ADR-raw-sinks-1 D17.6-8. Relabelled from ready to blocked.
Needs #2460
Generated by Claude Code