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.
Think6m
Plan8m
Build7m
Verify4m
Assertion ledger
9 claims, each independently verified. Showing 8 — show all →
| ID | Says | Matcher | |
|---|---|---|---|
| A001 | Branch names from worktree-checked-out branches are clean and correct | verified | ok |
| A002 | Pipeline stage advances to ready-for-verify when worktree has a build report | verified | ok |
| A003 | Current branch marker is still stripped correctly | verified | ok |
| A004 | The worktree plus-marker regex in work.ts uses a character class that matches both markers | verified | ok |
| A005 | The worktree plus-marker regex in git.ts uses a character class that matches both markers | verified | ok |
| A006 | Test helper accepts a worktree option for creating real worktrees | verified | ok |
| A007 | Worktree cleanup runs before directory removal in test teardown | verified | ok |
| A008 | All existing tests continue to pass after the fix | verified | ok |
Findings 5 total
obspackages/cli/tests/commands/work.test.ts→ closed
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.ts→ closed
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.ts→ closed
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.ts→ closed
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
obs→ closed
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