Issue #2694: An argument of process::run whose start is from outside is a raw sink, proved by process::is_operand or a literal “–” (ADR-raw-sinks-1 D18)

Open and answer this issue on GitHub.

ready, safety · opened 2026-11-22 · updated 2026-11-23 · 8 comments

Owner’s decision on #1939 (2026-11-22, alternative C), written as ADR-raw-sinks-1 D18: the start of each element of process::run’s args is a raw sink. An element whose first part is from outside is refused, NK1308, unless process::is_operand(part) guards it, a literal "--" stands earlier in the list, or the manifest allows untrusted-option.

Probe

On develop 2026-11-22, a file opt.nika:

use std::process
use std::cli

fn main() throws {
    let name = cli::args().nth(1) ?? ""
    process::run("rm", [name])
}

Expected (ADR-raw-sinks-1 D18 item 1): nikaia check opt.nika refuses the call, NK1308, at name, and the help offers process::is_operand(name) or "--" before it.

Actual: it builds. prover_walk.nika treats only the program of process::run as a sink (D10); std::process has no is_operand, and the manifest reader knows no untrusted-option.

Cause

Traced: D10 was built by #2217 with the arguments explicitly outside the rule (“each reaches the program as one word”); D18 changes that.

Status (2026-11-22, updated 14:20)

Built by 4225dbeec (accepted as partial): item 1’s is_operand and its guard, and items 2, 3, 6 and 7.

Changed since by D18 item 6 (local commit 653abd8bb, Part of #2722): a literal "--" no longer proves the elements after it, and process::is_operand refuses a leading / as well as -. Read the "--" route in the text below as withdrawn. A file passes as "./" + name or as root.join(name).path().to_text() (D18 item 4), or behind an is_operand guard.

Left:

To build

  1. process::is_operand(text: ref String) -> bool in std::process, written in Nikaia: true when the text does not start with - (the empty text holds it). It is a guard predicate like path::is_below (D14): after if process::is_operand(x) and after if !process::is_operand(x) { ...; return/exit }, x is proved for this sink, and a function that checked it hands back its proof.
  2. The prover (crates/nikaia-std/src/compiler/prover_walk.nika): for each element of process::run’s second argument, written as a list literal, the element’s first part is asked. A first part that is not outside passes whatever follows ("--output=" + name, f"-I{dir}", a path of a Dir, D18 item 4). An outside first part passes when proved by item 1 or when a literal "--" element stands earlier in the same list; otherwise NK1308 under key untrusted-option. An args that is not a list literal is outside as a whole when any value pushed into it is (as a_list_filled_from_outside_is_outside does today) and is then refused unless every pushed outside value was proved, or a literal "--" was pushed first.
  3. The manifest key untrusted-option in manifest.nika ([allow], [allow.packages.NAME], --allow=KEY, --allow=NAME:KEY, --trust lists it), the same way untrusted-program is read.
  4. The run-time check under raw-sinks = "warn" (D7): process::run throws io::IoError::Other naming the argument, before anything starts.
  5. Our own code: before switching the rule on, count the calls it refuses in the compiler, packages/, examples/, tools/, scripts/ and benches/ (by a build under raw-sinks = "warn") and list the count in the report. Each one is fixed by a proof (is_operand guard or "--", or the value made under a Dir), never by trusted: and never by an [allow] untrusted-option line; an [allow] line only where taking an option from outside is what the tool is for, named in the report.
  6. Tests in tests/compiler/tests/, each with its .stdout / .stderr: an_outside_argument_of_process_run_is_a_raw_sink (refused, the help text), an_argument_proved_an_operand_passes, a_literal_double_dash_proves_the_arguments_after_it (and one before it stays refused), an_option_the_program_wrote_passes_with_an_outside_value ("--output=" + name), untrusted_option_in_the_manifest_admits_the_call (with raw_sinks_manifest_keys extended).
  7. Website and guide: where process::run is described, the rule and its example; drop “specified, not built yet” from Part III 17 (std::process) once it passes.

Done when

The probe is refused with NK1308 and passes after if !process::is_operand(name) { process::exit(2) } and with ["./" + name] (the "--" route was withdrawn by D18 item 6). The tests of item 6 pass, every existing raw-sink test passes with its expected output unchanged, our own code builds under the rule with the count of item 5 fixed by proofs, and the last commit carries Fixes #N.

Files

crates/nikaia-std/src/std/process.nika (or where std::process lives), crates/nikaia-std/src/compiler/prover_walk.nika, crates/nikaia-std/src/compiler/manifest.nika and their lowered .rs, tests/compiler/tests/, docs/specification/30-nikaia-tooling.md, guide/ and website/ where process::run appears.

Part of #1253

Comments

keywan-ghadami, 2026-11-22

Brief queued: issue-2694


agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —

Issue #2694

Your work order is issue #2694, 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/2694/comments -F body=@file, ending with the Claude Code footer), rule I13.

Rules (CLAUDE.md; shared checkout)

Report (at most 15 lines, to exactly /home/user/Nikaia/docs/briefs/safety/issue-2694.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.


Generated by Claude Code

keywan-ghadami, 2026-11-22

Run: issue-2694, Result: partial

Tokens: input 242, cache read 8676911, cache write 194297, output 52840 Cost: 4.55 USD, time 17 min 2 s, turns 121

Report

Result: partial Files: crates/nikaia-std/src/compiler/check_facts.nika crates/nikaia-std/src/compiler/check_references.nika crates/nikaia-std/src/compiler/emit_core_calls.nika crates/nikaia-std/src/compiler/lowered/check_facts.rs crates/nikaia-std/src/compiler/lowered/check_references.rs crates/nikaia-std/src/compiler/lowered/emit_core_calls.rs crates/nikaia-std/src/compiler/lowered.rs crates/nikaia-std/src/compiler/lowered/manifest.rs crates/nikaia-std/src/compiler/lowered/prover_state.rs crates/nikaia-std/src/compiler/lowered/prover_walk.rs crates/nikaia-std/src/compiler/manifest.nika crates/nikaia-std/src/compiler/prover_state.nika crates/nikaia-std/src/compiler/prover_walk.nika crates/nikaia-std/src/process.rs crates/nikaia-std/src/runtime/lowered.rs crates/nikaia-std/src/runtime/lowered/raw_sinks.rs crates/nikaia-std/src/runtime/raw_sinks.nika crates/nikaia-std/std.contracts crates/nikaia/src/main.rs docs/specification/30-nikaia-tooling.md tests/compiler/tests/raw_sinks_manifest_keys.stdout tests/compiler/tests/the_program_of_process_run_is_a_raw_sink.nika website/safe/index.html tests/compiler/tests/a_mut_parameter_lent_in_an_argument_of_a_method_on_it.nika tests/compiler/tests/a_mut_parameter_lent_in_an_argument_of_a_method_on_it.stdout tests/compiler/tests/an_argument_of_process_run_is_a_raw_sink.nika tests/compiler/tests/an_argument_of_process_run_is_a_raw_sink.stdout Commit: ADR-raw-sinks-1 D18: the start of an argument of process::run is a raw sink, proved by process::is_operand or a literal “–” Body: process::is_operand (Nikaia, runtime/raw_sinks.nika; contract; pub use in process.rs) is a guard property. prover_walk.nika: each element of a list literal handed to process::run has its first part asked (raw_sink_first_part: an f-string’s first hole, the lhs of +, none after a literal piece), a literal “–” ends the check; a list variable is followed through let/push/assignment (ProverState::option_lists: 0 proved, 1 after “–”, 2 unproved), else judged whole; a parameter carries the sink (option/options) to its callers. NK1308 help names untrusted-option, the new [allow] key (manifest.nika). Also a lowering defect found on the way, in its own part of this commit: walk.state.m.insert(k, f(walk)) with walk a mut parameter lowered to Rust that borrows *walk twice (NK1343), since an argument that is a &mut already never reached mut_args; the checker now records it (relent_args) and emit_lends_mut binds it first, as for a local. Rust added: one pub use in process.rs (for #557 / #125). Docs: Part III 17 drops “specified, not built yet”, the NK1308 row names D18, website/safe lists it. Part: #2694 Tests: new an_argument_of_process_run_is_a_raw_sink (13 cases: refused, is_operand guard by exit and by if, after/before “–”, “–output=” + name and f”-I{name}” pass, name + “.txt” refused, pushed list unproved/after “–“/proved, through a function, [allow], –trust) and a_mut_parameter_lent_in_an_argument_of_a_method_on_it, both plus raw_sinks_manifest_keys FAILED on $NIKAIA_OLD and pass now; 55 raw-sink/outside/process_run tests and 16 .stderr tests using process::run pass –both-settings; test --std operand and manifest ok; lower-std fixpoint clean; clippy and fmt clean. Gate: green Deviation: item 6 built as one test program an_argument_of_process_run_is_a_raw_sink with all the named cases, not five files; the_program_of_process_run_is_a_raw_sink’s “a literal program” case now writes ["--", name] so its expected output stays unchanged. Deviation: item 4 (the run-time check under raw-sinks = “warn”) not built: it needs plumbing like D7’s raw_paths (project_check -> emitter, Rust in project.rs/modules.rs/emit), left for a next run. Deviation: item 1’s “a function that checked it hands back its proof” not built: the hand-back proof (prover_calls.nika OutsideProof) is path-specific today. Deviation: item 5 not done: under the new rule our code gets 191 new NK1308 warnings (237 now, 46 before, counted by nikaia check on every file calling process::run): scripts/drive.nika 113, benches/hello 7, ledgers 12, agent 7, solver 8, java_binding 9, release 5, benches/yaml 5, game 4, commit 4, others 1-2; the compiler’s std showed none. Each needs a judgement (git reads a “–” as the path separator: git show -- sha breaks), so none fixed; warn keeps them building. Needs: a next run for items 4 and 5 and the hand-back proof of #2694 Changelog: The start of an argument of process::run is a raw sink: data from outside there is NK1308 unless process::is_operand proves it, a literal “–” stands before it, or [allow] untrusted-option = true admits it (ADR-raw-sinks-1 D18). Issue: wrong I4: the probe’s env::args() draws NK1171 (and cli::args()[1] NK1245); let name = cli::args().nth(1) ?? "" runs it Comment: #2694 Built: is_operand, the prover (list literals, pushed lists, parameters), untrusted-option, tests, docs. Left: the run-time check under warn (item 4), the hand-back proof of a checking function, and the 191 sites in scripts/benches/packages (item 5; drive.nika 113), each needing a choice between “–” and a guard since git reads “–” as a path separator. Friction: commit.nika refuses a commit touching lowered/ without lowered.rs, whose one digest covers every change, so the lowering fix could not be its own commit beside the D18 change. Friction: the lowering defect needed a temporary let in prover_walk.nika to bootstrap: the old binary lowered the new code into Rust that does not compile, so the fix could never be built otherwise. Disk freed: 0 (target/nikaia-project-tests 1.6G, / 11G free) Reviewed: 85d0203131c2d74e4551845d01613728eab1f392308a82de337180de840a3e8d Pushed: local 4225dbeec40739106aee09dbf435ca91fe0389ae Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01UVxJDvbkNUUMs8HdjJ8ixV

Debrief

  1. Most cost: the lowering defect (NK1343) took the most turns. First I had to see that it only shows when the receiver’s root is a mut parameter. Then I found it couldn’t be bootstrapped: the old binary lowered my new prover code into Rust that doesn’t compile, so the build failed before the fix could take effect. One background cycle was wasted before I saw that and bootstrapped with a temporary let. I also burned a few turns on nikaia test NAME and nikaia run of a test file before using --filter and --bless.
  2. Looked up:
    • the AST shapes (LitInterpolated, Binary, Assign.op: BinaryOp?, Let.names)
    • how [allow] keys are read from the help text (project_check_raw_sink_key)
    • that guard predicates come from any sync, non-panicking bool contract
    • where mut_args is filled
    • the existing hoisting in emit_method_hoisted
    • the issue’s To build list, again from the transcript after compaction
  3. Checks run:
    • lower-std / build / lower-std, until the fixpoint held
    • the new test and 55 filtered raw-sink tests at --both-settings, plus the 16 .stderr tests that call process::run
    • test --std filtered to the new and manifest tests
    • the fails-before run on $NIKAIA_OLD
    • clippy and fmt
    • the per-file NK1308 count, new binary against old
    • I did not run scripts/pre-push.nika myself, though the rules ask for it before committing.
    • Wasted: the first background cycle, and cargo test -p nikaia-std --lib raw_sinks, which ran 0 tests (test --std is the right command).
  4. One change: builder.md should say that a fix to the lowering whose new code also needs that fix must be bootstrapped with a temporary local, which is then removed and rebuilt. It should also say that commit.nika forces every change touching lowered/ into one commit, because lowered.rs holds a single digest.
  5. What the issue lacked:
    • wrong I4: the probe uses env::args() (NK1171); cli::args().nth(1) ?? "" works.
    • rules-gap: item 5 doesn’t size the work. There are 191 sites, 113 in drive.nika, and git reads -- as its path separator, so each fix is a judgement. That is a separate issue, not one item.
    • knowledge: Lowering | an argument that is already a &mut (a mut parameter handed on) was not in mut_args, so nothing hoisted it; fixed with relent_args.
    • knowledge: Core | the run-time check for a raw sink under warn goes through Rust plumbing (raw_paths → project.rs → emitter); html::Raw's is not built either.
  6. Traps for the next builder:
    • Fact: Core | A test program runs with nikaia test –project tests/compiler –filter NAME (–bless writes its .stdout); nikaia run of a test file and a bare name argument are refused.
    • Fact: Lowering | commit.nika refuses a change to lowered/ without lowered.rs, and its one LOWERED_DIGEST covers every lowered change, so two lowered changes cannot be split into two commits.
    • Fact: Core | The compiler's own test blocks, std's runtime included, run with target/fast/nikaia test –std –filter X, not cargo test –lib.
  7. For the next builder in this area:
    • Fact: Ledger and bounds proofs | Raw-sink D18 lives in prover_walk.nika (raw_sink_options, raw_sink_first_part, raw_sink_option_list), with ProverState::option_lists in prover_state.nika.
    • Fact: Ledger and bounds proofs | Count raw-sink warnings with nikaia check FILE grep -c NK1308 on each file that calls process::run: 237 after D18, 46 before (2026-11-22, commit 4225dbee).

Generated by Claude Code

keywan-ghadami, 2026-11-22

From the report of the run of issue-2694 (#2694):

Built: is_operand, the prover (list literals, pushed lists, parameters), untrusted-option, tests, docs. Left: the run-time check under warn (item 4), the hand-back proof of a checking function, and the 191 sites in scripts/benches/packages (item 5; drive.nika 113), each needing a choice between “–” and a guard since git reads “–” as a path separator.


Generated by Claude Code

keywan-ghadami, 2026-11-22

From the report of the run of issue-2722 (#2722):

With #2722, process::is_operand refuses a leading “/” too: the D18 run-time check under warn (item 4) should call it, and #2722 item 4 waits for that check


Generated by Claude Code

keywan-ghadami, 2026-11-22

Run: issue-2694, ESCALATE claude exited with code 1

Tokens: input 242, cache read 8676911, cache write 194297, output 52840 Cost: 3.40 USD, time 41 min 12 s, turns 121

Report

(none)

Debrief

  1. Most turns: The worst was a lower-std deadlock that I caused. I made lists filled out of sight an error under warn, and std itself has 4 such sites (comptime_bundle.nika:685, project_drive.nika:385, 541 and 615). After that, lower-std refused std and stopped before writing my revert, the build compiled the stale lowered prover_walk.rs, and one whole cycle was wasted. The second cost was a slow nikaia check count of 43 files (246 lines, about 203 of them option sites in scripts/ and benches/ alone). It also blocked any build while it ran.
  2. Looked up:
    • ADR-raw-sinks-1 D7 and D18 (what warn does with a pushed list: not decided).
    • The emitter’s raw_path_checks path.
    • is_operand is &str in Rust, and a list element is block::Text, so the emitted Ok(__part) needs Into::into.
    • That realpath output is absolute, which is_operand refuses.
  3. Checks:
    • Useful: the cycle, the probes plain/guard/pushed/nothrow, and the runtime test run, which caught the Text/String rustc error.
    • Wasted: the per-file count (compiler files could have been left out) and the second cycle, which built from a stale lowered file.
    • Not done: the new tests’ .stdout, the fails-before runs on $NIKAIA_OLD, the existing raw-sink tests, pre-push and any commit. Nothing was committed. The tree holds unverified edits to prover_walk, prover_calls, prover_state, project_check, emit_expr, their lowered files and 30-nikaia-tooling.md.
  4. One change: builder.md should say that when lower-std prints Error:, it has written nothing after the refusal. The next build then compiles stale lowered files, so the refusal has to be fixed in the lowered .rs or the source before building again.
  5. Issue lacked:
    • wrong I4: the issue sizes item 5 at “191 sites”; the actual count is over 200 option sites in scripts/ and benches/ alone, many of them absolute paths (realpath, drive_waiter_file) that is_operand refuses at run time, so the proofs need roots, not guards.
    • rules-gap: D18 does not say how warn treats a non-literal or pushed list. No decision yet.
    • wrong I4: the issue still names the withdrawn "--" route in items 1, 2 and 6.
  6. Traps:
    • Fact: Lowering A prover change that refuses a std site makes lower-std stop with Error: before writing later lowered files, so the next cargo build compiles stale lowered Rust; patch the lowered .rs or revert, then build.
    • Fact: Lowering A value the emitter yields in place of a list element is nikaia_std::block::Text, so a generated Ok(x) of a String needs ::std::convert::Into::into(x).
  7. Next builder in this area:
    • Fact: Raw sinks The run-time checks are keyed in raw_paths (check ids -1 markup, -2 sql, -3 option, proposed and uncommitted); prover_walk.nika raw_sink_checked_part records them and emit_expr.nika emit_raw_sink_checked emits them.
    • Fact: Raw sinks Under default warn, 2026-11-22 at 4a7601a3c, nikaia check gave 313 NK1308 lines across scripts/ and benches/, 203 of them option sites (drive.nika 378 lines of output); by source: process::run 105, cli::args 51, fs::read_to_string 40.

Generated by Claude Code

keywan-ghadami, 2026-11-23

Run: issue-2694, ESCALATE claude exited with code 1

Tokens: input 400, cache read 13406435, cache write 262342, output 94155 Cost: 7.01 USD, time 92 min 11 s, turns 200

Report

(none)

Debrief

  1. What cost the most: chasing the wrong place a rustc warning landed in a_pub_parameter_at_a_raw_sink_is_from_outside. I searched the emitter’s buffer code (EmitOut, insert_at, push_around, vec!) for many turns. The cause was elsewhere: Project::report (project.rs, near line 3524) builds the program a second time without the build’s raw_path_checks. I only found that by dumping the source map. The run then ended before I wrote the report or committed: nothing is committed. The tree still holds my uncommitted changes:
    • the prover/emitter .nika files and their lowered files;
    • the spec text;
    • the new test and the changed test;
    • the pub test’s .stderr, edited to the wrong span 27:1.
  2. Looked up that the brief could have handed me: that the map for rustc messages is rebuilt in report and not taken from the build. Also the raw-check ids (-1 markup, -2 sql, -3 option, 0 and up a root) and where emit_raw_sink_checked sits.
  3. Checks run:
    • Useful: the cycle and fixpoint, the 23 raw-sink tests with --both-settings (all pass), the drive.nika build (passes), and fails-before (both tests fail on the old binary).
    • Wasted: the earlier rounds reading emitter code for the map bug, and one extra --profile fast build of the project.rs fix, which could not work because report runs on a different host.
  4. One change: builder.md could say: “a rustc warning placed in the wrong function means the map was emitted twice: compare report’s second emission with the build’s inputs first.”
  5. What the issue lacked:
    • knowledge: Core | Project::report builds the program again for rustc's map, without raw_path_checks, so text the build added shifts every later warning.
    • wrong I4: item 5 counts “over 200 NK1308 sites” in our own code, which a single run cannot clear.
    • rules-gap: under warn, an argument pushed onto a list or held in a Vec[String] parameter gets no run-time check, and no decision says what it should get.
  6. Traps:
    • Fact: Core | nikaia test takes --filter NAME, not a positional name.
    • Fact: Lowering | emitting bare parentheses around a plain name draws rustc unused_parens; use ::std::convert::identity(...) or &(...).
  7. Fact: Raw sinks | the source map for rustc messages comes from the second emission in project.rs Project::report (around line 3524), which lacks program.raw_path_checks; the DriveHost there cannot see the build's checks, and a build-cache hit runs no emitter (2026-11-23, uncommitted tree on develop).

Generated by Claude Code

keywan-ghadami, 2026-11-23

Run: issue-2694, ESCALATE claude exited with code 1

Tokens: input 600, cache read 20352026, cache write 453838, output 148640 Cost: 11.32 USD, time 103 min 41 s, turns 301

Report

(none)

Debrief

Before the answers: the run ended in a bad state.

  1. Most turns: the 62+ NK1308 sites in drive.nika (lane_dir in loops, helper results, mutable lists), and three NK1343 lowering errors (ICEs) that check does not catch. nikaia fmt on drive.nika also reformatted the whole file, and I had to rebuild my edits on top of HEAD.
  2. Looked up: which forms the prover accepts (alias, loop, let with an if, ??), and that nikaia run FILE refuses test programs.
  3. Checks run: check per script, pre-push, the --both-settings test, and the lower-std cycles. check alone was misleading, because it does not run rustc; the drive edits needed an actual build.
  4. Change that would have saved the most: builder.md should say that a script edit is verified by running or building it, not by check. Also: never nikaia fmt drive.nika.
  5. What the issue lacked:
    • rules-gap: no count of sites per script, and no estimate of how big drive.nika’s share is.
    • knowledge: Lowering | a function returning String that returns fs::...display() (Text), or a Text handed to Root::Dir, draws NK1343 at build, not at check.
  6. Traps for the next builder:
    • Fact: Core | nikaia check does not catch NK1343; build or run a changed script before committing it.
    • Fact: Core | nikaia fmt reflows all of scripts/drive.nika, which is not fmt-clean on develop; do not fmt it.
    • Fact: Lowering | let x = if c { s } else { fs::canonical(..).display() }; x + "/" draws NK1343 (EitherText: Plus).
  7. Work area:
    • Fact: Raw sinks | scripts/drive.nika holds 62 NK1308 process::run sites at a8424a67 (2026-11-23), counted with nikaia check scripts/drive.nika | grep -c NK1308.

Generated by Claude Code

keywan-ghadami, 2026-11-23

Run: issue-2694, Result: partial

Tokens: input 98, cache read 3564442, cache write 87253, output 27128 Cost: 14.65 USD, time 30 min 5 s, turns 50

Report

Result: partial Files: scripts/slot.nika Commit: slot picks the directory BASE lies below without taking it from BASE (ADR-raw-sinks-1 D18) Body: Steps 1 so far: d66fd4ff0 (a copy proved where it is bound), a8424a67e (drive proves its pids, git words and paths), 3c79b49b (slot binds the cwd or cache root itself, so its root path passes by D18 item 4 and D11). Step 2 (run3 patch: run-time check of an option sink under warn) was built, its tests passed and pre-push was green, but it is not committed: 52 NK1308 option sites remain in scripts/drive.nika and are checked at run time under warn, so the driver’s absolute paths (drive_waiter_file, the –ci-wait EXIT file, worktree paths from git) would be refused because is_operand refuses a leading /. Saved as docs/briefs/safety/issue-2694.run4.patch plus issue-2694.run4.new/ (the new test and step3.py, which adds the Vec[String] check, id -4), for the next run. Pushed: local 3c79b49b Tests: nikaia check of every scripts/*.nika: only drive.nika warns (52 option sites, 0 errors); slot run with a cwd BASE and a cache BASE, exit 0; pre-push green; lowered/ clean after lower-std Gate: green Deviation: none Found: OutsideProof::operand_proved (prover_calls.nika, traced) accepts a returned value whose first part is a literal or a clean or operand name, but not a root path or a call to a function that hands back an operand, so fn waiter(sha: String, kind: String) -> String throws { return abs("target/x") + f"/wait-{sha}.{kind}" } (abs returns fs::Root::Dir(cwd).join(given).path().to_text(), with cwd = fs::canonical(".", fs::Root::Dir(".")).display()) used as process::run("rm", ["-f", waiter(sha.clone(), "pid")]) with sha = cli::args()[1].clone() draws NK1308 today under nikaia check; by D18 item 1 (an element whose first part is not outside passes) it should pass Needs: drive.nika’s 52 option sites proved (the absolute ones first), then apply run4.patch, then run4.new/step3.py, for #2694 Changelog: none yet (slot.nika only proves its own argument) Issue: fits I1-I13; step 2 cannot land before step 1 covers drive, which the brief ordered but whose size (52 sites, absolute paths) it did not say Friction: nikaia fmt scripts/slot.nika reflows lines nobody touched, so it was reverted by hand; the earlier context ran out mid-run Disk freed: none; target/nikaia-project-tests 1.6G, / 7.7G free, no new entry over 100 MB Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01UVxJDvbkNUUMs8HdjJ8ixV

Debrief

  1. Most cost: the order of the steps. Step 2 adds a run-time check under warn, and is_operand refuses a leading /, so every absolute path at a still-unproved site fails. I found this only through pre-push failing on slot.nika:111, after the whole run-3 patch had been built. After that came the cycles of about 10 minutes each, and a context that ran out in the earlier session.
  2. Looked up: ADR-raw-sinks-1 D11, D12 and D18 items 1, 4 and 6, to decide whether a Dir path passes. I also had to find where the prover hands back a proof through a function result (OutsideProof::operand_proved in prover_calls.nika). The brief could have said up front that a root’s own text is judged by D11.
  3. Checks: the cycle, pre-push, nikaia check on every script, slot run with both BASE kinds, and the drive warning list. Wasted: one full cycle that only reverted the uncommitted step 2, and one nikaia fmt of slot.nika that I had to undo.
  4. Change: the brief should say that step 2 lands only when nikaia check scripts/*.nika shows no option site holding a value that can be absolute or start with -. It should also give the count of sites left in drive.nika, so a builder can size step 1 before building step 2.
  5. What the issue lacked:
    • broke I5: no property for the step-2 check on absolute paths. Every absolute path fails it, including the driver’s own lock files.
    • rules-gap: an order whose steps depend on each other (proof before enforcement) does not have to say how big the prerequisite is (52 sites).
    • knowledge: Lowering | nikaia fmt on scripts/*.nika reflows lines nobody touched (slot.nika, drive.nika); format only on a scratch copy.
  6. Traps:
    • Fact: Core Under raw-sinks = "warn", every unproved process::run option site is checked at run time with is_operand, which refuses a leading /, so an absolute path at an unproved site fails when the program runs.
    • Fact: Core A helper that takes a value from outside as a parameter makes its result outside, even when it returns only clean values; bind the clean value in the caller.
  7. For the next builder in this area:
    • Fact: Raw sinks Key files are prover_walk.nika (raw_sink_option_start, raw_sink_root_path, raw_sink_options) and prover_calls.nika (operand_proved, operand_result), plus emit_expr.nika (emit_raw_sink_checked).
    • Fact: Raw sinks 2026-11-23, at 3c79b49b: scripts/drive.nika holds 52 NK1308 option sites, and every other script is clean.
    • Fact: Raw sinks Step 2 is saved in docs/briefs/safety/issue-2694.run4.patch; run4.new/ holds its new test and step3.py, which adds check id -4 for a Vec[String] handed to process::run.

Generated by Claude Code

Back to Open Issues