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.
Think1m
Plan4m
Build9m
Verify5m
Assertion ledger
10 claims, each independently verified. Showing 8 — show all →
| ID | Says | Matcher | |
|---|---|---|---|
| A001 | Phase 2 cannot pass completeness checks using phase 1's legacy save data | verified | ok |
| A002 | Phase 1 still uses legacy save data when numbered keys are missing | verified | ok |
| A003 | Phase 2 status detection does not fall back to legacy save keys | verified | ok |
| A004 | Phase 1 status detection still uses legacy save keys when needed | verified | ok |
| A005 | The existing backward compat test asserts the corrected behavior | verified | ok |
| A006 | Worktree display reuses the shared worktree info function instead of duplicating git queries | verified | ok |
| A007 | Worktree display still shows branch name, commit count, and path | verified | ok |
| A008 | Multi-line next actions display with proper arrow prefix on each line | verified | ok |
Findings 6 total
obspackages/cli/src/commands/work.ts→ closed
Resolves claims summary removed from completeWork — both JSON and human-readable output — without spec authorization
riskpackages/cli/tests/commands/work.test.ts→ closed
Resolves claims tests removed (3 tests, ~120 lines) — unscoped deletion of upstream-finding-resolution feature tests
debtpackages/cli/tests/commands/work.test.ts→ accept
Arrow-line count assertion uses toBeGreaterThanOrEqual(2) — passes with any number >= 2, not specific to the 2-line ready-to-merge case
obs→ closed
printExistingWorktree duplication resolved — uses getWorktreeInfo now
obs→ closed
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