Issue #2872: Loose corpus files that use a dependency cannot be checked or explained…

Open and answer this issue on GitHub.

blocked, ci · opened 2026-11-28 · updated 2026-11-29 · 7 comments

Waits for #2871. Needs #105

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

Found

Loose corpus files that use a dependency cannot be checked or explained through the toolchain, and the Rust sharing test’s one claim lives in one of them: nikaia check --sharing --user-parallelism yes examples/fortunes.nika prints error[NK1339]: A single file outside a project has no dependencies, so there's no http to use. and no report; benches/game/json/tree.nika gives the same (json); examples/foreign-runtime/overlaps.nika gives error[NK1181]: hyper_shim::serve_once ... hyper_shim isn't declared anywhere. The in-process Rust tests parse these files alone. The same fortunes.nika copied into a scratch project with http = { path = ".../examples/http" } does print atomic db (Shared[postgres::Connection]) could not decide: ... fetch, even though NK1117 then refuses it. So a toolchain test needs each such file in a project (moving examples/fortunes.nika breaks 44 references), or a test that wraps it in a scratch project, which reads no committed book; 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-28

Supervisor decision: each loose corpus file that uses a dependency becomes a project (a directory with nikaia.toml and src/main.nika), and every reference to it is updated.

Why: NK1339 is by design, because a single file has no dependencies. So examples/fortunes.nika, benches/game/json/tree.nika and examples/foreign-runtime/overlaps.nika cannot be checked or run as they stand. A user who runs nikaia run examples/fortunes.nika gets an error, so this is a defect in the corpus, not in the test. A test that wraps such a file in a scratch project would hide that, and it reads no committed book.

To build:

Done when: nikaia check passes on each moved project, no loose corpus file gives NK1339 or NK1181, and pre-push is green.


Generated by Claude Code

keywan-ghadami, 2026-11-28

Brief queued: issue-2872


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

Issue #2872

Your work order is issue #2872, 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/2872/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-2872.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-28

Run: issue-2872, Result: partial: examples/fortunes still draws NK1245 on postgres::connect and http::Server::new(), the database and the routed server #105 carries

Tokens: input 136, cache read 5016033, cache write 93423, output 31044 Cost: 2.42 USD, time 101 min 41 s, turns 68

Report

Result: partial: examples/fortunes still draws NK1245 on postgres::connect and http::Server::new(), the database and the routed server #105 carries Files: examples/fortunes.nika examples/fortunes/src/main.nika examples/fortunes/nikaia.toml benches/game/json/tree.nika benches/game/json/tree/src/main.nika benches/game/json/tree/nikaia.toml examples/foreign-runtime/overlaps.nika examples/foreign-runtime/overlaps.rs examples/foreign-runtime/overlaps/src/main.nika examples/foreign-runtime/overlaps/nikaia.toml examples/foreign-runtime/overlaps/contracts/hyper_shim.contracts examples/foreign-runtime/overlaps/contracts/hyper_shim.derived benches/game/README.md benches/game/game.nika benches/game/json/README.md benches/page.nika crates/nikaia/tests/it/examples.rs crates/nikaia/tests/it/foreign_runtime.rs crates/nikaia/tests/it/sequences.rs crates/nikaia/tests/it/sharing.rs crates/nikaia/tests/it/stored_views.rs crates/nikaia/tests/it/typecheck.rs crates/nikaia/tests/it/undeclared_type.rs docs/handoff.md docs/history/adr/adr-022.md docs/history/adr/adr-033.md docs/history/adr/adr-069.md docs/history/adr/adr-102.md docs/history/adr/adr-122.md docs/history/foreign-runtime.md docs/history/rc-or-arc.md docs/history/staging-candidates.md docs/history/subprocess-cost.md docs/language-review.md docs/long-jobs.md docs/selfhosting-plan.md docs/specification/adr/adr-017.md docs/specification/adr/adr-024.md docs/specification/adr/adr-289.md docs/stored-views.md examples/README.md examples/foreign-runtime/README.md Commit: The three loose corpus files that use a dependency are projects: examples/fortunes, benches/game/json/tree, examples/foreign-runtime/overlaps (NK1339, NK1181) Body: A nikaia check sweep of the 169 loose .nika under examples/, benches/, tests/ found exactly three with NK1339/NK1181; each is now a directory with nikaia.toml and src/main.nika: fortunes takes http = { path = "../http" }, tree takes json from packages/json, overlaps declares hyper-shim = { type = "rust", path = "../shim" } with the shim contracts serve/crossing/smuggled carry (without them NK2504). fortunes’ NK1117 is fixed (use std::env). Every path reference is updated (docs, history, READMEs, game.nika, the Rust tests: examples.rs takes a directory in SPECIFICATION_LEVEL, sharing.rs names files by path since fortunes is a main.nika now). The stale generated examples/foreign-runtime/overlaps.rs, read by nothing, is deleted. Part: #2872 Pushed: local 78b2910fb75a1485cc54fbf369dc3cf93d83024d Tests: rescan of the 166 loose files: no NK1339/NK1181; nikaia check exit 0 on benches/game/json/tree/src/main.nika and examples/foreign-runtime/overlaps/src/main.nika; README’s nikaia lower .../overlaps/src/main.nika --overlaps runs; it:: examples, foreign_runtime (overlaps, experiment), sequences::no_loose_program, typecheck::no_program_in, stored_views::, undeclared_type:: 42 passed; sharing::the_one_shared_in_the_repository_comes_out_atomic_undecided not finished: it walks benches/lowering/source.nika (21 363 lines, on develop since Nov 20), stopped after 53 min, its logic checked by nikaia check --sharing --user-parallelism yes examples/fortunes/src/main.nika, which prints 1 Shared value(s): 0 plain, 1 atomic, of which 1 because this analysis could not decide; clippy green; pre-push green (page-examples skipped, nothing in guide/website) Gate: green Deviation: none Found: the in-process test sharing::the_one_shared_in_the_repository_comes_out_atomic_undecided does not end (stopped after 53 min, one thread at 90 % CPU, 1.2 GB) because its walk of examples/ and benches/ reaches benches/lowering/source.nika (21 363 lines, tracked since Nov 20): on HEAD 78b2910fb with target/fast/nikaia built from it, timeout 300 nikaia check benches/lowering/source.nika exits 124 (no answer in 300 s) and timeout 900 nikaia check --sharing --user-parallelism yes benches/lowering/source.nika exits 124, while every other examples/ and benches/ file answers within 30 s (benches/yaml/load/load.nika the slowest, about 30 s); a check should answer in time roughly proportional to the file; cause unknown (suspected: a superlinear pass in the checker or sharing::analyse, settled by a callgrind run of nikaia check on its first 2 000 and 4 000 lines) Needs: #105 Changelog: none Issue: complete Owner: none Comment: #105 examples/fortunes is now a project (#2872) and nikaia check examples/fortunes/src/main.nika stops at what this issue builds: error[NK1245]: The compiler can't tell what type \postgres::connect(env::var(“DATABASE_URL”) ?? “postgres:/…` is. (line 85) and error[NK1245]: The compiler can’t tell what type `http::Server::new()` is.` (line 89) Friction: none Disk freed: target/nikaia-project-tests 966M, / 4.9G free of 252G (88 %), no new cache entry over 100 MB; the target/ dirs the checks wrote into the three new projects deleted Reviewed: 2b840d358783c344138ec739645a1a648dcc4a6edcba4b8ba4698f15aee80e0a Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01UVxJDtmukJNapbMLmZMzTV

Debrief

  1. Most time: waiting on sharing::the_one_shared_in_the_repository_comes_out_atomic_undecided. My first run was killed at the 10-minute background default. My tail --pid waiters were capped at 600 s, so I kept restarting them. After 53 minutes I killed the test, and finding the cause (benches/lowering/source.nika) took a per-file timing loop.
  2. Looked up: how check treats a project file (check FILE, there is no --project); how examples.rs, common::standalone_programs and the sharing walk find corpus files; how serve, crossing and smuggled declare the shim, and that they ship contracts/hyper_shim.* (without it, NK2504). The brief could have named the Rust tests that hard-code the three paths.
  3. Checks: the NK1339/NK1181 sweep over 169 loose files (useful, and the rescan), check on each moved project, the 42 touched it tests, clippy and pre-push (all needed). The 53-minute sharing run was wasted, and so were the 900 s and 300 s timings of source.nika, apart from the Found they gave.
  4. One change: builder.md should list the touched corpus-sweep tests known to take over 10 minutes, and say to run a filtered it test in the foreground with --nocapture, so a stuck test shows which file it is on.
  5. What the issue lacked:
    • rules-gap: the list of Rust tests that hard-code these paths (examples.rs, sequences.rs, typecheck.rs, sharing.rs, foreign_runtime.rs).
    • knowledge: Core | the in-process sharing corpus test walks examples/ and benches/ recursively and does not finish on benches/lowering/source.nika.
    • broke I7: the Found’s cause was not marked; the supervisor’s decision settled it as by design.
  6. Traps for the next builder:
    • Fact: Core nikaia check takes a file (check DIR/src/main.nika), not --project; on a project file it reads that project’s [dependencies].
    • Fact: Core a | grep on cargo test output buffers until the end, so a hanging test shows nothing; run with --nocapture or read the test threads’ names in /proc/PID/task/*/comm.
    • Fact: Core nikaia check or lower on a project writes target/ and nikaia.lock into it; delete them before committing a new project.
  7. For the next builder in this area:
    • Fact: Probes on 2026-11-28 (HEAD 78b2910fb) nikaia check benches/lowering/source.nika gave no answer in 300 s and check --sharing none in 900 s; every other examples/ or benches/ file answered within 30 s.

Generated by Claude Code

keywan-ghadami, 2026-11-28

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


Generated by Claude Code

keywan-ghadami, 2026-11-28

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


Generated by Claude Code

keywan-ghadami, 2026-11-28

Supervisor: the move is committed (78b2910fb). What remains is the sharing test, which hangs on benches/lowering/source.nika (#2880). That file is deleted under “benches/lowering: make it a project with a committed book” (#2871), so this issue waits for #2871 and then finishes its test run. I put Waits for #2871 at the top of the body.


Generated by Claude Code

keywan-ghadami, 2026-11-29

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


Generated by Claude Code

Back to Open Issues