Issue #2314: let name: OsString = "Path" draws NK1135 “There’s no type called…

Open and answer this issue on GitHub.

blocked, bugs · opened 2026-11-19 · updated 2026-11-20 · 8 comments

Filed by the driver from the Found: of the run of issue-2304 (#2304) (owner, 2026-11-06).

Found

let name: OsString = "Path" draws NK1135 “There’s no type called OsString”, so process.rs’s merged test (OsString pairs, its Windows half) stays Rust; no decision yet

Cause not marked

The Found does not say how sure its cause is (docs/issues.md I7): a cause it names is a hypothesis, unknown until checked. The second item checks it (nikaia run scripts/where.nika, a probe, callgrind) before anything is built on it; a cause shown false is answered wrong I7: ... in the report.

To build

Done when

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

Comments

keywan-ghadami, 2026-11-19

Decided (supervisor, 2026-11-19): an obvious extension of the type map, written as Part III 15.2 in 6fca29b4.

The test needs a windows flag, not an OsString in Nikaia. OsString is left out on purpose (Part I 2.2, NK1135) and stays out. The whole Windows rule is same_name(a: &OsStr, b: &OsStr, windows: bool). A Nikaia String is UTF-8, and every platform’s OsStr holds UTF-8, so it can cross to an &OsStr parameter for free (OsStr::new). The way back (an OsStr or OsString returned) is not mapped, because it may hold text that isn’t UTF-8.

The Unix half is already a program: process_a_childs_environment_is_cleared_removed_then_set.nika.

To build

  1. Bridge: a D24 description whose Rust parameter is &OsStr accepts a Nikaia String and lowers the argument as std::ffi::OsStr::new(<text>.as_str()), or whatever the lowered Text offers to get a &str. The describer (nikaia describe crate) writes &OsStr as String. Test: a tests/compiler program or std test block that calls such a function.
  2. process.rs: widen same_name to pub(crate) and describe it in crates/nikaia-std/std.contracts with pub = false, as (a: ref String, b: ref String, windows: bool) -> bool sync.
  3. Test block: add a block in a runtime/*.nika file (for example runtime/env.nika) that checks:
    • same_name("Path", "PATH", true) and same_name("path", "PATH", true) hold;
    • same_name("Path", "PATH", false) does not hold;
    • same_name("PATHX", "PATH", true) does not hold.
  4. Delete names_compare_without_case_on_windows and, if nothing else uses them, its helpers pairs and the test module.

Done when process.rs has no #[test] left, nikaia test --std passes, and the lower-std fixpoint is clean.


Generated by Claude Code

keywan-ghadami, 2026-11-19

Brief queued: issue-2314


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

Issue #2314

Your work order is issue #2314, 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/2314/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/ci/issue-2314.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-19

Run: issue-2314, Result: blocked

Tokens: input 34, cache read 733269, cache write 48304, output 8887 Cost: 0.75 USD, time 1 min 44 s, turns 17

Report

Result: blocked Files: none Commit: none Body: The decision (comment 2026-11-19, Part III 15.2 in 6fca29b4) has the describer write &OsStr as String and std.contracts describe same_name as (a: ref String, b: ref String, windows: bool) -> bool sync. That leaves the lowering nothing that says the Rust parameter is &OsStr. A contract entry’s fields are signature/sync/panics/touches/pub/views/places/keeps/throws/… and none records a parameter’s Rust type. The emitter does not read the Rust source (D25 keeps only hashes in crate.derived). So a ref String argument lowers as it does for &str: runtime/lowered/raw_sinks.rs:15 has html::Raw::escaped("a < b & c"). Lowered the same way, process::same_name("Path", "PATH", true) would be rustc E0308 (expected &OsStr, found &str). Turning every text argument into AsRef::as_ref(x) would break generic impl AsRef<_> parameters, so that is not a way out. Nothing was built and no build was run. Fixes: none Pushed: none Tests: none run; nothing changed Gate: green Deviation: none Found: The ledger has no way to say a described Rust parameter is &OsStr, so Part III 15.2’s &OsStr bridge cannot lower: std.contracts (a: ref String, ...) for crate::process::same_name(a: &OsStr, b: &OsStr, windows: bool) lowers its call like html::Raw::escaped("a < b & c") (runtime/lowered/raw_sinks.rs:15), i.e. same_name("Path", "PATH", true), which rustc refuses with E0308; expected per Part III 15.2 same_name(std::ffi::OsStr::new("Path"), ...); two candidate records: a ledger type ref ffi::OsStr that the checker lets a String fill, or an entry field naming the &OsStr parameters (e.g. os_text = ["a", "b"]) written by translate in signature.nika and read by the emitter’s argument lowering; no decision yet Needs: supervisor decision: how a contract entry records that a parameter’s Rust type is &OsStr (a ledger type such as ref ffi::OsStr, or an entry field next to a ref String signature), since the lowering of #2314’s bridge depends on it Changelog: none Issue: broke I3: step 1 of the decision says the describer writes &OsStr as String, but it does not say where the lowering learns that a parameter is &OsStr once the signature says ref String, and no contract field holds it Owner: none Comment: none Friction: none Disk freed: none (no build, no tests run) Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01UVxJDtmukJNapbMLmZMzTV

Debrief

  1. What cost the most: finding where a described Rust parameter’s type would reach the lowering. That took about 8 reads across std.contracts fields, signature.nika, describe.rs and ADR-rust-boundary-1 D24-D28, before I could see that no record carries it.
  2. What the brief could have handed me:
    • the describer’s type translator is translate in compiler/signature.nika;
    • the contract entry fields that exist (none holds a parameter’s Rust type);
    • D25: the compiler keeps only hashes of the Rust files, never their signatures.
  3. Checks run: greps and reads only. No probe, build or test. I saw no need for a build, since the existing lowered line html::Raw::escaped("a < b & c") already shows how a text argument crosses. Nothing was wasted, but I never ran the stale NK1135 probe on develop (To build’s first item); it is by design under Part I 2.2 anyway.
  4. One change that would save the most: a decision that changes the lowering should be checked before it is filed as ready. It should name the record the emitter reads, or the builder should be told to check that first. This run spent about 25 turns finding that out.
  5. What the issue lacked:
    • broke I3: the decision’s step 1 says the describer writes &OsStr as String, but not where the emitter learns a parameter is &OsStr. No contract field holds that.
    • knowledge: Lowering | A contract entry carries only Nikaia types (signature, views, keeps, ...), so the emitter can't tell Rust parameter types apart that map to the same Nikaia type.
  6. Traps for the next builder:
    • Fact: Lowering | A ref String argument to a described Rust function lowers as plain &str (runtime/lowered/raw_sinks.rs: html::Raw::escaped("a < b & c")), so any Rust parameter type other than &str/&String needs its own record in the contract before it can be bridged.
    • Fact: Core | The describer's Rust-to-ledger type mapping is translate/result_of in crates/nikaia-std/src/compiler/signature.nika, not describe.rs.

Generated by Claude Code

keywan-ghadami, 2026-11-19

The report of the run of issue-2314 (#2314) 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

keywan-ghadami, 2026-11-19

Decided by the supervisor (2026-11-19), for the builder’s question of how the ledger says a described Rust parameter is &OsStr: candidate B.

The Nikaia type stays ref String (Part III, &OsStr as a parameter -> String). A contract entry names its &OsStr parameters in a new key, os_text = ["a", "b"]; the row is in the contract field table of docs/specification/30-nikaia-tooling.md (commit 49ea5d10). No new Nikaia type, and no blanket AsRef::as_ref, which breaks generic parameters.

To build:

  1. Describer: translate in crates/nikaia-std/src/compiler/signature.nika writes os_text for each &OsStr parameter of the Rust signature; the ledger reader keeps it.
  2. Emitter: the argument lowering of a call into a described entry wraps an argument named in os_text as std::ffi::OsStr::new(x).
  3. std.contracts: process::same_name’s entry gets os_text = ["a", "b"].
  4. Then the item this issue was for: process.rs’s last #[test] becomes a test of same_name in Nikaia, plus a test that a described &OsStr parameter takes a String (fails before step 2).

Status stays ready; re-queued in the ci lane.


Generated by Claude Code

keywan-ghadami, 2026-11-19

This corrects my earlier comment. This issue does not go back into the queue as it is: it is blocked and waits on the build of the os_text decision, The ledger has no way to say a described Rust parameter is &OsStr (#2351), which now holds the decision and its To build list. Once #2351 closes, the driver re-queues this issue.


Generated by Claude Code

keywan-ghadami, 2026-11-19

Driver: not queued, this issue waits for #2351, which is still open (#1819). Set ready again when it is closed.


Generated by Claude Code

keywan-ghadami, 2026-11-20

Open question moved here from the closed improve issue #2352 (Found: #2351): how does a contract entry record a &OsStr parameter — as a ledger type ref ffi::OsStr, or as an entry field such as os_text?


Generated by Claude Code

Back to Open Issues