test(qa): cover session and Workboard managed-worktree lifecycles; fix symlinked state-dir lock blindness (#120362)

* fix(agents): canonicalize managed worktree paths

* test(qa): cover managed worktree owner lifecycles

* test(agents): split worktree canonical-path regression into focused file

* fix(doctor): canonicalize persisted managed-worktree paths for symlinked state dirs

* fix(doctor): keep worktree path migration detection read-only

* test(doctor): bound managed-worktree migration product proof

* fix(doctor): keep worktree path detection from creating state dirs

* test(doctor): allow state migration detection under CI load

* test(agents): split embedded-runner steering runs into focused file

Unblocks the check-lint gate broken by #120285's max-lines overflow.
This commit is contained in:
Peter Steinberger
2026-08-07 18:57:36 -07:00
committed by GitHub
parent 0463d1bd83
commit 6a6cd7859f
16 changed files with 1281 additions and 350 deletions
@@ -0,0 +1,27 @@
title: Managed worktrees session-owner lifecycle
scenario:
id: managed-worktrees-session-lifecycle
surface: runtime
category: agent-runtime.agent-turn-execution
coverage:
primary:
- agent-runtime.managed-worktrees-session-lifecycle
objective: Prove the real child gateway creates and persists a session-owned managed worktree, runs a turn from it, protects it during live-session garbage collection, snapshots and removes clean and dirty checkouts on session deletion, restores dirty state without synthetic branch history, and reports locked checkouts as preserved.
successCriteria:
- sessions.create returns the managed checkout and sessions.list persists its id, branch, and repository root while a real mock-provider turn remains usable.
- Garbage collection returns its structured result while preserving the live session-owned worktree.
- Clean and dirty session deletion remove the checkout with a pinned restorable snapshot, and restore rebuilds dirty untracked state without adding the synthetic snapshot commit to branch history.
- A foreign git worktree lock makes session deletion report worktreePreserved with the checkout still present.
docsRefs:
- docs/concepts/managed-worktrees.md
- docs/concepts/qa-e2e-automation.md
codeRefs:
- src/gateway/server-methods/sessions-create.ts
- src/gateway/server-methods/sessions-delete.ts
- src/agents/worktrees/service.ts
- test/e2e/qa-lab/runtime/managed-worktrees-session-lifecycle-product-proof.e2e.test.ts
execution:
kind: vitest
path: test/e2e/qa-lab/runtime/managed-worktrees-session-lifecycle-product-proof.e2e.test.ts
summary: Run the real child gateway through session worktree creation, turn execution, live-owner garbage collection, snapshot deletion and restoration, and locked-checkout preservation.
@@ -0,0 +1,26 @@
title: Managed worktrees Workboard-owner lifecycle
scenario:
id: managed-worktrees-workboard-lifecycle
surface: runtime
category: agent-runtime.agent-turn-execution
coverage:
primary:
- agent-runtime.managed-worktrees-workboard-lifecycle
objective: Prove the real child gateway materializes a Workboard card workspace as a managed wb-<card-id> worktree, writes the resolved checkout and branch back to the card, runs its subagent, and removes the clean checkout losslessly at run end.
successCriteria:
- Dispatch materializes the card's source workspace under the managed state directory as wb-<card-id> on branch openclaw/wb-<card-id>.
- The dispatched card persists the resolved managed checkout path and branch while retaining its source workspace metadata.
- The real mock-provider subagent run reaches a terminal outcome and run-end cleanup removes the clean checkout losslessly.
docsRefs:
- docs/concepts/managed-worktrees.md
- docs/concepts/qa-e2e-automation.md
codeRefs:
- src/agents/worktrees/service.ts
- extensions/workboard/src/dispatcher.ts
- extensions/workboard/src/dispatcher-workspace.ts
- test/e2e/qa-lab/runtime/managed-worktrees-workboard-lifecycle-product-proof.e2e.test.ts
execution:
kind: vitest
path: test/e2e/qa-lab/runtime/managed-worktrees-workboard-lifecycle-product-proof.e2e.test.ts
summary: Run the real child gateway through Workboard card worktree materialization, workspace writeback, subagent completion, and run-end lossless removal.