Repository navigation
test(postgres): cover pending-final receipts after ACK reply loss - #196111
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 maintainer review before merge. What this changesThis PR adds conformance coverage for pending-final receipts surviving a committed queue acknowledgement whose worker response is lost. Example: A synthetic Matrix send returns message ID accepted-final, then the queue ACK response is lost.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR adds distinct recovery coverage, and the pinned diff has no actionable findings. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherOutbound delivery persists platform evidence in the agent session store before acknowledging queue custody in the state store; recovery consumes the remaining durable queue state. flowchart TD
A[Pending final marker] --> B[Outbound delivery]
B --> C[Synthetic Matrix transport]
C --> D[Agent session receipt]
D --> E[State queue acknowledgement]
E --> F[Worker response loss and reopen]
F --> G[Recovery without another send]
Technical reviewBest possible solution: Retain the focused conformance scenario using the existing delivery, engine, and worker-loss owners. Do we have a high-confidence way to reproduce the issue? No production defect is claimed; source inspection verifies the injected worker-response-loss path, and this read-only review executed no target code. Is this the best way to solve the issue? The test protects receipt-before-ACK ordering and durable receipt retention through existing production owners without adding runtime hooks or duplicating the generic planner case. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 65b12c3500dd. TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +132, Other +3. Total +135 across 2 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 9, 2026, 12:02 PM ET / 17:02 UTC (Revision 2). |
|
@clawsweeper re-review Please review head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…enclaw#196111) * test(postgres): preserve pending-final receipts after ACK reply loss * test(postgres): keep fixture inspection synchronous
Related: #195955
What Problem This Solves
PostgreSQL qualification lacked proof that a pending-final delivery receipt survives loss of the queue acknowledgement response after the acknowledgement actually commits.
User Impact
No user-visible behavior change. This adds regression coverage; SQLite schema versions, database schemas, recovery formats, configuration, and delivery policies are unchanged.
Why This Change Was Made
The test composes existing delivery, worker-loss, and engine fixtures. It sends once through a synthetic Matrix transport, holds a real successful queue ACK response, terminates that worker, and reopens both stores. It checks the original session, intent, delivery identity and platform receipt, the removed queue row, and two recovery passes without another send. Both physical connection types are asserted.
The existing conformance inventory discovers this file automatically. The redundant concrete-filename planner row was removed after ClawSweeper review; the existing generic database-engine admission case already covers that rule.
Fixture setup uses the canonical agent database path. Only synchronous native inspection is admitted; asynchronous seeding, delivery, and recovery retain the production worker boundary. No production hooks or admission exceptions were added.
Evidence
Candidate:
9587ae8753b18afc4addd5acc16a3beb0b85f814, base:abf7150adb2c029912c2a78fd652a21cc18e4a99. Executed test bytes were compared with the committed candidate.--list: new target discovered exactly once.git diff --check: passed.The initial PG executions exposed two fixture-only synchronous reads; both were repaired without weakening the main-thread guard. No production delivery defect is claimed.
This covers committed ACK response loss at the actual worker boundary. Full Gateway process termination after remote platform acceptance remains separate follow-up proof.