entities:001 migration: return (entities, 0) on no-facets fresh journal
load_all_legacy_entities was returning bare `[]` on the early-exit
path when `facets/` doesn't exist, but the caller at :261 unpacks
the result as `facet_entities, skipped_detached = ...`. Raises
`ValueError: not enough values to unpack (expected 2, got 0)`.
This maint task auto-runs on every supervisor startup
(think/supervisor.py:1577-1583), so every fresh install with no
`facets/` dir hits the crash before the UI renders. Ramon's
install on 2026-04-22 caught it — silent P0 for new installs.
Fix:
- Return `[], 0` instead of `[]` on the early-exit path.
- Update return type annotation to `tuple[list[FacetEntity], int]`.
Test coverage (tests/test_maint_001_migrate_to_journal_entities.py):
- Fresh journal with no `facets/` dir — asserts `(empty, 0)` return.
- End-to-end migrate_entities() against fresh journal — regression
guard for the ValueError.
- Normal path with populated `facets/` — no regression; skipped
count still reflects detached entities.
Verified the new tests fail against the buggy code and pass against
the fix; all 33 maint-suite tests pass together.
Source: vpe/req_a5zuiqkg (from cpo, Ramon install triage report
b7d4cfa8).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>