agent: builder model: sonnet max_turns: 80 budget_usd: 12 —

Brief (#878): a binding in a condition is refused with a message that names match (ADR-382 D6)

Score: bugs lane (docs/priorities.md): a wrong help text on a form ADR-382 D6 refuses; one file, small C (Sonnet).

Problem and probe

ADR-382 D6 refuses if let v = x, if x is Some(v) and if e is Leaf(v): match binds what an enum or a T? holds, and a T? tested with != null needs no binding (D1). The parser refuses all three (pinned in a9978f9), but its words mislead:

if let v = x {      // error: `let` is a reserved word, so it can't be used as a name here.
                    //   help: Choose another name, such as `let_`.
if e is Leaf(v) {   // error: Expected `{` here, but found `is`.

Expected: a headline that says a condition does not bind a name, and a help naming match (and != null for a T?). Also while let v = x (same rule; probe it first, it must read the same).

Locations

To build (one commit)

  1. In a_better_reading (or a sibling it calls first), recognise: found let right after if/while (the last token before it), and found is inside an if/while head. Give a ParseReading with the caret on let/is, headline A condition can't bind a name: match binds the value an enum or a T? holds. and help Write match x { … }, or test a T? with x != null. (wording may be tightened, the content not). The reserved-word headline must not fire for these. Then lower-std, commit the lowered diff.

Done when

nikaia test --both-settings tests/compiler (filters: binding, reserved); it filters parse_error, reserved, four_words, and the guard set of .claude/agents/builder.md; each new or changed .stderr failed on the unfixed compiler. Commit line ends Fixes #878. Changelog: one line (a message changes).

Stop and report if: the is case cannot be told apart from a real missing { without a parse retry that stops_at does not give.

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/b878-condition-binding-message.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, Fixes, Pushed, Tests, Gate (green|red), Deviation, Found, Needs, Changelog, Owner, Disk freed. 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); 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.