# Retest Plan v2 — New User End-to-End

**Date:** 2026-04-07
**Owner:** 135-provision agent
**Backend:** local (`http://192.168.13.72:8000`) — has PR #274 numeric qty + news derive fix
**Mobile:** Expo on port 8083, branch `feat/simtrade-provision-on-login` (PR #135)
**Evidence folder:** `.agent-status/retest-evidence/v3-newuser/`

## Focus

Brand new user flow. Not the existing $50k test account. We need to verify the FULL provisioning + first-time experience + buy/sell flow.

## Test Scenario

| # | Step | Expected |
|---|------|----------|
| 1 | **Register fresh user** via Supabase signup (e.g. `mfathonin+rt$(date +%s)@nanostreet.ai`) | New user created, JWT received |
| 2 | First app load after login → `POST /provision` auto-fires (PR #135) | New Alpaca account created, `already_existed: false`, account funded |
| 3 | Check `GET /account` | Equity > $0 (whatever sandbox can fund — likely $50k via ACH) |
| 4 | SimTrade tab loads | Onboarding sheet shows (first time) |
| 5 | Complete onboarding (tap through both steps) | Sheet hides, `onboardingCompleted: true` persists |
| 6 | Insights/Progress/News tabs | Show empty CTA (no positions yet — verifies GAP 2/3 fix) |
| 7 | **BUY**: Place market buy AAPL × 2 | Order accepted, filled |
| 8 | After order → portfolio invalidates (verifies GAP 1 fix) | Equity/cash updates without manual reload |
| 9 | Insights/Progress/News tabs | Show real content (positions exist now) |
| 10 | **BUY**: Place limit buy MSFT × 1 at $400 | Order accepted, filled or pending |
| 11 | Check positions | AAPL × 2, MSFT × 1 |
| 12 | Check portfolio history | Initial flat line + post-buy data point |
| 13 | **SELL**: Place market sell AAPL × 1 (partial) | Order accepted, filled |
| 14 | Check positions | AAPL × 1 (decreased), MSFT × 1 |
| 15 | Check orders list | All 3 orders visible with correct status |
| 16 | Check portfolio news | News for AAPL/MSFT (verifies backend news fix) |
| 17 | Check insights | AI cards present |
| 18 | Logout, login fresh user #2 | Onboarding sheet shows (verifies userId-scoped key) |

## Evidence Capture

For EVERY step capture in `.agent-status/retest-evidence/v3-newuser/`:
- `NN-step-name.png` — screenshot
- `NN-step-name-network.json` — relevant request/response (for API steps)
- `NN-step-name-console.log` — any console errors

Final: `v3-summary.md` with pass/fail per step + bug findings.

## Tooling

- Playwright MCP against Expo web on `http://localhost:8083`
- Local backend on `http://192.168.13.72:8000`
- Supabase signup directly via curl for fresh users

## Pass Criteria

- All 18 steps pass
- Provisioning works for fresh users (PR #135 verified)
- Cache invalidation works after buy AND sell (GAP 1 verified)
- Empty state CTAs show before any positions (GAP 2/3 verified)
- News populates after buying (backend news fix verified)
- Onboarding key scoped per user (verified)

## Gaps Handling

- **Mobile bug** → fix in PR #135 branch
- **Backend bug** → tell backend-integration agent (window 5) to fix in PR #274 / news branch
- Keep PRs unmerged until all gaps resolved
