Open and answer this issue on GitHub.
blocked, safety · opened 2026-11-22 · updated 2026-11-22 · 7 comments
Builds D19 of ADR-raw-sinks-1, the owner’s decision on “Decision: a shell named as the program of process::run (sh -c, cmd /c) is a shell sink” (#2717), alternative B.
let name = req.query("file") ?? ""
process::run("sh", ["-c", f"convert {name} thumb.png"]) // name = "x; rm -rf ~"
This builds and runs the stranger’s text as shell code.
std (Nikaia, beside raw_sinks.nika).
sh, bash, zsh, dash, ksh, fish, cmd, powershell, pwsh.python, python3, perl, ruby, node, ssh.env, sudo, nohup, timeout, nice, xargs..exe and case on Windows.match, is on the list, every element of args with an outside part is refused, NK1308, unless untrusted-shell is allowed (D4, D5).
-, and after the number for timeout and nice.raw-sinks = "warn" (D7) throws io::IoError::Other, naming the program and the argument.untrusted-shell names the list and says to run the commands with process::run one by one instead.tests/compiler/tests/, each with its .stdout/.stderr:
sh -c with outside text;/bin/bash;env sh -c;python3 -c;sh -ec;sh -c with a fully literal text;scripts/ and benches/ have many process::run("sh", ["-c", …]) calls (ledgers.nika, analysis_cost.nika, solver.nika, lower_mine.nika, the benches’ run helpers, release.nika/pre-push.nika via python3).
process::run per command, a pipe as two runs, a glob through fs.untrusted-shell allow and no trusted: goes into our manifests.Result: blocked, with the gap named.std::process) and 13.3 (untrusted-shell), and website/safe, state the rule.scripts/, tools/ and benches/ build under deny with no new allow.Brief queued: issue-2723
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2723, 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/2723/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-2723.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-2723, Result: blocked
Tokens: input 258, cache read 9899964, cache write 229814, output 64967 Cost: 5.45 USD, time 0 min 7 s, turns 129
Result: blocked
Pushed: none (D19 work saved, unpushed, on branch wip/issue-2723 bcb0fb3f: std list, prover, run-time throw, help, test, docs)
Tests: new tests/compiler/tests/a_shell_named_as_the_program_is_a_raw_sink (13 cases) passes on the wip build and FAILED on the old binary; std runtime:: 24 passed; an_argument_of_process_run_is_a_raw_sink and raw_sinks_manifest_keys pass; clippy clean
Gate: green
Deviation: on the wip branch, case and .exe are ignored on every target; env’s NAME=VALUE operands are skipped; a shell sink carried through a function parameter is refused at compile time but gets no run-time throw under warn (D7’s mechanism keys on the call’s own program expression)
Found: To build item 6 cannot be done: scripts/drive.nika:2482 runs sh -c "( '{exe}' run '{script}' -- --ci-wait {sha} '{log}' '{exit}' ) < /dev/null > /dev/null 2> '{err}' & echo $! > '{pid}'" (and drive.nika:1178 a detached measurement the same way), and std has no shell-free form: let child = process::spawn("sleep", ["60"]); println(f"{child.id()}") gives NK1171 “process::Child has no method called id.”; process::spawn("sleep", ["60"]; stdout: process::Stream::Inherited) gives NK1109 “process::spawn has no option called stdout.”; spawn always sets stdin to null and pipes stdout/stderr into memory, with no dir, env, file redirection or detach (outlive the parent) option; no ADR refuses these; run on target/fast/nikaia built from HEAD 2026-11-22; no decision yet
Needs: supervisor decision: a detached process::spawn (pid, stdin/stdout/stderr to null or a file, outliving the parent) or another shell-free form for drive.nika:2482 and 1178; then wip/issue-2723 lands together with the rewrites of drive.nika (950, 1208, 1222, 1231, 1409, 1475, 1756, 1858-1900, 1983, 1997, 2335, 2383, 2946, 3511, 3519, 5747-5766), lower_mine.nika (mine_sh), ledgers.nika:251-252, analysis_cost.nika:443-455, benches/game and benches/hello, which the new prover refuses
Changelog: none (nothing committed)
Issue: fits docs/issues.md, but To build 6 assumes every script form can be written without a shell, and the detached background run cannot
Owner: sudo -u root sh -c X slips past D19’s rule that a runner passes the check to its first operand, because the first operand is -u’s value root; the wip branch skips only - elements; should runners carry per-runner option tables? no decision yet
Comment: #2723 D19 is built on branch wip/issue-2723 (bcb0fb3f): process::shells/runners/is_shell/is_runner in std, NK1308 shell kind in prover_walk, a run-time IoError::Other under warn, Part III and website text, a 13-case test. It cannot land yet: under the default warn our own scripts would throw at run time, and drive.nika:2482 (a detached & background run writing its pid) has no shell-free form, because process::Child has no id() and spawn has no stdio/detach options
Friction: a new std fn used by the compiler’s own .nika (process::shells in prover_walk) gives NK1171 on the first lower-std, because the binary embeds the old std.contracts; it needed a bootstrap round (compiler files at HEAD, lower-std plus a build, then the files restored), about 10 turns; docs/builder-facts.md does not mention this
Disk freed: none; target/nikaia-project-tests 1.6G, / 5.7G free (86 % used), no new cache entry over 100 MB; shared tree restored to HEAD (sources by name, lowered/ regenerated by lower-std plus build), git status clean of my files
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDvbkNUUMs8HdjJ8ixV
process::shells/is_shell used in prover_walk.nika gave NK1171 on the first lower-std, because the binary embeds the old std.contracts. It took about 10 turns and two cycles: compiler files temporarily set back to HEAD, then lower-std plus a build, then the files restored. Second was the check of all scripts and benches. It timed out in the foreground and showed the blocker only after the whole prover was built.walk.raw_paths to project_check_raw_path_checks to EmitState.raw_path_checks to emit_core_argument), the signature of process::spawn and Child, and where Part III 13.3 and 17 sit in 30-nikaia-tooling.md. The brief could have named all of these.runtime:: tests, two neighbouring raw-sink tests, clippy, fmt, the scripts/benches deny scan. Wasted: building the full prover, help, docs and test before scanning scripts/ for shell forms that cannot be rewritten. One polling loop broke the wait-in-one-call rule.process::run("sh"), before any build. Here it would have found the blocker in about 3 turns, not 80.broke I7: it claims every script can drop the shell, and no check settles that. The detached & run with a pid (drive.nika:2482, :1178) cannot.rules-gap: no list of our own shell call sites by form (pipe, glob, redirect, background).knowledge: Lowering | a new std fn used by the compiler's own .nika needs one lower-std and build with the compiler files at HEAD first, because the binary embeds std.contractsFact: Lowering | A std function first used inside crates/nikaia-std/src/compiler/*.nika draws NK1171 until a binary built with its std.contracts entry exists; bootstrap with the compiler files at HEAD, then restore them.Fact: Core | process::spawn has no pid (Child.id), no stdio, dir or env options and no detach; a background shell run in a script has no shell-free form yet.Fact: Raw sinks | The D7/D19 run-time check flows from prover_walk raw_paths (RawPathCheck, root -1 for D19) through project_check_raw_path_checks to emit_core_args emit_core_argument, keyed by node_key of the argument; measured 2026-11-22, wip/issue-2723 bcb0fb3f.Fact: Raw sinks | The D19 prover refuses about 60 shell sites (2026-11-22, bcb0fb3f): drive.nika about 30, lower_mine 9, game 9, hello 10, analysis_cost 3, ledgers 2.Generated by Claude Code
From the report of the run of issue-2723 (#2723):
D19 is built on branch wip/issue-2723 (bcb0fb3f): process::shells/runners/is_shell/is_runner in std, NK1308 shell kind in prover_walk, a run-time IoError::Other under warn, Part III and website text, a 13-case test. It cannot land yet: under the default warn our own scripts would throw at run time, and drive.nika:2482 (a detached & background run writing its pid) has no shell-free form, because process::Child has no id() and spawn has no stdio/detach options
Generated by Claude Code
Driver: not queued, this issue waits for #2748, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
Supervisor, 2026-11-22: run 1 is accepted as blocked. Its work is on wip/issue-2723 (bcb0fb3f) and lands after #2748.
process::spawn takes run’s options. Stream gains Discarded and File(path). Child gains id(). A spawned child outlives the program. #2748 builds this (ready). The next run rewrites drive.nika:2482 and :1178, and the other sites the report lists, on top of it.sudo -u root sh -c X slips past the “first operand” rule): decided by the supervisor as the amendment to ADR-raw-sinks-1 D19 item 4, in the same commit:
NAME=VALUE operands of env are skipped, and -- ends the options.untrusted-shell unless proved) when there is:
env -S, sudo -s/-i);The next run builds this in place of “skip - elements”.
.exe ignored on every target; a shell sink passed through a parameter has no run-time throw under warn): accepted for now. Note the second one in Part III as “compile time only” where the check is described..nika uses a new std fn): goes into docs/builder-facts.md.Generated by Claude Code
Driver: not queued, this issue waits for #2748, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
From the report of the run of issue-2748 (#2748):
process::spawn now takes run’s options with Stream::Discarded/File(path) and Child::id (ADR-243 D11, Fixes #2748): drive.nika’s detached sh -c "( ... ) & echo $! > pid" can be written as let child = process::spawn(exe, args; stdout: process::Stream::Discarded, stderr: process::Stream::File(err)) then writing child.id(); the File path must be text of its own (an f-string), and spawn’s program is not yet a raw sink like run’s.
Generated by Claude Code