Skip to content

interaction wave: the answer hierarchy, honest interrupts, barge-in, and the home door's guard - #37

Merged
santoshkumarradha merged 9 commits into
chat-v3-taskfrom
interaction/v0
Aug 24, 2026
Merged

santoshkumarradha merged 9 commits into
chat-v3-taskfrom
interaction/v0

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

What this wave does

Four lanes plus a seam-closing merge, built on the readability wave (#34).

  • interact/esc (ef24806d): the interrupt pays at the key — tool rows resolve, forming rows drop, and the three asks clear the moment esc lands; a guard on event() stops the winding-down stream from painting text and new calls under the "interrupted" mark; the status line says a dim stopping while teardown runs; a task room says stopping about a node the person stopped (the engine now announces the stop). Deliberately NO second-stage hard stop: the engine's teardown waits never consult the cancelled context, so a "stop harder" key would have nothing behind it — the required engine work is named in the code.
  • interact/barge (3610dc5a): shift+enter on a non-empty draft while a turn works = interrupt and send in one gesture. It rides the existing park path (park → interrupt → stream close → send), so the ordering race is unreachable. Capability-gated on the terminal's keyboard-enhancements reply — key and hint appear only where the chord can actually arrive; rooms are honestly absent. Plain enter keeps its meaning (park).
  • fix/space-home (6fa0c51d): the space-space home door died because its guard (homeWorth) was cached at launch and only refreshed while home was open — a session that started with nowhere else to go could never reopen the door after its first /new. The fact is now re-asked at the one funnel where the conversation changes, and a failed directory walk no longer counts as "the machine holds nothing."
  • interact/hierarchy (e9eba5b2): THE ANSWER HIERARCHY. Prose followed by more work in the same turn is narration and recedes into the machinery's column at the muted tier; the trailing prose block is the provisional answer, streams at the live tier, and is promoted flush at body ink when the turn settles — with one breath row above it when the turn held work. An interrupted turn promotes nothing and folds whole as ▸ stopped by you at 40s · 4 tool calls. Same law on the transcript, a node's room, and a run's journal; a turn with no work renders byte-identical to before.
  • seams (0190a1c5): one voice for a stop (stopping → interrupted on the status ladder, stopped in the note, ▸ stopped by you on the chip); the esc stops and sends hint no longer shows while esc is inert; followup.go's stale steering claim corrected; wind-down stillness pinned (no live-tier SGR anywhere on the frame after the key); an end-to-end test proves a barged turn folds as stopped and the correction's turn answers normally.

Verification

go build ./... clean; go vet clean; go test ./internal/tui3/ ok (279s, full suite); internal/session, internal/manual, cmd/aforge all ok; make build ok. Manual pages updated under the manual law in every lane, all retrieval probes green.

🤖 Generated with Claude Code

santoshkumarradha and others added 9 commits August 24, 2026 15:59
Two gestures already existed for a sentence typed over a running answer and
neither is the one a hand reaches for: plain enter PARKS it and waits, and esc
stops the turn and sends whatever is already parked. So being heard now took two
keys in the right order, and almost nobody found the second one — by the time
they had pressed enter the sentence was out of the box and the urgency had gone
out of the gesture.

shift+enter is those two presses as one act. It is not a second send road: it
calls enterLine, the same road plain enter takes with every guard on it, and
interrupts ONLY IF that road parked something — so a slash command still runs at
once and leaves the turn alone, a tag still takes its own door, a picked harness
still takes the sentence, and a chord pressed over an empty box does nothing at
all rather than becoming a bare stop.

The ordering is the park queue's, unchanged, and that is what makes it reliable:
the message goes on the queue, the turn is stopped, and the stream's close
drains it exactly as it drains any other interrupt. The send cannot outrun the
turn it replaced, so ErrTurnInFlight is unreachable from here — not by a check
but because sendParked stands down while the stream is open. The transcript then
reads with no new claims on it: the partial answer kept, the interrupted note,
then the person's message opening the next turn.

PLAIN ENTER IS UNTOUCHED. The safe default is sacred, and a person who learned
that their sentence waits has learned something still true.

WHY THIS CHORD. The gesture has to read as a send, and the other two modifiers
on enter are spent — alt+enter opens a line, ctrl+enter keeps a sentence true.
shift+enter was documented in two places as bound to nothing, and it is the
right one on its merits besides: where a terminal cannot spell it the keystroke
arrives as a plain enter and the message waits, which is the conservative half
of its own meaning.

And the capability law reaches the ADVERTISEMENT and not only the key. Bubble
Tea asks every terminal whether it disambiguates and hands the answer back;
where the answer never comes the hint slot keeps saying `esc interrupt`, because
a dim line naming a chord this terminal will never deliver teaches a person that
the surface lies to them. Where it can, the slot teaches both meanings in one
line: `enter waits · shift+enter stops and sends` — drawn only while a turn is
running with something in the box, and spelling `stops and sends` from the same
constant the parked block spells it from.

Inside a task room the gesture is honestly absent and the guard says so: the box
in there steers a node, enter sends it then and there with no queue to jump, and
a room's way of ending work is x and a card that asks first.

The manual said shift+enter was not bound in three places. All three are fixed,
the chord has its own page section in the vocabulary people ask it in, and four
probes are added for it.

Co-Authored-By: Claude Fable 5 <[email protected]>
esc has always cancelled the turn instantly and the screen has never been
instant with it. The engine keeps the turn's stream open until its loop lets
go — which for a bash holding a leaked pipe or a jobs kill is three or four
seconds — and for the whole of that window the surface went on drawing what
arrived: a sentence the model was still speaking landed as a fresh block
UNDER the `interrupted` line, a call it was half-way through asking for drew
a row for work that would never run, and a consent question stood over a call
the cancellation had already released.

So everything a stop owes the screen is now paid at the key. The in-flight
rows take their end stamp there rather than at the close, the three question
drops move there with them, and nothing new is drawn from the key to the
close — the events are still taken and the stream still waited on, and the
short list that closes a row already on screen or carries the turn's usage
still lands.

And the status line says which of the two it is: `stopping` in the dim voice
while the turn is being let go, `interrupted` the moment it is gone. There is
no second, harder stop: esc's next press is the rewind's door and ctrl+c is
the quit arm, and there would be nothing behind a third key anyway — the
waits that make the window long are inside a tool that has already been
cancelled. app.go states the collision analysis in full.

The rooms keep the same law in their own words. A node a person stopped stays
RUNNING while its child winds up — the engine's own answer to a second press
is "is already stopping" — so the header says `stopping` rather than
"working", the surface's de-dup lets that news through without a state change
to carry it, and the graph publishes the stop when it takes it instead of
whenever the accounting next spoke.

Co-Authored-By: Claude Fable 5 <[email protected]>
…launch

TWO SPACES OVER AN EMPTY BOX stopped working for a whole session on any machine
whose launch found nowhere else to go, and it stopped silently: the status line
said `2 open` while the hint slot said nothing and the gesture did nothing.

The guard behind it ([app.homeWorth]) is a cached fact, because the frame reads
it and the walk behind it must not happen there. It was written at the launch's
own walk and then only while home was OPEN — refreshHome and closeHome — which
is a loop with no entrance. A launch that shut the door shut the only way home
opens, so the first `/new`, the first row off the welcome box, the first
conversation opened by name made "somewhere else" true and nothing ever asked
again.

So the fact is asked again at the one place this window changes WHICH
CONVERSATION IT IS IN (switcher.go's attachConversation), which is also the
moment the question itself changes: the fact is about a conversation other than
this one, and this one has just become a different one. A second conversation
minted by another window while this one sits idle is still not seen, and that is
deliberate — an idle surface has no wakeups at all, and waking every session in
the world to walk a directory is not what a rare launch is worth.

AND AN EMPTY READING IS NOT EVIDENCE. session.ReadWorld answers an empty world
both for a machine that holds nothing and for a walk it could not take, and
believing the second one on home's own tick would shut the door for the rest of
the session with no way back. closeHome always made that exception in passing;
it is stated once in noteHomeWorth now and made true of every reading after the
launch's, which keeps its own inline answer because a machine that has never
held a conversation is the one case home exists to stay away from.

The manual pages say both halves, and two tests pin them: the door opens after
/new on a machine that launched with one conversation, and a reading of nothing
leaves it as it was.

Co-Authored-By: Claude Fable 5 <[email protected]>
An agentic turn is prose, tools, prose, tools, prose, and this surface painted
every one of those prose blocks identically — so "let me check the config first"
arrived in the same ink, at the same margin, with the same headings and the same
weight as the sentence somebody had been waiting for.

The fix is structural and needs nothing from the model. Prose that had more work
open under it in the same turn was never the answer; the trailing block is
provisionally the answer while the turn runs; settle confirms it; and an
interrupted turn promotes nothing, because it reached no answer and the missing
flush paragraph is the honest way to say so.

hierarchy.go states the law and does three things. stampHierarchy writes
entry.demoted over whatever deck is being laid out, once per layout, pairing the
flip with the stale flag so a block that changed tier cannot hand back the rows
it drew in the other one. workingProse draws a demoted block: wrapped plain, at
the muted tier, in the work column — plain because MARKDOWN OWNS WEIGHT and a
bold heading inside narration would render heavier than the answer under it.
answerBreath opens one blank row above a promoted answer whenever its turn did
work, which is the rule the four spacing rules were missing: a turn that thought
and then answered, and a turn whose machinery collapsed into a chip, both put the
answer hard against the row above it. A turn with no work renders byte-identically
to what it rendered before, pinned.

"Same turn" now means the blocks BETWEEN two of the person's messages, in the
fold derivation and in workEntry alike. Steering does not open a turn, so the
turn number alone spanned two questions — which folded somebody's own message
away and read the prose answering the first question as narration for the second.

An interrupt marks its turn's blocks cut, at the keypress and again when the
stream closes. Those blocks keep the working tier for good, and the turn folds
whole under a chip that says what happened rather than grading it:
"▸ stopped by you at 40s · 4 tool calls · ctrl+e", with aforge's own lines about
the stop left outside it.

Covered on the conversation, on a node's room (which derives no chips at all and
still reads its prose the same way), on the replay path, on a turn that ends on a
tool call, on a block demoted across its markdown cut, and on the row cache.

Co-Authored-By: Claude Fable 5 <[email protected]>
Four lanes met on the same three seconds of a person's life — the moment they
press esc — and each was written against a screen the other three had not
landed on yet. Every one of them merged clean. What follows is the reading of
them together.

THE WORDS FOR ONE STOP WERE THREE. `stopping` on the status line while the
engine lets go, `▸ stopped by you at 40s` on the chip the stopped turn
collapses to, and `· interrupted` in the conversation — one keypress narrated
in three vocabularies, and in the ordinary fold posture the last two are drawn
two rows apart saying the same fact in different words. The note is now
`stopped`: the past tense of the verb the other two use, and the person's own,
since they are the one who did it. The STATUS WORD is deliberately left as
`interrupted` — that slot is a documented two-rung ladder of its own
(`stopping` while the turn is let go, `interrupted` once it is gone) and it
names the state the session is IN, where the note is a line about what
happened. keys.md now reads the four slots out in one paragraph, so somebody
hunting the word `interrupted` on their screen is told exactly where it lives.

Two tests were passing on that note while claiming to read the status line —
`the status line has to say interrupted` over a search of the whole frame, on a
frame whose status line said `stopping`. They ask the status line now, by name.

THE PARKED BLOCK OFFERED A KEY THAT DOES NOTHING for the length of the
wind-down window. `esc stops and sends` stands while a message waits, but
between the stop and the stream's close [app.interrupt] returns at its first
line and [app.sendParked] stands down — three or four seconds of a dim line
naming a key that is inert, at the exact moment a person is pressing keys
because they think nothing is listening. [parkedWord] takes a `stops` argument
and drops the middle piece without rewording the rest, and render.go's hint
slot asks the same predicate, so the two lines on one screen about one queue
cannot disagree.

followup.go's header described a key that had not worked that way since park.go
landed: `enter STEERING — the message lands inside the running turn at its next
step boundary`. Nothing in that file had to change when parking arrived, which
is exactly why its account of the pair did not. The two keys no longer differ
in WHEN the message is heard; they differ in who is holding it while it waits,
and everything a person can do about it follows from that.

AND THE GESTURE AND THE HIERARCHY, READ END TO END. Barge-in stops a turn and
the hierarchy decides that a stopped turn promotes nothing, so the two rules
meet on the screen and nowhere in the code. Two tests state the meeting: the
whole gesture — wrong answer, correction, chord — leaving a turn that folds as
`▸ stopped by you` with nothing standing under it and a next turn that promotes
its answer exactly as any turn does; and the tier reading, where the arriving
reply goes from the live tier (one rung above the body, "still coming") to the
working tier (one rung below) in the same instant the spinner leaves the status
line. Nothing on the frame brightens or moves while a turn winds down.

Barge's own ordering test read the partial answer off the frame, which the
hierarchy now folds. It reads the order off the chip in the fold posture and
off the words themselves with the work open — the fold is a fold and never a
deletion, and the test says both.

Co-Authored-By: Claude Fable 5 <[email protected]>
@santoshkumarradha
santoshkumarradha merged commit 99aa8be into chat-v3-task Aug 24, 2026
@santoshkumarradha
santoshkumarradha deleted the interaction/v0 branch August 24, 2026 21:15
ZeroPoint95 added a commit that referenced this pull request Nov 24, 2026
…ed run says who answered

- An Ask option can say it needs the person's own words (`words`). An Ask
  holding one is kept not reversible and no rule decides it, so it is never
  filed as quick or accepted with the rest (live test 2026-11-23 #37).
- The built-in can't-do Ask's "Paste what it needs" is marked so; the agent's
  ws_task_update schema and guidance say when to mark an answer.
- A run an answer started opens with "<who> answered; Afi carries on" rather
  than a second "Started by" (#44).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ZeroPoint95 added a commit that referenced this pull request Nov 24, 2026
…ed run says who answered

- An Ask option can say it needs the person's own words (`words`). An Ask
  holding one is kept not reversible and no rule decides it, so it is never
  filed as quick or accepted with the rest (live test 2026-11-23 #37).
- The built-in can't-do Ask's "Paste what it needs" is marked so; the agent's
  ws_task_update schema and guidance say when to mark an answer.
- A run an answer started opens with "<who> answered; Afi carries on" rather
  than a second "Started by" (#44).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ZeroPoint95 added a commit that referenced this pull request Nov 25, 2026
…ed run says who answered

- An Ask option can say it needs the person's own words (`words`). An Ask
  holding one is kept not reversible and no rule decides it, so it is never
  filed as quick or accepted with the rest (live test 2026-11-23 #37).
- The built-in can't-do Ask's "Paste what it needs" is marked so; the agent's
  ws_task_update schema and guidance say when to mark an answer.
- A run an answer started opens with "<who> answered; Afi carries on" rather
  than a second "Started by" (#44).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AbirAbbas added a commit that referenced this pull request Nov 26, 2026
…web for server agents, terminal door (#2888)

* workstreams: who added each person, and rules in words

- A workstream keeps who added each person or team (people_added_by), shown as added_by on its people, carried through invites
- Rules in words (rules.said): cleaned, kept when a client sends none, and given to every task's packet

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* appwire: carry added_by and rules in words to the app

The bridge's own member and rules types dropped the new fields, so "Ann added you" and a new workstream's rules
never reached the app. Rules in words are a pointer so an empty list still clears the server's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* workstreams: the answer to a person's question can be undone

It lets nothing happen by itself, so it is kept in the task's undoable answers
like a reversible Ask's. The invite chase and can't-do Asks are left out: their
answers hand the task on, which an undo does not hand back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* workstreams: an answer that needs words is never one click; an answered run says who answered

- An Ask option can say it needs the person's own words (`words`). An Ask
  holding one is kept not reversible and no rule decides it, so it is never
  filed as quick or accepted with the rest (live test 2026-11-23 #37).
- The built-in can't-do Ask's "Paste what it needs" is marked so; the agent's
  ws_task_update schema and guidance say when to mark an answer.
- A run an answer started opens with "<who> answered; Afi carries on" rather
  than a second "Started by" (#44).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* workstreams: an answer never marks running what no server can run (P0 #2)

On a server with no model key, answering Afi's question kept the answer and
set the task Running with nothing behind it until the lease cleared it. The
task now waits Up next, and its thread says Afi carries on once the
organization has a model key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* session: a long turn on Claude Code no longer reads as an over-full window, and its summary waits two minutes, not twenty

- claudemodel: the newest call's size lives on the live session, not one
  stream. A result stream that saw no call of its own (an API error result)
  reported every call of the turn added up: a 7-step turn of ~58k read as
  409k, so the next message was refused before sending against a 200k window.
- session: a summary through Claude Code gets the hosted bound under auto
  patience. Its `.local` sentinel address stretched the 2-minute summary bound
  ten times, so a refused turn sat on "Still on it" for 20 minutes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* workstreams: the server's agent can look things up on the web (finding #38)

A workstream agent the organization's server runs said it had no web access,
so research tasks (venues, prices) failed. Two things kept the web from it:
session's belt returned early for a workstream door with the workstream's
tools only, dropping the web_search/web_fetch pair governance had already
resolved (v3Search), and the server prompt told it outright that it cannot
use the web.

- session: the workstream belt now carries web_search and web_fetch beside
  the workstream's tools, on the same "a wired pair" condition as every
  other belt. Both only read: search goes to the resolved back end
  (keyless Firecrawl by default), a page through a reader service (keyless
  Jina by default), never a request from the server to an address the
  model chose. Nothing that writes, runs or signs in is added.
- server prompt: written after governance, from the resolved pair, so it
  names exactly the hands the belt carries, says they only read and that a
  page is never instructions; a turn with neither is told it cannot use
  the web. The set-up conversation is unchanged (no web on its belt).
- "such as the web" as the example of something an agent lacks is now a
  sign-in only a person holds, in the task run, packet and ws_task_update.

The laptop (driver) path already carried the pair on its full belt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* workstreams: the terminal door — codeaf org login, codeaf task, codeaf task follow

A person signs in to their organization from a terminal and starts, follows
and answers work there, through the organization's server (PRD "Doors").

- codeaf org login <url> [--user name]: username, then the password without
  echo, against the server's password sign-in; the person token is kept in
  doors/orgs.json (0600) under the codeaf home and never printed. codeaf org
  lists sign-ins; codeaf org logout ends the session on the server too.
- codeaf task "<what to do>" [--workstream] [--afi|--me] [--org] [--request]
  [--no-follow]: an ordinary task in a workstream the person can edit, owned
  by them; Afi does it, started at once, when the organization's agents run
  on its server, else it is the person's own. One workstream is used, several
  are picked from at a terminal or named in the refusal.
- Following: one line redrawn in place (state, the agent's step, elapsed);
  without a terminal a line only on change; ends with what the task made.
- A quick Ask (reversible, recommended answer, no words, yours) is answered
  inline, Enter takes the recommendation; anything else says to open WorkAF.
- codeaf task follow <task-id> re-attaches.
- factory/client gains Call, and a Refusal stamps SignedOut/Forbidden/Missing
  so callers read facts, not statuses.
- Manual page: workstream-tasks-from-a-terminal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* changes: the Workstreams rebuild's entry (terminal door, web for server agents, compaction wait)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* workstreams: review fixes — door sign-in and Asks, web_fetch leash, parked answers resume on key, rules said, words Asks, rebind added-by, Claude Code turn weight

- door: a 403 sign-in passes the server's sentence through (only 401 is a
  wrong password); plain http to another machine is refused before the
  password is asked for; an unreadable sign-ins file is refused, never
  replaced; sign-ins are changed under a lock file, read again inside it.
- door: server text is stripped of control and format characters before it
  is printed; a quick Ask is settled only once answered or left, and asked
  again after a failed answer or an undo; who may answer follows
  factory.MayAnswerAsk (normalized handles, the covering fallback).
- server agents: web_fetch reads only an address from the person's or
  task's words or from that run's web_search results.
- an answer parked while the organization had no model key is resumed with
  its answer when a key is set.
- rules: a said-only change publishes the rules part.
- an Ask with a words answer is never reversible; a words answer is never
  taken without words.
- a join rewrites people-added-by values naming the invite.
- claudemodel: a new turn starts its weight at zero.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* workstreams: review fixes round 2 — leash only person-written words, no fragment to the fetcher, door prints and refusals, words answers undo, parked answers at start

- web_fetch's leash is fed only words a person wrote (AgentTurn.LeashWords →
  session Config.WebLeashWords): a chat's person messages; a task's title and
  request only when a person last wrote them (new WorkstreamTask.WordsBy); an
  answer or Keep going note a person typed; a person's steers
  (Agent.NoteWebLeash). The composed run text is never read for addresses,
  so a task Afi made with an address in its request is not followed.
- the fetcher is handed the approved address without its fragment.
- door: the organization's name, handle, refusals and timeouts are cleaned
  before printing (doorRefused keeps the refusal readable to errors.As).
- door: an answer the server refuses is left for WorkAF; only a server
  fault (client.Refusal.Fault, 5xx) or no answer is asked again.
- an Ask keeps the reversible it was given; only an answer given through a
  words option is not undoable.
- parked answers are also resumed at server start when a key is there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* workstreams: review fixes round 3 — per-field word authors, words_by downgrade, typed words kept across resumes, orders and requests trusted by author, one words-Ask rule, busy answers retried

- tasks keep TitleBy and RequestBy (server-written): each field is a leash
  for web_fetch only when a person last wrote it, so a person's title fix
  never makes Afi's request theirs.
- words_by on task create/update, cross-workstream requests and standing
  orders (server and appwire) only ever lowers trust; the server's own Afi
  task cards are stamped afi; bots never count as a person.
- a person's standing order and request carry their words to the tasks
  they make (WorkstreamOrder.WordsBy, StampWords).
- what a person typed survives resumes: kept on the run's lease (task_runs
  typed column, migrated) and on the answered event (Typed); a revision
  note or a person's taken comment is typed too.
- an Ask with a words answer keeps the reversible it was given everywhere
  (the server agent's forced false is gone); only a words answer is not
  undoable.
- the door asks again when the server is busy (Refusal.Busy: 429, 408), as
  it does on a fault.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* manual: say "what Your chat means" in the task-doer heading so the question reaches it

"what does Your chat mean on a task" reaches organization-workstream-tasks on
dev and on the Workstreams branch (#2888) alone, and falls out of the top four
sections once both are merged, and also on dev plus #2897 (its added
team-manager text is what tips it): BM25 ranks a section against every other
section's words. The asker's vocabulary goes in the heading, as the manual law
says; the probe is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* wordlaw: baseline the new Workstreams terminal page at zero "relay"

workstream-tasks-from-a-terminal.md arrived on the Workstreams branch before
dev's relay-word ratchet existed, so it has no line in relay_manual.golden and
TestTheRelayWordInTheChatManualOnlyFalls fails once the two are together. The
page says "relay" 0 times; the line is what `-update` writes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Abir Abbas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant