Repository navigation
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. |
d71d68f to
670b64c
Compare
|
Codex review: blocked before merge. Reviewed October 7, 2026, 1:59 PM ET / 17:59 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR retains completed and in-flight session transcript previews across metadata edits while refreshing them when transcript or fallback-model inputs change. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, focused optimization with no blocking correctness finding. The earlier migration-proof blocker does not apply: the retained revisions are process-local and change no stored-data contract. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway’s session-row projection combines committed session metadata with background transcript reads. It supplies session lists and descriptions with previews and model facts without delaying foreground requests. flowchart TD
A[Session metadata publications] --> C[Resident session rows]
B[Transcript updates and repairs] --> C
C --> D[Compare transcript input revision]
D -->|Unchanged| E[Retain preview work]
D -->|Changed| F[Background transcript read]
E --> G[Session lists and descriptions]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +31, Tests +115, Docs +4. Total +150 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep transcript enrichment under the existing projection owner, retaining valid work across neutral edits and revoking it when its actual inputs or residency change. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the unnecessary enqueue and held-read invalidation path on fetched main, and the PR supplies a focused ten-edit regression with reported baseline failure. This review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes, retaining input revisions in the existing backfill owner is a focused solution, with explicit invalidation and cleanup rather than a competing cache or scheduling path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 24d311dcf66d. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Pull request was converted to draft
Keep backfill revisions tied to transcript watermarks and fallback inputs, preserving completed and in-flight work across unrelated metadata changes. Invalidate repaired transcript projections explicitly and release revisions with row residency. Cover metadata edit counts, held preview publication, and stored model changes through the resident projection and real session writers.
Pull request was converted to draft
a03bef4 to
206ed7e
Compare
…nclaw#166635) * perf(sessions): retain transcript previews across metadata edits Keep backfill revisions tied to transcript watermarks and fallback inputs, preserving completed and in-flight work across unrelated metadata changes. Invalidate repaired transcript projections explicitly and release revisions with row residency. Cover metadata edit counts, held preview publication, and stored model changes through the resident projection and real session writers. * fix(sessions): preserve backfills across readiness changes * test(gateway): stop awaiting metadata transcript backfills
What Problem This Solves
Renaming, pinning, or editing session metadata repeatedly queued transcript preview/fallback backfills and discarded valid reads already in flight. Ten metadata edits caused ten unnecessary backfills.
User Impact
Metadata edits retain the existing preview without another transcript read. Transcript appends/replacements, fallback-model changes, and completed transcript repairs still refresh the affected facts. No schema, stored-data, configuration, or update changes are required. The generated data-model compatibility checklist is inapplicable: “backfill” here enriches in-memory rows, and the new revisions exist only in a process-local Map. This matches ClawSweeper’s final-head technical assessment that no stored-data contract changes.
Why This Change Was Made
The existing backfill owner now retains the revision of its actual inputs: session generation, transcript watermark, and fallback-model facts. Materialization is the scheduling boundary. Transcript publications revoke that revision immediately, including during throttled refresh windows; archive eviction, removal, and disposal release it. Reconciliation publishes transcript scope because repaired indexes can become readable without changing their watermark.
Equal-revision publications still wake queued work after a failed readiness drain. Completed reads survive metadata changes between readiness settlement and consumption: they wait for materialization without rereading the transcript. The generic enqueue paths and archive materialization-object fence are removed.
Production LOC is +31 (80 added, 49 removed). Retaining the projection-specific revision and its lifecycle is necessary to reuse completed and in-flight reads while fencing stale transcript and fallback results.
Evidence
The metadata regression uses real session writes and resident projection reads. Negative controls reproduced the metadata count and in-flight rename defects, an omitted stored-model revision input, and both readiness failures in the earlier PR revision. Recovery coverage proves retained queued work resumes and completed fields survive the readiness handoff. Both final readiness cases pass in 3 ms and assert exactly two transcript reads for two rows.
Validation uses the authorized AWS Crabbox fallback after Blacksmith lease
tbx_01m4b3j0z2pdc9az6tykjwbm6nremained queued for 15 minutes. No local tests, builds, or typechecks ran.Final validation passed on head
206ed7e4c13c6018479b98aa87c5142f58d5baa0, AWScbx_6ddda4d2a7ec, runrun_4b148b4b2e2ab0de076af3e700bddd7b. The exact head and all 11 lane source hashes were checked before execution:pnpm test src/gateway/health/collector.session-row-projection.test.ts --maxWorkers=1: 2 passed, 39.96 s wrapper wall time; the previously timed-out case completed in 691 ms.pnpm test src/gateway/session-row-changes.gateway.test.ts --maxWorkers=1: 3 passed, 25.55 s wrapper wall time.node scripts/run-vitest.mjsover the seven other health files, backfill/foreground/projection siblings, and reconciliation lifecycle: 86 passed across 11 files, 95.55 s wrapper wall time.node scripts/check-changed.mjs --base d72a907b6125aef3ad98b709c533c8dec2f16c49 --head 206ed7e4c13c6018479b98aa87c5142f58d5baa0: passed, including core and all 27 test type graphs, lint, dead exports, storage/security guards, and zero runtime import cycles. The complete frozen-install/tests/gate command took 16m44s, excluding sync.Hosted CI passed on the final head: run 37664242038, 699 s elapsed wall time. The lead watcher squash-merged the PR as
e73b64b7f620e79844064a945447bbbb2a1f15d8; the merge is on current main and all 11 lane files match the validated head. All task leases are released.Earlier valid proof includes 335 tests across 47 files, followed by 42 final projection tests across three files and a passing full changed gate after the readiness correction. The latter gate included core and all 27 test type graphs, lint, dead exports, storage/security guards, and zero runtime import cycles; command time was 13m55s. Codex autoreviews are clean through P2 for the implementation, readiness corrections, and health fixture correction. All 11 lane files are byte-identical across the final rebase.
Single-worker test costs before the two small readiness cases were added: foreground 31.98 s wall time (metadata regression 601 ms), backfill 33.47 s, reconciliation lifecycle 54.21 s. The final three-file projection run took 68.23 s wrapper wall time. Harness/import and existing worker-lifecycle setup account for most of these costs.
CI on
a03bef4e38a8exposed an obsolete health/status fixture wait for metadata backfill (120 s timeout); this patch deletes that wait while preserving readiness, result, zero-SQL, and topology assertions. An audit of all 17 remaining backfill observers and relevant custom waits found no other obsolete waits. A second CI failure came from unchanged runtime-publication expectations; main fixed it ind0f181418b13. This branch rebases onto that fix and contains only its three lane commits, with no copied upstream fix.This is synthetic owner-boundary proof. Production CPU/RSS and end-to-end latency were not measured, and no Gateway deployment was performed.
Remote run ledger
All validation used the installed Crabbox CLI. Commands on each lease ran sequentially; no local tests, builds, or typechecks ran.
tbx_01m4b3j0z2pdc9az6tykjwbm6ncbx_fb9274b40051cbx_fb9274b40051cbx_e2151f0ab263cbx_8942fe1f2889cbx_8942fe1f2889cbx_b864eccbedfecbx_8e2b0d79342ccbx_8e2b0d79342cthis: voidwithout changing runtime behavior.cbx_8e2b0d79342ccbx_9eade5d481c0| AWS
cbx_9bb0b65512e6| Initial readiness-failure negative control; three projection files; lint; staged changed gate | Negative control failed as intended; 41 tests passed; lint and full gate passed (run_c9f450145c96763470027776f5bcdb78, 15m45s command time). || AWS
cbx_9bb0b65512e6| Final recovery proof attempt (run_85e3b0ef37f981a6a126d3b5949b354a) | Cancelled after sync finalization stopped progressing; workload did not start. Lease released. || AWS
cbx_a610e94fc08c| Recovery negative controls; three projection test files; focused lint (run_cd3d87ac972636ac36514d4e3f044af5) | Both controls failed as intended; 42 candidate tests passed. Lint required equivalent loop spelling; gate had not started. || AWS
cbx_a610e94fc08c| Final focused lint and staged changed gate (run_f16ab68572225e9b173bcac8122e8a48) | Passed, 13m55s command time; lease released. || AWS
cbx_ed83cd959be9| Health correction validation attempt (run_10d5ba0d5d07144d024584c1a1aa8209) | Cancelled during sync to incorporate main’s publication-test fix by rebase; no workload ran; lease released. || AWS
cbx_baf70db7941c| Rebased-head full-manifest attempt (run_a85cd3d39c2c6c97e4d1cf61dba6b839) | Cancelled during quiet full sync of the unpublished commit; no workload ran; lease released. Published the reviewed head as draft so the next lease can fetch it directly. || AWS
cbx_6ddda4d2a7ec| Frozen install; final health/publication tests; health/projection/reconciliation siblings; full PR changed gate (run_4b148b4b2e2ab0de076af3e700bddd7b) | 91 tests passed across 13 files; full gate passed, 16m44s combined command time; lease released. |