Open and answer this issue on GitHub.
blocked, safety · opened 2026-11-19 · updated 2026-11-20 · 7 comments
Filed by the driver from the Found: of the run of issue-2217 (#2217) (owner, 2026-11-06).
no raw sink refuses data from outside the program today (ADR-raw-sinks-1 D3, Part III 13.3 say NK1308): use std::io\nuse std::fs\nfn main() throws {\n let name = io::read_line() ?? ""\n let t = fs::read_to_string(name, fs::Root::Anywhere)\n println(t)\n} gives Checked exit 0, and html::Raw(name) and process::run(name, []) give the same; NK1308 is emitted nowhere in crates/ (traced: grep finds it only in a comment in project_settings.nika); this is the part of #1253 still to build after raw sinks steps 1-3
#1253 #2216
develop first: the run that wrote it may have used a binary older than the tip, so it may be fixed already (#1822: #1788 was filed from a probe a fix under #1754 had already made pass). A probe that passes there names the commit that fixed it (git log -400 --grep by topic, since a fix often lands under another issue’s number), and the run builds only a tests/compiler/tests/ test that pins it (docs/issues.md I13).std defect with a probe (nikaia run scripts/probe.nika -- SNIPPET; a lowered file that differs, with an uncached lower-std of a git archive HEAD copy, NIKAIA_LOWER_CACHE_SALT fresh and --sysroot COPY/crates, its lowered/ diffed against the copy’s, never the shared working tree’s, #1793), a defect in docs/, guide/, website/ or scripts/ (a stale example, a wrong rule) with the command or check that shows it; a behaviour the code does on purpose (name the function or ADR) closes it as by design. The Found line may lack them (#1710): the commit message, or the report’s Body: when closed, gives the probe or check with its expected output, the ADR or Part I-III section that says so, and its actual output (docs/issues.md I5, I6), and the cause, file and function, traced or suspected (I7).std defect in the compiler, a stale page example or rule in its page or docs/ file, a script defect in the script. Add a test in tests/compiler/tests/ unless a check that already runs turns red on it (name it: pre-push’s page-examples for guide/ and website/, check-adr-refs.py for a docs citation).The probe or check gives the expected output the first item names from its ADR or Part I-III section, and a tests/compiler/tests/ test (or the named check) that failed on the unfixed tree is green; or the probe already passes on develop and a test pins it, naming the commit that fixed it; or the issue is closed as by design, naming the function or ADR.
Generated by Claude Code
Supervisor (2026-11-19): not a decision. ADR-raw-sinks-1 D3 and Part III 13.3 already specify NK1308 for data from outside at a raw sink, so this is kind 3, a defect: the build of the rest of “Raw sinks” (#1253). Labels set to ready, safety; queued in the safety lane before “Run by path and working directory” (#2217), which waits for it.
Generated by Claude Code
Brief queued: issue-2242
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2242, 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/2242/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-2242.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-2242, Result: partial
Tokens: input 206, cache read 7470589, cache write 196334, output 56990 Cost: 4.40 USD, time 29 min 10 s, turns 103
Result: partial
Files: crates/nikaia-std/std.contracts tests/compiler/tests/a_line_read_from_standard_input_is_data_from_outside.nika tests/compiler/tests/a_line_read_from_standard_input_is_data_from_outside.stderr crates/nikaia-std/src/compiler/prove_terms.nika crates/nikaia-std/src/compiler/prover_walk.nika crates/nikaia-std/src/compiler/lowered/prove_terms.rs crates/nikaia-std/src/compiler/lowered/prover_walk.rs crates/nikaia-std/src/compiler/lowered.rs tests/compiler/tests/a_guard_on_a_std_predicate_proves_it_after.nika tests/compiler/tests/a_guard_on_a_std_predicate_proves_it_after.stdout
Commit: 9887487c io::read_line and io::read_exact are untrusted sources (ADR-365); a13303eb a guard on a std predicate such as html::is_plain(name) makes it a fact after the guard (ADR-381 D5)
Body: Cause traced. io::read_line was marked provenance = "trusted" in std.contracts, and no sink check existed anywhere. 9887487c makes read_line and read_exact untrusted, with a trusted: option. a13303eb lets a pure bool free function of std (html::is_plain) be a named property, so the precondition of html::Raw can be proved (prove_terms property_name, prover_walk prover_std_properties, prover_a_property_callee). The NK1308 check itself (prover_walk prover_raw_sink, project_check_let_raw_sinks_through with [allow], NAME:key into NK1309 and raw-sinks=warn, project.rs plumbing, 9 lines of Rust) is built and refuses the probe. It is not merged: it is commit 0254f60c3 on the local ref wip/issue-2242, without its lowered files (run lower-std after applying).
Pushed: local a13303ebd55c53e9a5f644f8dbd49d2983a9039c
Tests: both new tests fail on the unfixed binary $S/old/nikaia (NK1109 plus 2x NK1300; NK1300) and pass with –both-settings, together with io_lines_are_text, io_read_exact, io_standard_input_arrives_in_pieces, a_file_or_stdin_read_is_untrusted_unless_marked and the 11 named-property tests (17 ok). lower-std fixpoint clean; pre-push green. The wip check gives NK1308 on the probe; counted with it: 41 sites in the compiler, 52 in scripts/, 14 in examples/packages, 1268 in 261 tests/compiler programs.
Gate: green
Deviation: To build item 3 (NK1308) is built but not committed: ADR-raw-sinks-1 D8 and ADR-396 D4 (“Until those are done, the refusal is not merged”) hold the refusal until about 1375 sites in our own code build under it; most are a path from fs::read_dir or a read file, a mktemp dir or a toolchain path from process::run, under fs::Root::Anywhere.
Found: none
Needs: the sites of our own code moved, so the NK1308 check on wip/issue-2242 can merge (ADR-raw-sinks-1 D8): in tests/compiler, let tmp = process::run("mktemp", ["-d"]).stdout.trim().clone() followed by fs::write(f"{tmp}/p.nika", fs::Root::Anywhere, source) draws NK1308 for tmp (261 programs); the compiler reads fs::read_to_string(dir.join(name).join("Cargo.toml"), fs::Root::Anywhere) with name from fs::read_dir (project_drive.nika:611, 41 sites); scripts/drive.nika has 20 sites, scripts/agent.nika 11; each wants trusted: true at its source or a Root::Dir, issues to file per area
Changelog: io::read_line and io::read_exact are untrusted sources, as io::read_to_string is (ADR-365); after a guard return if !html::is_plain(name), html::is_plain(name) is proved, as a program’s own named property is (ADR-381 D5).
Issue: broke I9: the To build list has one item for the whole NK1308 refusal and leaves out the site migration that ADR-raw-sinks-1 D8 requires before merge (about 1375 sites), so Done when cannot hold in one run; broke I7: the cause is not marked, and the trace showed two (read_line trusted in std.contracts, and no sink check at all)
Owner: none
Comment: #1253 The NK1308 check (fs paths under Root::Anywhere or Dir(“/”), html::Raw parts with an html::is_plain guard, the process::run program; [allow], NAME:key into NK1309, raw-sinks=warn) is commit 0254f60c3 on wip/issue-2242. Still open: D6 (a pub parameter at a sink), D7 (the run-time check under warn), db::raw and http::File, a root held in a variable, a number part by its type (only a whole number the walk follows passes today), and the D10 match-of-literals arms (from_outside taints a match by its scrutinee). The sites of D8 come first.
Friction: none
Disk freed: none; target/nikaia-project-tests 349M, / 14G free of 252G, 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
from_outside and untrusted in prover_calls.nika; provenance in std.contracts) and where a check should go (prover_calls_in). Also: the NK1302 Finding model, how named properties work (ADR-381, property_name), the warn filter in project_check.nika, the one Rust call site in project.rs, and ADR-396 D4 (“not merged until our code builds”).broke I9: one To build item for the whole NK1308 refusal, with no item or follow-up issue for the D8 site migration, so Done when cannot hold in one run.broke I7: the cause is unmarked, and there are really two: io::read_line is provenance = "trusted", and no sink check existed at all.knowledge: Core | a std free predicate (html::is_plain) was no prover fact after a guard; only methods were std properties (fixed in a13303eb).| Fact: Core | A new refusal on outside data is merged only after every site in the compiler, scripts/, examples/, packages/ and tests/compiler builds under it (ADR-396 D4, ADR-raw-sinks-1 D8); count the sites with the prototype check before building the rest. |
| Fact: Self-hosting | lower-std turns the prover’s findings straight into errors and skips project_check’s severity filters, so a warn setting there does not let the compiler’s own build through. |
| Fact: Core | The tests/compiler programs taint tmp (from mktemp via process::run) and the toolchain path, so any path or program sink check hits about 260 of them. |
Generated by Claude Code
The report of the run of issue-2242 (#2242) 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
The owner decided on 2026-11-19 to prove path sinks safe instead of adding trusted: at each one (“Weg 2”). This is recorded as ADR-raw-sinks-1 D11-D16 (57379dba7). The build is split into four issues, in order:
Root::join, Root::path, path::is_component and is_below; trusted: comes off read_line (#2300)fs::scratch() instead of mktemp and Root::Anywhere (#2301), needs #2300trusted: (#2302), needs #2300The check so far (0254f60c3, local ref wip/issue-2242) is also saved on the branch ccr-1df86473-m6u8d2. #2303 brings it onto develop.
Generated by Claude Code
From the report of the run of issue-2302 (#2302):
#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
Generated by Claude Code
Supervisor: this issue is the umbrella of the split build (#2300, #2301, #2302, #2303) and is not built as one run (its last run broke I9). Status blocked until those four are closed; it is closed then, naming them. The Found probe now gives warning[NK1308] at raw-sinks = "warn".
Generated by Claude Code