Repository navigation
fix(update): capture and seal original state on PostgreSQL families - #187217
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 acquires existing maintenance custody for PostgreSQL original-state capture and includes updater-owned writes in Doctor’s generation handoff. Example: An isolated PostgreSQL 17.11 installation runs openclaw update --yes --no-restart --channel dev.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it addresses two source-confirmed PostgreSQL recovery defects still present on current main, and no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe installed updater captures recovery originals before activation and passes database generations to candidate Doctor; existing backup providers produce snapshots, while receipts determine whether automatic restoration remains admissible. flowchart TD
A[Installed updater] --> B[Original recovery capture]
B --> C[Existing maintenance owner]
C --> D[Exact database backup providers]
D --> E[Sealed recovery manifest]
A --> F[Parent write observation]
F --> G[Doctor generation receipt]
Technical reviewBest possible solution: Use the existing maintenance owner and generation receipt lifecycle to complete PostgreSQL capture and attribution without weakening custody or untouched-database checks. Do we have a high-confidence way to reproduce the issue? Source confirms missing capture custody and the PostgreSQL observation skip, supported by the reporter’s concrete A/B trace; this read-only review did not execute the updater. Is this the best way to solve the issue? The patch repairs both gaps at their existing owners, preserves the custody refusal and sticky restoration checks, and adds no parallel capture implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5492aee09fb9. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +51, Tests 0, Docs +5. Total +56 across 4 files. Added test files: 0. View PR surface stats
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 Reviewed October 28, 2026, 11:31 PM ET / October 29, 2026, 03:31 UTC. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ed (#187367) 945f6dd (#187217) routed update engine selection through dry-run previews, so openclaw update --dry-run --json with an unparseable config exited 1 with 'configuration is invalid' instead of returning its best-effort preview. Malformed-config previews now reach the existing would-refuse notes without choosing a database backend or inspecting writable state; real updates and Doctor still refuse unsafe admission. Fixes #187333. Thanks @shakkernerd.
…penclaw#187217) On PostgreSQL families a successful update warned that the original-state capture was unavailable, refused automatic restoration because the database writer was unknown, and left the capture unsealed, while the same update on SQLite sealed it. The PostgreSQL capture now takes custody through the existing backup provider, the updater's own writes are attributed, and update status reads the PostgreSQL stores, so the capture seals and reports stale-success like SQLite. Fixes openclaw#187155. Thanks @etzelm.
…ed (openclaw#187367) fe72331 (openclaw#187217) routed update engine selection through dry-run previews, so openclaw update --dry-run --json with an unparseable config exited 1 with 'configuration is invalid' instead of returning its best-effort preview. Malformed-config previews now reach the existing would-refuse notes without choosing a database backend or inspecting writable state; real updates and Doctor still refuse unsafe admission. Fixes openclaw#187333. Thanks @shakkernerd.
What Problem This Solves
Fixes #187155: PostgreSQL updates can report original-state capture unavailable, classify their own database writes as an unknown writer, and leave recovery status unable to recognize a successful update.
User Impact
PostgreSQL originals are captured and sealed through the existing exact backup provider, updater writes are attributed, and status reads the configured engine to recognize successful captures as stale. The installed updater must contain this repair. No schema, configuration option, CLI option, or dependency changes.
Why This Change Was Made
Original capture supplied no maintenance custody; parent generation observation skipped PostgreSQL; status read its SQLite anchor instead of the PostgreSQL ledger. This reuses the existing custody and engine-selection owners. Unparseable configuration keeps recovery files visible with unreadable outcomes, and all status inspection remains bounded by its existing deadline. Foreign-write refusal and uncertain-child custody remain intact.
Thanks @etzelm for the same-build SQLite/PostgreSQL comparison.
Evidence
44ffd0a845b32480ffaf46ff6cfbcaa2267491c1. Public stale-success status fails with the pre-fix status reader after the capture repair. The final five-family PostgreSQL conformance cases pass, including public status with valid and malformed configuration.7f3f4f2b-af1f-49c5-9e1b-758d34d9da9esucceeds (20.735 s), seals four exact capsules, and public status reportsstale: its update already succeeded(2.170 s). SQLite run/capture5fc7c4e6-67fc-4f04-a686-fdad23604d31does the same (11.764 s / 3.649 s). Captured and live Workboard sentinels, both agents, and configured ports are retained. No capture-unavailable or unknown-writer warning.Cannot bridge inspect-Duxclsbo.js export findSystemGatewayServices(PG 272.070 s; SQLite 282.390 s). A supported clean package rebuild does not remove that failure. Candidate output contains the export but lacks source-origin region comments required byscripts/lib/update-compat-chunks.mts; CI environment causation is unproven. No compatibility guard/generated metadata was changed, and candidate activation is not claimed. Repeated already-current runs retain existing skipped/ambiguous semantics.check:changed/ SQLite inventory was skipped under the campaign's local gate budget. PR CI supplies broad proof.Live commands and local regression commands
Inside the task-owned container, separately for
ENGINE=postgresandENGINE=sqlite:PostgreSQL exact capsules retain 97 state tables, 39 tables for each agent, and 18 Workboard tables. Both captures retain six SQLite image/anchor entries.
Focused proof used repository wrappers with isolated HOME/state and distinct compiler caches:
node scripts/test-database-conformance.mjs --engine postgres --connection "$TASK_PG_DSN" -- src/infra/database-engine/update-preflight.conformance.test.ts --maxWorkers=1 node scripts/run-vitest.mjs src/cli/update-cli/status.deadline.test.ts --maxWorkers=1 node scripts/run-vitest.mjs src/flows/doctor-health.fleet-preflight.test.ts --maxWorkers=1