Repository navigation
Providers phase 2b: registry-owned transcript-entry mapping with kind routing + shadow comparison - #398
Merged
Conversation
…ting Kills the quadruplicated per-provider transcript mapping (#394 §4.5, §9): the codex quartet (marker / rolling turn cursor / rollout map / turn stamp / terminal clear) was copy-pasted across live ingest, initial history, and older pagination; the claude progress-unwrap + conversation/compact filter existed four times (those three plus the session preview). The copies had ALREADY drifted — the live claude path recorded pagination markers before its filter while the other sites recorded kept-only, and the live codex path cleared its turn cursor while pagination used a differently-seeded local. What changed: - New registry capability `createTranscriptEntryMapper()` (+ `extractProviderSessionId`) on RendererProviderCapabilities. The mapper interface lives in providerConfig.ts; implementations in @providers/{claude,codex}/renderer/transcript/mapper.ts. Codex's is stateful (rolling turn cursor with get/setTurnCursor so live ingest persists it across bursts); Claude's is stateless. - The misplaced provider parsers moved home (opportunistic cleanup): workspace/codex/{entries,rollout,rollout.test,eventCursor}.ts → providers/codex/renderer/transcript/; workspace/claude/history.ts → providers/claude/renderer/transcript/. Pure git renames + import updates; ~600 LOC of provider knowledge out of shell code. - Live ingest (useIpcSubscriptions) now routes by SESSION KIND, not per-line shape sniffing, with two safety nets: (1) bursts arriving before session meta exists fall back to the old shape sniff, so early codex session_meta lines aren't misrouted during restore races; (2) a shadow comparison counts lines where the legacy sniff disagrees with the kind route and reports them on the existing jsonl_entries feed-debug record (routeShadowMismatches + routeShadowSampleType). Nonzero means a #290-class foreign- transcript attach or discriminator drift — visible instead of silently rendering as someone else's conversation. - initialHistory / history / previewModel lose their forks entirely; sites keep their genuinely site-specific policies (dedupe, tool indexing, marker-update rules, prepend-vs-append). The codex optimistic-user + queuedMessages reconciliation stays live-site- local, now gated on routed kind instead of line shape. Deliberate behavior unifications (each commented in place): - Claude live marker policy is now kept-entries-only like the other sites (worst case: pagination re-reads a few filtered lines). - Filtered claude lines no longer enter the seen-uuid set (they were deduped before filtering; re-arriving filtered lines get filtered again). - pendingCompaction clearing on compact summaries now applies to both providers' mapped entries (was claude-branch-only; no-op for codex today). - Preview now stamps codex turn ids (harmless extra fields; it used the bare mapper before). Also fixed three negated-form literal-pair guards phase 1's pattern missed (initialHistory ×2, history ×1) and removed initialHistory's stale isCodexRolloutEntry import. Verified: tsc clean on both projects, electron-vite build clean, vitest 170/170 (rollout.test.ts moved with its module and still runs; the 1 failing suite is the pre-existing voice-dictation harness quirk). Part of #394. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #394 (phase 2b). Builds on #395/#397.
What
createTranscriptEntryMapper()+extractProviderSessionIdonRendererProviderCapabilities. Codex's mapper is stateful (the rolling turn cursor, withget/setTurnCursorso live ingest persists it across bursts); Claude's is stateless and carries the conversation/compact filter.routeShadowMismatches+ a sample type on the existingjsonl_entriesfeed-debug record. Nonzero = Claude JSONL transcript can disconnect while proxy/semantic stream stays live, breaking resume identity #290-class foreign-transcript attach or discriminator drift, now visible instead of rendering as someone else's conversation.workspace/{codex,claude}/→providers/{codex,claude}/renderer/transcript/, pure git renames, ~600 LOC); three negated-form literal-pair guards phase 1 missed; a stale import.Deliberate behavior unifications (each commented in place)
pendingCompactionclearing on compact summaries now applies to both providers' mapped entries (was claude-only; no-op for codex today).Verification
tsc --noEmitclean on both tsconfig projects (the real gate, per the phase-1 lesson)electron-vite buildclean (main + preload + renderer)vitest170/170 —rollout.test.tsmoved with its module and still runs🤖 Generated with Claude Code