Repository navigation
fix(test): verify workspace repair during update - #150375
Conversation
|
🦞👀 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. Reviewed September 16, 2026, 7:33 PM ET / 23:33 UTC. ClawSweeper reviewWhat this changesThe PR updates upgrade-test assertions, regression tests, and documentation to require workspace repair during update and unchanged persisted state across both subsequent Gateway starts. Merge readiness✅ Ready for maintainer review This remains a useful, focused correction to upgrade validation: current main still expects startup repair after that responsibility moved to Doctor. No actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe upgrade-survivor harness imports synthetic legacy sessions through a published OpenClaw installation, updates to a candidate package, and inspects stored state. Its snapshots and Gateway logs determine whether workspace repair and session preservation satisfy the upgrade contract. flowchart LR
A[Published installation] --> B[Legacy session import]
B --> C[Update and candidate Doctor]
C --> D[Verify workspace repair]
D --> E[Two Gateway start and stop cycles]
E --> F[Compare snapshots and shutdown logs]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +17, Docs +1, Other +8. Total +26 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep Doctor as the repair owner and make the existing upgrade scenario enforce repair completion before startup while preserving session and transcript bytes. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the mismatch: current main expects missing metadata after update and a first-start backfill, while Doctor now owns repair. No tests or application code were executed during this read-only review. Is this the best way to solve the issue? Yes. Updating the existing scenario assertions is the narrow fix, and the new pre-startup comparison strengthens preservation checks without adding another repair path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 04ce86783632. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
The Projects upgrade-survivor scenario still expects Gateway startup to repair legacy workspace metadata after #150110 moved that repair into Doctor.
User Impact
No user-visible change. The scenario now requires the normal update to finish workspace repair before Gateway startup and verifies that both starts preserve the repaired state.
Why This Change Was Made
The published 2026.9.4 updater already invokes candidate
doctor --non-interactive --fix. The fixture must therefore lack the field after published import and contain exactly the registered project root after update. Both Gateway runs must report no workspace backfill and preserve the stored records. Existing import, archive, identity, transcript, sentinel, snapshot-cleanup, and shutdown checks remain; no extra Doctor recovery pass is added.Related: #150077, #150110.
Evidence
The updated controls reproduced three failures against the original helper, including its first-start backfill expectation in both raw and rendered logs. All 13 focused tests now pass, covering staged field presence, missing or premature repair, wrong roots, unrelated mutations, and shutdown failures. The old inline snapshot timing was source-audited; its policy now belongs to the existing assertion used by the real snapshot command and pure fixtures.
Selected formatting, type, lint, boundary, and dead-export checks passed, as did independent P2 review. The corrected tooling
a7acea6dpassed all 29 phases with published2026.9.4/3a9d69dbupdating to exact candidated40b6293(tar SHA-256870f8907e6bbb4b75268736eae3557ab90fb74840565eb9a11f4df821802b4d7) in one application attempt. All 9,871 installed records matched. Doctor repaired the workspace during update; four snapshots verified preservation, and both starts performed zero backfills and shut down cleanly. One queued lease was replaced before any application attempt. Earlier proof remains separately attributed. Successful cleanup removes raw migration manifests and archived originals after validation; hashes, reports, backup, snapshots and logs remain privately retained.