Repository navigation
fix(update): preserve local package overrides - #89985
fuller-stack-dev merged 143 commits into
Conversation
|
Codex review: blocked before merge. Reviewed September 11, 2026, 6:58 AM ET / 10:58 UTC (Revision 34). ClawSweeper reviewWhat this changesPackage updates preserve locally edited distribution files in recovery bundles and add an explicit option to replay them when upstream baselines match. Merge readiness⛔ Blocked before merge - 2 items remain This PR remains useful: current main lacks the preservation behavior, both earlier code findings are repaired, and the latest maintainer disposition resolves the previous acceptance checklist. No new actionable defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe package updater stages and validates a replacement installation before swapping it into service. This change captures local files from the retained old package and optionally restores trusted edits into the private candidate. flowchart TD
A[Installed package and local edits] --> B[Stage and validate replacement]
B --> C[Drain service and retain old package]
C --> D[Capture recovery bundle]
D --> E{Replay requested and baselines match?}
E -->|Yes| F[Replay into private candidate]
E -->|No| G[Keep bundle for manual recovery]
F --> H[Activate and verify package]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1835, Tests +1648, Docs +44, Other +97. Total +3624 across 37 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the accepted preserve-by-default, explicit-replay design within the existing package transaction, including its documented upgrade limits and recovery bundles. Do we have a high-confidence way to reproduce the issue? Not applicable as a new preservation/replay capability; the supplied real npm/pnpm evidence demonstrates the motivating loss and repaired behavior, but this read-only review did not execute updates. Is this the best way to solve the issue? Yes. The patch extends the existing swap owner, preserves legacy artifacts without guessing baselines, and separates automatic preservation from explicitly consented replay. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 227e7ae26af4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (33 earlier review cycles; latest 8 shown)
|
4f1fef0 to
d694e2b
Compare
d694e2b to
ecaa970
Compare
6717762 to
b7c8cdd
Compare
|
Maintenance repair is pushed at exact head
The merge tree is clean against current |
|
🦞👀 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. |
|
Repair published at The final-rename finding was valid. I reproduced both failures against the prior head: a destination created immediately before publication was overwritten and replay reported success; restoration also overwrote a concurrently created destination. The repair uses the pinned dependency's existing public
Verification: 101 targeted tests passed, including all nine real-npm update scenarios and four publication/recovery regressions; the four regressions passed again after the final callback lint fix. The packaging contract suite passed 63 tests with three Windows-only cases skipped locally. Core/core-test types, typed owner lint, export/assertion/deadcode guards passed. Inventory fixture expectations now reflect the advertised content metadata; frozen filename-only fixtures remain unchanged. Guards and baselines were not weakened. Product direction: preservation plus explicit trusted-code replay is the accepted scope for this refresh. The documented refusals and manual recovery retention are intentional. Matching file baselines is not a promise that local code works with every new release. Legacy full-dist recovery copies need disk space and manual cleanup; unsupported entries must be repaired before retrying. The first upgrade from an updater without this feature still requires a manual backup. Data compatibility: this extends package-artifact integrity metadata and named recovery backups, not a runtime database/configuration schema or a new durable state owner. The actual published The canonical package rebuild for this exact head is running. Earlier canonical tarball checks are supporting evidence, not an exact-head artifact stamp; I will add the new digest once the build and integrity checks finish. Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/34588506381 . Native preparation and landing remain gated on current review and CI; no auto-merge is armed. The automatic exact-head ClawSweeper review is already running: https://github.com/openclaw/clawsweeper/actions/runs/34588634221 . No duplicate re-review request is being made. |
|
Installed-runtime repair is published at The late dependency-lifetime finding was valid. A new regression executes the production swap owner from inside the package being replaced, with the actual fs-safe JavaScript and native dependency copied inside that installation. At the previous head, both cases failed after the live package moved: replay applied zero changes and retained the backup. The repair resolves dependency realpaths before service drain and uses the existing runtime-relocation owner to map only paths inside the moved package/project to its retained backup. External dependency stores retain their original paths. The exact prepared URLs are used throughout publication and restoration; the helper does not resolve from the missing live tree or the new candidate. Verification:
Maintainer disposition: accepted. Preserve local packaged changes by default and retain explicit, operator-consented trusted-code replay. The documented legacy-copy disk cost/manual retention, unsupported-topology refusals, first-hop manual backup requirement, and lack of cross-release compatibility guarantees for local code are accepted parts of this scope. This is not an unresolved product decision for this refresh. The artifact-format compatibility evidence remains in the PR body; there is no new runtime database/configuration schema or durable state owner. The exact-head canonical rebuild, automatic CI and fresh review remain landing gates. No auto-merge is armed, and no duplicate review or CI dispatch is being requested. |
|
Final artifact and review disposition for The canonical package build passed, including bootstrap/UI checks, bundled dependency validation and dist import-graph checks. The packed Actual artifact controls passed:
Maintainer disposition for the three remaining checklist items in ClawSweeper revision 33:
Revision 33 reviewed this exact head, found no actionable code defects, and rated the real-update proof sufficient. The installed npm/pnpm, late-edit, unsafe-topology, atomic-race and Doctor-rollback proof remains recorded in the earlier evidence. I also reviewed the newer release-closeout main Exact-head CI is still running. Two failures outside the changed updater are under bounded retry diagnosis: iMessage self-chat and the shutdown fixture's |
|
Merged via squash.
|
What Problem This Solves
A packaged OpenClaw update replaces
dist, losing operator-maintained local files and edits. A successful update then retires its previous-package backup. This also loses edits made while the replacement package is being installed.Why This Change Was Made
Preserve local packaged overrides at the existing package-swap boundary, after service drain and the old-tree move. Save recovery material before retiring the old generation, and replay only into the private candidate when the operator explicitly passes
--reapply-local-overrides.The updated implementation follows the current retained-transaction owners rather than restoring the deleted global updater. It adds content hashes to the existing packaged inventory contract and validates them in the updater and tarball checker. No historical release allowlist, dependency patch, new state schema, or service-custody implementation is introduced.
User Impact
distchanges and report the named recovery bundle; they do not automatically execute local code.distpayloads are preserved for manual inspection, without guessing which bytes are local. Inventory metadata and dependency trees are excluded.This is a refresh of the same PR. Container guidance and service-custody work remain with their separate owners.
Maintainer disposition: accepted. This refresh retains automatic preservation and explicit trusted-code replay. The documented legacy-copy disk cost/manual retention, unsupported-topology refusals, and absence of cross-release local-code compatibility guarantees are accepted parts of that scope. The first-hop manual backup requirement remains. No runtime database/configuration schema or new durable state owner is introduced.
Evidence
Independently reproduced on main
f551ccc6fcf499e5d7711d91aa80cb053b6443d9: a real disposable npm update loses a modified executable, an existing local addition, and a late addition, then retires the backup.Repaired real-npm matrix: 9/9 cases passed, covering late replay, preservation without replay, unchanged packages, filename-only legacy artifacts, upstream conflicts, unsafe topology, install failure, Doctor failure, and refusal to roll back over later edits.
Real pnpm 12.3.4 native-project update from a disposable 2026.9.3 package to 2026.9.4 replayed both early and late additions. Installed bytes were read back and the installed fixture CLI executed successfully.
Frozen CLI and existing package-update suites passed 570 tests, including the source-freshness check. Focused inventory, replay mode, mutation-boundary, retained-swap, and detached-handoff coverage also passed. Public CLI routing carries explicit consent and refuses the flag on unrelated update subcommands.
The current validator accepted the published
[email protected]tarball, SHA-2564f1f656770461d4677dea755b1899cba12b912b06798c89a59e2f0c18688b761, without a historical exception.Fresh independent review of the frozen candidate reported no P0 findings. This is supporting review evidence, not a claim that lower-priority review or required CI is unnecessary.
Exact-head canonical artifact at
7f1860a452c73faa9f6fc6d8adfa7a2d6aae0779passed the complete build, bootstrap/UI checks, bundled dependency validation and dist import-graph checks. Tarball SHA-25646c190219d2e81c98d655f95786133477f66d8f0eb28b488ea27f9d4c8564a39. The actual tarball checker rejected both a tampered JavaScript payload and missing advertised content metadata. The packed build-info identifies this exact head.Core, core-test, and packaging-script typechecks, typed lint, and staged size/environment ratchets passed.
Review follow-up: atomic publication/restoration now uses the pinned dependency's public
rename-noreplaceprimitive. Real final-rename fault injection reproduced clobbering before repair; after repair, competing destinations survive both paths, and post-rename sync failures restore upstream bytes. Four committed regressions cover these cases. No dependency patch was needed.Follow-up verification passed 101 targeted tests (including 9 real npm updates and 4 final-rename/sync-failure regressions), plus 63 packaging contract tests. Three Windows-only packaging cases were skipped locally and remain covered by required CI. Strict types and typed lint passed.
Static-contract and inventory fixture CI findings were repaired without changing any guard or baseline.
Refreshed head:
7f1860a452c73faa9f6fc6d8adfa7a2d6aae0779. Exact-head CI and the native preparation/merge gates remain required before landing. Local executable proof used isolated temporary packages and state on macOS; no operator fleet, installed service, or global configuration was changed.Installed self-update follow-up: reproduced the helper import failure while the updater and actual fs-safe/native dependencies lived inside the package being renamed. Resolve module realpaths before service drain, then relocate only the dependency paths covered by the complete package/project move into the retained backup. External stores keep their original paths. Publication and restoration use those same prepared URLs.
Two committed installed-updater regressions now pass: late-edit replay and rollback after Doctor failure. The complete follow-up run passed 76 tests, including the nine real-npm scenarios, four atomic race/sync regressions, and native staging/transaction coverage. Core and core-test types, scoped typed lint, export/assertion checks, and size/environment ratchets passed.
Real pnpm 12.3.4 self-update also passed with the full update owner and fs-safe/native dependency loaded from inside the old installed package. Both early and late additions survived in the new native package group; installed bytes were read back and its fixture CLI executed successfully.
Current-main integration: independently reviewed the newly landed baseline-timeout recovery owner at
f50d4ce71e3eee4005f297f05caa402f8a571fca. The clean combined tree passed 69 tests: 18 bounds/timeout cases (including replay after timeout and rollback afterward), 40 CLI reporting/admission cases, and 11 real-npm/installed-updater E2E cases.The combined tree exceeded the swap file's line budget. Extracted only the PR-owned preparation/capture/replay sequence into
package-update-local-overrides.ts, and moved the unchanged input type to the existing swap contract module. The exact extracted merge tree passed all 69 tests again, typed lint and the unchanged line/environment ratchets. No rebase or mainline policy changes were needed.Release-closeout integration: main
c677baebc93f4de4ed323580fda0f85895512a3dsubsequently changed unconfigured-install finalization and absent-service admission. Reviewed those changes and ran the affected suites on the clean combined tree6eba65e825b6d0fb22ee84060e50c1c0ab1c3ff6: 58/58 tests passed, including the source-freshness check. No PR-head change or sibling work was imported.