Open and answer this issue on GitHub.
blocked, safety · opened 2026-11-21 · updated 2026-11-21 · 4 comments
Part of #2442. The rest of “Where the compiler states its own untrusted-paths allowance” (#2442), after 7af31096 (the store’s reads, D17.1). Decided by the supervisor as ADR-raw-sinks-1 D17 items 6-8 (an obvious extension of the owner’s decision on #2442); this issue also holds the Founds filed as #2461 and #2462.
NIKAIA_TARGET_DIR. The outer build pushes NIKAIA_TARGET_DIR = the --target-dir it hands Cargo, beside NIKAIA_GEN_DIR in project_drive_cargo_env (project_drive.nika ~762). The wrapper proves --out-dir below it and writes through fs::Root::Dir on it. CARGO_TARGET_DIR is not exported (the Cargo-lock wait of #1774). Unset: no store, rustc runs (D17.3).project_drive_fresh / project_drive_record (#1750, project_drive.nika ~675-728): every path, plus the binary and the record, is proved below one of the roots the outer build holds (project root, the sysroot’s std sources, the target directory) and is read through a root on it. If a path is below none of them, no record is kept and Cargo runs.crates/nikaia-std/trust/nikaia.toml (beside the sources, above none, so Layout::resolve never takes it), ordinary manifest form, empty [allow]; project_check.nika reads it by path and --trust shows it.On today’s develop, NK1308 untrusted-paths-read/write remains at project_drive.nika 685, 694, 698, 727, 728 (outer record) and at the store’s two fs::copy (~1676, ~1694). The wrapper sees no CARGO_TARGET_DIR under cargo build --target-dir X (probe in the #2442 report: env-printing RUSTC_WRAPPER, verified). The locker test’s dep-info names 26 files in crates/nikaia-std/src (verified). Cause of the manifest point: Layout::resolve (crates/orchestrator/src/cache.rs:680) takes the nearest nikaia.toml among the ancestors (read, verified).
NIKAIA_TARGET_DIR in project_drive_cargo_env; the store proves out_dir below it (path::is_below) and copies/writes through a root on it; no fs::Root::Anywhere left in the store.Root::Anywhere left in 675-728.crates/nikaia-std/trust/nikaia.toml with [package] and an empty [allow]; project_check.nika reads its allowances from it instead of a list in code; nikaia check --trust on the compiler shows zero allowances.tests/compiler/tests/: a write outside NIKAIA_TARGET_DIR is not stored; a record path outside the roots keeps no record; the #1750 cache and the second store still hit in a default build (an existing test or a new one).nikaia check of project_drive.nika gives no NK1308; the compiler’s manifest exists with zero allowances; no trusted:, no fs::Root::Anywhere at the sites above; the new tests failed on the unfixed tree and are green; the #1750 and store cache tests stay green.
Generated by Claude Code
Brief queued: issue-2460
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2460, 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/2460/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-2460.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-2460, Result: blocked
Tokens: input 70, cache read 1865639, cache write 65957, output 15143 Cost: 1.25 USD, time 5 min 1 s, turns 35
Result: blocked
Pushed: none
Tests: issue probe target/fast/nikaia check crates/nikaia-std/src/compiler/project_drive.nika on HEAD’s binary: NK1308 at 685, 694, 698 (x2), 727, 728 (x2); the store’s fs::copy at 1676 and 1694 draw no NK1308 today but still name fs::Root::Anywhere
Gate: green
Deviation: none
Found: item 6 needs a copy from the store (user cache, ~/.cache/nikaia, orchestrator::cache::user_cache_dir) into the target directory, and std has no form for it: fs::copy takes one root for both names (ADR-108 D2, “both names must lie under it”), use std::fs; fn main() throws { let from: fs::Path = "/abs/cache/f"; fs::copy(from, "g", fs::Root::Dir("/abs/target/out")) catch { println(f"copy: {error}"); return }; println("copied") } prints copy: the name leaves the root it was given: /abs/cache/f, and the ADR-108 route of fs::read under one root then fs::write under the other drops the executable bit of a stored bin output, since std has no permission setter (fs::set_permissions("g", fs::Root::Dir("."), 0o755) gives NK1171 fs has no function called set_permissions); either a copy over two roots or a mode option is wanted, no decision yet
Found: item 6 also needs the target directory before Cargo starts, and Nikaia cannot learn it: project_drive_cargo_env (project_drive.nika 759) builds the env before host.make_cargo, and the --target-dir is chosen in Rust (make_cargo, crates/nikaia/src/project.rs 4457: Sysroot::rlib_cache(...) when shared, else none, which is Cargo’s default <manifest dir>/target); ProjectDriveHost (Rust-implemented) has no target_dir accessor, so the item needs a new Rust host method (traced), no decision yet
Found: item 7 needs the outer build’s roots (project root, the sysroot’s std sources, the target directory) in project_drive_fresh / project_drive_record, which the Rust host cargo_fresh / record_cargo (crates/nikaia/src/project.rs 4307-4315) calls with only record, handed[, messages, generated]; ProjectDriveHost (project_drive.nika 40-160) has gen_dir, own_dir, switches_path but no accessor for any of the three roots, so each must be a new method of a host implemented in Rust, which the issue itself says to report, not write around (traced), no decision yet
Found: item 8 asks project_check.nika to read crates/nikaia-std/trust/nikaia.toml by path, but Nikaia has no TOML reader: manifests are parsed only in Rust (Manifest::read, crates/nikaia/src/manifest.rs 110, toml crate) and manifest_parse (manifest.nika 429) takes already parsed ManifestItems; project_check_raw_sinks_in_std (project_check.nika 333) is called from Rust (allow_std_helpers_in_std, crates/nikaia/src/check/mod.rs 808) with no path, so the item needs either a Nikaia TOML reader or a change to that Rust caller to read the manifest and pass its [allow] (traced), no decision yet
Needs: supervisor decision: (1) a std copy over two roots, or a permission/mode option on fs::write, for the store’s outputs (item 6); (2) whether new Rust host methods target_dir (item 6) and the outer build’s roots (item 7) may be added to ProjectDriveHost; (3) how project_check.nika gets the manifest’s [allow] without a Nikaia TOML reader (item 8)
Changelog: none
Issue: wrong I7: the decision (and 7af31096’s probe, “fs::write/fs::copy under Root::Dir(target) gives Checked”) assumed the store can copy into a root on the target directory, but the store’s source lies in the user cache outside it and fs::copy resolves both names under one root (ADR-108 D2), so the copy fails at run time with “leaves the root”; broke I4: items 7 and 8 name host accessors and a manifest read whose implementation is Rust (project.rs hosts, Manifest::read) without saying whether new Rust is allowed
Friction: none
Disk freed: none; target/nikaia-project-tests 1.3G, / 8.4G free (79 %), 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_01UVxJDvbkNUUMs8HdjJ8ixV
nikaia check project_drive.nika. It passed the 120 s tool timeout and had to finish in the background. Second was tracing where each root comes from, across project_drive.nika, project.rs, cache.rs and fs.rs, to show that all three items need Rust or a missing form.fs::copy takes one root for both names.user_cache_dir, outside the target directory.make_cargo in Rust picks --target-dir.ProjectDriveHost and its Rust implementation in project.rs.Manifest::read, the toml crate).fs::copy probe and the fs::set_permissions probe. My first run of both probes was wasted, because I left out use std::fs (NK1117). I did no builds and no tests, since nothing was committed.nikaia run), not only check. The issue’s claim rested on a probe from 7af31096 that only checked, and Checked hid the “leaves the root” failure.wrong I7: the plan to copy through a root on the target directory assumes the copy’s source lies under that root. It lies in the user cache.rules-gap: items 7 and 8 lean on Rust-implemented hosts and on Rust TOML parsing, and the issue does not say whether new Rust is allowed. I wrote broke I4 in the report without checking that I4 is the rule for this, so the label may be wrong.knowledge: Core | std has no permission setter and no copy across two roots, so a file can only move between roots by read and write, and an executable loses its mode.Fact: Core | nikaia check crates/nikaia-std/src/compiler/project_drive.nika runs past 120 s; run it with run_in_background.Fact: Probes | A probe file needs use std::fs (NK1117), and check passing a fs::Root::Dir call proves nothing about run time; run it with real paths.Fact: Core | Nikaia has no TOML reader: a nikaia.toml reaches Nikaia only as ManifestItems parsed by Rust (crates/nikaia/src/manifest.rs).Generated by Claude Code
Driver: not queued, this issue waits for #2481, #2482, #2483, #2484, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
Supervisor, 2026-11-21: the builder’s run (192f6637 base) stopped at Result: blocked, correctly. ADR-raw-sinks-1 D17.6-8 each need Rust, which the rule “new features: no new Rust” forbids outside the exception of #1214:
fs::copy takes one root for both names (ADR-108 D2). Reading and then writing drops the executable bit, and std has no permission setter. Both fs forms live in fs.rs.--target-dir is chosen in Rust (make_cargo, project.rs). ProjectDriveHost has no accessor for it.std sources and the target dir. The Rust host passes none of them.project_check.nika cannot read trust/nikaia.toml. TOML is parsed only in Rust (Manifest::read), and its caller (check/mod.rs 808) passes no path.These are a decision for the owner, not bugs: relabelled decision, safety. The options go to the owner in the session:
fs::copy that keeps the mode, three host accessors, and the Rust caller passing the manifest’s [allow]. The logic stays in Nikaia, and the report lists the Rust for #557 / #125.make_cargo and Manifest::read (a TOML reader) into Nikaia. This is larger, and it is the self-hosting direction.#2460 waits for the decision.
Generated by Claude Code