Repository navigation
fix(update): bound private SQLite snapshot amplification during candidate validation on a live install - #167451
Conversation
Keep candidate read-only inspections on the existing rehearsal image while retaining write guards and physical path containment. Report snapshot capacity before cleanup and avoid serving-schema repair advice for candidate-only capacity failures. Refs #160483, Refs #155902. Thanks @iFadi for the live-install capacity evidence.
Let packaged bootstrap commands verify the configured port is offline before a source rebuild. Check port availability for mock auth as well as plugin repair, preserving the runtime publication guard.
|
🦞👀 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 changesThe branch reuses prepared SQLite databases during isolated update validation, adds snapshot-capacity diagnostics, and releases the QA Gateway port before packaged authentication bootstrap. Example: Five inspections overlap while validating a candidate with a 1 GiB database
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review This PR contains useful work that current main does not provide. No definite introduced code defect was found, and the related cleanup PR addresses a different failure. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe updater prepares private copies of installed databases so candidate migrations and startup checks can run without changing the serving installation. Read-only database openers select the inspection source and retain responsibility for closing their readers. flowchart TD
A[Installed databases] --> B[Updater prepares private copies]
B --> C[Candidate validation]
C --> D{Complete isolation markers and contained database family?}
D -->|Yes| E[Read prepared database]
D -->|No| F[Create artifact-preserving snapshot]
E --> G[Close inspection readers]
F --> G
F --> H[Report capacity and recovery guidance]
Technical reviewBest possible solution: Keep reuse in the existing read-only owners, preserve external-source artifact protection, and retain separate tracking for live-update failures and cleanup leaks beyond this repair. Do we have a high-confidence way to reproduce the issue? Yes for redundant copies: current main unconditionally snapshots each artifact-preserving agent opener, and the supplied overlapping-reader experiment reports the resulting amplification. The complete Debian update failure was not reproduced. Is this the best way to solve the issue? Yes for the bounded copy-amplification problem: recognizing the existing private rehearsal contract at the read-only owners avoids another snapshot implementation and preserves explicit snapshot ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0f56d2e3d9b8. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +46, Tests +200, Docs +9, Other +1. Total +256 across 13 files. Added test files: 2. View PR surface stats
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 8, 2026, 5:02 PM ET / 21:02 UTC. |
…date validation on a live install (openclaw#167451) Refs openclaw#160483 Refs openclaw#155902 Reported by @iFadi.
…date validation on a live install (#167451) Refs #160483 Refs #155902 Reported by @iFadi. (cherry picked from commit 0ac773b) Backport adaptation: the release line has no agent-scoped artifact-preserving reads (openSqliteReadOnlyDatabase) or inspection write guard, so only the shared-state rehearsal snapshot reuse, capacity diagnostics, and admission guidance were ported; the rehearsal test and docs cover shared state only.
* fix(update): backport safe validation and recovery reports to 2026.9.x Adapt #167451 and #170130 to the September shared-state reader architecture. Reuse isolated rehearsal images, capture authored config without reopening migrated state, preserve candidate-owned verification, and retain actionable snapshot-capacity diagnostics. Keep saved outcomes and rollback restrictions. Require distinct known versions before reconciling runtime recovery advice; version-only health cannot identify a changed Git commit at the same version. Adapted from Peter Steinberger authored main commits: - 0ac773b - d128f0d Using older-line adaptation 47538fa from #170736 / #170753. * test(release): consolidate September survivor and lifecycle fixtures Keep the shell survivor roster canonical, preserve bounded/redacted Doctor lint and redirected failure evidence, and reset stale attempt logs. Share the September Chokidar fixture and await real cleanup recovery config settlement. Do not import October-only observer/startup-maintenance features. Adapted from Dallin Romney authored source proposals: f13af59 cd3346e 6dd10c2 5f40bd0 Consolidates relevant subsets of #166817, #166828, #166855, #166882, #166892. * test(ui): isolate September font fixtures before each case Backport only the font fixture reset from 9ef8502 as carried by #166813 and #166890. Preserve the September theme inventory. * fix: compose 2026.9.36 release validation security candidate Preserve the prepared release validation composition; adopt pinned ClawHub materialization and compatibility-tested tool and runtime dependency security repairs. Remaining audit and review limitations are recorded in the external release audit evidence. Co-authored-by: RomneyDa <[email protected]> * fix: complete release security dependency and workflow repairs Repair embedded Mermaid/KaTeX assets, migrate the coherent Vitest security cohort, and retain trusted workflow data boundaries. Co-authored-by: RomneyDa <[email protected]> * fix(release): restore original bounded scope of #186177 Preserve all original and security history while reducing this PR to the conflict-free merge of original head 32665a0 and release base e93b50a. Removed work remains in ancestor commits and local split evidence. Scope reduction does not certify full composition or waive unresolved review gates. Co-authored-by: RomneyDa <[email protected]> * fix(update): preserve unsafe Doctor recovery guidance Co-authored-by: RomneyDa <[email protected]> * test(update): adapt Doctor custody regression harness Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Read-only candidate checks can copy the updater's already-prepared SQLite image again for each reader. Five overlapping inspections of a synthetic database with 1 GiB of payload retained six database copies until their scope closed. This amplifies temporary storage even though cleanup eventually succeeds.
Refs #160483, Refs #155902. Thanks @iFadi for the live-install capacity evidence; related cleanup report: #157712.
User Impact
Candidate read-only inspections reuse the prepared database. Snapshot capacity errors include estimated bytes needed, available bytes, and observed live WAL sidecars. Candidate snapshot ENOSPC/EDQUOT failures recommend freeing snapshot space and retrying the update, without recommending schema repair on the serving installation.
Why This Change Was Made
SQLite's consistent online backup already exists in v2026.9.9. Current main also removes duplicate rehearsal publication copies and handles an inactive WAL becoming active. The remaining reuse fix belongs to the read-only openers: recognize the complete isolation contract shipped by the 2026.9.4 updater, check physical containment of the main file and every sidecar, and retain read-only scope cleanup and write guards. External paths and escaping symlinks keep artifact-preserving copies. Explicit independently mutable snapshots keep their existing ownership.
The trusted wrapper's extraction manifest also includes the newly imported rehearsal boundary helper. No schema, dependency, configuration, CLI, or environment options change. The raw-copy cleanup-refusal case is separately owned by #167027.
Evidence
node scripts/check-changed.mjspassed for the core/docs, wrapper manifest, and QA changes, including extension production/test typechecks and native extension lint. The final capacity-before-cleanup ordering change also passed focused lint, core typecheck, both affected test typecheck graphs, and the three final test runs.