Repository navigation
Recover session reliability regressions without merging PR #1360 #1465
Description
Recover session reliability regressions without merging PR #1360
Important
Problem — Current session behavior has independent live-update, responsiveness, fleet-attachment, and release-integrity failures. PR #1360 contains useful performance work but is conflicting, fails its bundle gate, and breaks the current Files Changed cache contract.
Approach — Recover verified behavior through four small current-main slices, each with a production-path regression test. Treat PR #1360 as a source of evidence, never as a merge vehicle.
Approaches considered — Merge #1360 then hotfix was rejected because it combines conflicting provenance, cache, manifest, and hub-serving changes. A performance-only repair was rejected because it leaves active live-update and release failures. Deferring all fleet work was rejected because attachment switching is unsafe today.
Scope — In: Files Changed invalidation, session-performance salvage, attachment cursor compatibility, CI known-fix enforcement. Out: retention policy, Fleet v2 composite cursors and tab provenance, hub-serving ownership.
Assumptions — PR #1360 remains held. Fleet v2 remains the durable owner for multi-peer cursor and tab-provenance design.
Acceptance Criteria
- A production
message.part.updatedevent for a completed child file-edit invalidates the viewed parent’s Files Changed query before that parent receives its idle status event. - The shared
ServerSessionreducer owns the initialized diff-version record, increments it for a completed filediff on the child and every recorded task-spawn ancestor, and directory-scoped consumers read that same record. - Evicting a session deletes every field the cache contract owns, including diff version, without accessing an absent record.
- Mirror writes schedule at most one full-store prune per scope per minute; a mirror hydration begun after a streaming save can acquire its read transaction without waiting for a second prune.
- A bulk warm runs at most three session chains concurrently per server and a foreground load can start while a bulk warm is in progress.
- When successful attachment changes the observed attachment identity, the active global event stream is aborted, its persisted cursor is removed, and its replacement subscription contains no predecessor cursor. An action that leaves the observed identity unchanged does none of those things.
- A CI-packaging run with the recorded chore: fix pre-existing main breakages blocking clean overlay composition (#821) #832 diff-version hunk removed fails before artifact staging, while a run with all known-fixed hunks intact retains advisory treatment for branch divergence.
- Every recovery slice that changes overlay sources registers them in bundle provenance and passes the app-bundle gate.
Testing Decisions
- Extend the real server-event integration path for Files Changed; reducer-only coverage is insufficient.
- Extend cache-eviction coverage with the complete shared session-state shape.
- Use a controlled IndexedDB harness to count prune scheduling and prove hydration can read during streaming saves.
- Use a controlled six-request pool to assert three-or-fewer warm chains and foreground admission.
- Exercise attachment identity, storage, stream abort, and the next global event subscription together.
- Exercise CI packaging end to end with the chore: fix pre-existing main breakages blocking clean overlay composition (#821) #832 fixture removed; pure preflight-helper coverage is insufficient.
- Run each slice’s affected package suite and the app-bundle gate; run the session-performance and Files Changed suites again after the eventual fix(app): the switch-latency arc — mount, mirror, warm, probes + snapshot-first boot (#1306) #1360 rebase.
Key Decisions
- Re-land only the lazy-prune behavior from commit
8296e7caand the three-worker warm behavior from commit57815658, both against currentmainwith fresh tests. - The parent decomposes into four slices in this order: Files Changed cache and event ownership; session responsiveness; attachment cursor compatibility; CI known-fix enforcement. The first slice must land before PR fix(app): the switch-latency arc — mount, mirror, warm, probes + snapshot-first boot (#1306) #1360 is reconsidered; all slices must land before its rebase review.
- Fleet v2 owns per-peer cursor sets, owner-verified tab resolution, and unresolved-tab presentation. The recovery does not modify session-tab rebasing.
- The retention classifier is a separate product-policy issue.
Data Contracts
ServerSessionowns the diff-version record and the task-spawn ancestry needed to mutate it. Directory-scoped state is a reader, not a second owner.- The compatibility cursor remains a single-origin cursor valid only for the current attachment epoch. The recovery invalidates it on an effective attachment change; Fleet v2 replaces it with per-peer cursor state.
Constraints & Invariants
- Do not merge or broad-cherry-pick PR fix(app): the switch-latency arc — mount, mirror, warm, probes + snapshot-first boot (#1306) #1360.
- Do not bypass overlay provenance or the bundle gate.
- Do not remove a state field without updating all consumers.
- Do not duplicate Fleet v2’s durable data-plane design in a compatibility patch.
- Do not change automatic retention behavior in this recovery.
Prior Art
- PR fix(app): the switch-latency arc — mount, mirror, warm, probes + snapshot-first boot (#1306) #1360 and commits
8296e7caand57815658for the measured performance repairs. - The existing Files Changed lineage and event-routing tests.
- Fleet Studio’s proposed SSE fan-out decision record.
- The chore: fix pre-existing main breakages blocking clean overlay composition (#821) #832 cache-shape and Sync-reconciliation: the fork→overlay sync clobbers amicode-side fixes (#929's fix regressed by ff7b69c8; the diff_version fix owes a fork mirror) #964 known-fix contracts.
Source
- Blocks merge of PR fix(app): the switch-latency arc — mount, mirror, warm, probes + snapshot-first boot (#1306) #1360.
- Fleet v2 owns the follow-up for multi-peer cursors and tab provenance.
- Retention-policy behavior is tracked separately.
Activity
aarontrowbridge commentedon Oct 29, 2026
Closing as done in the 0.4.0 backlog sweep (2026-10-29), checked against lane/0.4.0.\n\nEvidence: PR #1472 (12d03e3) merged; children #1466/#1467/#1469 closed; #1468 landed 4d71d5a\n\nReopen if this is wrong.