Skip to content

A reopen with one reading is served: tool/output takes an empty call, both names that agree, and half ranges (IntelMac: 64 + 35 refused calls) - #5844

Merged
joelteply merged 2 commits into
canaryfrom
47035f1d/tool-output-serves-unambiguous-calls
Nov 7, 2026
Merged

joelteply merged 2 commits into
canaryfrom
47035f1d/tool-output-serves-unambiguous-calls

Conversation

@joelteply

@joelteply joelteply commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

How this serves the minds: a resident's call to reopen a saved result had one plain reading, but it was refused, and she spent her next act re-asking. This advances path step 1 (Fast: fewer wasted acts) and is pattern 1 of #5838 ("degrade, never refuse"; Joel 11-07, card 9ed04d88). Card 47035f1d.

What was wrong (receipts)

IntelMac refusal analysis, 2026-11-07, posted in #continuum-dev. tool/output refused:

  • "give exactly one of outputId or act": 64 calls;
  • the empty call: 35;
  • a range with only one end ("give BOTH startLine and endLine"): Codex's finding in the same audit.

The change (tool_output.rs, working memory, registry)

  • Neither name reopens her newest saved output: WorkingMemory::reopened_handle(ActRef::NewestSaved). When none is saved, the typed refusal is ActOutputRefusal::NothingSaved (next: NoMove::NothingSaved).
  • Both names are served when they name the same output. When they differ, she gets ActOutputRefusal::Disagree (category Invalid), whose next calls are each name alone. The act's call is offered only when the act resolves.
  • A half range is read (line_range): endLine alone reads 1..end, startLine alone reads start..last line. The reader already stops at the last line (spill::investigate_readers: number <= end).
  • ActRef is the one way an act is named to the resolver. PersonaWorkspaceRegistry::act_output_handle and NoResidentMind carry it.
  • Next calls render through Reopen::params, the same form every handle shows. Fable's Reopen::Lines/Bytes in Her newest result is irreducible at its whole; past the window, its first page of content (card 8a12dcd1) #5840 compose with this, since they touch different hunks.

Removed: the "exactly one" refusal, the half-range refusal, and the duplicated params construction in act_refused.

Tests (each with a what-this-catches line)

  • a_reopen_with_one_reading_is_served_and_only_two_readings_refuse:
    • an empty call with nothing saved gets the typed NothingSaved;
    • an empty call reads the newest saved output (h2), skipping the unsaved Build(deps): Bump actions/stale from 8 to 9 #3;
    • both names agreeing is served;
    • disagreeing names get next calls [{outputId}, {act}];
    • an unknown act beside an id offers only the id.
  • a_half_range_reads_to_the_output_s_edge: endLine alone, startLine alone, both, and neither.
  • The existing act test no longer asserts the removed "both/neither refused".

Measured

Source and tests only; nothing deployed. Worktree 47035f1d on base 97f73c4, IntelMac, 2026-11-07.

  • cargo test -p continuum-cognition --features metal --lib -- tool_output act_output working_memory saved_handle newest_result an_action_result_cannot_mute: 87 passed.
  • -- prompt_shaping tool_surface: 77 passed. The surface ceiling holds.
  • Mutation-proved. Each of these fails one test:
  • cargo run -p source-hygiene --bin ratchets -- origin/canary: exit 0.
  • Owed after deploy (owner: Cormac; deadline: the first live read after the next canary deploy on the IntelMac): tool/output refusals per hour against today's 64 + 35.

Round 2 (f52f753): a reopen is a view of its source

Fable's FAIL at 31fffeb found that fold (a) on the card was missing. A tool/output result was saved as a new output, both per call and as the act receipt. Her search of that handle then matched her own earlier selection instead of the log (Codex's 5090 capture, windows-df8).

  • Per call: command_executor.rs reads the source that a Reopens command names (tool_output::reopened_source, keyed by the declared ToolEffect, never by name). That source becomes the call's custody, so the selection is never saved.
  • Per act: in act_observe/apply.rs, an act whose every call reopened one output takes that output as its receipt's custody (reopened_by_every_call). Any other act saves its receipt as before.
  • Typed open end: a range's open end is now spill::LineRange { end: None }, not usize::MAX (Fable's non-blocking note).
  • Test: a_reopen_is_a_view_of_its_source_and_never_a_new_output:
    • searching a handle for FAILED, then searching the resulting custody for FAILED, returns the same original line, and the custody is the source;
    • another command's result is not a view;
    • two sources, or a mixed act, are not a view either.
      It is mutation-proved: returning a fresh handle fails it, and so does accepting two sources.
  • Re-run at f52f753:
    • -- tool_output act_output working_memory spill newest_result act_observe: 183 passed;
    • -- prompt_shaping tool_surface: 77 passed;
    • ratchets: exit 0.
  • Not unit-tested: the executor and apply wiring itself (each is a single match on the helper). The live read after deploy owes the check that tool/output acts mint no new handles.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

… both names that agree, and half ranges (IntelMac: 64 + 35 refused calls)

tool/output refused every call that did not name exactly one of outputId or act (64 refusals on
the IntelMac 11-07), the empty call (35), and a range with one end. Each had one reading:

- neither name: her newest saved output (WorkingMemory::reopened_handle(ActRef::NewestSaved));
  none saved is the typed NothingSaved refusal;
- both names: served when they name the same output; when they disagree, a typed Disagree
  refusal whose next calls are each name alone (the act's only when it resolves);
- endLine alone reads from line 1, startLine alone to the last line (line_range).

ActRef is the one way an act is named to the resolver (registry and working memory); the
next calls render through Reopen::params, the same form every handle shows.

Card 47035f1d; Joel 11-07 "Refusal is insane" (card 9ed04d88, pattern 1 of #5838).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…so a search of a search reads the log (Codex's 5090 capture)

A tool/output result was saved as a new output under a fresh handle, call and act alike, so her
next search ran over her own earlier selection instead of the log (windows-df8: tool/output her
most frequent call while nothing got written). Now:

- the executor reads the source a Reopens command names (reopened_source, by the declared
  effect, never the name) and makes it the call's custody instead of saving the selection;
- an act whose every call reopened one output takes that output as its receipt's custody
  (reopened_by_every_call); any other act saves its receipt as before;
- a range's open end is typed (spill::LineRange { end: None }), not usize::MAX (Fable's note).

Fable's FAIL on #5844 at 31fffeb; card 47035f1d.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@github-actions github-actions Bot added size: L and removed size: M labels Nov 7, 2026
@joelteply
joelteply merged commit 0ac06c6 into canary Nov 7, 2026
45 checks passed
@joelteply
joelteply deleted the 47035f1d/tool-output-serves-unambiguous-calls branch November 7, 2026 21:00
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