Fix worktree branch parsing

`git branch -a` marks branches checked out in linked worktrees with a `+ ` prefix. `getWorkBranch()` at `work.ts:144` strips the `* ` prefix (current branch) but not the `+ ` prefix (worktree branch). The result: when a worktree is active, `getWorkBranch` returns `"+ feature/slug"` — an invalid git ref — to every caller. Build reports become invisible, pipeline stage detection breaks, `--merge` fails, and `work status` shows wrong stages for every work item with an active worktree.

verdict PASSscore 9 / 9findings 5 (0 risk · 2 debt · 3 obs)duration 43mrejection cycles 0shipped May 12, 2026surface cli

Pipeline timeline

Intent to proven code in 43m across Think, Plan, Build, and Verify.

Think
6m
Plan
8m
Build
7m
Verify
4m

Assertion ledger

9 claims, each independently verified. Showing 8 — show all →

IDSaysMatcher
A001Branch names from worktree-checked-out branches are clean and correctverifiedok
A002Pipeline stage advances to ready-for-verify when worktree has a build reportverifiedok
A003Current branch marker is still stripped correctlyverifiedok
A004The worktree plus-marker regex in work.ts uses a character class that matches both markersverifiedok
A005The worktree plus-marker regex in git.ts uses a character class that matches both markersverifiedok
A006Test helper accepts a worktree option for creating real worktreesverifiedok
A007Worktree cleanup runs before directory removal in test teardownverifiedok
A008All existing tests continue to pass after the fixverifiedok

Findings 5 total

obspackages/cli/tests/commands/work.test.tsclosed
No dedicated @ana tag for A003 — existing test satisfies the assertion but is tagged @ana A010 from a prior contract
debtpackages/cli/src/engine/detectors/git.tsclosed
A004 and A005 are source-inspection-only assertions — no behavioral test verifies the regex actually strips + markers in git.ts (only work.ts path is integration-tested)
obspackages/cli/tests/commands/work.test.tsclosed
No mutual exclusion between featureBranch and worktree options in createWorkTestProject — setting both creates branch via checkout then fails on worktree add
debtpackages/cli/src/engine/detectors/git.tsclosed
Integration test covers work.ts parsing path end-to-end but git.ts detectBranches is not exercised by any new test — the fix is verified only by source inspection
obsclosed
Proof chain shows 'Phase detection logic (A001-A003, A006-A011) has no dedicated tagged tests' from prior cycle — still present, not addressed by this build

Integrity seal

scopesha256:460ba0f73c2cc...
contractsha256:2427e481ab399...
plansha256:7f30e4158a926...
specsha256:1457803502095...
build-reportsha256:7515ff2e5fb12...
build-datasha256:e66b2a3c54a8c...
verify-reportsha256:9a5725646e996...
verify-datasha256:c51fd662c5b8a...
audit cmd$ ana proof audit fix-worktree-branch-parsing   → all hashes match