Repository navigation
fix(sessions): preserve unrelated reads after lost category replies - #160656
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed October 1, 2026, 9:05 AM ET / 13:05 UTC (Revision 6). ClawSweeper reviewWhat this changesThe PR limits lost category-update acknowledgement fences to affected sessions and reconciles their facts through existing bounded database-worker reads. Merge readiness⛔ Needs changes before merge - 1 item remains This PR remains useful: current main still invalidates unrelated reads after an uncertain category update. No introduced correctness defect was found, and the earlier merge-conflict blocker is resolved. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway’s session-row projection turns committed SQLite facts into session lists, descriptions, and sharing checks. Category-update uncertainty must hold affected facts pending while allowing unrelated prepared reads to remain usable. flowchart TD
A[Category edit] --> B[Database worker commits]
B --> C{Reply outcome known?}
C -->|Yes| D[Publish committed facts]
C -->|No| E[Fence affected session facts]
E --> F[Bounded worker reconciliation]
F --> G[Session reads and sharing checks]
D --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +223, Tests +596. Total +819 across 15 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep category uncertainty local to captured keys, retain structural fallback and no replay, and let the existing worker-read owner restore current facts. Do we have a high-confidence way to reproduce the issue? Yes: hold A’s real worker reply, commit B’s category edit, inject a lost acknowledgement, and observe current main reject A’s reply through the broad revision fence. This review established the path from source and recorded evidence without executing it. Is this the best way to solve the issue? Yes: the patch narrows uncertainty at its producer and reuses the existing preparation owner, while preserving conservative structural fallback and affected-session fencing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9bf17b16a878. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
6eb0ad5 to
87428e5
Compare
Carry the category worker's captured key scope into resident row readiness after an uncertain acknowledgement. Keep affected authority pending, reconcile through bounded exact reads, and preserve conservative structural invalidation and no-replay semantics.
87428e5 to
0059b14
Compare
|
Merged via squash.
|
…penclaw#160656) Carry the category worker's captured key scope into resident row readiness after an uncertain acknowledgement. Keep affected authority pending, reconcile through bounded exact reads, and preserve conservative structural invalidation and no-replay semantics.
Fixes #160609
What Problem This Solves
A lost acknowledgement during a session-category edit makes unrelated sessions in the same store reread their rows.
User Impact
Unrelated exact reads can finish while the affected category is reconciled. Affected session authority stays pending until current worker facts arrive. No configuration, schema, protocol, migration, or operator action changes.
Why This Change Was Made
The category worker already captures every key it can change. Carry that category-only scope into resident-row readiness and reconcile through the existing bounded worker path. Keep the full committed-cache discard, no replay, and conservative store-wide fencing for superseded writes or structural uncertainty.
Rebased onto
1b896e6327f74f275d6fad7e0ef2d30de652a109, preserving main’s bounded list preparation and canonical selector. The review diff is 140 changed lines smaller (10.5%), retaining all seven original added cases and adding two archive-readiness controls; this reduces review churn, not production LOC. Production is +376/−153 (net +223) for category-uncertainty ownership, lifecycle-maintained readiness and bounded reconciliation; tests are +629/−33 (net +596). No second scheduler or read path. Release-note context stays here under the release-owned changelog policy.Evidence
0059b141fd424a19b1a5cb0d8bf9d64cfd211da4retains current main’s metadata-only worker acceptance, registry fences and list selection. Archive eviction retains unresolved metadata for the canonical preparation path; controls cover public search/full reads and metadata-only acceptance without host SQL or unrelated display work. P0–P2 integration review found this archive-readiness gap; the owner fix and focused follow-up review are complete. The final reader-factory relocation into its materialization owner removes the reported import cycle and was directly reviewed. Formatting and diff checks passed. Exact-head CI completed successfully at 2026-10-01 13:10:39 UTC: 51 successful jobs, 22 intentionally skipped jobs, zero failures. Actual named passes: category 4, worker-read 20, sharing-store 15, prepared-read 15 plus registry-refresh 2, and list-page 4: 60 passed, none skipped in these files. The architecture check passed. The exact-head ClawSweeper review found no correctness/security issue; its sole before-merge and rank-up request for current-path validation is satisfied by these receipts.Runtime proof and measured test cost
Current affected CI job walls, including setup and other assigned files: category 133s; worker-read 259s; sharing-store 316s; prepared-read/registry-refresh 272s; list-page 258s. These are job costs, not standalone file timings. All named shard-completion receipts reported zero failed invocations.
The complete pre-reduction head
9d8bc6aec973704d978d132c741a18018b9507f9passed 52/52 cases, zero skipped on 2026-10-01. The ClawSweeper durable review history records the 9d historical review cycle with no correctness/security issue; its cost follow-up was addressed by this single AWS run. These measurements remain bound to that historical head.Commands ran sequentially as
pnpm test <file> --maxWorkers=1 --reporter=verboseon Linux x64, AWS c7a.8xlarge, Node 24.19.0 / V8 13.6.233.17-node.51, pnpm 12.5.1 and Vitest 5.0.1. Every child exited/closed with code 0 and was joined.src/gateway/session-row-projection.category.test.tssrc/gateway/session-row-projection.worker-read.test.tssrc/gateway/session-row-projection.prepared-read.test.tssrc/config/sessions/session-sharing-store.worker.test.tsCommand wall includes worker preparation, imports, setup and teardown, not just assertions. Driver wall was 233.502s. Source carrier
017d7d4e19eeb3e4d03f1ec1eb31c8bb0c23ed68had the exact historical treec4353ec6bea48ea1c0d8b6b98613c51ba3845f58; before/after source guards passed. The sole AWS resource was released with provider cleanup confirmed. No baseline latency comparison is claimed.Whole-file costs exceed 30s because these tests exercise real worker/projection and SQLite lifecycles with normal preparation and imports. The 8,193-row case took 9.541s, above the 5s target: it crosses the real 8,192-row admission ceiling and checks bounded draining plus archive eviction. A cheaper layered equivalent remains a follow-up, not demonstrated replacement coverage.
Earlier head
662a2843909d0eb3bb256a374baebda33d88bd9cpassed 51 cases through scoped runs and its complete CI run. Its historical static validation combined a 26-graph pass with affected gateway-root/lint reruns after mechanical corrections.Historical 9d CI failed required lint; no waiver was taken. After the source refresh, 6eb CI completed successfully with 51 successful and 21 skipped jobs. That run predates the final integration with main’s bounded list preparation and does not replace final-head CI.
Release-tag reachability and production frequency of the lost-acknowledgement condition remain unestablished.