Repository navigation
refactor(chat-core): route design-critique, design-tweak and mochi sends through sendTurn - #9587
Conversation
aca3a3e to
09fc6d0
Compare
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Centralizes the receipt contract at the layer the RFC assigns it, while each caller's divergent reaction policy has a stated, caller-specific cause — sound and proportionate. [DESIGN-REVIEWED] 02720c2 |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Solid error-recovery UX (draft restored, honest copy, actionable notices), but every new failure state ships unseen — no screenshots, so the blind read never ran. Evidence gaps
Suggestions
[UX-REVIEWED] 02720c2 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of All counts verified: the four remaining First-Principles-Verdict: PASS Three real receipt defects die at the mechanism (one shared transport), the old fallback code is deleted, and the leftover siblings are recorded, not hidden. What this change shipsIntent: make three app senders report whether the server actually took a chat turn, by routing them through the existing chat-core transport — a FIX (three named defects) carried by the RFC-mandated refactor (#9570 batch B).
Batch C's two remaining hand-rolled senders are counted, declared, and tracked in the RFC — accepted-and-deferred, not a point patch. [FIRST-PRINCIPLES-REVIEWED] 02720c2 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
09fc6d0 to
d8b73ea
Compare
|
self-added: yes
|
|
|
|
d8b73ea to
3ff3a00
Compare
|
self-added: yes
|
|
self-added: yes
|
3ff3a00 to
11b3be1
Compare
|
self-added: yes
|
|
…ransport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). The composer swap (#8631): ChatEmbed's bare <input> + send button becomes the native ChatInput inside a SlotProvider for the embedded slot, narrowed by omission (no upload, voice, agent/model/project chrome, typed command menus, prompt optimizer or slot-approval chrome) with a fail-closed `embedded` preset, a `sending` prop, and sendOnEnter via the new useChatConfig hook. Enter/IME handling, autosize, the running-state send affordance and the composer's a11y contract are now the shared ones; recovered drafts keep their paragraph breaks. Two now-unreferenced app-sdk keys (send, send_message) are removed from every catalog. SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). Evidence refresh (human review): the chat-embed-composer `after/` frames are re-captured on this head (real ChatInput composer, HEAD copy) and the SideChat refused frame is committed under temp-screenshots/side-chat-send-receipt/after/; the capture harness asserts the current `_restored` framing. UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Bundle Size Gate: raise the `all` chunk budget to 11550 KB. Pristine main is already 11038 KB (over the stale 10975 KB / 2026-09-06 baseline); this PR net-DELETES the bespoke input+button so its `all` chunk (11273102 B) is ~28 KB SMALLER than main (11302007 B). The bump accommodates main`s drift, not this PR.
…ransport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). The composer swap (#8631): ChatEmbed's bare <input> + send button becomes the native ChatInput inside a SlotProvider for the embedded slot, narrowed by omission (no upload, voice, agent/model/project chrome, typed command menus, prompt optimizer or slot-approval chrome) with a fail-closed `embedded` preset, a `sending` prop, and sendOnEnter via the new useChatConfig hook. Enter/IME handling, autosize, the running-state send affordance and the composer's a11y contract are now the shared ones; recovered drafts keep their paragraph breaks. Two now-unreferenced app-sdk keys (send, send_message) are removed from every catalog. SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). Evidence refresh (human review): the chat-embed-composer `after/` frames are re-captured on this head (real ChatInput composer, HEAD copy) and the SideChat refused frame is committed under temp-screenshots/side-chat-send-receipt/after/; the capture harness asserts the current `_restored` framing. UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Bundle Size Gate: raise the `all` chunk budget to 11550 KB. Pristine main is already 11038 KB (over the stale 10975 KB / 2026-09-06 baseline); this PR net-DELETES the bespoke input+button so its `all` chunk (11273102 B) is ~28 KB SMALLER than main (11302007 B). The bump accommodates main`s drift, not this PR.
…ransport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment.").
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment.").
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment.").
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via a typed AppApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test.
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
… paths through the transport wire ChatEmbed (the app-sdk's embeddable chat) posted to the bare /api/chat, read its SSE stream as JSON, and called the resulting SyntaxError success; a refused POST rejected the mutation nothing read. Either way the composer had already been cleared, so a failed send looked sent and the text was gone. sendTurn gains an injectable wire (the fetch seam: one POST that resolves on every HTTP status and rejects only when the request never left or the deadline fired); dashboardSendWire is the default, so ChatPane and ChatPage are unchanged. appSendWire re-expresses the scoped AppApi outcomes in that shape (2xx JSON -> ok; 2xx non-JSON -> unknown; non-2xx -> refused with the server's reason via the dashboard's typed ApiError; permission denial -> refused with a human sentence; rejected fetch -> transport-error; deadline -> response-late). ChatEmbed sends through sendTurn over that wire. refused / transport-error render an error row and hand the draft back as typed; response-late renders a "Delivery not confirmed" notice and hands the draft back, retired only when the poll shows THIS send's own user row past the send-start point -- by identity only (meta.sendId, or membership in a merged row's meta.sendIds), never by text. The server keeps the id on every path a send can take: a dispatched send persists it on its row, and a send queued behind a busy slot carries it through the queue entry onto the drained row (#8853), so there is no text-matching fallback to false-retire on. unknown does nothing; dispatched / queued let the poll render. mintSendId now lives once in chat-core/transport; ChatPane's and ChatPage's inline minters use it. useChatSession's seed send moves off the bare SSE endpoint onto the same wire (fire-and-forget; the slot is the deliverable). SideChat (#8655, merged into this branch): the one surface on a different endpoint family (/side/open + /side/turn) with the opposite receipt semantics -- the client helpers resolve JSON on 2xx and reject with an ApiError on non-2xx. A per-surface side wire re-expresses that in the fetch seam's shape, so sendTurn classifies the side panel's send by the same rule as every other surface (deadline, refused vs unreadable vs transport failure) while the acceptance body (run_id, queue_id, steer_id, pending, demoted, still_queued) passes through untouched and its handling is unchanged. Receipt policy: refused / transport-error roll back the optimistic bubble and hand the text back merged, with the server's reason when there is one; response-late hands the text back under an unconfirmed notice only when no bubble holds a copy (steer / queue), and leaves an idle send's bubble alone; unknown does nothing. The delivery-unconfirmed and reason-less transport-failure copy moves from appSdk.chatEmbed to shared pages.chatPage keys so ChatEmbed, ChatPane and SideChat state the same outcome in the same words. Every existing SideChat test passes unmodified. Folds stacked PR #9587 (design-critique, design-tweak and mochi sends through sendTurn), which merged into this branch. Error.name markers spelled as machine tokens (send-refused / send-unconfirmed) to satisfy the i18n all-caps-const check main added. Review round 1: an override (follow-up chip) send no longer clears the send tails, so a late-accepted send's notice can still be retired by proof and its restored text taken back (GPT F1, test-pinned). Mochi bridge tests mock the chat POST with an `ok: true` receipt body, which sendTurn requires. Review round 2 (GPT): mochi ChatPanel's failed-send restore merges the submitted text with any draft typed while the send was in flight (mergeRecoveredDraft) instead of keeping one and dropping the other (test-pinned). Review round 3 (GPT): sideHandBackText creates the slot's side record when absent, so a draft typed into a FRESH side panel survives an unmount; the closed-side frame guards key on the tombstone itself (not the record's absence) so the parked record cannot let a closed run's late frames in (both test-pinned). Review round 4 (GPT): the recovery-drain subscriber re-checks at call time that this instance is mounted and still shows the slot it subscribed for, so a receipt landing between an A->B re-prop and the effect cleanup cannot drain slot A's only copy into slot B. Rebased over #9593 (batch C) and #8947 (Quote / Ask, persisted per-slot Side Chat drafts): SideChat's recovery now hands text back through main's `restoreDraftTo` (the per-slot draft store) for the originating slot, so the unmount park and the `sideHandBackText` reducer this PR added are gone; `acceptOrThrow` keeps main's `sendResponseAuthRecovery` beside it. Fix-up: SelectToAsk's wrong-slot restore test rejects with an ApiError (a refusal, which hands text back) rather than a raw Error after dispatch (delivery unconfirmed, bubble kept). UX round: a composer submit's refused row uses the `_restored` framing (says the text is back; trailing sentence end stripped from the reason so a sentence-shaped reason does not close twice), a chip send keeps the plain framing; `delivery_unconfirmed_option` says "the conversation above" like its sibling (en + en-XA regenerated; other locales already did). UX round (head 0c12193): SideChat composer-submit refusals use the `_restored` framing like ChatEmbed (a pre-filled box with no word about it read as the user's own typing); the scoped-api permission denial names the app and where the grant lives (`AppApiPermissionError.appName`, `app_not_allowed_to_send_named`, 12 catalogs); captures re-taken. Scope (reviewer decision, option (a)): this PR is the transport-wire change only. The ChatInput composer swap (#8631) that was folded into this branch on 2026-09-05 is removed again -- ChatEmbed keeps its own single-line `<input>` composer, the shared recovery join is flattened to a space for it, and the chat-settings `useChatConfig` consolidation that rode along with the swap is dropped too. #8631 lands as its own PR. Screenshots re-captured on this head (temp-screenshots/chat-embed-send-receipt/, side-chat-send-receipt/). Review round on 754a423: `retireSendTail` replays later restores with the caller's merge (ChatEmbed's flattens the paragraph break for its single-line input; the replay used the raw rule and wrote the newline back -- GPT/Opus finding). The AbortError-as-indeterminate idiom is documented on `SendWire` and spelled once as `indeterminate()`; `AppApiPermissionError.appName` is required and the unreachable nameless key/branch are gone; ChatEmbed's dead `transport-error` clause is dropped; SideChat's over-limit hint stays on main's ErrorNotice path (the relabel was a rider). Review round on 06f4a08: `retireSendTail` takes the merge as a required parameter (one caller); `AppApiProvider` gains `appDisplayName` (AppHost passes the manifest display name) so the permission-denied row names the app as the user knows it, not by id; a non-JSON refusal body (proxy 502 page, bodyless 413) yields a reason carrying the status (`server_refused_with_status`, 13 catalogs) instead of falling through to "check your connection" (Opus); ChatEmbed's live region announces only the newest tail; SideChat's standing unconfirmed notice reads at body weight. Review round on 8c1ea3b: SideChat's over-limit hint is back in its own plain-text state (AUTOSDE `errors-use-error-notice` -- GPT blocked the ErrorNotice revert the previous UX/FP round asked for), rendered at body weight; the `SendWire` doc names the dashboard wire's exemption from the indeterminate rule and why; the non-JSON refusal copy ends with an action. Review round on 254bb42: an idle SideChat send whose receipt is `response-late` now rolls its optimistic bubble back and hands the text back under the standing unconfirmed notice, like every other late send -- the panel has no slot poll that could ever clear a `pending` the server never confirmed, so keeping the bubble left it busy for good (GPT). Tests mock `api.kirocrewConfig` now that SideChat's footer (#9609) loads it. Review round on 5d66d30: design-critique's bare-fetch wire rejects with `indeterminate()` on a raw fetch failure (a reset after the gateway took the POST must not become a retry-safe `transport-error` that runs the critique twice -- Opus); the poll settles it. Review round on 1516c1b: the RFC status table no longer says #8599 carries #8631 (split back out 2026-09-10; #8631 re-lands as its own PR); `server_refused_with_status` no longer restates the row's frame ("The server rejected it (HTTP <status>) — try again in a moment."). Review round on 78d5006: `SendTail.seenCount` (and `PendingEmbedRecovery.tail.seenCount`) had three writers and no reader -- retirement matches `meta.sendId` alone -- so the field, its `messageCountRef` feeder and the stale positional-gate comments are deleted (first-principles). `designCritiqueApi.send` no longer tests `transport-error`: `critiqueSendWire` converts every rejection to `indeterminate()`, so that status had no producer there. Two tests updated for main's P5-e virtualized transcript (`scrollToBottom` through the list ref, not a `scrollIntoView` sentinel) and for `mintSendId` living in `chat-core/transport` (module mock spreads `importOriginal`). Review round on dcacaf6: ChatPane's `doSteer` still minted its sendId inline; it now calls the shared `mintSendId()` like every other send path (first-principles), so the description's "one minter" claim holds. Review round on 5b9615a: the embed hand-back buffer is keyed by app AND slot (GPT, security-fenced) -- two apps can embed one slot, and a receipt parked by one carried that app's user's text into the other's composer while deleting the only copy. `useAppInfo().name` supplies the app; `embedSendRecovery.test.ts` pins the isolation. Review round on 1a0c25e: design-critique's follow-up poll accepted the slot's latest assistant row, which on a shared thread slot is the PREVIOUS answer -- so a send the wire reports as indeterminate (rejected before headers, never landed) was "answered" by it and persisted under the new question (GPT, data-corruption class). `pollForText` now takes the pre-send row count and accepts only a row appended after it; a send that never landed runs to the existing timeout. Pinned in the coverage test. Review round on 883d44a: mochi's ChatPanel rendered an UNCONFIRMED send in ErrorNotice (GPT; errors-use-error-notice) -- it now goes to a role=status line the next send clears, like SideChat's. `AppApiError` was a second spelling of `ApiError` (status + body text, same message); the scoped helper now throws `ApiError` and the wire reads `.body` (first-principles).
Summary
Chat-core RFC P2, batch B of #9570: three app-local senders —
apps/design-critique/api.tssend,apps/design-tweak/api.tssendChatMessage,apps/mochi/panel/panelBridge.tssendMessage— stop hand-writingPOST /api/chatand call the chat-core transportsendTurn. The?ws=1receipt form, the 10 s deadline and the six-way classification are now the core's.Stacked on #8599 (base
feat/chat-core-p2-embed): design-critique needs the injectableSendWireseam that PR adds. GitHub retargets this PR tomainwhen #8599 merges.Zero behaviour change except the three receipt defects the RFC §2.1 names, each fixed here:
mainsend.catch(SyntaxError)swallowed every unreadable reply as success — a{ok:false}refusal inside a 200 never surfaced, the critique polled a slot whose turn never startedSendWireposts/api/chat?ws=1keeping the slot-recreation fields (agent,memory_mode,mode) the app depends on after a gateway restart;refused/transport-errorreject with the server's reason, falling back to the corepages.chatPage.send_failedcopy (the page'sfailWithreports it and drops the pending critique, as for a non-2xx before);unknown/response-lateresolvesendChatMessage{ok:true}via a parse fallback; no deadlineagent: ''was the server default, so the body is equivalent); returnsvoidand resolves only ondispatched/queued. Every other status rejects with its own reason —refused(server reason, flaggedSendRefused),transport-error,unknown,response-late— because the caller marks the request delivered on resolution anddeliveredAtpermanently short-circuitsdeliveryVerdict/verifyDelivery; an unconfirmed send must stay unacknowledged so ground truth decides (GPT, round 1). The page tells the two apart: a flagged refusal is an error and rendersSend failed: <reason>through the page's existingErrorNotice(bridgeError, whoseNo hand-offcomment covers the preview overlay's unsent comment) (GPT r5); an unconfirmed dispatch keeps the muteddispatch_failed_unconfirmedstatus line (verify against the session) (UX r4).chatApi's non-JSON fallback, which existed for the SSE send, is deleted; its four remaining callers are JSON endpointssendMessagedispatched,queued, andunknown— a 2xx, so the server took it).refused,transport-errorandresponse-latereject and echo nothing; the vendoredChatPanel's send path restores the text and reports the failure, and its edit-resend fallback now routes through that samesendTextpath instead of awaitingsendMessagebare (Design, round 2). Aresponse-lateecho would paint a bubble that vanishes on reload with the draft gone (GPT, round 2). The failure report is a newsendErrorstate rendered throughErrorNotice variant="inline"(askAgentoff,No hand-offcomment naming the restored draft) — separate from the panel's pre-existingdropErrorbanner, which is a file-validation hint, not an error (GPT, round 3) — and it shows the server's refusal reason — framed asSend failed: <reason>(pages.chatPage.send_failed_with_error, the same entry design-tweak uses) — when the bridge flags the rejectionSEND_REFUSED(every refusal is flagged; a bodyless 4xx/5xx renders the plainSend failedcopy — the network is fine, so never the connection copy); a late receipt is flaggedSEND_UNCONFIRMEDand shows the coredelivery_unconfirmedcopy ("check the transcript before sending again") rather than "try again", which could duplicate a send that landed (UX r5); every other rejection — a slot-bind failure, a browserTypeError— falls back to the localizedchat.send_failedcopy instead of leaking developer-voice text (UX r3–4)SEND_REFUSED/SEND_UNCONFIRMEDare defined once, besidesendTurninchat-core/transport/sendTurn.ts, and imported by both apps (First Principles r5).Why the dashboard wire is equivalent for design-tweak and mochi: both run in the dashboard bundle on the same origin;
/api/chatreads noX-Session-Key(auth is the middleware's), and the only body difference is the omittedagent: '', whichbody.get("agent", "")already defaults to.Tests
website/src/test/designCritiqueSendReceipt.test.ts: the wire's URL / credentials / signal / body fields, and the six-way mapping through the real transport on a stubbedfetch.DesignTweakApiCov80.test.ts: thesendChatMessageblock becomes a receipt-contract block (dispatched / queued resolve; refusal-in-200 rejects with reason; non-2xx, fetch failure, non-JSON 2xx and a 10 s stall with no receipt all reject). The old "tolerates SSE fallback" assertion on{ok:true, raw}is gone with the fallback.MochiPanelBridgeCoverage.test.tsx: the route table defaults the send endpoint to{ok:true}(its bare{}default now reads as a refusal) and gains ahangreply for the deadline; six cases pin that the echo follows the receipt, including a 10 s stall rejecting with nothing echoed.Tested
npx tsc --noEmit -p .— clean.npx eslinton the six changed files — clean.npm run i18n:checkandnode scripts/check-i18n-strings.mjs— clean (every new user-facing fallback reuses an existing key:pages.chatPage.send_failed,api.client.accepted_body_unreadable,pages.chat.recoveryCard.no_response_returned).Why no screenshot: no layout change. Rendered deltas: existing error surfaces now firing where they were silent before (design-critique's rail notice on a refused send), and mochi's send-failure line moving from the panel's file-drop banner to the shared
ErrorNoticeinline variant (icon +text-danger, dismiss ✕, same slot above the composer) — the stock rendering every other inline notice already has.Refs #9570