.into() (comptime program: NK1127, rustc E0308)Open and answer this issue on GitHub.
ready, bugs · opened 2026-11-17 · updated 2026-11-21 · 3 comments
Found while building “yaml: remove the needless collects and copies” (#1981).
In packages/yaml/src/main.nika, change uri_decoded’s return s.clone() to return s, then:
cd packages/yaml && nikaia check src/main.nika
4× NK1127 “limits can’t be computed while the program is built” on the default_limits() defaults of documents, read, parse and load. The function means the same as before, so the file should check clean.
The comptime program’s rustc gives E0308 (expected Text, found EitherText<'_>) at return Some(uri_decoded(nikaia_std::index::or(verbatim, || ""))) in resolved. The ledger gives resolved an owned String? result, but uri_decoded returns an either value.
The same happens with invalid_tagged’s text: n.raw.clone() changed to n.raw. It does not reproduce in a standalone program, because there resolved is inferred as returning an either value.
crates/nikaia-std/src/compiler/emit_stmt.nika, around line 1376 (call_returns_either): it writes no .into() when an either-valued call is returned from a function with an owned result. Assignments get one from either_back (around line 873).
.into(), as either_back does for an assignment.tests/compiler/tests/ with that shape (an owned-result function whose ledger result is owned, returning an either-valued call)..clone()s in the yaml package (uri_decoded, invalid_tagged).The probe checks clean, and the test passes under nikaia test --both-settings.
Brief queued: issue-1993
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1993, 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/1993/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/bugs/issue-1993.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-1993, Result: partial
Tokens: input 250, cache read 7215609, cache write 154740, output 55365 Cost: 3.96 USD, time 16 min 20 s, turns 125
Result: partial
Files: crates/nikaia-std/src/compiler/emit_below.nika crates/nikaia-std/src/compiler/emit_core_flow.nika crates/nikaia-std/src/compiler/emit_core_leaves.nika crates/nikaia-std/src/compiler/emit_stmt.nika crates/nikaia-std/src/compiler/lowered.rs crates/nikaia-std/src/compiler/lowered/emit_below.rs crates/nikaia-std/src/compiler/lowered/emit_core_flow.rs crates/nikaia-std/src/compiler/lowered/emit_core_leaves.rs crates/nikaia-std/src/compiler/lowered/emit_stmt.rs tests/compiler/tests/either_call_returned_owned.nika tests/compiler/tests/either_call_returned_owned.stdout packages/yaml/src/main.nika
Commit: An either-valued call handed back from an owned text result is made owned
Body: either_into_owned (emit_below.nika) adds .into() after a return of a call whose result is of both kinds, when the function’s own result is owned text and not lent; it is applied in emit_core_handed_back, emit_stmt_expr (tail) and emit_core_return, the same rule either_back applies to an assignment. Before this, a package’s build-time default program (comptime) emitted return Some(uri_decoded(..)) into Option
nikaia fmt re-indented four compiler files from spaces to tabs, and I restored them from HEAD and re-applied my edits by hand.comptime_bundle.nika keeps it in NOT_BUILT). The real error only showed through a RUSTC= wrapper script that saved stderr.target/nikaia/build-time/comptime/, not in ~/.cache.a_dependency_default_beside_...).nikaia check on yaml; the rustc wrapper; lower-std fixpoint; pre-push.fmt on the edited compiler files; looking for the build-time program in ~/.cache.RUSTC=<wrapper that tees stderr>. The program is at <pkg>/target/nikaia/build-time/comptime/<hash>/main.rs.”wrong I7: it put both clones on the either-return shape. Line 2027 is a separate defect: Error becomes a struct holding a reference, and rustc reports E0106.broke I5: no probe that fails today. The real shape needs a library package whose ledger records the result as owned.knowledge: Core | a single-file test never reproduces a ledger-pinned owned result; build a scratch rust-library package as a_dependency_default_beside_a_type_error_is_not_refused_again does.| Fact: Core | nikaia fmt re-indents crates/nikaia-std/src/compiler/*.nika to tabs and rewraps yaml grammar actions, so never run it on those files; let pre-push judge fmt on what is staged. |
| Fact: Core | NK1127’s “couldn’t build” hides rustc’s error; set RUSTC to a script that appends stderr to a file to see it. |
| Fact: Lowering | nikaia check in packages/yaml creates packages/yaml/target (gitignored), so delete it after the run. |
Generated by Claude Code
From the report of the run of issue-1993 (#1993):
uri_decoded’s clone is gone with the fix; invalid_tagged’s text: n.raw.clone() stays: without it Error.text becomes a view and the comptime program fails E0106 (separate defect, filed from this run’s Found)
Generated by Claude Code