Skip to content

fix(update): copy memory before the dashboard and unattended appliers rewrite the install - #21873

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/12440-update-memory-copy
Oct 21, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/12440-update-memory-copy

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The dashboard's Update button and the gateway's unattended update take the same fresh copy of every memory store that kirocrew update takes, and never rewrite the install when that copy did not land.

kirocrew update copies every memory store right before it rewrites the install, and refuses when the copy fails (#12428). Two other paths rewrite the same install with no copy at all: api_update_apply (the dashboard's Update button) and GatewayOrchestrator._auto_apply_update (the unattended update, including the one a policy min_version floor forces). A bad upgrade on either path could cost up to a day of memory, the gap since the last scheduled copy.

Why it matters

memory.db is the one file in the crew home that nothing else can rebuild. The unattended path runs when nobody is watching, so it is the path where a lost store is noticed last.

Not a goal

  • The reset --hard calls under src/kiro_crew/apps/builtins/auto_improvement/: they reset a scratch clone, not this install (the issue's own out-of-scope list).
  • The unattended policy-provider apply in slack/gateway_runtime/update_schedule.py (provider.apply()). The issue does not name it, and it is a separate applier; it is raised for a follow-up instead.
  • The managed-venv wheel applier: it already copies through its before_promote hook (wheel_apply.memory_snapshot_hook).
  • Any change to how the copy itself works, where copies are stored, or their permissions. Both paths call the existing step unchanged.

What changed (motivation → approach → change)

Both appliers rewrote the install with no copy, because only the CLI called the copy step. Each now calls that same step, wheel_apply.snapshot_memory_before_update, before it rewrites anything. It runs on a worker thread, since it copies SQLite files. The refusal text now has one spelling, wheel_apply.snapshot_refusal (src/kiro_crew/platform/wheel_apply.py), shared by the wheel hook, both new sites and the CLI (src/kiro_crew/cli_server_update.py). The memory spec (docs/system-specs/modules/memory-skills-hooks.md) now says every applier copies first and how each one refuses.

  • Dashboard Update button (src/kiro_crew/dashboard/handlers/updates_apply.py). A failed copy refuses the request with HTTP 500, code memory_snapshot_failed, and the same "Not updating … kirocrew memory backups" message the CLI prints. No fast-forward is started. A shutdown that begins during the copy answers 503 shutting_down, so no installer starts after the shutdown sweep. A policy-defined update command gets the same gate when it can apply, matching the CLI.
  • Unattended update (src/kiro_crew/slack/gateway_runtime/update_apply.py). A failed copy skips this update. It logs a warning, shows one dashboard notice and a failed progress line, and tries again on the next check. It never resets without a copy and never exits the gateway. Every one of its refusals (local commits, repo exec config, a dirty tree, hidden edits, untracked collisions, the interpreter floor) runs once before the copy, so a checkout that keeps being refused takes no copy and rotates no backup out. All of them then run again after the copy, directly before reset --hard, so a change made during the copy is still caught.

A new structural test reads the syntax tree of the three applier files. Each call that rewrites the install must have a copy call after the previous rewrite and before it, so one update path cannot borrow another path's copy, and a new rewrite added without one fails CI, as the Design lane asked on #12428.

Backwards compatibility

Compatible: an install whose stores copy cleanly updates exactly as before. An install with no stores yet copies zero and goes on, as the CLI does.

Removes nothing: the change only adds a refusal on a failed copy, the same one kirocrew update already makes. No key, route, field or function is removed or renamed.

Tests

  • test/test_dashboard_updates_coverage_apply.py::TestApplyRefusals::test_memory_is_copied_before_the_fast_forward: the copy runs once, before git merge --ff-only.
  • …::test_a_failed_memory_copy_refuses_the_apply: a failed copy answers 500 memory_snapshot_failed, schedules no worker and runs no merge.
  • …::test_a_policy_apply_copies_memory_first_and_refuses_without_it: a policy apply copies first, and a failed copy stops it.
  • test/test_slack_gateway_update_reset.py::TestAutoApplyUpdateResetPath::test_memory_is_copied_before_the_reset: the copy runs once, before git reset --hard.
  • …::test_a_failed_memory_copy_skips_the_update_and_says_so: no reset, no restart, one notice, one failed progress line.
  • test/test_update_memory_copy_placement.py: every rewrite in the three applier files has its own copy since the previous rewrite, the known appliers are all found, and a second path that only has the first path's copy above it is flagged. Deleting the dashboard git path's copy now fails it.

All six fail with the source change reverted and the tests kept (5 failed, and the placement test fails for both appliers). Determinism: 10 repeated runs green, plus one shuffled order green. The existing applier tests (743 across 13 files) still pass.

Manual verification

N/A — unit coverage sufficient: both appliers are driven end to end through their real handler and orchestrator code with git and the copy step stubbed.

Related Issues

Closes #12440

Follow-up for the unattended policy-provider applier: #21898. This PR fixes the gap at the caller level (each applier takes the copy itself); #21898 is the cause-level fix, moving the policy path's copy to the one seam every policy apply goes through.

Pattern harvest

Rule candidate: review-prompt
Pattern: a new path that rewrites the install without calling the pre-update memory copy. test/test_update_memory_copy_placement.py now enforces it for the three applier files.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 18, 2026 11:50
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision f1f4ed0deb8e775614b9a48d5873403c343dc98c touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of f1f4ed0deb8e775614b9a48d5873403c343dc98c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that the dashboard Update request, which now waits for the copy of every memory store before it answers, finishes in reasonable time on an install with large stores.

[DESIGN-REVIEWED] f1f4ed0

Description read

[DESCRIPTION-READ] c32f7d07ff86da2540780a6454124973f2cd1b3725c72b7775fffaf276045720

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f1f4ed0deb8e775614b9a48d5873403c343dc98c — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

When #21898 moves the policy copy to the provider seam, it must also delete the caller-level copy at updates_apply.py:104. Otherwise one dashboard policy apply makes two copies and rotates out two backups.

What this change ships

Inventory (7 items) — 6 justified

Intent: one Update click or unattended update can no longer lose up to a day of memory.db. Both paths now take the same pre-update copy kirocrew update takes. FIX (#12440).

  1. Dashboard Update copies memory before the fast-forward. A failed copy refuses with 500 memory_snapshot_failed — justified
  2. A dashboard policy apply that can apply copies first. Check-only and Windows providers copy nothing — justified
  3. A shutdown that begins during the dashboard copy answers 503 and starts no installer — justified
  4. Unattended git update copies before reset --hard. A failed copy skips this update with one notice and a failed progress line, then retries next check — justified
  5. Unattended refusals now run before the copy as well as after it, so a checkout that keeps being refused rotates no backup out — justified
  6. kirocrew update's three-line refusal is now one line, shared via snapshot_refusal (4 consumers) — rides along, declared, harm-free
  7. A structural test fails CI when a rewrite of the install has no copy before it — justified

[FIRST-PRINCIPLES-REVIEWED] f1f4ed0

Description read

[DESCRIPTION-READ] 872364252cbfed216bbcfa7000df8987386c798d878d8a564b8bd72924a96a80

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed f1f4ed0deb8e775614b9a48d5873403c343dc98c — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] f1f4ed0

Verdict parsed from the review's SHA-scoped output markers for commit f1f4ed0deb8e775614b9a48d5873403c343dc98c.

False positive or not applicable? A repository writer can comment:
/ai-review override fable f1f4ed0deb8e775614b9a48d5873403c343dc98c: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of f1f4ed0deb8e775614b9a48d5873403c343dc98c and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f1f4ed0

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f1f4ed0deb8e775614b9a48d5873403c343dc98c: <one-sentence reason>

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Close to ready. The copy is in the right place on both appliers, and it matches what kirocrew update does. One should-fix in the new placement test.

Head reviewed: 64fe1d1.

What I checked on this head:

  • Dashboard apply: the copy runs after every refusal that leaves the tree alone (dirty tree, fetch, divergence, upstream pin, interpreter floor) and before _apply is scheduled. A failed copy returns 500 with no worker. The policy branch uses the same can_apply() gate as the CLI.
  • Unattended apply: the copy runs after step 5 and before the update ownership step and git reset --hard. A failed copy redacts and caps the text, sends one notice keyed on the target, and returns without a restart.
  • The copy runs through asyncio.to_thread, so it does not block the event loop.
  • Issue #12440 is tier T1. No file is on the security path denylist. One commit, fix: title, Pattern harvest present.

Should-fix (inline): the placement pin is satisfied in api_update_apply by the policy-branch copy, so deleting the git-path copy keeps it green. I confirmed this with a mutation.

Open items from the automated lanes, for the author to answer:

  • The two provider.apply() calls in update_schedule.py still run with no copy. The description defers them to a follow-up. Please link that follow-up issue in the description.
  • The copy now runs inside the POST /api/update request, so a large store makes the request wait for the copy. Please confirm this stays inside the dashboard request timeout for a large store.

CI: Build, CI and CodeQL show as cancelled on this head, and readiness is still checking. A rerun is needed before merge.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 18, 2026
@iamwhatever
iamwhatever force-pushed the fix/12440-update-memory-copy branch from 64fe1d1 to 790fcd9 Compare October 18, 2026 12:52
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 18, 2026
@iamwhatever
iamwhatever force-pushed the fix/12440-update-memory-copy branch from 790fcd9 to 8b5627a Compare October 18, 2026 13:30
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=b5422cfac5df fixed

Fixed in 8b5627a: docs/system-specs/modules/memory-skills-hooks.md now says every applier that rewrites the install copies first, where POST /api/update and the git auto-update take it, and how each refuses (CLI exit 1, dashboard 500 memory_snapshot_failed, unattended skip + one notice + retry).
It names the one applier still without a copy, the unattended policy-provider apply, and links #21898.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • fixed: the CLI kept its own spelling of the refusal

Fixed in 8b5627a: cli_server._snapshot_memory_or_exit now prints wheel_apply.snapshot_refusal(failure), so the CLI, the wheel hook, the dashboard and the unattended path share one spelling.

@iamwhatever

iamwhatever commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author
  • rebutted: two quick Update clicks racing

api_update_apply has never held an in-flight guard on its git branch; two concurrent POSTs already raced the fetch, the ff-only merge and the rebuild on main, so this PR adds no new race.
What this PR adds to that existing race is a second complete memory copy, which spends one extra retention slot and loses no data.
An apply-level single-flight guard is a separate change outside this PR's goal.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 18, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • rebutted: a repeatedly failing copy stalls a forced update silently

Only the dashboard notice is deduped (one per target per process). Every retry still logs a WARNING and pushes a failed progress line carrying the snapshot_refusal text, so the operator sees the refusal on each check.
The mandatory path keeps retrying on its cadence; not applying a min_version update without a copy is the intended outcome of this PR's goal.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • accepted-and-deferred: unattended policy-provider apply has no copy

Confirmed: #21898 owns both provider.apply() sites in update_schedule.py, with the task, deferred-finding label, assignee and Due line, and adds that file to the placement pin.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 18, 2026
@iamwhatever
iamwhatever force-pushed the fix/12440-update-memory-copy branch from 8b5627a to 7b640ab Compare October 18, 2026 14:36
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 18, 2026
@iamwhatever

iamwhatever commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=e4a294dac144 fixed

Fixed in 6180ae8: the three cheap refusals (commits ahead, repo exec config, dirty tracked tree) now run once before the forced copy via _refuses_cheaply(), so a checkout refused on every check takes no copy and rotates no backup out of backup_keep; checks 1-5 still run again directly before reset --hard. New test test_a_dirty_tree_refuses_before_any_memory_copy fails on 39311c3 and passes on 6180ae8.

@iamwhatever

iamwhatever commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=1f5c8e370bc4 fixed

Fixed in 6180ae8: the three cheap refusals (commits ahead, repo exec config, dirty tracked tree) now run once before the forced copy via _refuses_cheaply(), so a checkout refused on every check takes no copy and rotates no backup out of backup_keep; checks 1-5 still run again directly before reset --hard. New test test_a_dirty_tree_refuses_before_any_memory_copy fails on 39311c3 and passes on 6180ae8.

@iamwhatever

iamwhatever commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=f738f8cccea0 fixed

Fixed in 6180ae8: the three cheap refusals (commits ahead, repo exec config, dirty tracked tree) now run once before the forced copy via _refuses_cheaply(), so a checkout refused on every check takes no copy and rotates no backup out of backup_keep; checks 1-5 still run again directly before reset --hard. New test test_a_dirty_tree_refuses_before_any_memory_copy fails on 39311c3 and passes on 6180ae8.

@iamwhatever

iamwhatever commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=a1b708788106 fixed

Fixed in 6180ae8: the three cheap refusals (commits ahead, repo exec config, dirty tracked tree) now run once before the forced copy via _refuses_cheaply(), so a checkout refused on every check takes no copy and rotates no backup out of backup_keep; checks 1-5 still run again directly before reset --hard. New test test_a_dirty_tree_refuses_before_any_memory_copy fails on 39311c3 and passes on 6180ae8.

@iamwhatever

iamwhatever commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=f8ca03648460 fixed

Fixed in 6180ae8: the three cheap refusals (commits ahead, repo exec config, dirty tracked tree) now run once before the forced copy via _refuses_cheaply(), so a checkout refused on every check takes no copy and rotates no backup out of backup_keep; checks 1-5 still run again directly before reset --hard. New test test_a_dirty_tree_refuses_before_any_memory_copy fails on 39311c3 and passes on 6180ae8.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=ee674e1a8165 fixed

Fixed in 6180ae8: the PR description no longer says the copy comes after every refusal; it now says the cheap refusals run before the copy and all last-moment checks run again after it.

@iamwhatever

iamwhatever commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=9454cf4d6f97 fixed

Fixed in 6180ae8: the three cheap refusals (commits ahead, repo exec config, dirty tracked tree) now run once before the forced copy via _refuses_cheaply(), so a checkout refused on every check takes no copy and rotates no backup out of backup_keep; checks 1-5 still run again directly before reset --hard. New test test_a_dirty_tree_refuses_before_any_memory_copy fails on 39311c3 and passes on 6180ae8.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=b70c8acf8760 fixed

Fixed in 6180ae8: the cheap refusals now run before snapshot_memory_before_update, so a dirty or ahead checkout no longer spends a forced copy each check; the last-moment revalidation still runs after the copy, directly before reset --hard.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • accepted-and-deferred: unattended policy-provider apply has no copy

Tracked as the cause-level follow-up in #21898.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 20, 2026
@iamwhatever
iamwhatever force-pushed the fix/12440-update-memory-copy branch from 6180ae8 to 5c73076 Compare October 20, 2026 20:46
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=dc166696f92b fixed

Fixed in 5c73076: every refusal (checks 1, 2, 3, 3b, 4, 5) now lives in _refused_before_reset(), run once before the memory copy and once after it, directly before reset --hard. A checkout that keeps failing any of them takes no copy; a change made during the copy is still refused before the reset.
Tests added/changed: test_every_refusal_runs_before_any_memory_copy test_an_edit_made_during_the_copy_refuses_the_reset

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=b70c8acf8760 fixed

Fixed in 5c73076: checks 3b, 4 and 5 now also run before the forced copy (one _refused_before_reset() pre-pass), so a persistent hidden edit, untracked collision or interpreter-floor refusal no longer spends a copy each check. The same helper runs again after the copy, ahead of reset --hard.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=188f7c6844de rebutted

Same ruling as rounds 7-10 (retrospective this round, verdict keep): the CLI gate is already on main; moving the gate into apply_policy_update changes that seam's bool|None contract, shared with the update_schedule.py sites this PR's Not a goal excludes, and would merge the dashboard's 500 memory_snapshot_failed into policy_update_failed.
The cause-level move is tracked in #21898.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head reviewed: 5c73076 (rebased onto a newer main, plus a real change since fa2777a).

What changed since my last review: the unattended git applier now runs every pre-reset refusal (commits ahead, exec config, tracked edits, hidden edits, untracked collisions, interpreter floor) through one _refused_before_reset() helper, called once before the memory copy and once after it. That is a good answer to both concerns at once. A checkout that keeps refusing no longer spends a copy every check and rotates backups out of memory.backup_keep, and an edit made while the copy runs is still caught before reset --hard. The new test_every_refusal_runs_before_any_memory_copy cases and test_an_edit_made_during_the_copy_refuses_the_reset pin both orders.

One blocker on this head: Backend Lint & Type Check is red in the mypy step, and it comes from this refactor. Moving the checks into a nested function drops the if _git is None narrowing from the outer scope, so mypy sees str | None at three call sites. I reproduced it locally with mypy on update_apply.py: errors at lines 401, 480 and 600. Details inline.

Verified locally on this head: test_slack_gateway_update_reset.py, test_update_memory_copy_placement.py, test_dashboard_updates_coverage_apply.py, test_facade_mirror_guards.py and test_spawn_audit.py, 174 passed.

The min_version question is unchanged by this push: wheel_apply.py and the dashboard handler carry the same behaviour as fa2777a, so a store that never copies still holds back a forced min_version update. That stays a maintainer decision, so this review is a comment, not an approval.

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Oct 20, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • accepted-and-deferred: the dashboard gate resolves the provider separately from apply_policy_update

Real, and the same double lookup the CLI already has on main (cli_server_update._update). A policy edit between the two reads could skip or waste one copy; nothing applies without a copy on the git path, which keeps its own gate.
Removing the second lookup is the seam move tracked in #21898, which deletes both caller-side gates.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • accepted-and-deferred: unattended policy-provider apply has no copy

#21898 is assigned to iamwhatever, labelled deferred-finding, and carries a Due date; the memory spec names the gap and links it.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incremental review of 52145b8 against 5c73076 (same base, the only changes are in update_apply.py and test/link_screen_sites.py).

The mypy failure from my last review is fixed. _git is now narrowed once into git_bin: str right after the is None return, and the three uses inside _refused_before_reset (git status --porcelain, git diff --name-only --diff-filter=A, and the incoming_python_floor_breach call) read git_bin, so the nested helper no longer sees str | None. Backend Lint & Type Check is green on this head. The link_screen_sites.py entry now names the helper at its new nesting depth (_auto_apply_update._refused_before_reset._obstructions), which matches where _obstructions lives after the refactor. Both edits are behaviour neutral: same binary, same arguments.

No new findings. What I verified: the interdiff between the two heads, the narrowing site and every git_bin use in the file, and the check rollup (some backend test shards were still running when I looked).

One thing remains open and is not mine to decide: whether the update min_version floor should move with this change. That is a maintainer call, so I am leaving this as a comment rather than an approval.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review-ready at 52145b8: PR Readiness passed (readiness: passed), every CI job green (the macOS shard-1 red was a runner out-of-memory flake, recorded as #22599 and green on its one rerun), mergeable, no unresolved threads. GPT and Opus report no findings on this head; every Design / First Principles item has a disposition.

Open for the maintainer:

Not merged, approved, or set to auto-merge; that is the maintainer's call.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased onto main 6c133fa to clear a conflict: main split test/test_spawn_audit.py (#22389), moving its allowlist into test/spawn_audit_helpers.py. This PR's one allowlist entry (update_apply.py::_refused_before_reset, the moved git status / git diff --diff-filter=A spawns) now sits there, beside ::_auto_apply_update; test_spawn_audit.py is main's copy. Targeted tests (240) and mypy pass; CI re-running.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • rebutted: the Update request waits on the copy

POST /api/update already waits on slower inline work before it answers (a git fetch bounded at 30 s, the rev-list count and the interpreter-floor read); the copy runs in asyncio.to_thread so the event loop stays free, and an SQLite online backup of a store is seconds-scale.
Answering only after the copy is what lets the button show a refused copy as an error instead of a background worker failing later.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Already written into #21898: when the copy moves into apply_policy_update, remove the caller-level policy copies in updates_apply.api_update_apply and cli_server_update._update, so a policy apply copies once.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review-ready at f1f4ed0: PR Readiness passed (readiness: passed), every CI job green, mergeable, no unresolved threads. GPT and Opus report no findings on this head; every Design / First Principles item has a disposition.

Open for the maintainer:

Not merged, approved, or set to auto-merge; that is the maintainer's call.

@chenmingwei23 chenmingwei23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: readiness passed, no conflicts, checks green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The dashboard and unattended update appliers take no memory copy before rewriting the install

3 participants