Skip to content

fix(infra): keep PostgreSQL owner acquisition used by production - #198270

Merged
roboclaw-bot merged 1 commit into
mainfrom
roboclaw/main-ci-postgres-custody
Nov 13, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
roboclaw/main-ci-postgres-custody

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

check-dependencies fails on main (run https://github.com/openclaw/openclaw/actions/runs/43425732822, job 131887281463): the production dead-export scan reports acquireConfiguredGatewayPostgresOwner in src/infra/gateway-postgres-owner.ts, added by #196237. Production only calls it from inside the same module (via createGatewayPostgresCustody); its only external importers are two PostgreSQL test suites, so it can't simply become private.

User Impact

None at runtime; module boundary only.

Why This Change Was Made

The unchanged 30-line custody adapter moves to its own module, src/infra/gateway-postgres-custody.ts, which imports the acquisition helper normally; gateway-lock.ts imports the adapter from the new module. The helper now has a real production importer and keeps its test consumers. No allowlist or baseline change.

Evidence

  • Saved failing log shows exactly this one finding in both Knip and the production export scan.
  • No open PR touches the symbol or file.
  • Syntax, pinned formatting and oxlint on touched files and independent Codex autoreview (P0–P2) pass. The full dependency scan is left to PR CI and the next scheduled main run.

Worked on by

Work sessions

Linked for team reference; these sessions aren’t public.

Move the unchanged custody adapter to its own module so the configured
PostgreSQL acquisition API has a real production consumer. Preserve its
existing failure-boundary tests and avoid deadcode allowlist changes.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 13, 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.

@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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves the existing PostgreSQL custody adapter into a separate module so owner acquisition has an external production consumer.

Example: The production export scan examines acquireConfiguredGatewayPostgresOwner.

  • Before: Its production caller is inside the defining module, while external consumers are tests.
  • After: gateway-postgres-custody.ts imports and calls it through the production Gateway lock path.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source change is focused and correct on inspection; the failed head lint check remains unattributed and the full dependency scan's success is not established.
Proof confidence 🦐 gold shrimp (3/6) This is a module-boundary refactor with unchanged runtime logic, so shipped-entry-point proof is not required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Repository dependency checks reject an acquisition export that is exercised by production only within its defining module.
Reason: The maintainer-authored direction repairs a concrete CI failure without exceptions, new policy, or runtime changes.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a coherent, behavior-preserving repair to the production import graph; no introduced correctness defect was found, but head CI remains unresolved.

Priority: P2
Reviewed head: b5b38080d3852489c6203ab94de998f7021ae14d

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway lock acquisition composes local process custody with optional PostgreSQL session ownership, forwarding session loss into the existing owner signal and releasing the session when physical custody ends.

flowchart LR
  A[Gateway and offline CLI] --> B[Gateway lock]
  B --> C[PostgreSQL custody adapter]
  C --> D[Configured owner acquisition]
  D --> E[PostgreSQL advisory lock]
  C --> F[Process owner loss signal]
Loading

Technical review

Best possible solution:

Retain the unchanged custody adapter at its new module boundary and complete attribution of the failed head check before landing.

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

Source confirms that main's acquisition export has only an in-module production caller and external test consumers; GitHub annotations confirm the reported dead-code gates failed, but no local scan was run.

Is this the best way to solve the issue?

The relocation is a focused solution: it gives the existing acquisition owner a real production importer while preserving its failure-boundary tests, lifecycle semantics, and strict export policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 439a9c3552da.

Provenance checked

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Mitchell Etzel: Raw commit c886f82 adds src/infra/gateway-lock.ts:500 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c886f82c7793; files: src/infra/gateway-lock.ts)

PR surface

Source +4. Total +4 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 36 32 +4
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 36 32 +4

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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Repairs a concrete dependency-hygiene failure on main without changing runtime behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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.

  • Inspect the failed head lint job's full diagnostics and establish whether it is patch-caused or inherited.

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 13, 2026, 8:20 AM ET / 13:20 UTC.

@roboclaw-bot
roboclaw-bot merged commit 2203cf9 into main Nov 13, 2026
143 of 146 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/main-ci-postgres-custody branch November 13, 2026 14:09
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…law#198270)

Move the unchanged custody adapter to its own module so the configured
PostgreSQL acquisition API has a real production consumer. Preserve its
existing failure-boundary tests and avoid deadcode allowlist changes.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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.

1 participant