Make finalized stream responses annotation-capable #10

Closed
opened 2026-08-28 19:24:41 +00:00 by dikka · 1 comment
Owner

What to build

Carry Pilcrow's normative finalized-response annotation interaction into the continuous session stream. Any finalized assistant response may become the one active annotation surface while other responses remain fully readable without permanent marginalia. Older responses remain annotatable while newer work is live; the provisional response is not annotatable.

Use one input and submission flow. With zero annotations, send ordinary readable Pi user content. With one or more annotations, serialize the established structured TOON payload. Text and validated raster attachments work in either form. While Pi is working, both forms use the same ordinary steering behavior as Pi's TUI; do not expose delivery-mode or native queue controls.

An unannotated reply entered while viewing an older response is an ordinary current message with no hidden source-response identity. Preserve canonical rendered-text targeting, one-response range containment, existing attachment validation, and submission authority safeguards.

Acceptance criteria

  • Every finalized assistant entry can be selected as the active annotation surface without hiding other stream entries.
  • Only one response exposes active target bars, marginalia, and editor interaction at a time; selections cannot cross responses.
  • A finalized older response remains annotatable while a newer live turn runs; provisional response text cannot be targeted.
  • Zero annotations dispatch ordinary readable content, while one or more dispatch valid TOON with exact source-response context.
  • Attachments work for ordinary, overall, annotation, and image-only input under existing validation bounds.
  • Both input forms use Pi's ordinary steering behavior while busy and immediate delivery while idle.
  • An unannotated reply from an older response carries no hidden reference or marker.
  • Canonical targeting, Markdown rendering, annotation editor, attachment, delivery, and real-browser selection QA remain passing.

Blocked by

  • #9 — Integrate live and technical work into the stream

Human checkpoint note: Do not request routine per-ticket approval. The implementing agent may make the internal architecture, refactoring, testing, and UI-detail decisions needed to satisfy the acceptance criteria. Pause only if implementation requires a material product or ownership change, a destructive or hard-to-reverse action, excluded security or deployment scope, credentials or spending, or a real-browser design fork with no safe default. Forgejo completion updates may be batched with the rest of the completed frontier. The user performs final hub and Pi restart steps. Agents must not start, restart, replace, or stop the user-run Pilcrow development server.

## What to build Carry Pilcrow's normative finalized-response annotation interaction into the continuous session stream. Any finalized assistant response may become the one active annotation surface while other responses remain fully readable without permanent marginalia. Older responses remain annotatable while newer work is live; the provisional response is not annotatable. Use one input and submission flow. With zero annotations, send ordinary readable Pi user content. With one or more annotations, serialize the established structured TOON payload. Text and validated raster attachments work in either form. While Pi is working, both forms use the same ordinary steering behavior as Pi's TUI; do not expose delivery-mode or native queue controls. An unannotated reply entered while viewing an older response is an ordinary current message with no hidden source-response identity. Preserve canonical rendered-text targeting, one-response range containment, existing attachment validation, and submission authority safeguards. ## Acceptance criteria - [ ] Every finalized assistant entry can be selected as the active annotation surface without hiding other stream entries. - [ ] Only one response exposes active target bars, marginalia, and editor interaction at a time; selections cannot cross responses. - [ ] A finalized older response remains annotatable while a newer live turn runs; provisional response text cannot be targeted. - [ ] Zero annotations dispatch ordinary readable content, while one or more dispatch valid TOON with exact source-response context. - [ ] Attachments work for ordinary, overall, annotation, and image-only input under existing validation bounds. - [ ] Both input forms use Pi's ordinary steering behavior while busy and immediate delivery while idle. - [ ] An unannotated reply from an older response carries no hidden reference or marker. - [ ] Canonical targeting, Markdown rendering, annotation editor, attachment, delivery, and real-browser selection QA remain passing. ## Blocked by - #9 — Integrate live and technical work into the stream > **Human checkpoint note:** Do not request routine per-ticket approval. The implementing agent may make the internal architecture, refactoring, testing, and UI-detail decisions needed to satisfy the acceptance criteria. Pause only if implementation requires a material product or ownership change, a destructive or hard-to-reverse action, excluded security or deployment scope, credentials or spending, or a real-browser design fork with no safe default. Forgejo completion updates may be batched with the rest of the completed frontier. The user performs final hub and Pi restart steps. Agents must not start, restart, replace, or stop the user-run Pilcrow development server.
Author
Owner

Implemented in jj revision 9e1efee1 (feat(web): integrate annotations into finalized stream responses).

What changed:

  • Any finalized assistant entry in the connected session stream can become the one active annotation surface while every other entry remains readable. Provisional text has no annotation controls and selections cannot cross response boundaries.
  • Older finalized responses remain annotatable during newer live work. Stopped, disconnected, quarantined, and cold streams stay readable but do not expose undeliverable annotation controls.
  • The stream composer is the single submission path. Zero annotations dispatch ordinary readable Pi user content with no source marker/reference; one or more annotations dispatch the established TOON payload with exact response ID, renderer version, canonical authority, comments, overall reply, and attachments.
  • Busy ordinary and structured input both use Pi steering; idle input remains immediate. No delivery-mode or native queue controls were introduced.
  • Raster attachments work for ordinary, overall, annotation, and image-only input with aggregate count/byte/duplicate-ID validation across the current authoritative draft.
  • Ordinary→structured editing now performs an explicit ownership transfer into one authoritative visible composer draft. It preserves pre-existing response drafts, text/attachment edits, and separate drafts for multiple responses without rewinding already-submitted ordinary text.
  • Open annotation editors synchronously flush latest text and image-only attachments before response switching, key changes, branch revalidation, and unmount.
  • Branch changes revalidate parent selection/draft authority. Retained responses refresh their authority; removed responses close safely and clear stale delivery state after autosave.
  • Rendered capture keeps immutable canonical text separate from refreshable lookup authority. Live→historical, historical→live, token refresh/expiry, and branch changes cannot permanently poison a valid response capture.
  • Delivery cleanup is keyed by the exact submitted response/renderer/content rather than the currently selected response. Response switching is fenced during unresolved delivery; delayed success/indeterminate/retry cannot leave a sent draft, delete another response’s draft, or enable duplicate submission.
  • The embedded editor validates against current structured overall attachments, not a stale ordinary snapshot.

Audit and regression coverage:

  • Fresh review found editor loss on switching, stale branch annotation state, sticky capture authority, wrong-response delayed cleanup, split draft ownership/duplicate text, stale attachment aggregation, and disconnected annotation controls. All findings were fixed before closure.
  • Added text/image-only switch and unmount autosave, removed/retained branch selection, connected/disconnected controls, historical↔live/TTL authority refresh, delayed success/indeterminate/retry switching, two-response/zero-annotation ownership transfer, structured attachment 15+1/removal/duplicate/exact-byte boundaries, and image-only combinations.

Validation:

  • Supervisor focused verification passed: 7 files / 164 tests.
  • Full suite passed: 65 files / 549 tests.
  • TypeScript no-emit checks, hub build, production browser build, changed-file formatting, and git diff --check passed.
  • Existing-server Chrome QA verified active stream annotation, editor-open submission fencing, session switching, exact response-keyed autosave, canonical selection/editor/marginalia, cross-response clearing, and structured outgoing authority.
  • Whole-tree vp check remains blocked only by the unchanged pre-existing formatting issue in .dev/agents/triage-labels.md.

Protocol remains exact v9. Durable hub-owned draft/submission recovery is intentionally left to #11. No server was managed.

Implemented in jj revision `9e1efee1` (`feat(web): integrate annotations into finalized stream responses`). What changed: - Any finalized assistant entry in the connected session stream can become the one active annotation surface while every other entry remains readable. Provisional text has no annotation controls and selections cannot cross response boundaries. - Older finalized responses remain annotatable during newer live work. Stopped, disconnected, quarantined, and cold streams stay readable but do not expose undeliverable annotation controls. - The stream composer is the single submission path. Zero annotations dispatch ordinary readable Pi user content with no source marker/reference; one or more annotations dispatch the established TOON payload with exact response ID, renderer version, canonical authority, comments, overall reply, and attachments. - Busy ordinary and structured input both use Pi steering; idle input remains immediate. No delivery-mode or native queue controls were introduced. - Raster attachments work for ordinary, overall, annotation, and image-only input with aggregate count/byte/duplicate-ID validation across the current authoritative draft. - Ordinary→structured editing now performs an explicit ownership transfer into one authoritative visible composer draft. It preserves pre-existing response drafts, text/attachment edits, and separate drafts for multiple responses without rewinding already-submitted ordinary text. - Open annotation editors synchronously flush latest text and image-only attachments before response switching, key changes, branch revalidation, and unmount. - Branch changes revalidate parent selection/draft authority. Retained responses refresh their authority; removed responses close safely and clear stale delivery state after autosave. - Rendered capture keeps immutable canonical text separate from refreshable lookup authority. Live→historical, historical→live, token refresh/expiry, and branch changes cannot permanently poison a valid response capture. - Delivery cleanup is keyed by the exact submitted response/renderer/content rather than the currently selected response. Response switching is fenced during unresolved delivery; delayed success/indeterminate/retry cannot leave a sent draft, delete another response’s draft, or enable duplicate submission. - The embedded editor validates against current structured overall attachments, not a stale ordinary snapshot. Audit and regression coverage: - Fresh review found editor loss on switching, stale branch annotation state, sticky capture authority, wrong-response delayed cleanup, split draft ownership/duplicate text, stale attachment aggregation, and disconnected annotation controls. All findings were fixed before closure. - Added text/image-only switch and unmount autosave, removed/retained branch selection, connected/disconnected controls, historical↔live/TTL authority refresh, delayed success/indeterminate/retry switching, two-response/zero-annotation ownership transfer, structured attachment 15+1/removal/duplicate/exact-byte boundaries, and image-only combinations. Validation: - Supervisor focused verification passed: 7 files / 164 tests. - Full suite passed: 65 files / 549 tests. - TypeScript no-emit checks, hub build, production browser build, changed-file formatting, and `git diff --check` passed. - Existing-server Chrome QA verified active stream annotation, editor-open submission fencing, session switching, exact response-keyed autosave, canonical selection/editor/marginalia, cross-response clearing, and structured outgoing authority. - Whole-tree `vp check` remains blocked only by the unchanged pre-existing formatting issue in `.dev/agents/triage-labels.md`. Protocol remains exact v9. Durable hub-owned draft/submission recovery is intentionally left to #11. No server was managed.
dikka closed this issue 2026-08-29 03:35:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lab/pilcrow#10
No description provided.