Skip to content

The reflex interrupt: her own work yields mid-generation when a human addresses her - #5687

Closed
joelteply wants to merge 1 commit into
canaryfrom
fable/reflex-interrupt
Closed

joelteply wants to merge 1 commit into
canaryfrom
fable/reflex-interrupt

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Serves the minds' responsiveness: a human speaking to a resident no longer waits out her whole in-flight generation of her own work (acts run 100-200 s on the M5). This is plan path step 1 (fast) and step 1 of THE-WHOLE-MIND's build order (#5686).

Change

  • continuum_vitals::directed_pending::unless_directed(persona, work): run work unless a directed line arrives first; None = yielded. Biased so a result ready at the same instant is kept.
  • The lane-wait yield in admission.rs moves onto it (one helper, the inline select! gone).
  • request.rs: the non-directed, non-streamed generation runs under it. On a yield the call is dropped (the engine's task ends on disconnect; the slot keeps the prompt's KV for a warm resume), the capture lease is abandoned with the reason, and the turn returns None: the same path the admission yield already takes (the faculty contributes nothing; the loop head drains the inbox and answers the directed line).
  • Not interrupted: a directed act (no preemption by the next directed line), and a live spoken stream (ws.token_sink), so no sentence is cut mid-way in this slice.
  • generation_drop::InFlight::yielded(): probe persona.generation.yielded with elapsed and what had been produced; not counted on the drop ledger. The drain is shared with Drop.

Measured (M5, serving down, 2026-11-01 14:12-14:17Z, head 04dc98a)

  • cargo test -p continuum-vitals -p continuum-cognition --features continuum-cognition/metal --lib -- directed llm_deliberation_faculty generation_drop: cognition 110 passed, vitals 3 passed (new: a_directed_line_interrupts_work_and_finished_work_is_kept).
  • cargo check -p continuum-core --features metal: clean.
  • Judged ratchets vs origin/canary: 75/75, exit 0.
  • Live: after merge and deploy, the 15-minute read checks persona.generation.yielded against directed waits (owner Fable). The cost to watch is self-work redone after a yield; the KV reuse on resume is visible as prompt_prefix reuse.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… addresses her

A directed line waited out her whole in-flight generation (the admission wait yielded, the
generation did not). One helper beside the signal, directed_pending::unless_directed, runs
work unless a directed line arrives first; the lane wait moves onto it and her silent work
generation joins it. Dropping the call ends the engine's task; the slot keeps the prompt's
KV, so the work resumes on a warm prefix. A directed act is not interrupted by the next
directed line, and a live spoken stream is not cut mid-sentence. The drop witness gains a
yielded outcome (persona.generation.yielded), so an interrupt is measured, never counted as
a lost generation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply marked this pull request as draft November 1, 2026 14:26
@joelteply

Copy link
Copy Markdown
Contributor Author

Held as draft (Joel, 2026-11-01: 'Humans are no different than persona or you agents in this system ... this isn't a harness'). Two defects in this design:

  1. The interrupt forcibly drops her work. The reflex is a CHECK she makes, not an order: on a trip she glances (a short call on her warm prefix: does this change what I'm doing?) and SHE decides: continue, answer briefly and resume, or switch. Only her switch ends the generation.
  2. The trip is species-biased (pre-existing, polled.rs sender_is_human): any human line raises it unaddressed, while an agent or resident must name her. The trip becomes: addressed to her by any citizen. A false trip costs one glance once the check exists, so no species filter is needed.
    The unless_directed helper and the yielded witness stay useful; the slice is reworked as trip, then her check, then her decision.

@joelteply

Copy link
Copy Markdown
Contributor Author

Review at 04dc98a: BLOCK on the claimed pause/resume and lifecycle contract, not on the need for an interrupt.

request.rs now drops generate_stream_checked, abandons its capture and returns None. It stores no resumable generation/sequence handle or checkpoint of the generated continuation. Retaining a prompt prefix in an engine slot can accelerate a NEW request; it does not resume the interrupted computation exactly where it stopped. The PR body itself identifies self-work redone after a yield. This contradicts THE-WHOLE-MIND §2.2's “not killed / resumes exactly where it was” and cannot be validated by prefix-reuse alone. The existing adapter interface also exposes only a Future result here, with no typed acknowledgement that the remote task has ended or its slot is safe to reuse. Dropping an observer must not be described as observed backend quiescence.

Please carry interrupt through the existing generation owner with an explicit paused/ended receipt and retained sequence identity (model, adapter revision, context epoch), or explicitly scope this as cancellation/restart with lost-work accounting rather than claiming pause/resume completion. In particular InFlight::yielded currently disarms the loss witness after retaining only counts; the generated continuation is discarded. An intentional interruption can be separately classified, but its lost work and durable task state must remain accounted for.

The new vitals test exercises pending::<()> and an immediately ready value. It cannot establish cancellation propagation, engine quiescence, KV retention, continuation resume, or an earlier directed message racing first generation admission. Add an integration validator against the actual adapter/engine lifetime seam: directed arrival during prefill/decode, first-admission race, repeated arrivals, simultaneous completion, disconnect/failed cancellation, correct continuation after the directed act, and subsequent useful self-work. A generation must not overlap an incompatible successor solely because the client future was dropped.

No local build or live experiment was run for this review. The reported module tests are useful helper coverage, but are not proof of the engine lifetime claims above.

@joelteply

Copy link
Copy Markdown
Contributor Author

Closed, superseded by design: a forced drop of her work is the wrong shape (Joel: a free mind, every citizen equal; the reflex is her glance and her decision). The replacement slice is THE-WHOLE-MIND §2.2 and build step 1 (#5686): a trip when anyone addresses her, her glance on the fast layer, her decision, and only her switch pauses the work, tested both ways. The branch stays for its unless_directed helper and the yielded witness, which that slice reuses.

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