Repository navigation
Description
Context
Part of #3150. Found while picking up #3155.
#3153 closed on 2026-11-04 with its first acceptance criterion unmet. That criterion, written in under the maintainer's G1 A ruling of 2026-11-03 (#3155 decision and #3153's own decision comment), requires the draft's outgoing to be a list of up to 10 snapshots per chat, with 409 DRAFT_OUTGOING_FULL refused in the creating save's transaction. It says: "The single-outgoing-slot implementation does not satisfy this criterion; a shipped single-slot field needs additive compatibility treatment."
What landed through #3342 is the single slot:
DraftOutgoing(packages/ui-sdk/src/protocol.ts:569-574) has{ requestId, text, fileIds, state: "held" | "dispatched" }, with nosnapshotId, noreturnedstate and nocreatedAt.Draft.outgoingandDraftSaveRequest.outgoing(protocol.ts:561,:594) are one optional object.- The store keeps it in one
outgoing_jsoncolumn (packages/ui-server/src/drafts/store.ts:200,:320-322), and the save sets, clears or keeps that one value (store.ts:493-507,:535-540). DRAFT_OUTGOING_FULLdoes not exist anywhere in the tree.- The decision record says so: "a draft has at most one outgoing snapshot" (
docs/decisions/chat-attachments.md, "What ui-server: admit generic chat files and retain specialized content routing #3153 built"). The plan's §6.4 still describes the single slot.
#3155's held-send, recovery-card and queue-full UI (rev 5 §2-§4, browser cases 22-28) consumes this list, so it cannot be built against the shipped field.
Out of scope
The composer UI, the transcript bubbles and their copy (#3155). The upload route, references, pool and sweep, which #3153 delivered. A separate send-intent table, which G1 rejected. Any change to the existing chat_message acceptance semantics beyond moving the matching snapshot's refs to the message.
Scope
Replace the single outgoing slot with the G1 A snapshot list on the host and in the SDK contract, with additive compatibility for the field that shipped on main.
Acceptance criteria
- A draft carries up to 10 snapshots per chat, each
{ snapshotId, requestId, text, fileIds, state: held | returned | dispatched, createdAt }, returned onGET /api/drafts/:draftIdand set throughPUTunder the existing If-Match and Idempotency-Key rules. - The save that creates a snapshot counts every live snapshot for that chat across tabs and devices in the same immediate transaction and refuses the eleventh with
409 DRAFT_OUTGOING_FULLbefore any send effect. - Cancel (held → returned), upload failure (held → returned), dispatch (held → dispatched) and a recovery read showing non-acceptance (dispatched → returned) edit a snapshot in place by
snapshotIdand never need a free slot, including at 10 of 10. - A slot is released only on confirmed acceptance (that snapshot's refs move to the message in the acceptance transaction), Edit into an empty composer revision, or Delete of a
returnedsnapshot. Nothing is evicted, merged or overwritten. Deleting areturnedsnapshot starts its files' seven-day clock rather than unlinking them. - An ordinary all-ready send also records a
dispatchedsnapshot until acceptance. - Every live snapshot's files stay in the draft sub-limit and pool accounting, as the single slot's do now.
- The shipped single
outgoingfield gets additive compatibility treatment (or a recorded maintainer ruling if that proves impossible), anddocs/plans/chat-attachments.md§6.4 plus the decision record's "What ui-server: admit generic chat files and retain specialized content routing #3153 built" are corrected.
Verification
Tests through bun run test: ten combined slots; the eleventh refused with no chat_message effect; Cancel at 10 of 10; two devices at 9 each racing and exactly one admitted; acceptance moving only the matching snapshot. Mutation: counting only one tab's (or one draft revision's) snapshots fails the race test. bun run check:pr --base origin/epic/3150-attachments.
Contract impact
The draft HTTP contract (docs/integration-contract/wire.md, session drafts) and @schlessera/brain-ui-sdk/protocol change additively: contract label, CONTRACT: commits, same-commit docs and a minor changeset. A breaking retype of the shipped field needs its own ruling first.
Activity
schlessera commentedon Nov 4, 2026
Claiming for implementation (claim token
orch-3588-a1). Branch:feat/3588-outgoing-snapshot-list, PR againstepic/3150-attachments.Collision report: path collision on
packages/ui-sdk/src/protocol.tswith draft #3582 (unrelated Apify contract work); closure-only reports otherwise.CONTRACT: feat(ui-server): keep up to ten outgoing draft snapshots pe…
Merge pull request #3656 from schlessera/epic/3150-attachments
schlessera commentedon Nov 6, 2026
Delivered on main: #3593 (squash
0ec44c466onepic/3150-attachments) landed with batch #3656, merge commit2d6d0e5a5. The batch's full ready-candidate proof (run 42250594660) passed every selected job on that tree. #3656 lists this issue as a closing reference, but GitHub did not close it automatically, so I'm closing it by hand.CONTRACT: feat(ui-react): keep each send as an outgoing snapshot and …
CONTRACT: feat(ui-react): keep each send as an outgoing snapshot and …
CONTRACT: fix(ui-server): version a kept draft when an acceptance rel…