Skip to content

test(postgres): qualify remote acceptance crash windows - #197780

Merged
vincentkoc merged 1 commit into
mainfrom
test/postgres-remote-acceptance-windows-20261112
Nov 12, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
test/postgres-remote-acceptance-windows-20261112

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #197778

What Problem This Solves

PostgreSQL crash qualification covered a committed final-delivery receipt before queue ACK, leaving two earlier remote-acceptance windows unproven.

User Impact

No runtime behavior changes. Tests qualify accepted delivery before local receipt commit and accepted delivery followed by a lost HTTP response. SQLite/PostgreSQL schemas, schema versions, migrations, persisted formats, config and recovery policy remain unchanged.

Why This Change Was Made

Extend the existing whole-Gateway process fixture to three crash boundaries. Each case observes actual sink acceptance, independently reads PostgreSQL queue/session state, kills the original Gateway, and restarts through the existing recovery owner. The two uncertain cases must retain an unknown outcome and an owed notice without inventing a receipt or blindly resending. The original committed-receipt case must ACK without resending.

The notice remains owed because this fixture has no external notification route; it does not prove notice delivery. This is qualification of existing reconciliation/retry policy, not an exactly-once delivery claim. A shared test preload holds requests or committed replies at the appropriate worker boundary; production code is unchanged (production LOC delta 0; test/support delta +90).

Evidence

Reviewed head: 810d2ca57fd9ec72dcec2528b78f0dd5eeae79ea. Tested PR merge: 7fb8307465308893b3739f49235c98d921b3bccd, with ordered parents baca36ea403cf681b9ec531c5f27837d0586dcad and the reviewed head. Checkout logs and GitHub commit metadata confirm both.

Ready-PR CI 43245291815 completed successfully with no failed, cancelled or timed-out jobs. All three PostgreSQL 17 shards passed. PostgreSQL 16 passed the entire Gateway target (10 tests), including all three crash windows:

Crash window PG17 PG16
Receipt committed, ACK held Passed, 49.628s Passed, 49.591s
Sink accepted, receipt not committed Passed, 48.115s Passed, 48.497s
Sink accepted, HTTP response lost Passed, 48.328s Passed, 49.070s
  • Manual source-head build/artifact checks passed with matching checkout and built-runtime SHA. That run also passed all three PG17 shards, SQLite schema baseline, core/aggregate test-typechecks, Node 24 compatibility and security-fast.
  • Fresh local autoreview: scoped-clean, no actionable P0–P2 findings. Exact-head ClawSweeper review also has no findings. Its sole rank-up move, focused execution with matching checkout proof, is satisfied above; source has not changed since review.
  • Six generated preload variants parse; staged content/freshness guards, targeted qualified oxfmt and git diff --check pass. Production LOC delta 0; test/support net +90.
  • The broader manual qualification is not all green. Its separate failure surfaces are recorded below; root cause and inheritance remain unproven. This test-only PR does not claim to fix them. Ready-PR CI is the required landing gate.
  • The queued pre-PR Testbox allocation was stopped before payload execution and is not passing proof. This fixture records owed notice debt; it does not prove notice delivery, real Telegram acceptance, or exactly-once external delivery.
Broader manual qualification: unresolved follow-ups

All jobs below belong to manual run 43239842063. No failed case names either changed PostgreSQL test/support file. That establishes surface separation, not a causal or inherited-failure verdict. No all-green broad qualification claim is made.

Job Observed failure / follow-up
Native i18n Missing zh-CN native translations.
HTTP/plugin/WebSocket Unchanged event-loop-health test worker exits with SIGKILL; underlying cause unknown.
CLI hosted 5 Precomputed root-help guard rejects TLS import through one-shot-exit; fails in Node and Bun.
CLI hosted 6 Direct-stop/SIGUSR2 cleanup custody case reaches 60s timeout in Node; Bun passes.
Gateway isolated 2 Remote Control UI authority case gets Unix-socket listen EINVAL; Node fails, Bun passes.
Private QA 20 Update work-deadline finalize-explicit-expiry case throws doctor service-inspection deadline error; Node fails, Bun passes.
Private QA 5 Scheduled message-tool revocation case does not reach provider boundary; Node fails, Bun passes.
Core runtime/process Stall-flight-recorder futex sample expects process state S, observes R; Node fails, Bun passes.
UI real-Gateway E2E Cancelled; no passing proof.

@vincentkoc vincentkoc self-assigned this Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds PostgreSQL Gateway crash tests for remote acceptance before receipt commit and acceptance followed by a lost HTTP response.

Example: The HTTP sink accepts “Committed final result.” but its response is lost before the Gateway records a receipt.

  • Before: The PostgreSQL process suite does not qualify this crash window.
  • After: The added case requires restart recovery to preserve an unknown outcome and owed notice without a receipt or duplicate send.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The source supports a focused and coherent test extension, but completed runtime validation of the new cases is not yet available.
Proof confidence 🦪 silver shellfish (2/6) No separate shipped-behavior demonstration is required for this test-only change; the author reports parsing and static checks but no completed execution of the added PostgreSQL cases.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: PostgreSQL recovery lacks process-crash qualification when a remote destination accepts output before the local receipt exists.
Reason: The maintainer-authored direction explicitly requests these cases, and the patch preserves the existing recovery contract and original case.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a distinct qualification gap using the existing recovery fixture, with no concrete introduced defect found.

Priority: P3
Reviewed head: 810d2ca57fd9ec72dcec2528b78f0dd5eeae79ea

Before merge

None.

Findings

None.

Agent review details

How this fits together

The fixture seeds queued final output, starts real Gateway processes and database workers, sends through a synthetic HTTP channel, and independently inspects PostgreSQL state across SIGKILL and restart.

flowchart LR
  A[Seed final output] --> B[Gateway process]
  B --> C[Database workers]
  C --> D[PostgreSQL state]
  B --> E[HTTP acceptance sink]
  F[Crash boundary preload] --> B
  B --> G[Restart recovery]
  G --> D
Loading

Technical review

Best possible solution:

Complete the three-window qualification in the existing process fixture while preserving production recovery policy and independent state assertions.

Do we have a high-confidence way to reproduce the issue?

This is a coverage-gap task rather than a runtime bug report; source confirms the missing acceptance windows, and no target code was executed during this read-only review.

Is this the best way to solve the issue?

Extending the existing process fixture is the smallest complete approach: each new case protects a distinct acceptance boundary without introducing a competing recovery owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 925d17a2e35e.

Provenance checked

  • Receipt-before-ACK process qualification keeps the original intent (9d770ec: Qualify recovery after a committed final-delivery receipt while ACK is held, using real Gateway processes and independent PostgreSQL reads.)
  • Coherent Gateway and worker clock keeps the original intent (a14127f: Keep the PostgreSQL crash fixture clock coherent across worker threads after ownership-lock observation changes.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

PR surface

Tests +90. Total +90 across 2 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 151 61 +90
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 151 61 +90

Preflight source

Source 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

Metric Value Why it matters
Production versus test growth Production +0; test/support net +90 lines The added coverage protects two distinct crash boundaries while sharing the existing process setup and preload.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #197778
Summary: This PR implements the canonical qualification request and extends a merged predecessor covering a later crash boundary.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P3: This is focused test qualification without a demonstrated production defect or changed runtime behavior.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is focused test qualification without a demonstrated production defect or changed runtime behavior.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete focused PostgreSQL execution of all three crash windows and verify the tested checkout matches the reviewed head.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 12, 2026, 9:57 AM ET / 14:57 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 12, 2026 15:12
@vincentkoc
vincentkoc enabled auto-merge (squash) November 12, 2026 15:17
@vincentkoc
vincentkoc merged commit bbed5e9 into main Nov 12, 2026
228 of 229 checks passed
@vincentkoc
vincentkoc deleted the test/postgres-remote-acceptance-windows-20261112 branch November 12, 2026 15:41
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL qualification: remote acceptance before local receipt

1 participant