Integrate live and technical work into the stream #9

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

What to build

Replace the separate temporary Live destination with the provisional newest entry of the continuous active-branch stream. A turn settles in place when durable Pi history appears. Final, interrupted, and failed outcomes retain available assistant content instead of disappearing or navigating to another page.

Render thinking passages, tool and bash work, visible Pi custom messages, and meaningful session boundaries in chronological context. Mirror Pi's visible-conversation intent: hide internal state, explicitly suppress known duplicate metadata such as timer records that have a better presentation, tailor important known types, and give unknown visible custom messages a safe bounded fallback.

Coalesce transport fragments and tool updates. After completion, technical work becomes one deterministic collapsed section by default; expansion shows the actual chronological details. Do not generate summaries, infer semantic phases, or create generic event cards. Follow latest operates only near the tail; deliberate upward scrolling suspends it and Jump to latest resumes it.

Acceptance criteria

  • A live Pi turn appears as the newest entry in the same session stream used for durable history.
  • Finalization reconciles the live entry with stable persisted identity without a Live-to-Responses navigation transition.
  • Interrupted and failed turns retain partial content and a clear terminal state.
  • Thinking, tools, bash, and visible custom messages appear in their actual chronological positions without raw fragment rows.
  • Hidden custom state stays hidden, known duplicate metadata is explicitly suppressed, and unknown visible messages render safely.
  • Completed technical work is one deterministic collapsed section whose expansion contains actual retained details and no generated summary.
  • Follow latest suspends on deliberate upward scroll, resumes through Jump to latest, and is unaffected by loading older pages.
  • Extension adapter, history normalization, hub integration, rendered stream, and follow behavior tests pass.

Blocked by

  • #6 — Read known sessions as paged active-branch streams

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 Replace the separate temporary Live destination with the provisional newest entry of the continuous active-branch stream. A turn settles in place when durable Pi history appears. Final, interrupted, and failed outcomes retain available assistant content instead of disappearing or navigating to another page. Render thinking passages, tool and bash work, visible Pi custom messages, and meaningful session boundaries in chronological context. Mirror Pi's visible-conversation intent: hide internal state, explicitly suppress known duplicate metadata such as timer records that have a better presentation, tailor important known types, and give unknown visible custom messages a safe bounded fallback. Coalesce transport fragments and tool updates. After completion, technical work becomes one deterministic collapsed section by default; expansion shows the actual chronological details. Do not generate summaries, infer semantic phases, or create generic event cards. Follow latest operates only near the tail; deliberate upward scrolling suspends it and Jump to latest resumes it. ## Acceptance criteria - [ ] A live Pi turn appears as the newest entry in the same session stream used for durable history. - [ ] Finalization reconciles the live entry with stable persisted identity without a Live-to-Responses navigation transition. - [ ] Interrupted and failed turns retain partial content and a clear terminal state. - [ ] Thinking, tools, bash, and visible custom messages appear in their actual chronological positions without raw fragment rows. - [ ] Hidden custom state stays hidden, known duplicate metadata is explicitly suppressed, and unknown visible messages render safely. - [ ] Completed technical work is one deterministic collapsed section whose expansion contains actual retained details and no generated summary. - [ ] Follow latest suspends on deliberate upward scroll, resumes through Jump to latest, and is unaffected by loading older pages. - [ ] Extension adapter, history normalization, hub integration, rendered stream, and follow behavior tests pass. ## Blocked by - #6 — Read known sessions as paged active-branch streams > **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 dbb0d5a7 (feat(stream): integrate live and technical work into session history).

What changed:

  • Replaced the separate temporary Live destination with a provisional newest entry in the continuous active-branch stream. Finalization reconciles to stable persisted Pi identity without navigation or duplication; interrupted/failed partial work remains visible.
  • Producer protocol moved atomically from v8 to exact v9. v9 carries bounded visible custom messages, coalesced tool/subagent state, authoritative assistant message_end boundaries, and distinct interrupted/failed terminal outcomes. v8/current-invalid shapes are rejected with bounded diagnostics while the hub remains healthy.
  • Live and persisted normalization share the same projection. Pre-tool/nonterminal assistant passages become chronological technical work; only terminal stop/length text becomes the canonical final answer, so settlement does not visibly rewrite the response.
  • Thinking, assistant passages, tools/bash, visible custom messages, and meaningful compaction/branch/model/thinking boundaries render chronologically. Internal/display:false custom state is hidden, timer duplicates are explicitly suppressed, known types have concise labels, and unknown visible types use bounded safe Markdown fallback.
  • Tool fragments and replacements are coalesced at the producer boundary. v9 has strict UTF-8 identity/content, event/entity/count, and aggregate-byte limits plus duplicate/orphan lifecycle validation; recorder, hub, SSE, and browser no longer replay an unbounded token event log.
  • Terminal technical work becomes exactly one deterministic collapsed section with actual retained chronology. Caps apply during iteration and overflow emits one explicit Technical detail limit reached boundary rather than silently dropping detail.
  • Persisted normalization yields and observes deadlines/cancellation between entries and inside block arrays.
  • Authoritative branch/history generation changes immediately clear stale provisional work, loaded pages, visits, response/capture authority, anchors, and annotation state. Transient disconnect retains state; final disconnect/owned exit persists a bounded interrupted projection until exact durable history reconciles it, without annotation authority.
  • History refresh restores by overlap/visible anchor rather than page count and applies a 240-entry/8 MiB browser window with an eight-request overlap cap.
  • Follow-latest stays active only near the tail; deliberate upward scrolling suspends it and Jump to latest resumes. Earlier-page loads preserve anchor/follow intent.
  • Embedded streams now use an accessible named section rather than nested main landmarks. Obsolete Live stage/return wording and state are replaced with Stream semantics that work for idle persisted sessions. The old LiveTranscript component was removed.

Audit and regression coverage:

  • Fresh review found live/persisted response divergence, unbounded quadratic v9 transport, stale old-branch content, lost interrupted work after reload, unbounded page retention, silent technical truncation, invalid landmarks, and obsolete Live return behavior. All findings were fixed before closure.
  • Added shared live→persisted equivalence, protocol limit/lifecycle/health, token/tool stress, session_tree/invalidation, disconnect/restart, shifted-page overlap/anchor/window cap, oversized block/cancellation/truncation, landmark, idle-stream return, interruption/failure/custom message, and follow/Jump tests.
  • Adapter/history/source/presentation/stream stress passed ten consecutive runs during implementation.

Validation:

  • Supervisor focused verification passed: 8 files / 141 tests.
  • Full suite passed: 65 files / 539 tests.
  • TypeScript no-emit checks, hub build, production browser build, changed-file formatting, and git diff --check passed.
  • Existing-server browser QA verified chronological thinking/tool/answer presentation, responsive layouts, suspended-follow Jump control/resume, and no console/runtime errors.
  • Whole-tree vp check remains blocked only by the unchanged pre-existing formatting issue in .dev/agents/triage-labels.md.

No generated summaries, semantic phase cards, branch UI, annotations for provisional text, Overview attention, model controls, or operative-management UI were added. No server was managed. Deploying this exact protocol requires: restart hub, reload/restart active Pi sessions, then reload browser pages.

Implemented in jj revision `dbb0d5a7` (`feat(stream): integrate live and technical work into session history`). What changed: - Replaced the separate temporary Live destination with a provisional newest entry in the continuous active-branch stream. Finalization reconciles to stable persisted Pi identity without navigation or duplication; interrupted/failed partial work remains visible. - Producer protocol moved atomically from v8 to exact v9. v9 carries bounded visible custom messages, coalesced tool/subagent state, authoritative assistant `message_end` boundaries, and distinct interrupted/failed terminal outcomes. v8/current-invalid shapes are rejected with bounded diagnostics while the hub remains healthy. - Live and persisted normalization share the same projection. Pre-tool/nonterminal assistant passages become chronological technical work; only terminal `stop`/`length` text becomes the canonical final answer, so settlement does not visibly rewrite the response. - Thinking, assistant passages, tools/bash, visible custom messages, and meaningful compaction/branch/model/thinking boundaries render chronologically. Internal/display:false custom state is hidden, timer duplicates are explicitly suppressed, known types have concise labels, and unknown visible types use bounded safe Markdown fallback. - Tool fragments and replacements are coalesced at the producer boundary. v9 has strict UTF-8 identity/content, event/entity/count, and aggregate-byte limits plus duplicate/orphan lifecycle validation; recorder, hub, SSE, and browser no longer replay an unbounded token event log. - Terminal technical work becomes exactly one deterministic collapsed section with actual retained chronology. Caps apply during iteration and overflow emits one explicit `Technical detail limit reached` boundary rather than silently dropping detail. - Persisted normalization yields and observes deadlines/cancellation between entries and inside block arrays. - Authoritative branch/history generation changes immediately clear stale provisional work, loaded pages, visits, response/capture authority, anchors, and annotation state. Transient disconnect retains state; final disconnect/owned exit persists a bounded interrupted projection until exact durable history reconciles it, without annotation authority. - History refresh restores by overlap/visible anchor rather than page count and applies a 240-entry/8 MiB browser window with an eight-request overlap cap. - Follow-latest stays active only near the tail; deliberate upward scrolling suspends it and Jump to latest resumes. Earlier-page loads preserve anchor/follow intent. - Embedded streams now use an accessible named section rather than nested main landmarks. Obsolete Live stage/return wording and state are replaced with Stream semantics that work for idle persisted sessions. The old LiveTranscript component was removed. Audit and regression coverage: - Fresh review found live/persisted response divergence, unbounded quadratic v9 transport, stale old-branch content, lost interrupted work after reload, unbounded page retention, silent technical truncation, invalid landmarks, and obsolete Live return behavior. All findings were fixed before closure. - Added shared live→persisted equivalence, protocol limit/lifecycle/health, token/tool stress, session_tree/invalidation, disconnect/restart, shifted-page overlap/anchor/window cap, oversized block/cancellation/truncation, landmark, idle-stream return, interruption/failure/custom message, and follow/Jump tests. - Adapter/history/source/presentation/stream stress passed ten consecutive runs during implementation. Validation: - Supervisor focused verification passed: 8 files / 141 tests. - Full suite passed: 65 files / 539 tests. - TypeScript no-emit checks, hub build, production browser build, changed-file formatting, and `git diff --check` passed. - Existing-server browser QA verified chronological thinking/tool/answer presentation, responsive layouts, suspended-follow Jump control/resume, and no console/runtime errors. - Whole-tree `vp check` remains blocked only by the unchanged pre-existing formatting issue in `.dev/agents/triage-labels.md`. No generated summaries, semantic phase cards, branch UI, annotations for provisional text, Overview attention, model controls, or operative-management UI were added. No server was managed. Deploying this exact protocol requires: restart hub, reload/restart active Pi sessions, then reload browser pages.
dikka closed this issue 2026-08-29 02:49:04 +00:00
Sign in to join this conversation.
No description provided.