Open and answer this issue on GitHub.
blocked, safety · opened 2026-11-19 · updated 2026-11-21 · 12 comments
The compiler (crates/nikaia-std/src/compiler/*.nika), scripts/*.nika and examples/ / packages/ pass the raw path sink check (NK1308, brought to develop behind warn by #2303) by proof, not by trusted: (ADR-raw-sinks-1 D13, D14, D15, D16; owner’s decision on #2242, 2026-11-19): each site is looked at alone. A name from fs::read_dir is opened under root.join(dir); a name from outside that must be one component is guarded with path::is_component; a relative path that must stay below a root with path::is_below; a temporary directory comes from fs::scratch(). What is the tool’s job (nikaia build FILE opens the file it is given) is said once in the manifest by a D15 line with a comment, e.g. untrusted-paths-read = ["args"], never trusted: at a site.
Part of #2242 Needs #2300 Needs #2303
Today: the NK1308 check of the local ref wip/issue-2242 (0254f60c3) reports 41 sites in the compiler, 52 in scripts/, 14 in examples/ and packages/. At 57379dba7 grep -c 'Root::Anywhere' gives 203 in the compiler, 243 in scripts/, 18 in examples/ and packages/ (most are not reached by data from outside and stay unreported); mktemp 0 in the compiler, 11 in scripts/. Largest groups: scripts/drive.nika 20, scripts/agent.nika 11; in the compiler project_drive.nika (project_run_dir_tests, a read_dir name opened under Anywhere).
The read_dir shape:
for name in fs::read_dir(dir, fs::Root::Anywhere) {
let src = fs::read_to_string(f"{dir}/{name}", fs::Root::Anywhere)
}
becomes
let tests = root.join(dir)
for name in fs::read_dir(".", tests) {
let src = fs::read_to_string(name, tests)
}
ADR-raw-sinks-1 D13, D14, D15, D16.2 (nikaia’s own D15 line with a comment), D16.3 (what no form covers is reported, not written around).
The NK1308 check of wip/issue-2242, run over the compiler, scripts/ and examples/ / packages/, reports no site that neither a proof (join, guard, scratch) nor a commented D15 line in the manifest covers; no trusted: is added anywhere; the D15 lines of nikaia’s manifest (and of each package that needs one) carry a comment naming why; the builds and the tests the changed files touch pass; the last step’s commit carries Fixes #THIS. A Found: line per finding, one per site no form covers.
nikaia in its manifest (the builder finds which one nikaia reads its settings from; nikaia.toml at the top), with a comment: the paths the tool opens come from its command line. Test tests/compiler/tests/a_manifest_allows_untrusted_paths_from_args_for_reading.nika: a package with untrusted-paths-read = ["args"] reads a file named by cli::args and builds; the same with stdin as the source is still reported (needs the NK1308 check: the builder may leave this test to the check’s issue and say so in the report).project_drive.nika, then the rest): join for read_dir names, guards where a component is meant, the D15 line where the tool opens what it is given. Each change built with nikaia lower-std and the touched tests run.scripts/: drive.nika, agent.nika and the rest; mktemp to fs::scratch() where a scratch root fits, else fs::scratch().path() (a method on its value, #2336); the script’s own D15 line if it is a package with a manifest. One commit per script or group.examples/ and packages/: the 14 sites; a package that reads a path from its user gets its own D15 line with a comment.Found: with file, line and what it would need.crates/nikaia-std/src/compiler/*.nika and their lowered files, scripts/*.nika, examples/**, packages/**, the manifests that get a D15 line, the one test above. Not tests/compiler/tests/ (the test migration issue), not std (the std issue), not the check itself (project_check_let_raw_sinks_through, prover_raw_sink). No new Rust. Each D15 line is as narrow as the site needs: -read before -anywhere, a source list before true.
trusted: at sites: rejected by the owner on #2242 as boilerplate and dangerous (D16).fs::exists / fs::metadata checks as proof: they hold for the moment of the call (D14).untrusted-paths-anywhere = true for the whole compiler: the compiler writes and removes in its cache, where a path from outside must not reach.Generated by Claude Code
Driver: not queued, this issue waits for #2300, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
Brief queued: issue-2302
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2302, 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/2302/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-2302.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-2302, Result: blocked
Tokens: input 18, cache read 270913, cache write 24978, output 4042 Cost: 0.36 USD, time 0 min 51 s, turns 9
Result: blocked
Files: none
Commit: none
Body: none
Pushed: none
Tests: probe only, nothing built; target/fast/nikaia current with HEAD ec0d49b74
Gate: green
Deviation: none
Found: the D15 [allow] keys with source lists are not built on develop nor on wip/issue-2242: package p with nikaia.toml [package] name = "p" version = "0.1.0" and [allow] untrusted-paths-read = ["args"], src/main.nika use std::fs use std::cli fn main() throws { for a in cli::args() { let r = fs::Root::Anywhere; println(fs::read_to_string(a, r)) } }, target/fast/nikaia check src/main.nika prints [allow] has no key called untrusted-paths-read. The keys are: untrusted-shell, untrusted-sql, untrusted-markup, untrusted-paths-anywhere.; ADR-raw-sinks-1 D15 says it is accepted with a source list; traced: allow_keys in crates/nikaia-std/src/compiler/manifest.nika:46 lists only the four keys and allow holds only keys set to true (no source lists), same at wip/issue-2242
Found: the NK1308 check (project_check_let_raw_sinks_through) is not on develop, only on the unmerged wip/issue-2242 (0254f60c3, "not to merge"); #2302's Done when and steps 1-4 judge each site by that check, so no site can be shown covered on develop
Needs: #2242
Changelog: none
Issue: broke I3: names only Needs #2300 (closed by 7945a9632) but also depends on the D15 manifest keys and the NK1308 check landing on develop, neither of which has an issue named as a dependency; the issue says the check is "built after this" yet its Done when needs it
Owner: none
Comment: #2242 #2302 (paths by proof in the compiler, scripts and packages) waits for the D15 keys (untrusted-paths-read/-write/-remove with source lists, manifest.nika allow_keys`) and the NK1308 check on develop; neither is built, so #2302 is blocked on them
Friction: none
Disk freed: none
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDvbkNUUMs8HdjJ8ixV
develop and wip/issue-2242.allow_keys sits at manifest.nika:46. I also had to find out whether fs::scratch and Root::join had landed (#2300’s commit).git log (needed), the manifest probe (decisive) and the key list on the wip branch (needed). The first nikaia check call without a FILE was wasted. I skipped building, since the binary was current with HEAD.develop before it queues the issue, or the issue should carry that probe as its first line.broke I3: the D15 keys and the NK1308 check are dependencies, but they are not named as Needs #N. Only #2300 is named.wrong I3: “Needs #2300” was the only gate it named, and once #2300 closed it read as ready although it was not.rules-gap: no rule requires that a gate an issue’s Done when uses (here the NK1308 check) is on develop before the issue is ready.Fact: Core | nikaia check needs the FILE argument even inside a package directory (nikaia check src/main.nika); bare "nikaia check" is a clap error.Fact: Packages | [allow] accepts only untrusted-shell, untrusted-sql, untrusted-markup, untrusted-paths-anywhere, each as true; the D15 keys (untrusted-paths-read/-write/-remove with source lists) are not built yet (manifest.nika allow_keys).Generated by Claude Code
The report of the run of issue-2302 (#2302) judged this issue against docs/issues.md; the author fixes the issue by the rule it names (How a run judges its issue):
Generated by Claude Code
Driver: not queued, this issue waits for #2242, #2330, #2331, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
Supervisor: ready again. #2242 is the umbrella this issue is part of, not a need. #2330 and #2331 were built as part of #2303. #2300 and #2303 are closed. Every site is fixed by proof, never by trusted: (owner, 2026-11-20). A site no proof fits is reported as blocked.
Generated by Claude Code
Run: issue-2302, ESCALATE claude exited with code 1
Tokens: input 248, cache read 7852489, cache write 181219, output 65005 Cost: 4.54 USD, time 67 min 16 s, turns 125
(none)
Two commits were made, both local: 3c4f0b2e (the D15 lines for inventory and the solver rod) and d621b0a9 (project_drive.nika, down from 28 NK1308 sites to 11). The project_tests.nika change is uncommitted and untested, and the final report at docs/briefs/safety/issue-2302.md.report.md was never written.
nikaia check of project_drive.nika takes about 7.5 minutes, lower-std prints no NK1308, and each lower-std/build cycle took about 10 minutes. I also guessed the nikaia test filter syntax wrong once (it is --filter), lost a turn to a shell cat > that hung, and missed that other files call project_tests_is_file until the cycle refused the build.Dir root must exist before use.Root::join and a guard carried through a struct field are not followed by the check.fs::copy takes one root.nikaia.toml in scripts/ breaks nikaia run.project_check_raw_sinks_in_std passes an empty allow list.check.test --std --filter project_drive, which matched 0 tests, and a cycle spent on a helper whose callers I had not grepped.check per file to find them.wrong I3: it assumes nikaia and the single-file scripts can carry a D15 manifest line. Neither has a home (no nikaia.toml, and a manifest in scripts/ turns the directory into a project).wrong I4: the site counts are stale (scripts went from 52 to about 210).broke I6: where nikaia’s own D15 line lives is not decided yet, so the issue cannot be built as written.knowledge: Core | NK1308 only shows from nikaia check FILE, never from lower-std.Fact: Core | a fs::Root::Dir whose directory does not exist refuses every name, so create the directory before building the root on it.Fact: Lowering | changing a compiler helper's signature needs a grep of every compiler .nika first; callers across files only show up in lower-std.Fact: Core | fs::copy takes one root, so a copy across two Dir roots is a read and a write, which drops the file's mode bits.Generated by Claude Code
Run: issue-2302, refused: docs/briefs/safety/ESCALATE exists
Tokens: input 248, cache read 7852489, cache write 181219, output 65005 Cost: 0.00 USD, time 67 min 16 s, turns 125
(none)
Two commits were made, both local: 3c4f0b2e (the D15 lines for inventory and the solver rod) and d621b0a9 (project_drive.nika, down from 28 NK1308 sites to 11). The project_tests.nika change is uncommitted and untested, and the final report at docs/briefs/safety/issue-2302.md.report.md was never written.
nikaia check of project_drive.nika takes about 7.5 minutes, lower-std prints no NK1308, and each lower-std/build cycle took about 10 minutes. I also guessed the nikaia test filter syntax wrong once (it is --filter), lost a turn to a shell cat > that hung, and missed that other files call project_tests_is_file until the cycle refused the build.Dir root must exist before use.Root::join and a guard carried through a struct field are not followed by the check.fs::copy takes one root.nikaia.toml in scripts/ breaks nikaia run.project_check_raw_sinks_in_std passes an empty allow list.check.test --std --filter project_drive, which matched 0 tests, and a cycle spent on a helper whose callers I had not grepped.check per file to find them.wrong I3: it assumes nikaia and the single-file scripts can carry a D15 manifest line. Neither has a home (no nikaia.toml, and a manifest in scripts/ turns the directory into a project).wrong I4: the site counts are stale (scripts went from 52 to about 210).broke I6: where nikaia’s own D15 line lives is not decided yet, so the issue cannot be built as written.knowledge: Core | NK1308 only shows from nikaia check FILE, never from lower-std.Fact: Core | a fs::Root::Dir whose directory does not exist refuses every name, so create the directory before building the root on it.Fact: Lowering | changing a compiler helper's signature needs a grep of every compiler .nika first; callers across files only show up in lower-std.Fact: Core | fs::copy takes one root, so a copy across two Dir roots is a read and a write, which drops the file's mode bits.Generated by Claude Code
Run: issue-2302, Result: partial
Tokens: input 280, cache read 9406561, cache write 195558, output 71985 Cost: 5.10 USD, time 22 min 59 s, turns 141
Result: partial
Pushed: local 3c4f0b2e (inventory and rod D15 lines), d621b0a9 (project_drive.nika, 28 NK1308 sites to 11), 06001c01 (project_tests.nika, 35 to 0)
Body: Names are opened under the directory they were read from (D13), and the rustc store key is guarded with path::is_component (D14). fs::copy across two Dir roots became read+write, so mode bits are dropped (spliced sources, test .in inputs). Left: comptime_bundle, project_members, describe, proofs_answers, sysroot_cache, lsp, sources, modules; scripts/ (about 210 sites); packages/yaml tests.
Tests: splice, rustc store and a_published test programs, both settings, 11/11; examples/report output tests 2/2; inventory package tests 2/2; publishable copy checked by hand (stale file removed); lower-std fixpoint; pre-push green
Gate: green
Deviation: step 1’s test already exists as a_manifest_allows_untrusted_paths_per_operation_and_source (#2303), so no new test was added. nikaia has no D15 line: there is no nikaia.toml to put it in.
Found: no NK1308 for a Dir root taken from outside: let dir = cli::args().nth(1) ?? "."; let at = fs::Root::Dir(dir); println(fs::read_to_string("x", at)) gives no warning under nikaia check, but ADR-raw-sinks-1 D11 says such a root is itself a sink; suspected cause in prover_walk.nika prover_raw_sink (root_part outside test)
Found: no NK1308 for an unguarded Root::join: with key from fs::read, fs::read(... , fs::Root::Dir(cache).join(key)) gives no warning, but D14 asks for an is_component guard; suspected cause in prover_walk.nika, Root::join not walked as a path part
Found: where nikaia’s own D15 line lives, no decision yet: no nikaia.toml exists, and project_check_raw_sinks_in_std (project_check.nika:333) passes allow=[]. project_drive’s paths from Cargo dep-info and the compiler’s record (lines 685-728, 1644) and rustc’s –out-dir (1664, 1682, 1685) need untrusted-paths-read=[“file”] and untrusted-paths-write=[“args”]
Found: how single-file scripts/.nika state D15, no decision yet: a nikaia.toml in scripts/ makes nikaia run scripts/x.nika fail with “not the entry point of the project”, and their roots come from cli::args, which no proof covers under D11
Needs: supervisor decision
Changelog: none
Issue: wrong I3: the issue assumes a nikaia.toml for nikaia and manifests for the scripts, and neither can exist; wrong I4: the scripts’ site count is about 210, not 52
Friction: every nikaia run scripts/.nika now prints dozens of NK1308 warnings; lower-std prints none, so each file’s sites take a 7-minute nikaia check FILE to list
Disk freed: about 5.9G (this run’s rust-library-splice/-user cache entries); target/nikaia-project-tests 510M, / 17G free
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDvbkNUUMs8HdjJ8ixV
Three commits landed locally: the D15 lines for inventory and the rod (3c4f0b2e), project_drive.nika from 28 NK1308 sites to 11 (d621b0a9), and project_tests.nika from 35 to 0 (06001c01); the report is written. Eight compiler files, scripts/ and the yaml package tests are still open.
Two flaws in my report: the second Found line (the Root::join hole) gives a retyped snippet, not the probe copied whole, so the bug lane must re-run it. I also wrote the Pushed: line by hand with all three shas; the commit script normally writes it.
lower-std shows none; nikaia check FILE takes about 7 minutes per file) and four build cycles of about 10 minutes each. One cycle was wasted because I changed a shared helper’s signature without first grepping its callers in other files.Root forms and guarded joins are proved (prover_walk.nika ~2740).Dir root must exist before use, and that fs::copy takes one root.project_check_raw_sinks_in_std passes allow=[].scripts/ breaks nikaia run.--filter flag of nikaia test.nikaia check per file, the splice and rustc test programs (both settings), the output tests of examples/report, the inventory build, pre-push.test --std --filter project_drive, which matched 0 tests, and the cycle that hit the callers’ NK1101.check, plus the rule “grep every caller before changing a compiler helper’s signature”.wrong I3: it assumes a nikaia.toml for nikaia and manifests for single-file scripts; neither can exist.wrong I4: the site count for scripts/ is about 210, not 52.broke I6: where nikaia’s own D15 line lives is a decision not taken yet, and the issue was filed ready.knowledge: Core | NK1308 shows only under nikaia check FILE, never in lower-std output.Fact: Core | a fs::Root::Dir on a directory that does not exist refuses every name, so create the directory first.Fact: Lowering | a compiler helper's callers in other .nika files show up only as NK1101 in lower-std, so grep them before changing a signature.Fact: Core | fs::copy takes one root, so copying across two Dir roots is fs::read plus fs::write, which drops mode bits.Fact: Core | running the rust-library-splice test programs adds about 0.8 GB of cache per entry, so remove your own entries at the end.Generated by Claude Code
Partly built and pushed in 0.0.1506 (project_drive.nika 28 → 11 NK1308 sites, project_tests.nika 35 → 0, inventory and rod D15 lines), all by proof, no trusted:.
Blocked on:
Left: comptime_bundle, project_members, describe, proofs_answers, sysroot_cache, lsp, sources, modules; scripts/ (about 210 sites); packages/yaml tests.
Generated by Claude Code
scripts/ and the split by helperAgreed between the bug lane and the safety lane, owner approved 2026-11-21, measured on develop 5ed0fac18 with raw-sinks = "warn".
The count of 52 sites in scripts/ is out of date. Distinct sink sites today:
| Script | Sink sites | Reports |
|---|---|---|
| drive.nika | 111 | 313 |
| agent.nika | 36 | |
| batch.nika | 6 | |
| cycle.nika | 5 | |
| issue-check.nika | 1 | 1 |
What the reports in drive.nika concern: every one is an fs call under fs::Root::Anywhere (exists, read_to_string, write, read_dir). None concerns the program of process::run, so these are real findings, not false positives of the check.
Where the untrusted values come from:
cli::args: 143process::run: 61read_dir: 14The same report repeats through helpers. For example:
drive.nika:307, said through drive_wake_linedrive.nika:422, lane through drive_settleSplit:
agent.nika and for the rest of scripts/.issue-check.nika is handled by “The driver queues an issue unchecked when scripts/issue-check.nika fails to run” (#2466): the body comes over stdin, so there is no path. Whether a file name given directly stays allowed is the open decision “How single-file scripts/*.nika satisfy the raw path sink check without a manifest” (#2443).
Order:
scripts/Generated by Claude Code
Split for scripts/ (445 NK1308 reports at about 211 sink lines in 21 scripts; 10 scripts already clean). Every part passes by proof (root fs::Root::Dir("."), fs::scratch(), guard at arrival): no trusted:, no [allow], no nikaia.toml in scripts/.
Dir("."), scratch for mktemp, joined read_dir names--claude program, which stays with #2443)--exeDefect found on the way: #2469 (a guard ending in process::exit does not prove the name). Order: after #2466, as planned by the bug lane.
Generated by Claude Code