Skip to content

test(qa): add managed-worktrees CLI lifecycle scenario coverage - #120335

Merged
steipete merged 3 commits into
mainfrom
claude/peaceful-goldstine-045296
Aug 7, 2026
Merged

steipete merged 3 commits into
mainfrom
claude/peaceful-goldstine-045296

Conversation

@steipete

@steipete steipete commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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.yaml also 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.ts was broken on current main — #119662 rewrote qa/scenarios/models/model-switch-follow-up.yaml to use expectedAlternate.model but left the catalog test asserting the retired alternate?.model literal. 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

  • New e2e (test/e2e/qa-lab/runtime/managed-worktrees-cli-product-proof.e2e.test.ts) spawns the real child CLI with an isolated OPENCLAW_STATE_DIR and proves: worktrees create with .worktreeinclude provisioning (preserved 0600/0755 modes) and the .openclaw/worktree-setup.sh hook (env contract verified), dirty remove pinning refs/openclaw/snapshots/<id>, restore rebuilding the tracked modification as an unstaged change plus untracked and provisioned files while keeping the synthetic snapshot commit out of branch history, and gc preserving manual worktrees. Local run: 1 passed in ~32s (node scripts/run-vitest.mjs ...).
  • extensions/qa-lab catalog + 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.
  • Live browser E2E of the same invariants through the Gateway RPC boundary: built Control UI, ran an isolated dev gateway (--allow-unconfigured, own state dir/port), and drove the Settings -> Worktrees page end to end — New worktree (repository/name/base-branch form) provisioned .worktreeinclude files 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.
  • Codex autoreview (gpt-5.6-sol, high): clean, no actionable findings.

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.
@steipete
steipete marked this pull request as ready for review August 7, 2026 19:50
…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.
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 7, 2026
@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 4:47 PM ET / 20:47 UTC.

ClawSweeper review

What this changes

Adds 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 provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep 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
Reviewed head: 6f01e00b9ff43a0a9bb247395e8f4f0838b66570

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correctly bounded QA addition with no actionable review finding; exact-head CI remains the normal landing gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored QA-only PR is not subject to the external contributor proof gate; its source provides a real child-CLI boundary test, while the claimed browser run was not independently artifact-verified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored QA-only PR is not subject to the external contributor proof gate; its source provides a real child-CLI boundary test, while the claimed browser run was not independently artifact-verified.
Evidence reviewed 6 items Exact-head product-boundary coverage: The new E2E invokes the isolated child CLI for create, remove, restore, list, and GC, asserting the returned records and on-disk lifecycle state rather than calling service internals directly.
Canonical owner boundary: The CLI delegates lifecycle operations to the managed-worktree service, which provisions files and runs the setup hook after creation.
Sibling invariant coverage: Existing service tests cover setup-hook environment, restore shape, and time-advanced manual-owner GC retention; this PR adds the missing real CLI composition proof.
Findings None None.
Security None None.

How this fits together

Managed 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]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still in progress; merge only after the required checks complete on a mergeable current head.
  • Complete next step (P2) - No repair lane is needed: no actionable defect was found, and the remaining action is normal exact-head CI and maintainer merge review.
Agent review details

Security

None.

PR surface

Tests +199, Other +31. Total +230 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 200 1 +199
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 31 0 +31
Total 4 231 1 +230

Review metrics

Metric Value Why it matters
Production versus test delta runtime production +0/-0; tests +200/-1; QA metadata +31/-0 The PR adds lifecycle assurance and coverage inventory without changing shipped managed-worktree behavior.

Stored data model

Persistent data-model change detected: serialized state: test/e2e/qa-lab/runtime/managed-worktrees-cli-product-proof.e2e.test.ts, vector/embedding metadata: qa/scenarios/runtime/managed-worktrees-cli.yaml. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused scenario and child-CLI proof after exact-head CI passes, retaining the taxonomy claim’s intentionally narrow manual-owner GC scope.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a focused test and QA-inventory improvement with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored QA-only PR is not subject to the external contributor proof gate; its source provides a real child-CLI boundary test, while the claimed browser run was not independently artifact-verified.

Label justifications:

  • P3: This is a focused test and QA-inventory improvement with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored QA-only PR is not subject to the external contributor proof gate; its source provides a real child-CLI boundary test, while the claimed browser run was not independently artifact-verified.

Evidence

What I checked:

Likely related people:

  • steipete: Introduced the managed-worktree lifecycle and has the largest sampled history on the worktree and QA surfaces; also authored the exact-head coverage and P2-scope narrowing. (role: feature introducer and recent area contributor; confidence: high; commits: 0acd851a3b3d, 2d70ca5abb21, 959fbb7e5c3b; files: src/agents/worktrees/service.ts, test/e2e/qa-lab/runtime/managed-worktrees-cli-product-proof.e2e.test.ts, qa/scenarios/runtime/managed-worktrees-cli.yaml)
  • Vincent Koc: Current-main blame ties Vincent Koc to the stale catalog assertion, and nearby managed-worktree service history shows continued work in the lifecycle area. (role: recent adjacent contributor; confidence: medium; commits: 58d08dedd39b; files: extensions/qa-lab/src/scenario-catalog.test.ts, src/agents/worktrees/service.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for required exact-head checks to finish before merging.

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.

@steipete

steipete commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete
steipete merged commit 45b1dbf into main Aug 7, 2026
126 checks passed
@steipete
steipete deleted the claude/peaceful-goldstine-045296 branch August 7, 2026 21:18
@steipete

steipete commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 8, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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