agent: builder model: opus max_turns: 110 budget_usd: 22 —

Brief: a slice pattern over a lent field in a tuple; .to_string() of a String view parameter (Part of #896, steps 1-2)

Score: bugs lane (docs/priorities.md, bugs-first default): nikaia check passes, rustc refuses; blocks the rs2nika drafts of attributes and seeds (self-hosting). Steps 3-4 of #896 (std gaps, filter_map closures) are a later brief: not yours.

Issue text (#896, steps 1-2)

1. A slice pattern over a borrowed field inside a tuple

struct A { args: Vec[i64] }
fn f(a: ref A, b: bool) -> String {
    return match (ref a.args, b) {
        ([], true) => "none",
        ([x], true) => f"one {x}",
        else => "more",
    }
}
fn main() { println(f(A { args: [3] }, true)) }

nikaia run: rustc Expected an array or slice, found Vec<i64>. The lowering writes &a.args where the slice pattern needs &a.args[..]. Without ref: NK2106 (right). match (xs, b) with xs: ref Vec[i64] works. Expected one 3.

2. .to_string() of a String view parameter, stored in a struct

struct B { name: String, held: Vec[String] }
fn add(mut bodies: Vec[B], name: String, args: ref Vec[String]) {
    let held: Vec[String] = args.iter().filter(fn(a) { a.len() > 0 }).map(fn(a) { a.clone() }).collect()
    if !held.is_empty() {
        bodies.push(B { name: name.to_string(), held })
    }
}
fn main() { let mut bs: Vec[B] = []; add(bs, "x", ["a"]); println(bs[0].name) }

rustc: lifetime may not live long enough. name.clone() and plain name compile. Expected x.

Locations

To build

  1. A tuple subject whose arms put a list pattern at a position lowers that position as a slice (&(a.args)[..]), and leaves the others as they were; also a ref place matched alone. Test tests/compiler/tests/a_list_pattern_in_a_tuple_over_a_lent_field.nika + .stdout (probe 1, plus a two-list form ([a], [b])).
  2. .to_string() of a String view whose value is stored (struct field, push, a let that escapes) yields an owned String. Test tests/compiler/tests/to_string_of_a_lent_parameter_stored.nika + .stdout (probe 2, plus a direct return B { name: name.to_string() }).

Done when

Both tests (each fails on the unfixed compiler); nikaia test tests/compiler --both-settings; it filtered on handed_over text_tiers typecheck; the guard set of .claude/agents/builder.md; clippy clean. One commit per step, each Part: #896 (the issue stays open for steps 3-4); Changelog: one sentence.

Stop and report if

An open design choice; an error in another agent’s file.

Read docs/builder-facts.md.

Rules (CLAUDE.md; this block is pasted into every brief, also a fix-forward)

Report (at most 15 lines, to exactly /home/user/Nikaia/docs/briefs/b896a-slice-in-tuple-to-string.md.report.md)

Fields of docs/architect.md, Briefs and reports: Result: done|noop|partial|blocked (the bare word alone on that line: Result: done, never a summary after it, which cuts the batch, b869a 2026-10-27; Owner: is a question for the owner or none, never a role), Files, Commit, Body (optional, one paragraph for the commit message), Fixes, Pushed, Tests, Gate (green|red), Deviation, Found, Needs, Changelog, Owner, Disk freed, and for a move Rs2nika: (the kept N of M lines of rs2nika --score, then the three costliest hand edits; none for a task that moves no Rust). none where nothing, and then the bare word: Deviation: none (a note) cuts the batch (batch.nika compares exactly); a note goes into the commit message. Found: is only for a defect outside your change (it cuts the batch); how you solved your own step goes into the commit message. Deviation: is only a step of the brief built otherwise than written or not built (a choice the brief left to you, such as keep what X needs and say so, is no deviation: it goes into the commit message; nor is building two steps in one commit when every step is built, e12-3a 2026-10-27, nor a step another commit on develop already built, shown by your test failing with that commit’s change reverted, b889 2026-10-27: name the commit in Body:); how you verified (e.g. a test not run against the unfixed compiler) goes under Tests:. A noop says why under Tests: (what was probed), not under Deviation:. Final answer, one line: done <sha>, report <path> (or BLOCKED: ... / PUSH REJECTED ...).

Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01GFeMqxRbtUMiGVyDMxsvEq

This site is open source. Improve this page.