work.ts saves.json backward compat bug + worktree dedup + formatting

Fix three clustered quality issues in work.ts identified by AnaLearn session 5. The priority is a logic bug in saves.json backward compatibility that allows multi-phase completeness checks to pass using wrong-phase data. Secondary: eliminate duplicated worktree-info computation and fix a broken multi-line display in work status.

verdict PASSscore 10 / 10findings 6 (1 risk · 1 debt · 4 obs)duration 1h 40mrejection cycles 0shipped May 15, 2026surface cli

Pipeline timeline

Intent to proven code in 1h 40m across Think, Plan, Build, and Verify.

Think
1m
Plan
4m
Build
9m
Verify
5m

Assertion ledger

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

IDSaysMatcher
A001Phase 2 cannot pass completeness checks using phase 1's legacy save dataverifiedok
A002Phase 1 still uses legacy save data when numbered keys are missingverifiedok
A003Phase 2 status detection does not fall back to legacy save keysverifiedok
A004Phase 1 status detection still uses legacy save keys when neededverifiedok
A005The existing backward compat test asserts the corrected behaviorverifiedok
A006Worktree display reuses the shared worktree info function instead of duplicating git queriesverifiedok
A007Worktree display still shows branch name, commit count, and pathverifiedok
A008Multi-line next actions display with proper arrow prefix on each lineverifiedok

Findings 6 total

obspackages/cli/src/commands/work.tsclosed
Resolves claims summary removed from completeWork — both JSON and human-readable output — without spec authorization
riskpackages/cli/tests/commands/work.test.tsclosed
Resolves claims tests removed (3 tests, ~120 lines) — unscoped deletion of upstream-finding-resolution feature tests
debtpackages/cli/tests/commands/work.test.tsaccept
Arrow-line count assertion uses toBeGreaterThanOrEqual(2) — passes with any number >= 2, not specific to the 2-line ready-to-merge case
obsclosed
printExistingWorktree duplication resolved — uses getWorktreeInfo now
obsclosed
saves.json fallback bug resolved — phase guard added in both code paths
+1more findings

Integrity seal

scopesha256:be2ed5885dc48...
contractsha256:07ec902427d6c...
plansha256:fc0fb2fe5484b...
specsha256:91dcd2f0c1650...
build-reportsha256:da5238875c7a6...
build-datasha256:b48c5b445a560...
verify-reportsha256:465c97de13d45...
verify-datasha256:0cab077de2c76...
audit cmd$ ana proof audit fix-work-saves-compat   → all hashes match