docs(plan): extension restructure — 6-phase implementation plan

24 tasks across 6 phases derived from the 2026-05-04 extension restructure
spec. Per-task bite-sized steps (TDD where new behavior, verify-existing-
tests where pure relocation) with explicit file/line citations and full
code snippets.

Phase 1 (StateHost typing, S-M, blocks 3+4):     5 tasks
Phase 2 (storage.ts + itemToManifestEntry, S):   3 tasks
Phase 3 (setup wizard SW migration + step registry, L): 7 tasks
Phase 4 (vault.ts split into 5 modules + vault_locked lift, M): 7 tasks
Phase 5 (P2 cluster: timer/gitHost/teardown/allSettled/debounce, M): 5 tasks
Phase 6 (get_vault_status + sidebar status indicator, S-M):     3 tasks
Task 7.1 (final verification sweep against spec Done criteria).

Recommended sequence: 1 → 2 → 5 → 4 → 6 → 3 (independents first, then
the typed-StateHost-dependent phases, then Phase 3 last because it's the
biggest single phase and benefits from all the supporting infra in
place). Max subagent parallelism: 3 streams.

Cross-plan: explicit out-of-scope notes for Plan A (security/docs polish,
already shipped) and Plan B (CLI restructure, already shipped). The
wasm.d.ts file is not touched by this plan (verify empty diff at done).

STATUS + ROADMAP updated to point at the plan.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-05-30 21:36:55 -04:00
parent 39c86ab123
commit 4a1c553f9d
3 changed files with 2670 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ Per the 2026-05-30 post-v0.6.0 audit: of the three 2026-05-04 architecture-revie
- **Extension restructure** — `vault.ts` split (5 modules), setup.ts SW-abstraction routing, type-checked `shared/state.ts`, SW router-helper dedup, `relicario status` parity, plus P2 cleanups (inactivity timer / gitHost-on-expiry / debounced detector). Effort: **L (multi-day to multi-week)**.
Spec: `docs/superpowers/specs/2026-05-04-extension-restructure-design.md`
Plan: not yet written — that's the next concrete move.
Plan: `docs/superpowers/plans/2026-05-30-extension-restructure.md` (6 phases, 24 tasks)
## Medium-term

View File

@@ -128,15 +128,15 @@ Per the 2026-05-30 post-v0.6.0 audit of the three 2026-05-04 architecture-review
- **CLI restructure** (`2026-05-04-cli-restructure-design.md`) — *already shipped* as Plan B Cycles 1+2 (`b9bd152`, `3dd1e1b`, `3759f6a`, `e69b347`); the last gap (read-side `refresh_groups_cache` callers in list/get) closed in `d717f0d`. Done-criteria all met.
- **Security polish** (`2026-05-04-security-polish-design.md`) — *already shipped* as Stream A Cycle 1 (`89090a8`) plus follow-ups (`0c9387f` start.sh fourth window, `229e483` recovery_qr.rs docs). All four phases done.
- **Extension restructure** (`2026-05-04-extension-restructure-design.md`) — **the only genuinely outstanding spec.** Spot-checks confirm:
- `extension/src/vault/vault.ts` is 1037 LOC (spec criterion: ~200; the split into `vault-shell.ts` / `vault-sidebar.ts` / `vault-list.ts` / `vault-drawer.ts` / `vault-form-wrapper.ts` / `vault-status.ts` has not happened)
- `extension/src/setup/setup.ts` still imports `relicario-wasm` directly (the SW-abstraction-bypass that P1.4 calls out)
- `extension/src/shared/state.ts` still has `any`-typed `StateHost`
- `loadDeviceSettings` / `loadBlacklist` / `saveBlacklist` / `itemToManifestEntry` still duplicated across `popup-only.ts` and `content-callable.ts`
- `relicario status` parity gap (no vault-tab equivalent of ahead/behind/lastSyncAt) still open
- Effort estimate from spec: **L (multi-day to multi-week)**
The next concrete move is **writing an implementation plan** for the extension restructure spec.
- **Extension restructure** (`2026-05-04-extension-restructure-design.md`) — **the only genuinely outstanding spec.** Plan written 2026-05-30: `docs/superpowers/plans/2026-05-30-extension-restructure.md` (6 phases, 24 tasks, ~145 bite-sized steps).
- Phase 1 (S-M): `StateHost` typing + `__resetHostForTests` — foundation, blocks 3 + 4.
- Phase 2 (S): Extract `service-worker/storage.ts` + move `itemToManifestEntry` — independent.
- Phase 3 (L): Setup-wizard SW migration + step registry + `clearWizardState`.
- Phase 4 (M): Split `vault.ts` into 5 modules + lift `vault_locked` channel.
- Phase 5 (M): Five P2 fixes (timer reset rule, gitHost on expiry, teardown dedup, allSettled, MutationObserver debounce) — independent.
- Phase 6 (S-M): `get_vault_status` SW handler + sidebar status indicator (closes the `relicario status` CLI/extension parity gap).
- Recommended sequence: Phase 1 → Phase 2 → Phase 5 → Phase 4 → Phase 6 → Phase 3 (independents first, Phase 3 last because it's the biggest single phase and benefits from all the supporting infrastructure landing first).
- Maximum parallelism (subagent-driven): 3 streams (Phases 1+2+5 concurrent; Phases 4 + 6 sequential after 1; Phase 3 sequential after 1).
Beyond extension restructure, ROADMAP medium-term holds Phase 4 command palette (no spec yet). Long-term: relay server, mobile.

File diff suppressed because it is too large Load Diff