Skip to content

perf(remote): release unviewed transcripts and trim live windows - #814

Merged
Juliusolsson05 merged 3 commits into
mainfrom
fix/remote-transcript-retention
Sep 7, 2026
Merged

Juliusolsson05 merged 3 commits into
mainfrom
fix/remote-transcript-retention

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented Sep 5, 2026 •

Copy link
Copy Markdown
Owner

The phone previously accumulated every live transcript even on the session list. Transcript ownership now follows actual view subscriptions: unviewed JSONL/semantic bodies are not mapped or retained, and leaving the last view releases entries, tool indexes, mapper/fold state and identity sets. Selecting the session again backfills durable history and rejects stale pending responses.

Fixes #805
Refs #813

Acceptance criteria

  • Several unviewed sessions retain zero transcript entries, tool indexes, seen UUIDs and semantic bodies; metadata remains available.
  • Last-unsubscribe, reselect, rolled file identity, stale requests and session removal have behavioral coverage. Partial semantic suffixes wait for a fresh turn; committed content remains authoritative.
  • Viewed live windows reuse the desktop pure count/estimated-byte trim planner (2,000 entries / 32 MiB triggers; 1,500 / 24 MiB targets), preserving semantic owners and tool pairs. Remote bookkeeping does not use desktop global registries.
  • Indexes rebuild from retained entries in chronological order. Trimmed identities suppress old live replays but allow older pages to reload them in order.
  • Exact history offsets survive trimming and all-duplicate pages; raw-record fan-out is not split. Paging/grace protects recently requested older content. Total entry count remains independent of the retained window.

Validation and reproducible evidence

  • 137 local tests / 14 files pass: all remote transport/store tests plus shared entry/trim tests. Ten new retention regressions exercise real Claude, Codex and OpenCode mappers and semantic folds.
  • The unviewed regression fails on parent fix(remote): bound outgoing queues and recover after overflow #813 with 4,096 retained entries. Fixed: three synthetic sessions each receiving 4,096 entries / 32 MiB logical ASCII text retain zero entries, indexes and UUIDs. These are collection/payload measurements, not production heap savings.
  • A 2,100-entry live burst retains 1,500 entries with matching indexes; 300 entries of 128 KiB each trigger byte trimming below the count threshold. Tests verify replay suppression, chronological reload, tool pairs, semantic owners and exact cursor offsets.
  • Typecheck, test contract, client production build and diff check pass. Full applicable repository checks passed against the updated main base. Existing bundle size/mixed import warnings remain.

Limits and tradeoffs

Safety constraints (active/history semantic ownership, tool pairs, missing stable identity/anchor and whole raw records) can pin a viewed window above its nominal target. Older-history reading has a 30-second trim grace. Small UUID-only tombstone sets grow during a continuously viewed session to preserve exact replay deduplication; all are released when that view ends. Live wire entries lack byte offsets and retain provider-marker fallback; history pages use exact offsets when supplied. Re-selection costs a backfill and an interrupted live turn may wait for durable completion. Mobile heap/FPS gains remain unmeasured.

Plan committed before code: docs/superpowers/plans/2026-09-05-remote-transcript-retention.md.

Dependency #813 is merged. This PR now targets main bb84772a; range-diff confirms its implementation patches are unchanged after rebase. Current head: c4f175f0. Fresh CI passed before merge. The user authorized merging once current checks pass on 2026-09-07. The parser source alias remains included; the clean-build failure was reproduced and corrected against an unbuilt parser checkout.

Merged with explicit user authorization on 2026-09-07 as 13258ffa after both current-head CI gates passed. No outstanding review feedback. The resolving issue is closed.

Make view subscriptions own transcript bodies, mapper state and replay identities. Reuse the pure desktop trim policy while preserving tool pairs, semantic owners and exact history offsets; rebuild indexes and retain identity-only tombstones for safe replay and pagination.

Refs #805
A clean checkout has no parser dist directory. The shared live-window planner introduced a runtime ghost-helper import, so mirror the desktop source alias rather than relying on a warmed workspace package build.

Refs #805
@Juliusolsson05
Juliusolsson05 force-pushed the fix/remote-transcript-retention branch from 6230658 to c4f175f Compare September 7, 2026 17:04
@Juliusolsson05
Juliusolsson05 merged commit 13258ff into main Sep 7, 2026
2 checks passed
@Juliusolsson05
Juliusolsson05 deleted the fix/remote-transcript-retention branch September 7, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(remote): bound live transcript retention for unviewed sessions

1 participant