Skip to content

fix(update): preserve successful startup writes for the next Doctor - #200260

Merged
RomneyDa merged 1 commit into
mainfrom
fix/update-successful-boot-attribution
Nov 16, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/update-successful-boot-attribution

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Related: #198268

What Problem This Solves

Fixes a subsequent update failing with SQLite migration source changed after update capture: credentials.sqlite after the activated Gateway startup check succeeds.

User Impact

Updates can proceed through the second Doctor after their own successful startup probe initializes credential state. Unrelated changes made before that probe still cause migration to refuse. No schema, permission, or global integrity-policy changes.

Why This Change Was Made

The existing boot-write attribution from #198268 only records writes when startup fails. The same probe can legitimately initialize credential receipts and device identity on success. Extend that existing owner to record either outcome, retaining the pre-boot generation comparison and the existing accepted boot-window concurrency tradeoff.

Evidence

  • Full rootless Podman recovery reproduced the failure after authentic interrupted activation, repair, repeated repair, and a distinct next update. Spawn/SQLite traces identified the successful startup probe as the credential writer between the two Doctors.
  • New real-SQLite regression fails on the base with the exact generation refusal and passes with the fix. A second case verifies that preexisting outside writes remain rejected.
  • Main owner suite: 45/45 passed with frozen matching dependencies (165.90 seconds Vitest / 168.05 seconds harness, including cold compilation).
  • Release adaptation: 38/38 migration/rollback tests passed; main and release core production/test typechecks passed. Touched lint, format, diff checks and SQLite worker/dialect ratchets passed.
  • Test allocation: 56 added lines cover the two distinct attribution/integrity contracts using the existing real-state fixture.
  • Remaining proof: fresh full release qualification. The exact-package build, integrity check, and full Podman recovery passed; initial FRV admission requires reconciliation before validation starts.
  • Hosted review only, explicitly authorized by Dallin Romney on November 16, 2026; the local review runner was unavailable and produced no report.

Full installed-package recovery proof

The release adaptation at ee283073849efe6bd080fef53328a3a3ec72a6bf passes the real package-publication-recovery flow in isolated rootless Podman: published [email protected] → authentic publication interruption → public repair → repeated repair → distinct next update (2026.11.6-first-hop.0). All assertions pass, including retained package bytes and authored settings. The rebuilt candidate tarball passes the canonical package integrity check; SHA256 84d5c376381401786a597d62b9cab8e0d89353dbbbd493d47f1cebdef263c8f2. Full next-update result is status: ok, exit 0. This complements the main-branch regression tests; it does not claim main and release source are byte-identical. No integrity guard was disabled.

Record the existing activated-Gateway boot attribution on success as well as failure. Preserve refusal of changes that predate the boot window.

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

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Nov 16, 2026
RomneyDa added a commit that referenced this pull request Nov 16, 2026
Backport the successful-boot attribution fix from PR #200260. Adapt the existing boot-write adoption helper and its settlement call from #198268, without the unrelated canary-runtime changes.

Canonical fix: 533a0fa. Helper provenance: e4a3093.

Co-authored-by: RomneyDa <[email protected]>
@RomneyDa
RomneyDa enabled auto-merge (squash) November 16, 2026 21:23
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Record successful activated-Gateway startup writes so the next Doctor accepts them while preserving rejection of changes made before startup.

Example: An update's successful startup probe initializes credentials.sqlite before a second Doctor runs.

  • Before: The second Doctor refuses with “SQLite migration source changed after update capture”.
  • After: Doctor accepts the startup writes; changes made before the startup probe still cause refusal.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A focused, source-supported repair with useful regression coverage and relevant release-adaptation results, pending the required upgrade coverage.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An update can fail during its second Doctor because its own successful Gateway startup initialized credential state.
Reason: The maintainer-authored direction restores the intended update flow without changing schemas, options, permissions, or the accepted concurrency tradeoff.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a current update failure through the existing attribution owner, and no introduced correctness defect was found.

Priority: P2
Reviewed head: 533a0facc883685126b9c1a56c5179b8cff51683

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted terminal output or logs showing an upgrade from latest stable v2026.11.4 to the main-branch candidate, successful activated startup followed by Doctor, and preserved settings and data; redact credentials, IPs, and non-public endpoints.
Agent review details

How this fits together

The update driver tracks captured database generations across Doctor and Gateway startup, passing accepted postimages to subsequent migration and rollback operations.

flowchart TD
  A[Captured database generations] --> B[First Doctor]
  B --> C[Compare preboot generations]
  C --> D[Activated Gateway startup]
  D --> E[Record attributable postimage]
  E --> F[Next Doctor]
  E --> G[Rollback on failure]
Loading

Technical review

Best possible solution:

Use the existing boot-attribution owner for both startup outcomes while retaining its preboot generation check and sticky restoration refusals.

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

The current-main condition leaves successful boot writes unattributed, and the next migration compares against that stale generation; the supplied recovery account and reported red/green SQLite regression support this path, but this review executed no target code.

Is this the best way to solve the issue?

This is the smallest complete production fix: remove the outcome restriction at the existing owner and retain two distinct acceptance/refusal regressions without adding state or another policy layer.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Activated-Gateway boot-write attribution changes intended behavior with a stated reason (e4a3093: Attribute startup bookkeeping after a failed activated boot so automatic database rollback can restore the captured baseline.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source 0, Tests +56, Other +2. Total +58 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 1 56 0 +56
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 3 60 2 +58

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: A focused repair for a subsequent update failing after successful startup, with limited demonstrated scope.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 16, 2026, 4:35 PM ET / 21:35 UTC.

@RomneyDa
RomneyDa disabled auto-merge November 16, 2026 21:58
@RomneyDa
RomneyDa merged commit 5597108 into main Nov 16, 2026
139 of 140 checks passed
@RomneyDa
RomneyDa deleted the fix/update-successful-boot-attribution branch November 16, 2026 21:58
@RomneyDa

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

RomneyDa added a commit that referenced this pull request Nov 16, 2026
Backport #200063, #200208, #200247, #200260 and #190065 to 2026.10.33. Preserve canonical source credit and maintenance-branch contracts.

All selected exact-head checks passed except the inherited Docker plugin API mismatch; aggregate ci-gate reports that same cause. Landing authorized with this attributed pre-existing failure.

Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: miguelbranco80 <[email protected]>
Co-authored-by: Shakker <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Merge current main, retaining successful-boot write attribution from #200260. Resolve the shared test imports and assert that pre-admission changes still migrate while disabling stale rollback.

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…penclaw#200260)

Record the existing activated-Gateway boot attribution on success as well as failure. Preserve refusal of changes that predate the boot window.

Co-authored-by: RomneyDa <[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 P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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