Repository navigation
test(qa): add managed-worktrees CLI lifecycle scenario coverage - #120335
Conversation
Managed worktrees had zero QA scenario-pack coverage despite being a headline feature. Mint agent-runtime.managed-worktrees-lifecycle in the taxonomy, add a runtime scenario, and prove the real child CLI through create with .worktreeinclude provisioning and the .openclaw setup hook, dirty removal pinning a snapshot ref, restore rebuilding tracked, untracked, and provisioned files with their modes, and gc preserving manual worktrees.
…flow qa/scenarios/models/model-switch-follow-up.yaml switched to expectedAlternate.model in 5a795f4 but the catalog test still greps for the retired alternate?.model literal; the test is outside the PR change-classification lanes, so the break only surfaces on direct runs.
…ual-owner gc ClawSweeper P2 on #120335: the scenario proves manual-owner gc retention only; session and Workboard cleanup lifecycles are not exercised, so the coverage description must not claim them.
|
Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 4:47 PM ET / 20:47 UTC. ClawSweeper reviewWhat this changesAdds a selectable QA Lab scenario and child-CLI lifecycle test for managed-worktree provisioning, snapshot removal and restore, and manual-worktree GC retention, plus a stale QA catalog assertion correction. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open: it adds a focused missing product-boundary QA proof, current main does not contain it, and review found no patch defect. It is maintainer-authored and CI is still running, so normal exact-head merge gating should decide landing. Priority: P3 Review scores
Verification
How this fits togetherManaged worktrees flow from the CLI into the managed-worktree service, which provisions files, runs repository setup hooks, snapshots dirty removals, restores state, and cleans expired records. QA Lab discovers YAML scenarios and runs their linked product checks as coverage evidence. flowchart LR
A[CLI worktree commands] --> B[Managed worktree service]
B --> C[Provision and setup hook]
B --> D[Snapshot restore and cleanup]
C --> E[CLI JSON result]
D --> E
E --> F[QA Lab product proof]
F --> G[Coverage taxonomy]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +199, Other +31. Total +230 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused scenario and child-CLI proof after exact-head CI passes, retaining the taxonomy claim’s intentionally narrow manual-owner GC scope. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR supplies missing lifecycle coverage rather than reporting an end-user failure; the existing child-CLI test is the concrete verification path. Is this the best way to solve the issue? Yes. A QA scenario plus real child-CLI proof covers the operator-visible boundary that existing service tests do not, while retaining those unit tests for the underlying lifecycle invariants. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 588d8bb85388. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Merged via squash.
|
…claw#120335) * test(qa): add managed-worktrees CLI lifecycle scenario coverage Managed worktrees had zero QA scenario-pack coverage despite being a headline feature. Mint agent-runtime.managed-worktrees-lifecycle in the taxonomy, add a runtime scenario, and prove the real child CLI through create with .worktreeinclude provisioning and the .openclaw setup hook, dirty removal pinning a snapshot ref, restore rebuilding tracked, untracked, and provisioned files with their modes, and gc preserving manual worktrees. * fix(qa): align model-switch catalog assertion with expectedAlternate flow qa/scenarios/models/model-switch-follow-up.yaml switched to expectedAlternate.model in 779446f but the catalog test still greps for the retired alternate?.model literal; the test is outside the PR change-classification lanes, so the break only surfaces on direct runs. * test(qa): narrow managed-worktrees taxonomy description to proven manual-owner gc ClawSweeper P2 on openclaw#120335: the scenario proves manual-owner gc retention only; session and Workboard cleanup lifecycles are not exercised, so the coverage description must not claim them.
What Problem This Solves
The QA scenario pack (
qa/scenarios/**) had zero coverage of managed worktrees (docs/concepts/managed-worktrees.md,src/cli/worktrees-cli.ts,src/agents/worktrees/service.ts) despite it being a headline feature (session worktrees, Workboard workspaces, snapshot/restore).taxonomy.yamlalso had no worktree coverage ID to attach evidence to.Why This Change Was Made
Managed worktrees only had unit-level coverage of the service internals; nothing proved the operator-visible lifecycle through a real product boundary. This adds a QA scenario backed by a real child-CLI product proof, plus the taxonomy coverage ID it reports against.
Included bounded fix (pathfinder):
extensions/qa-lab/src/scenario-catalog.test.tswas broken on currentmain— #119662 rewroteqa/scenarios/models/model-switch-follow-up.yamlto useexpectedAlternate.modelbut left the catalog test asserting the retiredalternate?.modelliteral. The assertion is outside PR change-classification lanes, so it only fails on direct runs. One-line alignment.User Impact
Test/QA-only; no production code changes. QA coverage inventory gains
agent-runtime.managed-worktrees-lifecycle, and QA suite runs can now select managed-worktree lifecycle proof.Evidence
test/e2e/qa-lab/runtime/managed-worktrees-cli-product-proof.e2e.test.ts) spawns the real child CLI with an isolatedOPENCLAW_STATE_DIRand proves:worktrees createwith.worktreeincludeprovisioning (preserved 0600/0755 modes) and the.openclaw/worktree-setup.shhook (env contract verified), dirtyremovepinningrefs/openclaw/snapshots/<id>,restorerebuilding the tracked modification as an unstaged change plus untracked and provisioned files while keeping the synthetic snapshot commit out of branch history, andgcpreserving manual worktrees. Local run:1 passedin ~32s (node scripts/run-vitest.mjs ...).extensions/qa-labcatalog + scorecard evidence suites: 65/65 passed with the new scenario registered.pnpm maturity:check,pnpm tsgo:all,pnpm check:test-types, oxfmt,git diff --check: green. Heavy lanes ran locally (no Crabbox on this host — documented trusted-source fallback); Linux-only lanes covered by PR CI.--allow-unconfigured, own state dir/port), and drove the Settings -> Worktrees page end to end — New worktree (repository/name/base-branch form) provisioned.worktreeincludefiles with modes and ran the setup hook; Delete showed the "Snapshot and delete" confirm, pinned the snapshot ref, and flipped the row to Restorable; Restore rebuilt tracked/untracked/provisioned state with modes and no snapshot commit in branch history; Clean up now preserved the active manual worktree. Disk state verified after each step.