PSSaaS Architect — Phase 8 Workstream 2: React UI
Role: PSSaaS Systems Architect
Phase: PowerFill Phase 8 Workstream 2 (React UI) — operator workflow on top of the Phase 8 W1 Superset analytical surface
Date dispatched: TBD (next Architect session)
Model required: Opus 4.7 High Thinking — verify in the Cursor model picker before responding. If running under any other model, STOP and escalate.
Estimated effort: Per Phase 8 W1 completion report's Counterfactual Retro #6: 1-2 Architect-sessions if scoped to "Submit / Status / List / Reports navigation" surface. Per Phase 7 CR #5 banked observation: "API contract layer ~1-2 sessions; React scaffolding ~2-3 sessions." Workstream 2 is the React scaffolding portion; the API contract layer is fully stable from Phases 7 + 6e.
Predecessor work (updated 2026-04-19 post-A54-fix + canonical Claim-vs-Evidence family adoption): Phase 8 W1 (Superset Dashboards) is COMPLETE as of 6d19d24. 8 dashboards × 25 charts deployed to PSX Superset; A63+A64 added. THREE substantive changes since the W1 push that W2 must internalize:
- A54 + A56 RESOLVED via narrow ADR-021 §"Narrow Bug-Fix Carve-Out" (commit
cf8ef8b, sentinel bumped tophase-8-superset-ready-a54-fixed). End-to-end Complete PowerFill run is now empirically achievable on PS_DemoData (~30s; pool_guide_count: 515; UE step succeeds with 12 forensic events). - A66 added — UE clears + rebuilds-empty the user-facing run-output tables on syn-trade-empty datasets like PS_DemoData. The F-7-8 / 688-row Cash Trade Slotting pattern from W1 has been correctly superseded — Cash Trade Slotting now shows 0 rows post-Complete-run because UE supersedes Step 4's
pfill_cash_market_map. Hub Dashboard 1 (run history) is the new canonical proof-of-life. W2 freshness-rendering must handle A66's empty-state semantics, not just the original A54-blocked semantics. - Canonical Claim-vs-Evidence antipattern family adopted (commits
95084cb/10133c6/d4a70af/863c139) — three new antipatterns (Predictive Inflation / Capability Inflation / Capability Drift) + three new practices (#12 Three-Category Criterion / #13 Environment-Explicit Inventory / #14 Durable Regression Harness on Cadence) + procedural-vs-structural-vs-trigger-based countermeasure shapes + new cross-project-relays archive folder. Most relevant for W2: practice #13 (Environment-Explicit Inventory) — when claiming W2 capabilities, characterize per environment (dev / staging / production) explicitly. The W1 → A54-fix arc was the lead canonical example of Capability Inflation; W2 is the most likely vehicle for a repeat unless the discipline is applied actively.
PO milestone for Phase 8 ("PowerFill reports with drill-down in Superset that I can review") is achievable from W1 + A54 fix alone. W2 adds operator workflow on top — submit / monitor / cancel runs + drill-into-Superset deep-links + freshness-aware Note rendering per A60 — but is not strictly required for the milestone. Per PO sequence preference (2026-04-19): A54 fix → W2 → Phase 9 → Greg demo. W2 dispatched as the second item in that sequence.
Session-start checklist
Read these in this order before doing anything else:
CLAUDE.md— project identity, role-identification procedure, push-is-an-ask conventionAGENTS.md— agent memory: principles, lessons, F-PSD findings summarydocs-site/docs/agents/architect-context.md— your role definitiondocs-site/docs/agents/process-discipline.md— canonical practices, gates, antipatterns. Per Phase 8 W1 completion CR #1, the next revision likely promotes "Backlog re-read pass at planning time" to canonical sub-practice; check for that revision and use it explicitly in §2 of your plan.docs-site/docs/agents/handoff-prompts.md— Templates for delegationdocs-site/docs/handoffs/pssaas-session-handoff.md— current state (phase-8-superset-ready-a54-fixed; W1 COMPLETE + A54 fix shipped + canonical Claim-vs-Evidence family adopted; W2 first kickoff). Re-read the Backlog table during planning per the trigger-based countermeasure shape (canonical commit 10133c6) — Backlog re-read pass at planning-start is now anticipated for canonical adoption (F-8-BR-1 + the F-7-7 walkback are 2-instance corroboration); use it explicitly in §2 of your plan.docs-site/docs/specs/powerfill-engine.md§Phased Implementation (line ~640: "Phase 8 — Superset dashboards + React UI — 1-3 weeks → W1 DONE; W2 deferred") + §Output APIs (the 8 endpoints W2 fetches) + §Data Contracts (response shapes per report)docs-site/docs/handoffs/powerfill-phase-8-completion.md— the upstream W1 completion report (W2 builds on this)docs-site/docs/handoffs/powerfill-phase-7-completion.md— Phase 7 endpoint contracts (the 8 GET endpoints W2 fetches)docs-site/docs/adr/adr-025-powerfill-report-api-pattern.md— Phase 7 ADR; the 4 freshness-verdict semantics (Current / Stale / TerminalEmpty / RunNotFound) are the load-bearing UX signal for W2's Note-as-banner renderingdocs-site/docs/handoffs/powerfill-phase-6e-completion.md(run-management endpoints:POST /run,GET /runs,GET /runs/{id},POST /runs/{id}/cancel) +docs-site/docs/adr/adr-024-powerfill-async-run-pattern.md(BackgroundService + Channel pattern; the run state machine W2 polls)docs-site/docs/superset/powerfill-dashboards.md— Phase 8 W1's per-dashboard reference; W2's "View in Superset" deep-links target dashboard IDs 13-20 from this docdocs-site/docs/devlog/2026-04-19e-powerfill-phase-8-superset.md— most recent devlogdocs-site/docs/specs/powerfill-assumptions-log.md— A1 (revised), A28 + A37 (RESOLVED), A38 (RESOLVED), A41-A45, A47-A58, A60 (latest-Complete-wins; affects UI freshness rendering — load-bearing for W2), A61, A62, A63 + A64 (Phase 8 W1 additions)
After reading those, acknowledge your role and proceed.
YOUR TASK — Phase 8 Workstream 2: React UI
Per the Phase 8 W1 completion report's Architect Recommendation #2, W2 ships the operator workflow surface on top of the Phase 7 + 6e + 8-W1 contracts:
Run-management workflow UI: Submit / Status / List / Reports navigation + freshness-aware Note rendering per A60 (4 verdicts → 4 distinct UX states) + "View in Superset" deep-links to W1 dashboards.
W2 has no backend work — Phase 7 + 6e shipped the API surface; Phase 8 W1 shipped the analytical surface. W2 is purely greenfield React + a new build pipeline + new GHCR image + new K8s deployment + new GHA workflow.
Inherited context (do not re-litigate)
| Topic | State as of 863c139 |
|---|---|
| Phase 7 status | COMPLETE — 8 GET endpoints + ADR-025 freshness verdicts |
| Phase 8 W1 status | COMPLETE — 8 dashboards + 25 charts in PSX Superset (6d19d24) |
| A54 + A56 status | RESOLVED 2026-04-19 via ADR-021 §"Narrow Bug-Fix Carve-Out" (cf8ef8b). Two surgical fixes inside psp_powerfill_pool_guide: PK extension on ##cte_posting_set_1300 to (trade_id, loan_id, pa_key) + pt13 JOIN qualifier extended with settlement_date. |
| End-to-end Complete-run on PS_DemoData | Empirically achievable in ~30s post-A54-fix. allocated_count: 515, pool_guide_count: 515, UE step succeeds with 12 forensic events. First end-to-end Complete run in project history. |
| 6-step orchestration | All 6 steps exercise green end-to-end on PS_DemoData. Sentinel phase-8-superset-ready-a54-fixed. |
| PowerFill schema | 23 tables (21 PowerFill-owned + pfill_powerfill_log + pfill_run_history) — unchanged from Phase 6e |
| Existing endpoints | POST /run (202), GET /runs (paginated), GET /runs/{id}, POST /runs/{id}/cancel, POST /preflight, POST /preprocess, POST /candidates/preview, POST /carry-cost/preview, 8 Phase 7 GET /runs/{id}/<report> |
| Existing React UI | None exists. package.json only present in docs-site/ (Docusaurus). W2 scaffolds from scratch. |
| Superset dashboards (W1) | 8 dashboards at https://bi.staging.powerseller.com/superset/dashboard/13/ through /20/. W2 "View in Superset" deep-links target these IDs. |
| A60 freshness verdicts | 4 verdicts (Current / Stale / TerminalEmpty / RunNotFound) → HTTP 200/410/200/404 → distinct UI rendering required per verdict |
| A62 view drift | PS_DemoData has older view; existing-disposition endpoint returns 200 + dual-Note. UI should NOT throw; Note rendering handles it |
| A66 — NEW empty-state semantics on PS_DemoData (post-A54-fix) | UE clears + rebuilds-empty all 11 user-facing pfill_* data tables on syn-trade-empty datasets like PS_DemoData. The F-7-8 / 688-row Cash Trade Slotting pattern from W1 is correctly superseded — Cash Trade Slotting now shows 0 rows post-Complete-run because UE supersedes Step 4's pfill_cash_market_map. W2's TerminalEmpty banner messaging must handle TWO sources of empty-state: (i) Failed/Cancelled runs (BR-9 cleared the tables); (ii) Complete runs on syn-trade-empty datasets (UE rebuilt-empty per A66). The Note text from the Phase 7 endpoint distinguishes the cases; render the appropriate UX. Hub Dashboard 1 (run history) is the new canonical proof-of-life, not Cash Trade Slotting Dashboard 8. |
| A65 — banked observation on multi-trigger A54 | Multi-pa_key Switching + per-loan settlement-date variance are two distinct triggers for the original A54 PK violation. Both fire on PS_DemoData; PS608 customer DB behavior unknown. Phase 9 parallel-validation harness should probe both on every tenant DB. For W2: if a tenant DB triggers A54 in a way the fix doesn't address, the POST /run lifecycle returns to Failed terminal status — W2 just renders that as a TerminalEmpty banner, no special-casing needed. |
| Canonical Claim-vs-Evidence antipattern family (NEW 2026-04-19) | Practices #12 (Three-Category Criterion), #13 (Environment-Explicit Inventory), #14 (Durable Regression Harness on Cadence) are now canonical, plus procedural-vs-structural-vs-trigger-based countermeasure shapes. Most relevant for W2 work: practice #13 — when claiming W2 capabilities, characterize per environment (dev / staging / production) explicitly in the W2 completion report. The W1 → A54-fix arc was the lead canonical example of Capability Inflation; W2 is the most likely vehicle for a repeat unless the discipline is applied actively. |
| Cross-project-relays archive folder (NEW 2026-04-19) | docs-site/docs/agents/cross-project-relays/ is the new persistence floor for cross-project Collaborator exchanges that produce canonical changes. Not directly W2-relevant, but worth knowing about so W2's Counterfactual Retro can reference it if a W2-side observation surfaces that warrants archiving. |
Explicit scope (IN)
Workstream 2: React UI
- Scaffolding decision (Alternatives-First Gate): Vite + React + TypeScript vs Next.js vs CRA. Recommend Vite + React + TypeScript per modern JS ecosystem trends + matches docs-site nginx static-build pattern; document choice in new ADR-026.
- New
src/frontend/directory withpackage.json+ Vite config + tsconfig + ESLint + Prettier. Decide: build at deploy time (npm run build → static assets served by nginx) vs SSR (Next.js). Vite static-build is simpler and matches the docs-site nginx pattern. - Tenant context handling — UI sets
X-Tenant-Idheader on API calls. Tenant identification: tenant-picker dropdown for v1 (subdomain-based + auth-token-claim-based deferred to Phase 9+). Recommend continuing the existingX-Tenant-Idheader pattern with a tenant-picker dropdown for v1. - Auth integration — minimal for v1: just the existing PSSaaS API which doesn't currently require auth on the dev/staging surface. Architect should NOT add new auth concerns in W2; flag as Phase 9+.
- Run-management workflow UI:
- Run submission form (selects from PowerFill RunOptions defaults; submits to
POST /run; receives 202 + run_id + Location header; redirects to status page) - Run status page (polls
GET /runs/{run_id}every 2s while status is active; renders status transitions visually; offers cancel button for Pending/PreProcessing/Allocating/PostProcessing states; clean up timer inuseEffectreturn per AGENTS.md async-leak warning) - Runs list page (paginated
GET /runs; cursor-pagination via "Load more") - Per-run report navigation (links to each of the 7+1 Phase 7 endpoints + "View in Superset" deep-link to the corresponding W1 dashboard at
https://bi.staging.powerseller.com/superset/dashboard/<id>/)
- Run submission form (selects from PowerFill RunOptions defaults; submits to
- Freshness-aware Note rendering per A60 + A66 — implement banner UX for the 4 freshness verdicts (with TerminalEmpty's TWO sources distinguished per A66; see also "A66 — NEW empty-state semantics" inherited-context row above):
- Current → no banner; render data normally
- Stale → red banner: "This report shows historical data from run X. The latest run is Y; [view latest →]" (button binds to the latest run id parsed from the Stale Note text)
- TerminalEmpty (Failed/Cancelled — BR-9 cleared) → yellow banner: "This run failed at step
<step>; the report has no data.<failure_message>" - TerminalEmpty (Complete + syn-trade-empty dataset per A66) → blue/info banner (NOT yellow — this is not a failure): "This run completed successfully. The dataset has no syn-trade arbitrage opportunities, so the post-UE rebuild produced no rows. The Hub dashboard shows the run completed; to see allocation output use a tenant DB with syn-trade-eligible loans (Phase 9 + Greg consultation territory per A66)."
- RunNotFound → 404 page (handled by
GET /runs/{run_id}/<report>returning 404; UI catches and shows a friendly error)
- Build + deploy — new GHCR image
ghcr.io/kevinsawyer/powerseller-saas/frontend; new K8s deployment + service in the existingpssaas-stagingnamespace; new GitHub Actions workflow (extend.github/workflows/deploy-staging.yamlOR newdeploy-frontend.yaml). - Stop at Submit / Status / List / Reports navigation. Operator dashboards / scheduling / batch tools / advanced filtering are Phase 9+.
Cross-cutting
- Status sentinel bump to
phase-8-superset-react-ready(the canonical Phase 8 completion sentinel — both workstreams done). - Spec amendment to
docs-site/docs/specs/powerfill-engine.md— Phased Implementation table marks Phase 8 fully done. - Assumptions log additions — A67+ for new W2 findings (A65 + A66 already taken by the A54 fix).
- ADR-026 for the React scaffolding decision (mandatory if React workstream lands this session).
- Pre-push docs-build check per Phase 6e/7/8-W1 lessons:
docker build -f docs-site/Dockerfile.prod docs-sitebefore push if any newdocs-site/docs/**files created.
Explicit scope (OUT)
- Phase 9 parallel-validation against Desktop App
A54 fixA54 RESOLVED 2026-04-19 via ADR-021 §"Narrow Bug-Fix Carve-Out" (commitcf8ef8b); not in W2 scopeA56 PoC end-to-end demonstration of Step 5/6A56 RESOLVED 2026-04-19 as A54-side-effect closure; not in W2 scope- A62 closure (deploy
002to PS_DemoData OR rename PSSaaS view topfillv2_*) — Phase 9 carry-over - A66 root-cause investigation (UE clear-and-rebuild on syn-trade-empty datasets) — Phase 9 + Greg consultation territory; W2 just renders the 2-source TerminalEmpty distinction in the UI, doesn't investigate the underlying syn-trade-population question
- Auth / RBAC / multi-tenant isolation hardening — Phase 9+
- Mobile responsive design — Phase 9+ (desktop-only is fine for v1)
- Internationalization — Phase 9+
- New Phase 7-style API endpoints — Phase 7 closed those
- Background scheduling (cron-style runs, "every weekday at 6am") — Phase 9+
- Multi-tenant Superset registration — A64 / Phase 9+
- Cross-dashboard filtering between W1 dashboards — deferred to Phase 7+ (Q3 Option C snapshot replay)
Process discipline (canonical, non-negotiable)
Gates that must produce documented output
| Gate | Where to apply | What "documented output" means |
|---|---|---|
| Three-layer Primary-Source Verification Gate (Backlog re-read pass empirically demonstrated by F-8-BR-1; promote to canonical sub-practice if not already done by next process-discipline revision) | Spec-vs-implementation: verify Phase 7 endpoint contracts match what your React fetch logic + status-polling logic assume. NVO-vs-implementation: less applicable for W2 (greenfield UI over existing API). Implementation-vs-runtime: re-read session-handoff Backlog table during planning; F-8-BR-1 is canonical evidence this catches issues before the PoC. | A W2 plan §2 findings table per layer + explicit Backlog re-read pass log per row. |
| Alternatives-First Gate | At least 3 architectural decisions: (a) framework choice (Vite/Next.js/CRA — drives ADR-026); (b) state management (Zustand vs Redux vs Context-only); (c) styling approach (Tailwind vs CSS modules vs styled-components vs MUI). | A W2 plan §3 alternatives section per decision; ADR-026 for the framework choice. |
| Required Delegation Categories | Heavily delegable: React component scaffolding (one component per Phase 7 endpoint = 8 components — heavy delegation candidate); fetch helpers (one per endpoint, 8 helpers); types (TypeScript types for each Phase 7 response — generated from the C# DTOs ideally); tests for the React fetch logic. Self-implement: scaffolding decision (ADR-026), the freshness-verdict UX rendering pattern (4 banner states), the Run state machine animation/transitions, build + deploy pipeline. | A W2 plan §8 delegation inventory with subagent prompts AND Deliberate Non-Delegation justifications. |
| Reviewable Chunks at intra-session scope | Consider checkpointing after the scaffolding lands (Vite + tsconfig + minimal "Hello PowerFill" page + first endpoint fetch + freshness banner rendering) before proceeding to the run-submission form. | If checkpointing, send a plan-stage Architect Report after the scaffolding + first reports page lands. |
| Deploy Verification Gate | Arm (a) sentinel = phase-8-superset-react-ready. Arm (b) React UI accessible at staging URL (TBD path under pssaas.staging.powerseller.com/). Arm (c) operator submits a run, watches status transition, opens a report, drills into Superset. | A W2 completion report Markdown citing screenshots + curl outputs + the multi-page navigation walkthrough. |
| Counterfactual Retro | At session end | A retro section. Phase 8 W1 CR #2 banked "subagent prompts should cite AGENTS.md lessons explicitly"; W2 should adopt this for any subagent dispatch. CR #1 banked the Backlog re-read pass; W2 should report whether it caught anything. |
Antipatterns to avoid (canonical list applies)
- Phase-0 Truth Rot — A57 was qualified by A59 (kickoff specificity reduces but doesn't eliminate Truth Rot); the Backlog re-read pass at planning-start is the parallel safeguard that empirically caught F-8-BR-1 in Phase 8 W1 + would have caught F-7-7 earlier in Phase 7. This W2 kickoff itself was refreshed 2026-04-19 post-A54-fix to flush stale W1-era inherited-context — a concrete application of practice #13 Environment-Explicit Inventory + Capability-Inflation prevention. If you find more drift in this kickoff during your Backlog re-read pass, surface as A67+ and adjust the plan.
- Empirical-Citation Type Mismatch (Phase 5 origin) — when fetching from Phase 7 endpoints in React, use the actual JSON property names from
ReportContracts.cs(snake_case via[JsonPropertyName]), NOT the C# property names (PascalCase). The OpenAPI / Swagger UI athttp://pssaas.powerseller.local/api/swagger/is the canonical wire-shape reference; consider auto-generating TypeScript types from it. - Verification Avoidance (Phase 4 origin) —
npm run buildfor the new React UI before declaring complete;npm run lintif ESLint is wired; e2e click-through test (manual is fine for v1) before sentinel bump. - Ghost Deploy (PSX origin) — Docusaurus SPA-404 returns HTTP 200 + 18,053-byte fallback; verify React UI deploys by content match (e.g.
<title>PowerFill</title>in the served HTML). Phase 6e MDX-trap lesson: rundocker build -f docs-site/Dockerfile.prod docs-sitelocally before pushing if any new docs files use URL templates or other MDX-trap-prone syntax. The W2 React build also needs its own image-build verification before declaring deploy complete. - Delegation Skip (Phase 4 origin) — React component scaffolding is the heaviest delegation candidate in W2; architectural decisions (ADR-026, freshness UX, build pipeline) are yours.
- Async leak (generic) — React polling logic must clean up timers;
useEffectreturn cleanup is mandatory. AGENTS.md banks this; W2 plan should explicitly address it in the Run Status page design. - Subagent prompts missing AGENTS.md lesson citations (Phase 8 W1 origin, F-8-3) — when dispatching subagents for React component scaffolding, cite the AGENTS.md async-leak lesson explicitly + any React-specific constraints. Phase 8 W1 banked this discipline; W2 adopts it.
Tooling (verified post-Phase 8 W1)
- WSL Ubuntu with
dotnet 8.0.420,jq 1.6,gh 2.4.0(un-authed). Usewsl.exe -- bash -lc '...'for shell work. - PS_DemoData password in
docker-compose.override.yml:M0th3rFuck1ng$$44$$(Compose interpolates$$→$, actualM0th3rFuck1ng$44$). Pass via env var (PowerShell: single-quote the env-var value to prevent$expansion). - EXECUTE on dbo procs is GRANTED to
kevin_pssaas_devon PS_DemoData. - Pre-push docs-build check pattern (Phase 6e lesson): mandatory if any new docs files use URL templates or unfamiliar MDX syntax.
- kubectl access to PSX Superset (
psx-stagingnamespace) confirmed in Phase 8 W1; same access pattern for any W2 K8s work. - Node.js / npm for React workstream — W2 must verify on session start (likely needs
apt install nodejs npmin WSL OR a containerized build via the docs-site Dockerfile pattern).
Environment state (verified post-A54-fix + canonical Claim-vs-Evidence family adoption)
| Surface | State |
|---|---|
| Local API | phase-8-superset-ready-a54-fixed ✓ |
| Staging API | phase-8-superset-ready-a54-fixed ✓ (commit cf8ef8b shipped + canonical updates 95084cb/10133c6/d4a70af/863c139/4b08b51 shipped) |
| Phase 7 endpoints (live verified) | All 8 endpoints respond on staging + locally against PS_DemoData; the 8 dashboards consume them via direct SQL |
pfill_run_history on PS_DemoData | ~7+ rows; at least 2 are Complete (post-A54-fix runs 1ce2b077-... + 7c9dfe50-... + the Architect's reproducer 43e8f148-...); historical pre-fix runs are all Failed/Cancelled |
| End-to-end PowerFill run on PS_DemoData | Empirically Complete in ~30s (A54+A56 RESOLVED via cf8ef8b); allocated_count: 515; pool_guide_count: 515; UE step succeeds with 12 forensic events |
Superseded by A66: post-Complete-run all pfill_* data tables are 0 rows because UE clears + rebuilds-empty on syn-trade-empty PS_DemoData. Hub Dashboard 1 is the new canonical proof-of-life. | |
| Superset infrastructure | 36 + 8 = 44 queries + 6 deploy scripts in infra/superset/; Phase 8 W1 dashboards at IDs 13-20 |
| React frontend | DOES NOT EXIST — W2 scaffolds from scratch |
| EXECUTE permission on PS_DemoData | Granted ✓ |
| Canonical Claim-vs-Evidence family | LIVE (commits 95084cb + 10133c6 + d4a70af + 863c139); practices #12-14; procedural-vs-structural-vs-trigger-based countermeasure shapes; cross-project-relays archive folder. Most relevant for W2: practice #13 Environment-Explicit Inventory. |
| Backlog re-read pass at planning | Trigger-based countermeasure shape canonical; standalone canonical adoption of Backlog re-read pass pending (F-8-BR-1 + F-7-7 evidence accumulating); use it explicitly in W2 §2 plan regardless. |
Companion references
| Doc | Purpose |
|---|---|
docs-site/docs/specs/powerfill-engine.md §Phased Implementation + §Output APIs + §Data Contracts | Authoritative scope + endpoint contracts |
docs-site/docs/handoffs/powerfill-phase-8-completion.md | Upstream W1 completion report; precedent for W2 completion-report shape |
docs-site/docs/superset/powerfill-dashboards.md | W1 dashboard URLs (IDs 13-20) for "View in Superset" deep-links |
docs-site/docs/handoffs/powerfill-phase-7-completion.md | Phase 7 endpoint contracts + ADR-025 + F-7-8 |
docs-site/docs/adr/adr-025-powerfill-report-api-pattern.md | Phase 7 freshness-verdict semantics — load-bearing UX signal for W2's banner rendering |
docs-site/docs/adr/adr-024-powerfill-async-run-pattern.md | Phase 6e BackgroundService pattern; precedent for any W2 background work + the run state machine W2 polls |
src/backend/PowerSeller.SaaS.Modules.PowerFill/Contracts/ReportContracts.cs | Phase 7 wire-shape source of truth; W2 TypeScript types should mirror these snake_case JSON properties |
src/backend/PowerSeller.SaaS.Modules.PowerFill/Contracts/RunContracts.cs | Phase 6e + 7 wire-shapes for Run / RunSubmission / RunListItem / RunConflictResponse / RunCancelResponse + RunStatus enum |
src/backend/PowerSeller.SaaS.Modules.PowerFill/Endpoints/RunEndpoints.cs | The 12 endpoint contracts W2 fetches (4 from 6e + 8 from 7) |
docs-site/Dockerfile.prod | Multi-stage nginx static-build pattern (precedent for W2 React production image) |
Deliverables
When Phase 8 W2 is complete, the Collaborator and PO should be able to verify each without trusting your word:
- Code commits — atomic, logically grouped. DO NOT push — the PO pushes; you
git addandgit commitonly. src/frontend/scaffolded (Vite + React + TypeScript per Architect default; or whichever framework the Alternatives-First Gate selects).- Run management UX (Submit / Status / List / Reports navigation).
- Freshness-aware Note rendering per A60 (4 verdicts → 4 distinct UX states).
- "View in Superset" deep-links to W1 dashboards (IDs 13-20).
- Build pipeline — new GHCR image + K8s deployment + GitHub Actions workflow.
- ADR-026 for the framework choice.
- Sentinel bump to
phase-8-superset-react-ready. - Spec amendment marking Phase 8 fully done.
- Assumption log A67+ for new W2 findings (A65 + A66 already taken).
docs-site/docs/handoffs/powerfill-phase-8-w2-completion.md— W1 completion-report format + multi-page UI walkthrough screenshots.- Devlog entry at
docs-site/docs/devlog/2026-04-XX-powerfill-phase-8-w2.md. - Pre-push docs-build check if any new
docs-site/docs/**files.
Reporting protocol
Standard Architect Report format when you're done — what was produced / decisions / assumptions / open questions / recommended next steps / process notes.
If a W2 React component reveals an unexpected wire-shape gap with the Phase 7 endpoint (per Empirical-Citation Type Mismatch antipattern) — surface as A65+ and document.
If the React scaffolding decision encounters an unanticipated constraint (e.g. a backend dependency; a build tooling friction) — STOP and surface, don't paper over.
If a multi-day session reaches a natural pause point with partial W2 completion, that's fine — write a handoff so the next Architect session resumes cleanly.
The PO milestone for this phase: "I can review PowerFill reports with drill-down in Superset." Already achievable from W1 + A54 fix (sentinel phase-8-superset-ready-a54-fixed; Hub Dashboard 1 surfaces Complete runs including 11+ rows of audit history). W2 ships operator workflow on top — the PO should hit the "I can submit a run, watch it progress, and click through to its results" milestone after W2 (sentinel phase-8-superset-react-ready or phase-8-superset-react-ready-a54-fixed). Greg-demo readiness for the actual demo is unblocked from W2's perspective — Greg can see the operator workflow + the Hub dashboard's Complete run + can navigate to the per-report dashboards (rendering correctly per-A66's 2-source TerminalEmpty distinction).
What success looks like
- React UI accessible at a staging URL (TBD path under
pssaas.staging.powerseller.com/) - Operator can submit a run, watch status transition (4 active states + 3 terminal), view reports, drill into Superset
- 4 freshness verdicts render distinctly (Current = no banner; Stale = red banner with "view latest" button; TerminalEmpty Failed/Cancelled = yellow banner with failure context; TerminalEmpty Complete + syn-trade-empty per A66 = blue/info banner with no-arbitrage explanation; RunNotFound = 404 page)
- Hub Dashboard 1 deep-link surfaces the most recent run including Complete + Failed/Cancelled history (the canonical post-A66 proof-of-life)
- A submitted run on PS_DemoData reaches
Completeend-to-end via React UI's polling status page (validates the full operator workflow against real customer data) - Sentinel reflects
phase-8-superset-react-ready(orphase-8-superset-react-ready-a54-fixedto preserve the A54-fix sub-suffix; Architect's call) - ADR-026 documents the framework choice
- New deployment workflow in CI
Begin when ready. Local environment is fully wired; PS_DemoData has 515 real allocations + 5 audit rows; the 12 PowerFill endpoints (4 run-mgmt + 8 reports) are live; Superset infrastructure has 8 PowerFill dashboards at IDs 13-20 ready for "View in Superset" deep-links.
Reminder: Opus 4.7 High Thinking. Verify model in picker before sending your first response. Do NOT push.