Files
pad/internal
xarmian de9c87622a test(store): end-to-end onboarding walkthrough — fresh seed → user activity → idempotent re-trigger (TASK-1137) (#405)
Validates the entire arc PLAN-1131 promises, at the store level (the
API surface real workspace creation and real agent activity ultimately
call through). The "agent" steps are stubbed via direct CRUD — the
agent's reasoning is independently locked down by TASK-1136's resource
test, so this layer focuses on the workspace state machine.

Three phases mirror the user's experience:

Phase 1 — Fresh-workspace seed:
  - The four onboarding seeds land at IDEA-1 / PLAN-2 / TASK-3 / DOC-4
    in the right order with the right titles + statuses.
  - Conventions + playbooks land too (after the user-facing seeds).
  - IDEA-1 starts in status=new — the gate the post-signup hint relies
    on for "should I show the dashboard banner?".

Phase 2 — Agent walks user through populating real items:
  - IDEA-1 status flips new → exploring (signaling engagement).
  - One real plan gets created, three tasks under it, one user-supplied
    idea — using the actual user-facing collections.
  - IDEA-1 status flips exploring → implemented (closes the loop;
    dashboard banner hides on next refresh).

Phase 3 — Idempotency on re-trigger (server-startup auto-upgrade or
explicit re-init):
  - User's plan / tasks / idea remain untouched.
  - IDEA-1 status STAYS at `implemented` — re-seeding must NOT reset
    it to `new`, which would silently re-show the banner and confuse
    the user.
  - No duplicate seed items.
  - Conventions + playbooks counts unchanged.

Failure of any of these signals a regression in PLAN-1131's success
criteria. Walk back through the design doc before "fixing" the test.

Three small test helpers also added (findItemByTitle, extractStatus,
setItemStatus, countItemsInCollection) — kept private to the package
and used only by this test, but factored out so the assertions read
cleanly.

Parent: PLAN-1131. Origin: IDEA-1128.
2026-05-04 10:24:19 -04:00
..
2026-03-26 01:52:36 +00:00