Skip to content

A refusal's next moves are typed calls she can make, and load into her next act's tools (card e1360fbe) - #5980

Merged
joelteply merged 3 commits into
canaryfrom
fable/a-next-move-is-always-callable
Nov 14, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fable/a-next-move-is-always-callable

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

How this serves the minds: a resident who is refused must be told a next move she can actually call; this removes a repeat-the-refused-call loop. Plan line: goal 10 (tools are working sets) and FEEDBACK-PARITY (feedback reaches her, typed).

Glass box (the M5, 2026-11-13)

Aiko (75ece751), review card 149f1391 (no code change). From ~/.continuum/fixtures/prompt-captures/75ece751-….jsonl, event=="submitted" lines: 8 requests between 22:40:11Z and 23:26:07Z carry the refusal

nothing to submit: …/worktrees/149f1391 has no changes since 335a680… A submit publishes a patch: make the change there first, or, if this card's result is what you found rather than a change, record it with work/note (known: …) and close the card with work/state closed

and she kept calling work_submit (airc showed another work/submit ✗ at 23:23Z).

Correction to the card's premise: her tool list did hold both verbs. Every one of those requests offers work_create, ledger, update_task, work_submit, work_review, work_submission. ledger is work/note and update_task is work/state (their TrainedReflex aliases, continuum-rooms/src/work_preconditions.rs:100-102). The defect is that the refusal named commands by their canonical string in prose, and those strings are not names her list offers. A grep for work_ on the tool list misses the aliases.

Owners (file:line on the PR head)

  • NextMoves/NextCall and how they render: core/continuum-kernel/src/sdk_codegen/refusal.rs (NextCall::call → CallForm with CommandId::offered(), the name her list offers)
  • The work/submit refusal: core/continuum-mind/src/work/submission/latest_submission.rs (was CONCLUDE_WITHOUT_A_PATCH + CommandError::Invalid(format!(…)) in derive_submission, and the "not committed" one in committed_head)
  • Where the typed refusal was flattened into a String: sdk_codegen/handler.rs::dispatch_with_caller
  • Surface owner for her next act: cognition/tool_head/mod.rs (loaded = the tail) → tool_surface.rs::learned → llm_deliberation_faculty/tool_surface.rs::with_learned_head

The fix

(a) Typed next moves. SubmitRefusal::{NoChanges, Uncommitted} is a RefusalCause built with Refusal::new(cause, NextMoves). Its calls are NextCalls from VerbRefs to WorkNote/WorkState and CodeGitAdd/CodeGitCommit, which render as ledger({...}), update_task({"card_id":…,"state":"closed"}) and so on. The prose verbs are deleted: CONCLUDE_WITHOUT_A_PATCH and the code/git/commit, work/submit and room/join mentions in this file's refusals.

(b) A next move is always callable. The typed refusal now survives dispatch: CommandFailure { message, refusal } → DispatchFailure.refusal → ClientError::Refused.refusal. This is the in-process seam that continuum-airc-protocol::refusal's doc already described but nothing wired. The executor records the named commands on CallVerdict.next_commands. The act seam (act_observe/apply.rs) calls ToolHead::load, so those commands ride her next act's tail, the same way a commands/help find does, whatever the room's recipe declares.

(c) Ratchet source-hygiene::commands_in_refusal_text: a declared, namespaced command name inside a refusal's prose (CommandError::{Invalid,NotFound,Denied,Internal}(..), #[error(..)], ClientError::Refused{..}) is a site. The count may only fall, and touched files end clean. My local emulation of the rule counts 155 on this head; the base should be about 161 (6 removed here). The CI ratchet run gives the authoritative before/after.

Not in this PR: grid refusals (AircCommandResponse::Error) still carry no CommandRefusal, so a remote refusal loads nothing. The legacy ServiceModule::handle_command path (String errors) carries none either. Both are follow-ups for whoever owns the grid seam and the stringly_command_errors migration.

Tests

  • kernel sdk_codegen::refusal::tests::a_refusal_leaves_dispatch_with_its_next_moves_typed: dispatch keeps the sentence (rendered as offered) and the typed refusal. An arguments refusal carries none.
  • cognition tool_surface::tests::a_refusals_next_moves_are_on_her_next_acts_surface: with a refusal naming work/note in a room whose recipe leaves it out, her next surface's tail holds work/note.
  • cognition act_observe::tests::apply::a_refusals_next_moves_load_into_her_tool_head: the act seam loads what the refusal's CallVerdict names.
  • mind work::submission::tests (updated): the no-changes refusal's moves are [work/note, work/state] and the uncommitted one's are [code/git/add, code/git/commit], typed. Each move renders as its offered call, and the canonical name never appears in prose.
  • source-hygiene commands_in_refusal_text::tests: the ratchet itself, plus the predicate's fixture (multi-line prose, #[error], bare names, prefix-sharing names, non-refusal text).

Lines

+574 / −72 across 28 files. Removed: the CONCLUDE_WITHOUT_A_PATCH prose constant and 6 prose command mentions in refusals. The rest of the additions are the typed carriage, its tests and the ratchet (about 190 lines).

Not compiled locally

This machine serves live minds, so nothing was built or tested here. CI is the compiler.

Live receipt (after deploy; owner: whoever deploys canary to the M5; deadline: first deploy after merge)

Measure identical refused calls a mind repeats per hour. Before: Aiko, 8 work/submit refusals with the identical cause, 22:40-23:26Z on 11-13 (≈10/h on one card). After: the count of persona.act.refused with the same command and cause per mind per hour, plus whether a ledger/update_task call follows a "nothing to submit" refusal.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…s ledger/update_task as offered, and the commands a refusal names load into her next act's tools (card e1360fbe)

Aiko on the M5, 2026-11-13 22:40-23:26Z, review card 149f1391: 8 work/submit calls refused
with "record it with work/note ... close the card with work/state closed" while her tool list
offered those verbs as `ledger` and `update_task`. The refusal named commands by canonical
string in prose, so the move it told her to make was not a name she could call.

- work/submit's "nothing to submit" and "not committed" refusals are typed (SubmitRefusal) with
  NextCall references to work/note + work/state and code/git/add + code/git/commit, rendered
  under the names her list offers; CONCLUDE_WITHOUT_A_PATCH prose deleted.
- A refusal's typed next moves survive dispatch (CommandFailure -> DispatchFailure ->
  ClientError::Refused.refusal) instead of flattening into the sentence.
- The executor carries the commands they name on CallVerdict.next_commands; the act seam loads
  them into her tool head (ToolHead::load), riding her next act's tail like a help find.
- source-hygiene commands_in_refusal_text: a declared command named inside a refusal's text
  (CommandError variants, #[error], ClientError::Refused) is counted; falls only, touched
  files end clean.

Not compiled locally (serving node); CI is the compiler.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit bd90b99 into canary Nov 14, 2026
68 of 71 checks passed
@joelteply
joelteply deleted the fable/a-next-move-is-always-callable branch November 14, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant