Skip to content

improve(doctor): speed up schema checks for large databases - #143802

Merged
VACInc merged 5 commits into
openclaw:mainfrom
VACInc:fix/doctor-schema-preflight-cost
Sep 13, 2026
Merged

VACInc merged 5 commits into
openclaw:mainfrom
VACInc:fix/doctor-schema-preflight-cost

Conversation

@VACInc

@VACInc VACInc commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Doctor and Gateway restart readiness checks copy whole agent databases even when they only need schema metadata. The copy cost and temporary disk requirement grow with stored transcripts. The previous revision also bypassed the optimization for configured agents—the actual Doctor and restart callers.

Related: #139870. The shared-state lint-copy improvement in #145577 and header-only startup optimization in #145541 are complementary, not replacements.

Why This Change Was Made

Eligible agent schema checks read version, shape, and ownership metadata in one coherent read-only child transaction. The parent applies the existing ownership admission decision, including isolating secondary agents and refusing default/system-agent mismatches.

The child uses the canonical source-read lifetime owner, retaining its lease if native SQLite close fails until the child exits. Empty files, rollback recovery, incomplete WAL families, owner-provided snapshots, and full startup readiness keep the existing snapshot path. Ordinary busy/I/O failures are not retried as full copies.

The explicit copied-agent-file preflight now lives beside the agent schema inspector; its CLI and test callers were moved without changing behavior. This keeps the main preflight owner below the lint size limit. The earlier unused-import CI repair is now present on main and no longer contributes to this PR.

Data compatibility: no schema version, table, index, stored-row format, config, migration writer, or recovery writer is changed. The existing maintenance validator remains authoritative. Removing this optimization requires no data conversion.

User Impact

Configured agents get the intended schema-inspection optimization without weakening ownership admission or startup integrity checks. A source whose native close fails cannot prematurely allow canonical replacement.

Evidence

Current head: d4817de7b5f93a8445d3b26b88d284bc736e5d04, rebased again onto main d0ec2f18a5b. CI is not claimed green until its exact-head run finishes.

  • Configured-agent regression: DELETE and active-WAL cases through assertOpenClawDatabasesReady for Doctor and Gateway restart failed before the repair with “No space for a full agent database snapshot.” They pass after the repair, including foreign-owner refusal, fresh newer-schema metadata, and missing-index detection.
  • Native-close regression: expanded the existing two-process lifetime fixture to cover the agent schema reader. A failed native close allowed source exclusion before the repair; after the repair, exclusion remains unavailable until child exit. Success, read failure, cancellation, and coherent metadata under a concurrent WAL commit also pass.
  • Final focused tests: 100 tests across eight files pass, covering preflight, startup/default/system/secondary ownership admission, explicit copied-file preflight, child cancellation, and native lifetime. Earlier snapshot verification passed 53 additional tests against unchanged snapshot code.
  • Fresh autoreview: final uncommitted repair/extraction returned scoped-clean at the helper’s default P0 threshold. An independent source review confirmed the native-close repair and found no further blocking upstream-contract issue.
  • Validation: all final changed-surface gates passed, including core/test typechecks, type-aware lint, dead exports, import cycles, and database guards. The initial full build passed. The final runtime bundle compiled successfully, but the final full build stopped at the declaration publication guard because a dependency package.json changed during compilation (@peculiar/asn1-csr); this is not claimed as a passing final full build. Exact-head hosted CI must establish final build completion. Testbox was unavailable because Blacksmith was not authenticated, so trusted-source local fallback was used. No remote success is claimed.

The second rebase preserves main’s newly optional/defaulted schema-version pair. All nine affected configured-agent/admission tests, core typecheck, formatting, and diff checks passed again. The prior 100-test suite and changed-surface gates cover the unchanged repair; hosted CI verifies the full new base.

Configured-agent performance on real SQLite

The actual Doctor readiness entry point was compared with pinned main aac6465ffee using the same 538,669,056-byte synthetic agent database, an active WAL writer, and a configured default agent. Linux / Node v26.8.2; one warm-up per variant, then three alternating samples:

Readiness implementation Samples (seconds) Median
Pinned main 2.807 / 2.816 / 2.685 2.807 s
Repaired candidate 2.361 / 2.244 / 2.249 2.249 s

All calls completed successfully. SHA-256 hashes of the database and WAL were unchanged. This is a synthetic configured-agent readiness measurement (about 20% lower median), not full Doctor CLI latency. The baseline module was read from the pinned Git revision with imports resolved to the same dependencies. The subsequent explicit copied-file preflight move does not change this measured readiness path.

Data-model compatibility proof

No migration is required. A zero-diff check against the rebased main confirms that both canonical schema definitions, both schema-version contracts, and both generated database row contracts are unchanged. The patch changes read orchestration and connection setup only.

On the current repair, 52 existing Doctor post-upgrade, schema-preflight, and repair-completion tests passed. They include supported legacy-registry admission, newer-database refusal before repair, and preserving/revalidating repair ownership through restart. Thirteen explicit copied-file and configured-agent tests also passed; the copied-file tests verify that the reader does not mutate or create databases, including wrong-owner and sidecar refusals. These are current compatibility regression tests, not a claim of a fresh published-updater E2E run.

The full pnpm check:architecture gate now passes after replacing the moved raw pragma setup with the existing SQLite connection helpers. That follow-up preserves the same busy timeout, query-only mode, and trusted-schema setting.

Retained historical upgrade proof—not rerun for this refresh

The published [email protected] updater installed earlier candidate 8a466d4562c067098218213573ac2b4f83e6be77 in the isolated Docker sqlite-volume upgrade-survivor scenario. It preserved 4,800 sessions, 23,890 events, and 2,200 cron jobs; Gateway RPC verified eight conversations across two agents before and after restart; repeat Doctor completed in 13 seconds. The prior PR evidence and author comments retain the full command and output. These results support that earlier revision only, not a fresh upgrade claim.

Nonblocking follow-ups

A future simplification can remove the schema-only inspector’s unused startup-readiness option; startup stays on its established parent/snapshot path. Cold/PERSIST rollback-journal residue still selects a private snapshot conservatively, so it does not receive the fast path. Neither limitation weakens admission or recovery.

Proof limits

No production database or Gateway was touched. No live external channel was exercised. Windows/macOS large-database performance and published-updater E2E were not rerun in this refresh. Full integrity scans and recovery snapshots retain their existing costs.


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 10, 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 docs Improvements or additions to documentation size: L maintainer Maintainer-authored PR labels Sep 10, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 13, 2026, 2:01 AM ET / 06:01 UTC (Revision 9).

ClawSweeper review

What this changes

Doctor and restart readiness checks inspect eligible agent databases in a read-only child process, avoiding full copies while preserving ownership checks and recovery snapshots.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this remains a useful optimization absent from main. The prior configured-agent finding is resolved, and the remaining migration notice is unsupported because the patch changes read orchestration without changing persisted contracts. No actionable correctness or security finding remains.

Priority: P2
Reviewed head: d4817de7b5f93a8445d3b26b88d284bc736e5d04

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused optimization with useful runtime evidence, retained safety boundaries, and no remaining actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied Linux real-SQLite benchmark exercises configured Doctor readiness through the changed child reader and records faster successful checks with unchanged database/WAL hashes. Current compatibility and native-lifetime results supplement it; the earlier published-updater run remains historical evidence, not a current-head replay.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied Linux real-SQLite benchmark exercises configured Doctor readiness through the changed child reader and records faster successful checks with unchanged database/WAL hashes. Current compatibility and native-lifetime results supplement it; the earlier published-updater run remains historical evidence, not a current-head replay.
Evidence reviewed 9 items Introduced scope and unchanged persisted contracts: The verified merge-base-to-head file list contains read orchestration, worker registration, tests, and documentation. Comparison of both canonical schema definitions, both version contracts, and both generated database row contracts returned no changes.
Final revision preserves connection settings: The final commit only replaces explicit copied-file preflight PRAGMAs with setSqliteBusyTimeout and configureSqliteReadOnlyPragmas. Inspection of those helpers confirms the same timeout, query-only mode, and trusted-schema setting.
Prior configured-agent finding resolved: Configured Doctor and restart calls now reach the schema worker. Ownership metadata returns with the coherent read, and the existing parent refusal is applied before shape errors. Regression coverage exercises DELETE and WAL databases, foreign-owner refusal, newer-version reporting, missing-index detection, and owner-provided snapshots.
Findings None None.
Security None None.

How this fits together

Database preflight checks whether existing OpenClaw state is compatible before Doctor or Gateway readiness completes. It reads agent database metadata and returns compatibility, ownership, or repair diagnostics.

flowchart TD
  A[Doctor or restart readiness] --> B[Agent database preflight]
  B --> C{Safe direct inspection?}
  C -->|Yes| D[Read-only child transaction]
  C -->|No| E[Private snapshot]
  D --> F[Ownership and schema checks]
  E --> F
  F --> G[Ready or diagnostic refusal]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +305, Tests +225, Docs +6. Total +536 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 8 385 80 +305
Tests 4 236 11 +225
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 627 91 +536

Review metrics

Metric Value Why it matters
Measured readiness latency 2.807 s → 2.249 s median The supplied Linux configured-agent benchmark shows about 20% improvement on a 538 MB active-WAL fixture, without claiming full Doctor latency.
Production versus regression coverage Production +305 net lines; tests +225 net lines Production growth supports child-process isolation and coherent metadata inspection; coverage exercises the corresponding readiness and native-lifetime boundaries.

Stored data model

Persistent data-model change detected: database schema: src/infra/sqlite-readonly-inspection.ts, database schema: src/state/openclaw-agent-schema-inspection-worker.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Retain the existing maintenance validator and snapshot recovery owner while using coherent child reads for eligible schema-only checks; no data migration is needed.

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

Yes: current main visibly copies agent databases for schema-shape checks, and the supplied real-SQLite readiness benchmark exercises that cost. This read-only review did not execute tests or benchmarks.

Is this the best way to solve the issue?

Yes: the optimization reuses existing validation and source-lifetime owners while retaining required recovery snapshots. The final helper substitution preserves behavior, and an additional migration requirement would not match this diff.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded performance improvement for Doctor and restart checks on large agent databases.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied Linux real-SQLite benchmark exercises configured Doctor readiness through the changed child reader and records faster successful checks with unchanged database/WAL hashes. Current compatibility and native-lifetime results supplement it; the earlier published-updater run remains historical evidence, not a current-head replay.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Linux real-SQLite benchmark exercises configured Doctor readiness through the changed child reader and records faster successful checks with unchanged database/WAL hashes. Current compatibility and native-lifetime results supplement it; the earlier published-updater run remains historical evidence, not a current-head replay.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • VACInc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (8 earlier review cycles)
  • reviewed 2026-09-10T07:11:56.976Z sha 32df716c86008f41a7bf64cb8e8a02b5bdbb0c57 :: blocked before merge. :: none
  • reviewed 2026-09-12T02:00:31.499Z sha e8cf391bfa764f5cf170f8ff6584534984dbba73 :: blocked before merge. :: none
  • reviewed 2026-09-12T02:18:29.699Z sha 8a466d4562c067098218213573ac2b4f83e6be77 :: blocked before merge. :: none
  • reviewed 2026-09-12T02:24:40.157Z sha 8a466d4562c067098218213573ac2b4f83e6be77 :: blocked before merge. :: none
  • reviewed 2026-09-12T02:33:09.835Z sha 8a466d4562c067098218213573ac2b4f83e6be77 :: blocked before merge. :: none
  • reviewed 2026-09-12T21:16:52.325Z sha b368458615eedfc1b5642e48f56361c43d3833ae :: blocked before merge. :: [P2] Keep configured-agent schema checks on the optimized path
  • reviewed 2026-09-13T05:34:34.594Z sha 7e531c6 :: blocked before merge. :: none
  • reviewed 2026-09-13T05:49:38.576Z sha 6ebd8d5 :: blocked before merge. :: none

steipete added a commit that referenced this pull request Sep 10, 2026
* fix(pr): recover partially written review transitions

Classify index and working-tree entries independently against the journaled
source and target before replaying an interrupted native restore. Preserve
foreign bytes, ignored overlaps, and hidden index metadata, including
intent-to-add and resolve-undo state. Rebuild the validated source index so
completed index deletions can still remove their remaining source files.

Preserve the reserved .local artifact namespace and existing journal endpoints.
Unknown zero-byte files remain refused rather than inferred as owned writes.

Validation: 66 native owner cases, complete changed checks, and independent
review. Regression cases demonstrate worktree-first and index-first recovery,
plus fail-before/pass-after coverage for intent-to-add and resolve-undo guards.

Related: #143802

* fix(pr): register the journal validator executable entry

* test(pr): preserve Git reader coverage for journal recovery

Exercise the active Node-helper Git reader in the failure fixture and keep operation artifacts in the reserved .local namespace. Record reader starts and delayed exits after stdout closure so successful validation still proves every producer joined before lock release.

Validation: focused reader cases changed from two failures to five passes; full operation-lock suite passed 114 tests with one Linux-only zombie case skipped on macOS. Complete changed checks and focused independent review passed. Production runtime bytes are unchanged.

* fix(pr): preserve leading BOM characters in Git path records

Treat Git output as pathname records rather than a BOM-framed text document. Preserve an initial U+FEFF while keeping fatal UTF-8 decoding, so an untracked lookalike cannot be misclassified as a target path before native replay.

The native regression previously changed HEAD before final refusal; it now preserves the source state. All 67 owner tests, complete changed checks, and focused independent review pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
* fix(pr): recover partially written review transitions

Classify index and working-tree entries independently against the journaled
source and target before replaying an interrupted native restore. Preserve
foreign bytes, ignored overlaps, and hidden index metadata, including
intent-to-add and resolve-undo state. Rebuild the validated source index so
completed index deletions can still remove their remaining source files.

Preserve the reserved .local artifact namespace and existing journal endpoints.
Unknown zero-byte files remain refused rather than inferred as owned writes.

Validation: 66 native owner cases, complete changed checks, and independent
review. Regression cases demonstrate worktree-first and index-first recovery,
plus fail-before/pass-after coverage for intent-to-add and resolve-undo guards.

Related: openclaw#143802

* fix(pr): register the journal validator executable entry

* test(pr): preserve Git reader coverage for journal recovery

Exercise the active Node-helper Git reader in the failure fixture and keep operation artifacts in the reserved .local namespace. Record reader starts and delayed exits after stdout closure so successful validation still proves every producer joined before lock release.

Validation: focused reader cases changed from two failures to five passes; full operation-lock suite passed 114 tests with one Linux-only zombie case skipped on macOS. Complete changed checks and focused independent review passed. Production runtime bytes are unchanged.

* fix(pr): preserve leading BOM characters in Git path records

Treat Git output as pathname records rather than a BOM-framed text document. Preserve an initial U+FEFF while keeping fatal UTF-8 decoding, so an untracked lookalike cannot be misclassified as a target path before native replay.

The native regression previously changed HEAD before final refusal; it now preserves the source state. All 67 owner tests, complete changed checks, and focused independent review pass.
@VACInc VACInc closed this Sep 12, 2026
@VACInc VACInc reopened this Sep 12, 2026
@VACInc
VACInc force-pushed the fix/doctor-schema-preflight-cost branch from 32df716 to 1ac4a99 Compare September 12, 2026 01:49
@VACInc

VACInc commented Sep 12, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Rebased onto current main; head e8cf391bfa764f5cf170f8ff6584534984dbba73. Retained both worker registrations and updated the regression test to the current snapshot owner. Focused proof: 178 preflight/snapshot/coordinator tests and 23 Doctor upgrade/maintenance tests passed. The PR body now explains the unchanged data model and compatibility evidence addressing the previous gate. Autoreview findings were checked against the coordinator source and the corrected index; no unresolved code finding remains. Please assess the current head and the explicit proof limits. Exact-target CI is running with the PR kept draft.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@VACInc

VACInc commented Sep 12, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Final head 8a466d4562c067098218213573ac2b4f83e6be77 has fresh scoped-clean autoreview and a green hosted architecture/Kysely check. The requested published-driver × candidate proof now passed: the actual published 2026.9.4 updater installed this candidate in the existing isolated Docker SQLite-volume scenario, preserving 4,800 sessions, 23,890 events, and 2,200 cron jobs. Gateway history passed before and after restart; repeat Doctor completed in 13 s. The PR body includes the command and copied output.

Fresh final-head 2 GiB active-WAL preflight measurements also passed: 9.647 s baseline → 1.463 s candidate median, with identical results and unchanged database/WAL hashes. Please reassess the compatibility/proof blockers using these results. Full CI remains red on documented unrelated base UI/localization failures; those are not claimed green. No schema or persisted representation changes are introduced.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@VACInc

VACInc commented Sep 12, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main at d093d65; head b368458615e. Preserved upstream bounded header reads, ownership admission, and startup-readiness snapshots; schema-shape-only inspections retain the PR worker optimization. Focused preflight and worker suites: 41 tests passed. Formatting and diff checks passed. Core typecheck stops at the unchanged upstream src/gateway/server-startup-finish.ts:416 (GatewayPostReadySidecarHandle array mismatch); not a green full typecheck.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 12, 2026
@VACInc

VACInc commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

Related update: #145577 has merged. It removes redundant copies of Doctor's already-isolated shared-state lint database, whereas this PR targets agent database schema-shape inspection. These are complementary changes, not equivalent fixes. #145541 separately addresses header-only agent startup checks. This PR should remain open; the merge of #145577 is not a reason to close it as superseded.

#145577

@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Sep 13, 2026
VACInc and others added 4 commits September 13, 2026 05:33
Carry ownership metadata through the coherent child read, retain native source admission through failed close, and cover actual Doctor/restart callers. Keep explicit agent-file preflight with the agent inspector to stay under the source-size gate. Remove the upstream unused secret-ref import that blocked typechecking without changing its public re-export.

Co-authored-by: VACInc <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 13, 2026
@roboclaw-bot
roboclaw-bot force-pushed the fix/doctor-schema-preflight-cost branch from 7e531c6 to 6ebd8d5 Compare September 13, 2026 05:44
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Rebased again onto main d0ec2f1; current head 6ebd8d5. The configured-agent routing finding is fixed without weakening ownership admission: the worker returns coherent ownership metadata and the parent retains default/system refusal and secondary-agent isolation. Actual Doctor/restart DELETE and WAL cases fail before the repair and pass afterward.

Also repaired a native-close lifetime gap found during integration: the canonical source-read owner retains its lease after failed close until child exit. The real two-process regression fails before and passes after; coherent metadata, read failure, and cancellation remain covered.

100 focused tests passed before the mechanical second rebase; all nine affected configured-agent/admission tests and core typecheck passed again on this head. Main’s optional/defaulted schema-version pair is preserved. all changed-surface gates passed (core/test typechecks, typed lint, dead exports, import cycles, database guards), and final autoreview is scoped-clean at its default P0 threshold. The PR body now has a configured-agent readiness benchmark (538 MB active-WAL fixture: 2.807 s to 2.249 s median, identical DB/WAL hashes), accurate current revision, historical-only upgrade evidence, and explicit proof limits. There is no persisted schema/data/migration change.

The original full local build passed, but the final build was invalidated at declaration publication by a dependency input changing during compilation; not claimed green. Hosted exact-head CI is now running and will provide the final build/CI result. Please reassess the current integration and the documented compatibility evidence.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Current head d4817de fixes the sole observed CI architecture failure by replacing the copied raw pragma setup with the canonical SQLite connection helpers. The same timeout/query-only/trusted-schema values are retained. Full pnpm check:architecture, 13 explicit-file/configured-readiness tests, and fresh autoreview passed. New exact-head CI: https://github.com/openclaw/openclaw/actions/runs/34741433361 .

Additional current data-model compatibility evidence is now in the PR body: 52 Doctor post-upgrade, legacy-schema-preflight, and repair-completion tests passed; canonical schema definitions, schema-version contracts, and generated row contracts have zero diff against the rebased main. The copied-file tests check byte/file preservation. No migration is required because this patch changes read orchestration, not stored formats or writers. The older published-updater E2E remains explicitly historical, not current-head proof.

Please reassess the remaining data-model compatibility notice against these current results. Your latest review already reports accepted runtime proof and no actionable findings; please distinguish an unchanged stored format that needs no migration from missing proof for an actual migration. Do not waive a genuine compatibility issue if one remains.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@VACInc
VACInc merged commit 0f74803 into openclaw:main Sep 13, 2026
218 of 220 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…#143802)

* improve(doctor): avoid full copies for schema-only inspections

Co-authored-by: VACInc <[email protected]>

* test(doctor): follow the snapshot owner after rebase

Co-authored-by: VACInc <[email protected]>

* fix(doctor): comply with SQLite query guardrails

Co-authored-by: VACInc <[email protected]>

* fix(doctor): preserve ownership in fast schema checks

Carry ownership metadata through the coherent child read, retain native source admission through failed close, and cover actual Doctor/restart callers. Keep explicit agent-file preflight with the agent inspector to stay under the source-size gate. Remove the upstream unused secret-ref import that blocked typechecking without changing its public re-export.

Co-authored-by: VACInc <[email protected]>

* fix(doctor): reuse canonical read-only SQLite pragmas

Co-authored-by: VACInc <[email protected]>

---------

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

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

2 participants