Skip to content

fix: an update with nothing to do no longer copies your databases - #201978

Merged
fuller-stack-dev merged 19 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-noop-takes-no-capture
Nov 22, 2026
Merged

fuller-stack-dev merged 19 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-noop-takes-no-capture

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Every direct openclaw update copied the whole state (config and every database) into <state-dir>.update-captures/<run-id> before it knew whether it would change anything. An update that turned out to be already current, or that was refused, still copied. On a 20 GiB instance that is minutes of disk I/O and 20 GiB of temporary space for an update that does nothing, and on shipped versions the copy stayed behind.

User Impact

An already-current openclaw update, and an update refused before it changes anything, no longer copy the databases. A real update still keeps exactly one original-state capture, taken just before it starts changing state. Nothing new to configure.

Why This Change Was Made

Owner rule: "if snapshots aren't needed, don't do them"; a version check never copies.

  • Root cause. The capture was taken by the initialization owner (update-command-initialization-run.ts) before admission, for every direct CLI run. Whether the run is already current is decided later: for package installs at target selection (known, but not consulted), for Git installs inside the release runner after the build. Nothing reads the capture before those decisions; it is manual-recovery evidence and is handed to Doctor and finalization later.
  • Fix: the same owner, taken lazily. The initialization owner keeps the only capture code and exposes it on the in-process run context as captureOriginal() (runs at most once; never serialized; no new stored field, store, or config). The run calls it at its first state change:
    • activation (beforeActivate in update-command-execution.ts), after its last pre-stop refusal check and before the service stop, so the Gateway still serves while the copy runs: package activation and Git release activation. In release mode this is after the built-equals-running check and immediately before activation; a build alone changes no state;
    • a handoff of the update to the running Gateway (handoffUpdateFromGateway, once it has decided to hand off), because the handed-off update changes state in another process that cannot capture. One place covers both callers, candidate admission and execution;
    • on an already-current core: the legacy config repair, writing a changed update channel, publishing changed plugin records, a hand-off of post-core work to a fresh process (which always runs Doctor repair), or the fresh Doctor that runs after a plugin changed (update-command-noop.ts, update-command-convergence.ts). Those are the points where the run knows beforehand that state-changing work follows. The plugin cohort's per-step checkpoints are not used, since they fire even when nothing changes.
  • Kept eager on purpose. A profile with no state database yet still copies at initialization. The copy is cheap and records that the database was absent before this run's history created one (the fix(update): preserve original state before direct updates #161044 contract for fresh profiles). Fresh-state initialization that writes state before execution also copies first, as before.
  • Refusals. fix(update): preserve original state before direct updates #161044 took the capture before a refused update was written to history so the capture would hold only earlier history. A refused update changes nothing but its own history row, which is not data anyone recovers from, so it now copies nothing. Downgrade confirmation still happens at the same point; it used to be folded into the capture.
  • Plugin operations on an already-current core. Plugin package files are installed first; they are not part of the capture. Install-index rows (in the state database) and plugin config entries are published only when plugins changed, and the run copies just before that publication. Plugin data is migrated only by the fresh Doctor, which runs after the copy and keeps its own migration backups.
  • Gateway-started updates take no capture, before and after this change: the CLI they start carries a run id, which disables the capture, and their Doctor only reads an existing one.

Update behavior for published updaters

On an already-current run there is no candidate: the installed CLI does everything. Shipped drivers up to and including 2026.11.6 (published to latest today without this change) keep copying on no-op runs. The copying stops from the first release that contains this change. The leftovers those drivers leave are removed by the cleanup from #201711, which is already on main: a run recorded as already current has its capture retired at the next cleanup point. A real update driven by a published updater keeps that updater's capture behavior; the candidate does not take a second one.

Evidence

Checklist for landing:

  • (a) A real update still copies before its first state change, on every shape.
    • Package: one sealed capture, recorded on the run.
    • Git (every Git install now updates through releases, feat(update): run every Git install from releases and delete the in-place Git runner #200578): one capture via the runner's mutation hook.
    • Git release: the release runner calls that hook exactly once before activating a rebuilt release, and never for a release that equals the running one.
    • Handoff to a running Gateway: package on Linux and macOS, and Git, each leave exactly one capture.
    • Gateway-started updates: no capture before or after this change (see "Gateway-started updates" above).
  • (b) No path changes state before the capture exists. Every state-change point checks for the capture first: activation, handoff, legacy config repair, a changed channel, plugin record publication, fresh post-core process, post-plugin Doctor, and fresh-state initialization. Each has a test that fails with its hook removed. Plugin publication on an already-current core copies first too (round 2). Plugin package files installed before publication are not part of the capture.
  • (c) A no-op or a refusal before any state change writes nothing to captures. Covered for package and Git no-ops, the Git release no-op, the metadata refusal. The before-stop refusal test went through the in-place Git runner and was removed with it (see Not proven). The disk sampler in the cells measures the same thing.
  • (d) Real updates record the same original-state-capture step and warnings. The real-update cases assert the step. The failed-capture warning keeps its full text, run step, JSON and stderr. The capacity-warning cases are unchanged and pass.
  • (e) Messages stay true. Docs now say when the capture is taken (docs/cli/update/repair-and-recovery.md, docs/cli/update.md). No user-facing message text changed.

Owner tests through the real openclaw update command path (src/cli/update-cli.capture-space.test.ts, process-isolated lane, real capture code):

  • Already-current package update: copies nothing, records no original-state-capture step. RED on base: one capture directory.
  • Already-current Git update: the same. RED on base: one capture directory.
  • Update refused before it changes state (registry metadata refusal): copies nothing. RED on base: one capture directory.
  • Real package update: still exactly one sealed capture named by its run, recorded on the run (passes on base and head; guards against skipping a needed copy).
  • Gateway-started update (run id inherited): no capture on base or head.
  • Real update whose capture fails: continues with the full NO ORIGINAL-STATE SNAPSHOT ... unavailable warning on the run, in JSON and on stderr. This case moved here from update-command-fresh-preview.test.ts, where it used an already-current run that no longer copies.

The other state-change points, each proven to need its hook (each test fails with only that fix reverted):

  • Handoff to a running Gateway (update-cli.service-authority.test.ts, package on Linux and macOS, and Git): the handed-off update leaves exactly one sealed capture. Without the fix, the package and Git cases leave none.
  • Already-current legacy config repair (update-cli.config-convergence.test.ts): the capture exists when the repair runs. Without the fix: none.
  • Post-core work that continues in a fresh process (update-cli.post-core-handoff.test.ts): with a launch, copy then spawn; with a missing entry point, no copy.
  • Already-current core with a changed plugin (update-cli.fresh-doctor.test.ts): exactly one sealed capture exists when the post-plugin Doctor starts. Without the convergence hook: none.
  • Already-current core writing a changed channel (update-command-convergence-authority.test.ts): capture, then convergence. The same run without a channel change copies nothing. Without the fix: convergence only.
  • Git release runner (update-runner-git-release.test.ts, real Git repositories): a rebuilt release reaches the mutation hook exactly once before activation; a release that equals the running one never reaches it.
  • Real Git update through its mutation hook (update-cli.capture-space.test.ts): one sealed capture, recorded on the run.
  • Real package update whose candidate prepares a package publication journal before activation (update-cli.capture-space.test.ts): one sealed capture, and the update succeeds. RED at 0b539bc72bf: update-recovery-pending, the failure the first green cell hit.

#161044 contract, rewritten (update-command-fresh-preview.test-support.ts): a fresh profile still records the database's absence before history (unchanged, passes on base and head); an existing profile copies only at its first state change, after its own history row (RED on base: copied before execution); a refused update now copies nothing (RED on base: a recovery set existed). "Doctor sees an already-current update's completed history" keeps its Doctor and history checks and now asserts that no capture step exists (RED on base).

update-command-run-service-ownership.test.ts: its refused --tag main update asserted that the refusal copied the service profile's state with the selected service env. A refused update now copies nothing. The case now asserts no capture and no capture reference, and keeps its admission, env-selection, ledger and output checks. The fixture rows that only fed the old copy-content check were removed; the earlier run stays because it gives the service profile its state database.

Changed expectations, and why removal is safe: the foreground-failure case in update-cli-failure-recovery.test-support.ts was removed by #200578 with the in-place runner it used. The already-current plugin-exception case (update-cli.plugin-convergence.test.ts) no longer expects a cleanup step: that run copied nothing, so nothing is cleaned. That is the behavior this PR adds.

Recordings of the owner tests (the same update-cli.capture-space.test.ts cases). RED, with the six product files at base c25f49d92f4 and tests from this head, shows 3 failed (package no-op, Git no-op and refusal each copy) and 3 passed (the controls). GREEN on this head shows 6 passed.

unit-base-red.mp4
unit-head-green.mp4

Checks on this head: the touched and affected suites (capture, already-current, fresh Doctor, plugin and config convergence, service authority, convergence authority, fresh preview and terminal, status recovery, capture cleanup, automatic cleanup and its policy, upgrade-survivor no-op, update-restart module outcome, eager-import closure) pass under umask 022; three cases that timed out at 120 s while a package build ran in parallel pass when run alone. pnpm tsgo:core and pnpm tsgo:core:test pass; oxlint clean on touched files; pnpm check:baseline-ratchets --base cd2ae19272a --no-merge-base passes, with test lines at +178 of 400; pnpm check:docs passes; git diff --check clean. autoreview does not run on this machine.

Independent review (fresh read-only reviewer with the diff and the contract, not my conclusions) found one P0 and two P1 gaps, all real and all fixed above with failing-first tests:

  • P0: a handoff during candidate admission took no capture.
  • P1: an already-current legacy config repair wrote config without one.
  • P1: an already-current core that hands post-core work to a fresh process (Doctor repair) took none.

Its P2 notes are addressed as follows:

  • The weak fresh-Doctor assertion now checks the count of sealed copies at the moment Doctor starts.
  • The copy taken after admission includes the run's own history row; see Not proven.

Rating round 1 (ClawSweeper, head bf0d7312785): overall F, proof F, patch D. Each finding was checked against the code first.

  • Channel write before the copy on an already-current core: real, fixed. openclaw update --channel beta on an already-current core with no plugin change wrote update.channel before any copy. The copy now happens first whenever a changed channel will be written (update-command-convergence.ts). Test: fails with only that fix reverted, and the same run without a channel change copies nothing.
  • Plugin publication before the Doctor copy: at first answered with the approved "tell beforehand" rule and listed as a gap; fixed in round 2, below, at the one point where the plugin owner does know.
  • First Git release conversion publishes the release link before the copy: not a capture gap, rejected. The capture holds config, includes, databases, and declared plugin resources (src/infra/update-recovery-baseline-capture.ts). It has never held the install layout. The first release is built from the commit that serves now (update-runner-git-release.ts, the conversion step), so publishing it changes no captured state. Activation of the target release still goes through the mutation hook, where the copy is taken.
  • A pre-stop refusal still copied: real, fixed. An in-place Git update with --no-restart and a running owned Gateway is refused by the before-stop publication check, which ran after the copy. The copy now comes after that check and still before the service stop (update-command-execution.ts). Test: the refused cases copy nothing and the allowed ones copy once; both refused cases fail with only that fix reverted.
  • Docs blurred repairs on an unchanged core with unchanged runs: fixed. The recovery guide now lists each repair that copies on an already-current core.
  • Proof rated mock-only: the installed-package cells and the recordings were not finished at that head. Their results are below.

Rating round 2 (head 4983faf2f3b): overall F, proof F, patch D.

  • Plugin publication before the copy on an unchanged core: real, fixed. The plugin owner knows that a write is coming only when plugins actually changed. At that point it publishes install records and config through one beforeCommit, used by both its records-only path and its config path. The run now copies there first (beforeRecordPublication, passed by post-core convergence). This also covers already-current Git release installs, where no Doctor hook runs. The plugin cohort's beforePersistentEffect checkpoint was tried and rejected: the test showed it fires many times even when nothing changes, so it would have copied on every no-op run with plugins. Test (update-command-plugins.persistence.test.ts): a plugin change gives exactly copy, then commit, with the new records published; no change never copies.
  • The copy spent the activation deadline: real, fixed. The before-stop check and the copy now run before the activation clock starts. The run's --timeout deadline gets one owner method, exclude(operation): it stops the deadline during the copy and moves it by the copy's duration. The copy keeps its own step bound, as on main, where it ran before the deadline existed. An expired budget stays expired. Test (restart-health-deadline.test.ts): five seconds of excluded work leave a 1 s budget at 600 ms remaining, the budget then expires on time, and excluding after expiry is refused without running the work.
  • A handoff copied before resolving the installed updater: real, fixed. The copy now follows the entry-point check and still precedes releasing the executor. Test (update-command-report-handoff.test.ts): the missing-updater refusal copies nothing.
  • Docs promised too much for failures before activation: fixed (docs/cli/update.md).
  • Proof: recordings are linked above, and the installed-package cells follow.

Rating round 3 (head 264a73477b2, the last allowed round): overall F, proof F, patch D. All four findings were real and are fixed; no further round was run.

  • Combined plugin index and config write (P1). When plugins change both records and config, the combined writer commits the install index before the config writer's beforeCommit. Round 2 had removed the copy from that index commit as redundant; that was wrong. Publication hooks now come from one factory (createPluginRecordPublicationHooks in update-command-plugin-records.ts): the index commit and both beforeCommit paths run the copy first. Test: records-only, records-and-config (a real config delta) and unchanged. In each changed case the copy sees the index still empty; with no change, no copy happens.
  • Git release --no-restart channel write (P1). The channel check now runs before the early Git-release branch, so every path that writes a changed channel copies first. Test: copy, then the channel write.
  • Executor clock on an already-current core (P1). The executor's activation deadline gets the same exclude as the --timeout deadline, and the run's copy runs outside both. Test (update-command-executor-deadline.test.ts, real executor): five seconds of excluded work inside a 1 s activation budget leave the fence current, which then expires on the remaining budget.
  • Fresh post-core copy before its launch checks (P2). The copy moved into continuePostCoreUpdateInFreshProcess, after the entry-point and capability checks and before its tentative plugin-index write. Test: with a launch, copy then spawn; with a missing entry point, no copy.

What held the rating at F: the patch tier cited these four timing and ordering gaps, all fixed above. The proof tier said the after-fix installed cells were still pending; their results are in the table below.

End to end (installed-package Docker cells, local OrbStack, update-matrix harness with the per-directory disk sampler). Each cell installs the packed build relabeled as 2026.11.5, with a managed Gateway service, about 2 GiB of agent database and a busy writer (1 MiB/s). It then runs a real openclaw update --yes --json to the same build stamped 2026.11.6, a plain repeat (already current), and openclaw update --tag 9999.0.0 --yes --json, which the registry cannot resolve. Bytes are allocated bytes of ~/.openclaw.update-captures, sampled every 5 s, relative to the start of each step.

Step RED: base cd2ae19272a GREEN: head 2b00acc18a2
Real update (2026.11.5 → 2026.11.6) ok, capture step recorded, captures peak +2,119 MiB, 283.9 s ok, capture step recorded, captures peak +2,119 MiB, 242 s
Repeat, already current skipped/already-current, capture step recorded, captures peak +2,119 MiB, 37.1 s skipped/already-current, no capture step, captures +0 MiB, 9 s
Refused update (target-metadata-preflight) capture step recorded, captures peak +2,119 MiB, 59.9 s, and the 2,119 MiB copy stays behind no capture step, captures +0 MiB, 19 s, nothing left behind

The disk figures come from the per-directory sampler; the VM-wide free-space delta is not used.

The first green attempt, at 0b539bc72bf, failed the real update with update-recovery-pending ("Package publication is incomplete"). The lazy copy ran the package-admission check, which refuses any unfinished package publication, including the one this run had just prepared. The copy now proves ownership with the run's held executor fence instead (update-command-initialization-run.ts). Test (update-cli.capture-space.test.ts): a delegated-post-core candidate prepares its publication journal before activation; the update copies once and succeeds, and it fails with that fix reverted. The green column is the rerun after the fix. The final head bc47162ff2a differs from 2b00acc18a2 by merges of three main commits and an import sort. Two of those commits touch only UI tests and chat reads. The third, #201894, changes post-restart verification (update-command-verification.ts, update-command-post-update.ts). It touches no capture point and no file this PR changes, so the cell was not rerun.

Not proven

  • Git release no-ops are proven at the owner: release mode reports already-current after the built-equals-running check and calls the mutation hook only before activation. They were not run as installed Docker cells, because the dev cells build OpenClaw from source inside the container twice per cell. Since feat(update): run every Git install from releases and delete the in-place Git runner #200578, main has no in-place Git runner, so that shape no longer exists.
  • The red column ran on base cd2ae19272a, not on today's main. main still captures eagerly at admission, so the red behavior is unchanged.
  • The before-stop refusal test that went through the in-place Git runner was removed with that runner in feat(update): run every Git install from releases and delete the in-place Git runner #200578. No package-path before-stop refusal test exists.
  • A manual restore from a capture taken after admission brings back this run's own "running" history row; the next update reconciles it as abandoned. Captures taken before this change held only earlier runs.
  • Windows: the handoff to a running Gateway is Linux and macOS only, unchanged.

Steps left to a person

None. An already-current or refused update does nothing that needs a person. Copies left by drivers up to 2026.11.6 are removed by the existing automatic cleanup on the next update.

Follow-ups (recorded, not built)

  • Same-schema real updates still take the full capture. A real update whose target does not change any schema migrates no database, so under the approved policy (at most one copy-on-write clone per migrating database) it needs no database copy at all; only its config and plugin resources could change. This PR keeps today's full capture for every real update. Today's capture is a byte copy on both macOS and Linux, not a clone: the original-state backup acquires each SQLite source with preserveSourceArtifacts: true (src/infra/update-recovery-baseline-capture.ts:360), which takes prepareSqliteReadOnlyCopyInProcess (src/infra/sqlite-snapshot.ts:557). That copies the live family with clone: "never" (src/infra/sqlite-readonly-location.ts:452), on purpose; the synchronous variant at :188-190 states why: reflinks would lock the source inode and add shared extents to live databases. Only publishing the private staged image into the capture directory (src/infra/sqlite-snapshot.ts:285, via copySqliteFile with clone = "auto" at src/infra/sqlite-file-copy.ts:17) can use clonefile/FICLONE, and only when staging and capture share a volume. So a capture costs at least one full byte copy of every database, plus one clone or second copy.
  • Plugin-only changes on an already-current core copy the whole state before the fresh Doctor. A narrower capture of only the plugin's declared resources would need a capture scope the owner does not have today.

@clawsweeper

clawsweeper Bot commented Nov 19, 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 cli CLI command changes size: M labels Nov 19, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head bf0d73127855b712fff2f727b7163e40529bb81c, but the PR head is now 264a73477b2dd28af045290864cbef1d95560221. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-11-19T18:40:00.871Z sha bf0d731 :: needs changes before merge. :: [P2] Update the remaining consumers of eager capture timing

@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 21, 2026
…-no-capture

# Conflicts:
#	src/cli/update-cli.fresh-doctor.test.ts
#	src/cli/update-cli.post-core-handoff.test.ts
#	src/cli/update-cli/update-cli-failure-recovery.test-support.ts
#	src/cli/update-cli/update-command-execution.test.ts
#	src/infra/update-runner-git-release.test.ts
@fuller-stack-dev
fuller-stack-dev merged commit a577911 into openclaw:main Nov 22, 2026
135 of 136 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/update-noop-takes-no-capture branch November 22, 2026 05:57
obviyus added a commit that referenced this pull request Nov 22, 2026
- #201978 added two Git cases that drive the in-place Git executor, which Git installs no longer
  take. The release path copies nothing when current and never changes the running checkout;
  the package cases stay.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 23, 2026
…enclaw#201978)

* fix(update): copy original state only at the first state change

* docs(update): say when the original-state capture is taken

* fix(update): copy before a Gateway handoff, legacy config repair, or a fresh post-core process

* test(update): expect the copy before a fresh post-core process

* test(update): prove real Git and release updates copy at their mutation hook

* fix(update): copy after the last pre-stop refusal and before writing a changed channel

* test(update): a refused update copies nothing; sort run ids with a comparator

* fix(update): copy before plugin records publish, outside the update deadline, and only once a handoff is certain

* fix(update): copy before the combined plugin index write, every channel write and a fresh post-core launch, outside every update clock

* fix(update): let the lazy capture follow this run's prepared package publication

* test(update): drive the Git no-op capture case through the release runner

* style(test): sort merged imports
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…ate acts on it (#201668)

* fix(update): verify recorded data-at-risk marks before repair acts on them

* fix(update): verify any unverified data-at-risk mark and honor receipts in handoff recovery

* fix(update): recognize a Git release-mode service as its checkout's own

* fix(update): check a recorded data-at-risk mark before the next update, including already-current runs

* fix(update): lead data-at-risk refusals with triage and record them on the refused run

* fix(update): keep data-at-risk refusals within the recorded warning limit

* test(e2e): finish the seeded data-at-risk run with a terminal phase

* fix(update): name the agent route in killed-update recovery refusals

* fix(update): drop an unused import

* test(update): expect the agent route in killed-update refusals

* fix(update): verify the newest mark before restoration without comparing run ids

* fix(update): address review: keep the Gateway down on any inconsistent mark, resolve all marks, harden release ownership

* fix(update): break the admission-root import cycle and type the e2e schema read

* fix(update): address rating findings: agent rollback leftovers, helper restart, blocking findings first, shared Git metadata

* test(e2e): prove the next plain update resolves a mark with the Gateway running

* fix(update): address rating round 2: refuse marks before Doctor, registry-based rollback check, handoff fallback, async history read

* test(update): pick the repair run, not a settlement row, in the data-at-risk cell

* fix(update): resolve live-writer marks after Doctor holds the state

* fix(doctor): say a skipped stale-Gateway stop left the PID running

* fix(update): address rating round 3: leftovers before deferrals, retained rollback files, refusal after Doctor fails finalization

* docs(update): note retained rollback files and refusals after Doctor

* fix(doctor): say a stale Gateway stop could not be confirmed when nothing shows it running

* fix(update): address landing review: revert release-mode ownership, check leftovers first, handoff entry guard, durable rollback evidence

* test(update): follow main's Git release link layout in the launcher refusal test

* fix(update): treat uninspectable leftovers and unreadable databases as unchecked; true wording after Doctor

Release adaptation: Retain the stable installed-recovery harness. Do not add main's installed Docker service cell, later retired by #203808, or Git release-launcher wording/test because stable uses the in-place Git updater. Keep the state-verification, next-update, repair and interrupted-handoff paths and their compatible regressions.

Companion audit: #203486 is present-equivalent at 3081077 (preserved). #201978 is selected next in this lane. #203808 and #203966 involve the inapplicable installed service-cell layout; #203497 and #203194 change main's package/Git activation layout and are not applicable; #204017 depends on that release-install layout. #204077, #204043, #203555 and #203520 are independent authority, cleanup, helper-fixture and config-validation changes. #204151, #203917, #203849 and #203406 are separate guidance, cleanup or status changes, not required by the data-risk verifier. #203569 fixes a separate cron receipt fixture in the same Doctor suite; the touched stale-stop cases do not depend on it.

(cherry picked from commit a28f211)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit f8d4bc138ed2512c413cf96f66fe0eefb3b28d65)
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…01978)

* fix(update): copy original state only at the first state change

* docs(update): say when the original-state capture is taken

* fix(update): copy before a Gateway handoff, legacy config repair, or a fresh post-core process

* test(update): expect the copy before a fresh post-core process

* test(update): prove real Git and release updates copy at their mutation hook

* fix(update): copy after the last pre-stop refusal and before writing a changed channel

* test(update): a refused update copies nothing; sort run ids with a comparator

* fix(update): copy before plugin records publish, outside the update deadline, and only once a handoff is certain

* fix(update): copy before the combined plugin index write, every channel write and a fresh post-core launch, outside every update clock

* fix(update): let the lazy capture follow this run's prepared package publication

* test(update): drive the Git no-op capture case through the release runner

* style(test): sort merged imports

Release adaptation: Keep stable’s in-place Git runner and its existing service and rollback paths. Route the Git no-op fixture through updateGitCheckout and retain the before-mutation capture assertions. Omit the prepared Git release branch and its release-link-only tests. Merge the Doctor and fresh-handoff timing checks alongside the stable-only handoff coverage. Stable arms the executor clock before already-current package maintenance; keep both its timer and its synchronous fence/SQLite deadline checks paused during separately bounded capture. Exercise a live fence assertion after the original activation deadline elapses inside excluded work.

Companion audit: #203578 is present-equivalent at e396e3f; its stable state-ownership guard is preserved. #203194, #203497 and #203926 apply to main’s newer release staging/activation flow and are not applicable here. #204127 changes when plugins are installed after activation, #203917 concerns retained-runtime cleanup, #202934 adds a separate macOS Git prereq, and #204151 is independent handoff repair guidance. None is required for lazy original-state capture.

(cherry picked from commit a577911)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 1a2e6a7bec75074a150a684848990710c3fddc48)
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 P2 Normal backlog priority with limited blast radius. size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant