Skip to content

improve(upgrade): cover project workspace startup migration - #150077

Merged
steipete merged 4 commits into
mainfrom
codex/projects-startup-final-tooling-20260916
Sep 16, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/projects-startup-final-tooling-20260916

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Related: #149487, #148637, #149386, #149392

What Problem This Solves

Project inventory checks do not exercise startup backfilling a registered project's canonical workspace from legacy session data during an upgrade.

User Impact

No product behavior change. Maintainers gain an opt-in projects-startup-migration regression scenario for Projects storage work. It stays outside aggregate suites and uses synthetic state, a local project repository and no live provider.

Why This Change Was Made

The scenario creates a project and managed worktree through published [email protected] owners, verifies a backup, and imports two supported legacy sessions with four transcript events. The original updater installs a frozen candidate. Two ordinary Gateway start/probe/stop cycles must then demonstrate one workspace backfill, clean shutdown, preserved state/history and an unchanged second startup.

Policy and shared assertions consume one canonical JSON scenario catalog. Cold planning reads fixed, committed metadata without executing target modules or requiring Acorn. Historical literal catalog hashes remain intact; malformed present JSON is rejected. Both tooling and explicit current-target fixtures carry the declaration. Shutdown checks recognize the actual rendered subsystem prefix and raw JSON/file messages, while rejecting warning or failed terminal results.

Evidence

  • Published-driver live recovery: 29/29 phases passed in one application attempt. Tooling 5ddfc42902e0 exercised published 2026.9.4 / 3a9d69db306c against frozen candidate db3194e07ccc, tar SHA256 c351851a36418e708516b6b8faacbd432b06f3e0d7588c447a1ca3182e0c09d7. All 9,848 installed application records matched the artifact. The actual updater completed in 75.576 s, without follow-up repair.
  • Four snapshots proved the canonical workspace was absent before startup, became the registered project root after the first startup, and remained unchanged after the second. Project/worktree rows, transcript records, session identity/activity, the unrelated session and sentinels were preserved. Backfill counts were 1 / 0; clean-shutdown messages reported 35 / 22 ms. Both health/readiness probe sets passed, and the executor joined all owned processes and completed lease cleanup.
  • Current helper: 13 tests pass, including the reproduced rendered-log mismatch and mixed clean/warning/failed controls. Retained unchanged-scope proof includes 254 cold/planner/package-source cases, 17 workflow/historical cases, 12 shared CLI/copy/release cases and two export-cutover controls. Selected static checks and independent P0-P2 review pass.
  • Exact-head CI passed. Earlier CI and live failure receipts remain preserved; the final run includes the catalog, fixture-copy and shutdown-log corrections.

Evidence limit: the canonical import phase validated the migration manifest and archived-original hashes before successful test cleanup removed those raw files from the ephemeral runtime. Verification hashes, raw reports, the verified backup, all four snapshots and both Gateway logs are retained privately. This qualifies the stated two-session/four-event path on the exact frozen candidate above; it makes no blanket claim about newer main or other runtime scenarios.

@clawsweeper

clawsweeper Bot commented Sep 16, 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 scripts Repository scripts docker Docker and sandbox tooling size: XL maintainer Maintainer-authored PR labels Sep 16, 2026
@steipete
steipete marked this pull request as ready for review September 16, 2026 13:21
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 12:26 PM ET / 16:26 UTC (Revision 5).

ClawSweeper review

What this changes

Adds an opt-in upgrade test for project workspace migration during Gateway startup and centralizes scenario declarations for dependency-free test planning.

Merge readiness

✅ Ready for maintainer review

Keep open as useful, distinct upgrade coverage. The updated runtime receipt resolves the previous review’s incomplete-second-startup concern, and no actionable introduced defect was found.

Priority: P2
Reviewed head: 5ddfc42902e08269e9bc81556756fb5641ade82e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused validation work with a completed, identity-bound runtime receipt, passing exact-head CI, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The updated body reports the exact tooling head completing the published-driver Docker scenario: four persisted snapshots, two ready Gateway runs, clean shutdowns, and backfill counts 1/0 with preserved history. This resolves the prior incomplete-run concern; raw artifacts remain private and coverage is limited to the identified frozen candidate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The updated body reports the exact tooling head completing the published-driver Docker scenario: four persisted snapshots, two ready Gateway runs, clean shutdowns, and backfill counts 1/0 with preserved history. This resolves the prior incomplete-run concern; raw artifacts remain private and coverage is limited to the identified frozen candidate.
Evidence reviewed 9 items Introduced scope: Reviewed the pinned merge-base-to-head changes, including the complete new scenario helper. The stale test merge was not used to attribute current-main changes to this branch.
Production-path upgrade assertions: The runner uses published Doctor import and backup commands, verifies installed candidate identity, and performs two ordinary Gateway start/probe/stop cycles. Each cycle requires clean shutdown before snapshot readback; the helper checks transcript preservation, activity, project/worktree records, sentinels, and second-startup equality.
Updated proof resolves prior concern: The captured PR body, sourceRevision 0b3c5920e1038fc63d9ed94ed7a8862acd5b20d4b1501912ebcb38a84c9e105b, reports 29/29 phases using tooling 5ddfc42, published 2026.9.4, and frozen candidate db3194e. Four snapshots, backfill counts 1/0, clean shutdowns of 35/22 ms, and unchanged second-startup records directly address the previous rank-up move. Raw artifacts remain private; the import manifest and archived originals were validated before runtime cleanup, as disclosed in the body.
Findings None None.
Security None None.

How this fits together

The upgrade survivor harness installs a published OpenClaw release, prepares isolated user state, and runs its updater against a candidate package. It then checks Gateway startup and persisted state to detect upgrade regressions.

flowchart TD
  A[Published OpenClaw release] --> B[Local project and legacy sessions]
  B --> C[Doctor import and verified backup]
  C --> D[Published updater installs candidate]
  D --> E[Two Gateway start and stop cycles]
  E --> F[Compare persisted state and transcripts]
  G[Scenario catalog and package identities] --> D
  F --> H[Upgrade evidence]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +408, Docs +12, Other +680. Total +1100 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 10 446 38 +408
Docs 1 16 4 +12
Config 0 0 0 0
Generated 0 0 0 0
Other 9 748 68 +680
Total 20 1210 110 +1100

Review metrics

Metric Value Why it matters
Runtime versus validation growth Product runtime +0; tooling +680; tests/support +408 net lines Growth implements the published-upgrade fixture, persisted-state checks, and catalog integration without adding product runtime behavior.
Opt-in harness surface 1 scenario and 1 bindings environment variable added; aggregate defaults unchanged The extra package-specific setup applies only when this scenario is explicitly selected.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/assertions.mjs, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/project-worktree-startup.mjs, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/run.sh, migration/backfill/repair: scripts/e2e/upgrade-survivor-docker.sh, migration/backfill/repair: scripts/lib/docker-e2e-plan.mts, migration/backfill/repair: scripts/lib/upgrade-survivor-policy.mjs, and 9 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Retain this focused scenario within the existing survivor lifecycle, with package-bound observations and unchanged aggregate defaults.

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

Not applicable as a product bug: this PR adds internal validation coverage. Its supplied runtime receipt reports the intended migration and repeat-startup behavior.

Is this the best way to solve the issue?

Yes. Extending the canonical upgrade harness and sharing inert scenario metadata avoids a competing lifecycle or planner implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 22c4164c86b5.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The updated body reports the exact tooling head completing the published-driver Docker scenario: four persisted snapshots, two ready Gateway runs, clean shutdowns, and backfill counts 1/0 with preserved history. This resolves the prior incomplete-run concern; raw artifacts remain private and coverage is limited to the identified frozen candidate.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: Adds bounded regression coverage for persisted project and session state during published upgrades.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The updated body reports the exact tooling head completing the published-driver Docker scenario: four persisted snapshots, two ready Gateway runs, clean shutdowns, and backfill counts 1/0 with preserved history. This resolves the prior incomplete-run concern; raw artifacts remain private and coverage is limited to the identified frozen candidate.
  • proof: sufficient: Contributor real behavior proof is sufficient. The updated body reports the exact tooling head completing the published-driver Docker scenario: four persisted snapshots, two ready Gateway runs, clean shutdowns, and backfill counts 1/0 with preserved history. This resolves the prior incomplete-run concern; raw artifacts remain private and coverage is limited to the identified frozen candidate.

Evidence

What I checked:

  • Introduced scope: Reviewed the pinned merge-base-to-head changes, including the complete new scenario helper. The stale test merge was not used to attribute current-main changes to this branch. (scripts/e2e/lib/upgrade-survivor/project-worktree-startup.mjs:1, 5ddfc42902e0)
  • Production-path upgrade assertions: The runner uses published Doctor import and backup commands, verifies installed candidate identity, and performs two ordinary Gateway start/probe/stop cycles. Each cycle requires clean shutdown before snapshot readback; the helper checks transcript preservation, activity, project/worktree records, sentinels, and second-startup equality. (scripts/e2e/lib/upgrade-survivor/run.sh:2084, 5ddfc42902e0)
  • Updated proof resolves prior concern: The captured PR body, sourceRevision 0b3c5920e1038fc63d9ed94ed7a8862acd5b20d4b1501912ebcb38a84c9e105b, reports 29/29 phases using tooling 5ddfc42, published 2026.9.4, and frozen candidate db3194e. Four snapshots, backfill counts 1/0, clean shutdowns of 35/22 ms, and unchanged second-startup records directly address the previous rank-up move. Raw artifacts remain private; the import manifest and archived originals were validated before runtime cleanup, as disclosed in the body. (5ddfc42902e0)
  • Cold planning preserves execution boundary: The planner parses and validates committed JSON metadata without importing selected-target modules. Missing JSON retains the historical catalog lookup; malformed present JSON fails. The new catalog is included in the verified tooling closure and affected fixture copies. (scripts/lib/docker-e2e-plan.mts:245, 5ddfc42902e0)
  • Current-main necessity: Current main retains the workspace migration owner and its backfill log, but does not contain the new project-worktree startup scenario file. The related merged inventory/Doctor coverage does not exercise this two-startup preservation path. (src/config/sessions/startup-migration.ts:281, 22c4164c86b5)
  • Release comparison: The new scenario file is also absent from the supplied latest release, v2026.9.4. This PR adds validation coverage rather than claiming a new product fix or shipped release. (scripts/e2e/lib/upgrade-survivor/project-worktree-startup.mjs, 3a9d69db306c)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-16T13:28:49.563Z sha e7b98d5 :: blocked before merge. :: none
  • reviewed 2026-09-16T14:17:07.129Z sha 862159b :: blocked before merge. :: none
  • reviewed 2026-09-16T14:43:33.809Z sha 2c5bc9a :: blocked before merge. :: none
  • reviewed 2026-09-16T15:54:28.821Z sha 5ddfc42 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 16, 2026
@steipete
steipete merged commit a3017f7 into main Sep 16, 2026
147 checks passed
@steipete
steipete deleted the codex/projects-startup-final-tooling-20260916 branch September 16, 2026 16:36
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…#150077)

* test(upgrade): cover project workspace startup migration

* fix(upgrade): keep survivor catalogs dependency-free

* test(upgrade): copy current catalog into frozen target fixtures

* test(upgrade): recognize formatted shutdown results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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