Skip to content

improve(doctor): stop copying each database twice to classify its engine - #197277

Merged
steipete merged 3 commits into
mainfrom
codex/doctor-engine-probe-reuse
Nov 11, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/doctor-engine-probe-reuse

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: openclaw doctor reads the agent database about 20 times its size, partly because the Doctor's pre-repair capture copies each database twice just to learn which engine it uses.

User Impact

User impact: standalone openclaw doctor and openclaw doctor --fix, including the manual npm update procedure, read and copy less data on large installs. On a 422 MB agent database, plain Doctor reads 19% less from that database and finishes about 9% faster. No behavior or output changes.

Why This Change Was Made

During a maintenance-owned original-state capture, the Doctor parent classifies every source's engine (SQLite or a PostgreSQL anchor) before it starts the backup worker. Each classification is an artifact-preserving probe that copies and then compares the whole source in a child process. The backup worker then classified the same sources again with the same full-copy probe. The parent now passes its classification to the worker, which reuses it and probes only sources the parent did not classify. A spelling mismatch falls back to the old probe. PostgreSQL admission checks and the worker's own observations are unchanged.

To stay within the 700-line lint budget for update-database-backup.ts, the sidecar lstat fence now uses .catch(ignoreMissingPath). Only sidecar ENOENT is ignored, as before.

Refs: daily update-reliability sweep follow-up to G65's Doctor read measurement; no tracking issue.

Evidence

  • Regression test classifies maintenance-owned sources once for the backup worker (src/infra/update-database-backup.test.ts): red on base (the worker receives no classification), green with the fix. All 316 tests in the backup and database-engine suites pass on Crabbox AWS. tsgo:core, oxfmt, oxlint and the test-line ratchet are clean.
  • Native measurement on Crabbox AWS (c7a.4xlarge, Linux). Setup: a published 2026.11.2 install with a seeded 422 MB agent database, then the main package with and without this change, built from the same base ac7e941722a. Agent-database bytes were counted with strace across Doctor and all its children.
Run Base reads Fix reads Base time Fix time
doctor (retained capture present) 8,481 MiB 6,869 MiB 100.7 s 92.1 s
doctor --fix (first run, no retained capture) 8,485 MiB 7,679 MiB 107.5 s 103.9 s

Engine probes per plain Doctor run drop from 4 to 2: one in the reuse comparison and one in the fresh capture, each now probed only by the parent.

Remaining read amplification (follow-ups, not in this PR)

After this change, plain Doctor still reads about 16 times the agent database size:

  • Every read-only snapshot child copies the source, then compares it byte for byte with the copy to detect a concurrent change (sourceMatchesCopy). That doubles every child and accounts for about 47% of reads. A cheaper proof under maintenance custody, where no writer exists, would be a snapshot-owner design change.
  • The standalone reuse comparison makes a full private copy of each database, then discards it whenever a fresh capture follows.
  • The parent probes engines again in the fresh capture after the comparison already classified the same unchanged files in the same maintenance scope.
  • doctor --fix opens six separate full-copy session readers (archive preparation, database preflight, migrations, Database engines, SQLite database size). None of them share a private image.

Update-driven Doctor runs skip "Preserve original state" when an update recovery capture is already retained, so these mostly affect standalone Doctor and the manual npm procedure.

Maintenance-owned Doctor captures classified every database engine in the
parent, then the backup worker classified the same sources again. Each
artifact-preserving engine probe copies and hashes the whole source, so a
standalone `openclaw doctor` read a 422 MB agent database four extra times
just to learn it is SQLite.

The parent now hands its classification to the worker, which reuses it
instead of probing. On a 422 MB agent database, plain Doctor agent-DB reads
drop from 8,481 MiB to 6,869 MiB and `doctor --fix` from 11,711 MiB to
10,100 MiB.
Covers the 29 added test lines plus 21 lines of inherited base debt, which the test-line ratchet allows an exact grant to reconcile.
@clawsweeper

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

@steipete steipete changed the title perf(doctor): stop copying each database twice to classify its engine improve(doctor): stop copying each database twice to classify its engine Nov 11, 2026
@steipete
steipete marked this pull request as ready for review November 11, 2026 15:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T16:36:05.543744Z 3c0768b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete enabled auto-merge (squash) November 11, 2026 16:02
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR passes the maintenance parent's database-engine classifications to the backup worker to avoid repeating full-copy probes.

Example: Run plain Doctor with a seeded 422 MB agent database and a retained capture.

  • Before: The supplied measurement records 8,481 MiB read from the agent database.
  • After: The supplied measurement records 6,869 MiB read, with engine probes reduced from four to two.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Recorded native CLI measurements support the optimization, but the added test has a concrete type error and exact-head CI is not green.
Proof confidence 🐚 platinum hermit (4/6) The maintainer-authored PR is outside the ordinary contributor proof gate; its body records real Linux Doctor runs exercising maintenance capture and reduced database reads, although raw strace output and a latest-stable upgrade run are not supplied.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Standalone Doctor reads and copies large databases repeatedly before repair, increasing disk work and completion time.
Reason: The maintainer-authored direction removes demonstrated duplicate work without changing configuration, output, snapshot ownership, or recovery formats; broader amplification is explicitly outside this PR.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this PR removes measurable redundant Doctor work, but its added regression test contains a type error that needs repair.

Priority: P2
Reviewed head: bf8caf4b7589af71d7ea49c65206b3f67815c15d

Before merge

  • [P2] Preserve the engine map's type in the regression test (P2) - The worker launcher's input is declared as Record<string, unknown>, so reading input.sourceEngines through worker.mock.calls produces an unknown value. Checking input.mode and asserting that Object.keys is nonempty do not narrow that value to Readonly<Record<string, BackupEngine>>. Passing engines here therefore introduces a TypeScript assignment error when this test is typechecked. Retain the actual classification through a typed readBackupEngines spy result and use that map for the capture, while separately asserting the worker handoff; avoid casting the untyped payload.

Findings

  • [P2] [P2] Preserve the engine map's type in the regression test — src/infra/update-database-backup.test.ts:397

Tests

  • Missing end-to-end proof: The supplied native setup starts at 2026.11.2; it does not establish an upgrade from latest stable v2026.11.3 with settings and data intact.
Agent review details

How this fits together

Doctor's maintenance capture discovers database files, classifies their engines, and launches an isolated backup worker that produces verified recovery snapshots.

flowchart LR
  A[Doctor maintenance capture] --> B[Discover database paths]
  B --> C[Parent engine classification]
  C --> D[Isolated backup worker]
  D --> E[Verified recovery snapshots]
  D --> F[Probe unclassified sources]
Loading

Technical review

Best possible solution:

Keep the existing classification handoff and repair the regression test by retaining its engine map through the typed producer.

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

Current-main source independently classifies maintenance-owned sources in the parent and worker; the PR also records matched native CLI measurements, but no target code was executed during this review.

Is this the best way to solve the issue?

Reusing the existing parent's classification is a small, appropriate fix: canonical paths match the worker inventory, fresh worker observations take precedence, and unclassified sources retain their existing probe.

Full review comments:

  • [P2] [P2] Preserve the engine map's type in the regression test — src/infra/update-database-backup.test.ts:397
    The worker launcher's input is declared as Record<string, unknown>, so reading input.sourceEngines through worker.mock.calls produces an unknown value. Checking input.mode and asserting that Object.keys is nonempty do not narrow that value to Readonly<Record<string, BackupEngine>>. Passing engines here therefore introduces a TypeScript assignment error when this test is typechecked. Retain the actual classification through a typed readBackupEngines spy result and use that map for the capture, while separately asserting the worker handoff; avoid casting the untyped payload.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Parent maintenance classification keeps the original intent (954a610: Ordinary update callers did not consume engine classification, while maintenance admission still needed PostgreSQL detection.)
  • Worker engine observations keeps the original intent (c73495d: Reuse classification already obtained from generation images instead of reacquiring sources.)
  • Artifact-preserving physical probes keeps the original intent (691bc8d: Maintenance and artifact-preserving reads retain private inspection to preserve source artifacts and native custody.)
  • Prepared runtime imports keeps the original intent (a212e00: Retain required module exports before an updater replaces its runtime files.)
  • Sidecar missing-file handling keeps the original intent (082e55e: Permit transient reader-created sidecars without accepting durable source mutations; the replacement helper still ignores only ENOENT for sidecars.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/infra/update-database-backup.test.ts src/infra/update-database-backup-engine.test.ts --maxWorkers=1
  • node scripts/run-tsgo-core-test-shards.mjs --changed-paths-json '["src/infra/update-database-backup.test.ts"]'
  • git diff --check

What I checked:

  • Introduced change: The pinned introduction diff adds canonical engine classifications and passes them into the existing worker; worker observations retain precedence over the supplied classifications. (src/infra/update-database-backup.ts:364, bf8caf4b7589)
  • Test type mismatch: The inspection launcher's input is Record<string, unknown>, so the test's extracted engines value is unknown; the capture input requires Readonly<Record<string, BackupEngine>>. (src/infra/update-database-backup.test.ts:397, bf8caf4b7589)
  • Native performance evidence: The full PR body reports real Doctor and Doctor --fix runs on Linux with a published 2026.11.2 installation and a 422 MB database, comparing packages built from the same base; both recorded read totals decrease. (bf8caf4b7589)
  • Current-main behavior: The affected production files are unchanged between the introduction base and fetched main, so main still repeats maintenance-owned classification. (src/infra/update-database-backup.ts:653, a87a4bf29d36)
  • Preserved engine-inspection contract: fix(backup): read the backup engine without copying the live database #194234 deliberately retained private inspection for artifact-preserving scopes and offline custody; this PR reuses that inspection result rather than replacing it with a live source connection. (src/infra/database-engine/physical-store.ts:43, 691bc8dbe001)
  • CI attribution limit: Exact-head CI reports failed lint, test-types, and baseline-ratchet jobs. Lint annotations name unchanged files; typecheck annotations give only an exit code, and ratchet annotations name test-lines and baseline-ratchets. Detailed logs redirect to a blocked storage host, so their complete causes remain unverified. (bf8caf4b7589)

Likely related people:

  • Peter Steinberger: Raw commit 0b08491 adds src/infra/update-database-backup.ts:359 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0b0849145990; files: src/infra/update-database-backup.ts)

PR surface

Source +8, Tests +29, Other +2. Total +39 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 29 21 +8
Tests 1 29 0 +29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 4 60 21 +39

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 LOC Production +29/-21; tests +29/-0 The production growth carries canonical classifications through the existing backup owner; the single regression covers repeated classification work.

Labels

Label changes:

  • add P2: Redundant full-database reads impose meaningful Doctor overhead on large installations, while the identified repair is confined to the new test.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Redundant full-database reads impose meaningful Doctor overhead on large installations, while the identified repair is confined to the new test.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 11, 2026, 11:11 AM ET / 16:11 UTC.

…gine reuse

Use a pass-through catch instead of Promise.reject for the sidecar lstat fence, type the test's expected engine map, and allocate exactly the 26 added test lines.
@steipete
steipete disabled auto-merge November 11, 2026 16:40
@steipete
steipete merged commit 314f747 into main Nov 11, 2026
115 checks passed
@steipete
steipete deleted the codex/doctor-engine-probe-reuse branch November 11, 2026 17:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Correction to the landed squash message (314f747), which concatenated earlier commit messages:

  • A plain openclaw doctor ran four full-copy engine probes. Two of them, the backup worker re-probing what the parent had already classified, are removed. The database was not read four extra times.
  • The test-line allocation landed as exactly 26 lines, the added test lines. It does not cover any inherited debt.
  • doctor --fix reads went from 11,711 to 10,100 MiB when a retained Doctor capture exists, and from 8,485 to 7,679 MiB on a first run without one. Both were measured on the same 422 MB agent database.

The PR body above has the full measurements and the remaining follow-ups.

etzelm added a commit to etzelm/openclaw that referenced this pull request Nov 11, 2026
- Resolve src/infra/update-database-backup.ts: keep inspectRestorableDatabaseFiles in update-database-backup-files.ts (moved by this PR for the max-lines cap) and carry main openclaw#197277 sidecar lstat change into it; keep main engine-reuse changes.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
…ine (openclaw#197277)

* perf(doctor): reuse the parent's engine classification in backup workers

Maintenance-owned Doctor captures classified every database engine in the
parent, then the backup worker classified the same sources again. Each
artifact-preserving engine probe copies and hashes the whole source, so a
standalone `openclaw doctor` read a 422 MB agent database four extra times
just to learn it is SQLite.

The parent now hands its classification to the worker, which reuses it
instead of probing. On a 422 MB agent database, plain Doctor agent-DB reads
drop from 8,481 MiB to 6,869 MiB and `doctor --fix` from 11,711 MiB to
10,100 MiB.

* test: allocate test lines for the Doctor engine probe reuse regression

Covers the 29 added test lines plus 21 lines of inherited base debt, which the test-line ratchet allows an exact grant to reconcile.

* fix(doctor): satisfy CI lint, test types and test-line ratchet for engine reuse

Use a pass-through catch instead of Promise.reject for the sidecar lstat fence, type the test's expected engine map, and allocate exactly the 26 added test lines.
vincentkoc added a commit that referenced this pull request Nov 13, 2026
)

* feat(database): keep PostgreSQL rollback captures in PostgreSQL

- Exact update rollback and Doctor pre-migration captures copy the store into a frozen restore_<uuid> schema on the same server
- The copy runs in one REPEATABLE READ transaction: generated DDL, INSERT ... SELECT per table, sequences from captured allocations
- Manifest hashes come from a separate source read in the same snapshot and are checked against the copy
- The manifest keeps today's fields and adds carrier "postgres-schema" plus the schema name; only anchor.sqlite and manifest.json are written locally
- Restore copies the frozen schema into a fresh namespace and checks the manifest hashes, so the capture survives a failed or repeated rollback
- Verified update retirement drops capture schemas through the restore namespace guard before removing the snapshot directory
- Capture schemas carry a comment naming their directory; before each pre-migration capture, Doctor drops this store's captures whose directory was removed
- The portable SQLite export stays the default for archives, ports, repairs and the candidate state copy; the shared state family keeps it for client credential rollback
- inspectRestorableDatabaseFiles and readPostgresPortCapabilities move unchanged to their own modules to stay under the line cap

* fix(database): resolve CI failures for PostgreSQL schema captures

- Doctor's PostgreSQL capture no longer writes database.sqlite; the client credential Doctor test reads the captured token from the capture schema and drops it on cleanup
- Rename the worker-side prune to pruneOrphanedPostgresCaptures so prunePostgresSchemaCaptures has one exported spelling (export-name-collisions)
- Set the test-lines allocation to the CI-counted net delta (384)

* feat(database): make PostgreSQL server recovery captures opt-in

- Add database.postgres.recoveryCaptures ("portable" default, "server")
- Update and Doctor captures use restore_<uuid> schemas only when "server"
- Doctor still prunes orphaned capture schemas regardless of the setting
- Shared state family and candidate state copy stay portable
- Document the server carrier trade-offs in database-engines.md
- Raise core config baseline 2638 -> 2639 for the new setting
- Raise test-lines allocation 384 -> 421 for the opt-in tests

* fix(database): prune only capture schemas this role can drop

- Restrict Doctor capture pruning to schemas the runtime role can use (pg_has_role USAGE)
- Another role's marked restore_ schema under the same path no longer fails Doctor
- Test two isolated roles with one directory prefix; fails without the fix
- Raise test-lines allocation 421 -> 466 for the new test

* Merge origin/main into feat/postgres-native-captures

- Resolve docs/.generated/config-baseline.{counts.json,sha256} by regenerating with pnpm config:docs:gen (core 2641 -> 2642).

* test(database): raise schema capture test-line allocation to 469

- Net test lines of this change against current main are +469 (was 466 against the old base).

* docs(database): note original state captures stay portable

- Server recovery captures cover update rollback and Doctor pre-migration captures only.

- Original state captures before an update or standalone doctor --fix still write SQLite images of PostgreSQL stores.

* Merge origin/main into feat/postgres-native-captures

- Resolve docs/.generated/config-baseline.{counts.json,sha256} by regenerating with pnpm config:docs:gen (core 2645 -> 2646).

* Merge origin/main into feat/postgres-native-captures

- Resolve docs/.generated/config-baseline.sha256 by regenerating with pnpm config:docs:gen (counts unchanged, core 2646).

* Merge origin/main into feat/postgres-native-captures

- Bring in #197058, which retires the ui-e2e scenario failing on main.
- Resolve docs/.generated/config-baseline.{counts.json,sha256} by regenerating with pnpm config:docs:gen (core 2645 -> 2646).

* Merge origin/main into feat/postgres-native-captures

- Resolve src/infra/update-database-backup.ts: keep inspectRestorableDatabaseFiles in update-database-backup-files.ts (moved by this PR for the max-lines cap) and carry main #197277 sidecar lstat change into it; keep main engine-reuse changes.

* Merge origin/main into feat/postgres-native-captures

- Resolve docs/.generated/config-baseline.{counts.json,sha256} by regenerating with pnpm config:docs:gen (core 2647 -> 2648).

* fix(database): commit recovery capture metadata atomically

Write the cleanup marker through the existing post-data renderer so it commits with the copied schema. Preserve owner-specific DDL and keep ordinary restores unmarked.

Release note: keep PostgreSQL recovery captures discoverable after a client interruption at COMMIT.

Validation: the unchanged parent loses its marker after a real client SIGKILL; the fixed PostgreSQL 17.11 capture module passes all eight cases. Targeted lint, formatting, and independent P0-P2 correction review pass. Missing public.unaccent was reproduced on the parent and corrected through documented test-server initialization.

* fix(snapshot): keep capture custody paths private

* fix: refresh the reviewed correction baseline

Baseline-Refresh: 5211f64faa02cea25424c18dc6bcc3512926c76f

* fix(config): regenerate capture recovery baseline

Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…claw#196236)

* feat(database): keep PostgreSQL rollback captures in PostgreSQL

- Exact update rollback and Doctor pre-migration captures copy the store into a frozen restore_<uuid> schema on the same server
- The copy runs in one REPEATABLE READ transaction: generated DDL, INSERT ... SELECT per table, sequences from captured allocations
- Manifest hashes come from a separate source read in the same snapshot and are checked against the copy
- The manifest keeps today's fields and adds carrier "postgres-schema" plus the schema name; only anchor.sqlite and manifest.json are written locally
- Restore copies the frozen schema into a fresh namespace and checks the manifest hashes, so the capture survives a failed or repeated rollback
- Verified update retirement drops capture schemas through the restore namespace guard before removing the snapshot directory
- Capture schemas carry a comment naming their directory; before each pre-migration capture, Doctor drops this store's captures whose directory was removed
- The portable SQLite export stays the default for archives, ports, repairs and the candidate state copy; the shared state family keeps it for client credential rollback
- inspectRestorableDatabaseFiles and readPostgresPortCapabilities move unchanged to their own modules to stay under the line cap

* fix(database): resolve CI failures for PostgreSQL schema captures

- Doctor's PostgreSQL capture no longer writes database.sqlite; the client credential Doctor test reads the captured token from the capture schema and drops it on cleanup
- Rename the worker-side prune to pruneOrphanedPostgresCaptures so prunePostgresSchemaCaptures has one exported spelling (export-name-collisions)
- Set the test-lines allocation to the CI-counted net delta (384)

* feat(database): make PostgreSQL server recovery captures opt-in

- Add database.postgres.recoveryCaptures ("portable" default, "server")
- Update and Doctor captures use restore_<uuid> schemas only when "server"
- Doctor still prunes orphaned capture schemas regardless of the setting
- Shared state family and candidate state copy stay portable
- Document the server carrier trade-offs in database-engines.md
- Raise core config baseline 2638 -> 2639 for the new setting
- Raise test-lines allocation 384 -> 421 for the opt-in tests

* fix(database): prune only capture schemas this role can drop

- Restrict Doctor capture pruning to schemas the runtime role can use (pg_has_role USAGE)
- Another role's marked restore_ schema under the same path no longer fails Doctor
- Test two isolated roles with one directory prefix; fails without the fix
- Raise test-lines allocation 421 -> 466 for the new test

* Merge origin/main into feat/postgres-native-captures

- Resolve docs/.generated/config-baseline.{counts.json,sha256} by regenerating with pnpm config:docs:gen (core 2641 -> 2642).

* test(database): raise schema capture test-line allocation to 469

- Net test lines of this change against current main are +469 (was 466 against the old base).

* docs(database): note original state captures stay portable

- Server recovery captures cover update rollback and Doctor pre-migration captures only.

- Original state captures before an update or standalone doctor --fix still write SQLite images of PostgreSQL stores.

* Merge origin/main into feat/postgres-native-captures

- Resolve docs/.generated/config-baseline.{counts.json,sha256} by regenerating with pnpm config:docs:gen (core 2645 -> 2646).

* Merge origin/main into feat/postgres-native-captures

- Resolve docs/.generated/config-baseline.sha256 by regenerating with pnpm config:docs:gen (counts unchanged, core 2646).

* Merge origin/main into feat/postgres-native-captures

- Bring in openclaw#197058, which retires the ui-e2e scenario failing on main.
- Resolve docs/.generated/config-baseline.{counts.json,sha256} by regenerating with pnpm config:docs:gen (core 2645 -> 2646).

* Merge origin/main into feat/postgres-native-captures

- Resolve src/infra/update-database-backup.ts: keep inspectRestorableDatabaseFiles in update-database-backup-files.ts (moved by this PR for the max-lines cap) and carry main openclaw#197277 sidecar lstat change into it; keep main engine-reuse changes.

* Merge origin/main into feat/postgres-native-captures

- Resolve docs/.generated/config-baseline.{counts.json,sha256} by regenerating with pnpm config:docs:gen (core 2647 -> 2648).

* fix(database): commit recovery capture metadata atomically

Write the cleanup marker through the existing post-data renderer so it commits with the copied schema. Preserve owner-specific DDL and keep ordinary restores unmarked.

Release note: keep PostgreSQL recovery captures discoverable after a client interruption at COMMIT.

Validation: the unchanged parent loses its marker after a real client SIGKILL; the fixed PostgreSQL 17.11 capture module passes all eight cases. Targeted lint, formatting, and independent P0-P2 correction review pass. Missing public.unaccent was reproduced on the parent and corrected through documented test-server initialization.

* fix(snapshot): keep capture custody paths private

* fix: refresh the reviewed correction baseline

Baseline-Refresh: 5211f64faa02cea25424c18dc6bcc3512926c76f

* fix(config): regenerate capture recovery baseline

Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Vincent Koc <[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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant