Skip to main content

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:

  1. A54 + A56 RESOLVED via narrow ADR-021 §"Narrow Bug-Fix Carve-Out" (commit cf8ef8b, sentinel bumped to phase-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).
  2. 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.
  3. 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:

  1. CLAUDE.md — project identity, role-identification procedure, push-is-an-ask convention
  2. AGENTS.md — agent memory: principles, lessons, F-PSD findings summary
  3. docs-site/docs/agents/architect-context.md — your role definition
  4. docs-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.
  5. docs-site/docs/agents/handoff-prompts.md — Templates for delegation
  6. docs-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.
  7. 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)
  8. docs-site/docs/handoffs/powerfill-phase-8-completion.md — the upstream W1 completion report (W2 builds on this)
  9. docs-site/docs/handoffs/powerfill-phase-7-completion.md — Phase 7 endpoint contracts (the 8 GET endpoints W2 fetches)
  10. 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 rendering
  11. docs-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)
  12. 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 doc
  13. docs-site/docs/devlog/2026-04-19e-powerfill-phase-8-superset.md — most recent devlog
  14. docs-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)

TopicState as of 863c139
Phase 7 statusCOMPLETE — 8 GET endpoints + ADR-025 freshness verdicts
Phase 8 W1 statusCOMPLETE — 8 dashboards + 25 charts in PSX Superset (6d19d24)
A54 + A56 statusRESOLVED 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_DemoDataEmpirically 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 orchestrationAll 6 steps exercise green end-to-end on PS_DemoData. Sentinel phase-8-superset-ready-a54-fixed.
PowerFill schema23 tables (21 PowerFill-owned + pfill_powerfill_log + pfill_run_history) — unchanged from Phase 6e
Existing endpointsPOST /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 UINone 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 verdicts4 verdicts (Current / Stale / TerminalEmpty / RunNotFound) → HTTP 200/410/200/404 → distinct UI rendering required per verdict
A62 view driftPS_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 A54Multi-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 with package.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-Id header on API calls. Tenant identification: tenant-picker dropdown for v1 (subdomain-based + auth-token-claim-based deferred to Phase 9+). Recommend continuing the existing X-Tenant-Id header 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 in useEffect return 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>/)
  • 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 existing pssaas-staging namespace; new GitHub Actions workflow (extend .github/workflows/deploy-staging.yaml OR new deploy-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-site before push if any new docs-site/docs/** files created.

Explicit scope (OUT)

  • Phase 9 parallel-validation against Desktop App
  • A54 fix A54 RESOLVED 2026-04-19 via ADR-021 §"Narrow Bug-Fix Carve-Out" (commit cf8ef8b); not in W2 scope
  • A56 PoC end-to-end demonstration of Step 5/6 A56 RESOLVED 2026-04-19 as A54-side-effect closure; not in W2 scope
  • A62 closure (deploy 002 to PS_DemoData OR rename PSSaaS view to pfillv2_*) — 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

GateWhere to applyWhat "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 GateAt 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 CategoriesHeavily 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 scopeConsider 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 GateArm (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 RetroAt session endA 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 at http://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 build for the new React UI before declaring complete; npm run lint if 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: run docker build -f docs-site/Dockerfile.prod docs-site locally 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; useEffect return 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). Use wsl.exe -- bash -lc '...' for shell work.
  • PS_DemoData password in docker-compose.override.yml: M0th3rFuck1ng$$44$$ (Compose interpolates $$$, actual M0th3rFuck1ng$44$). Pass via env var (PowerShell: single-quote the env-var value to prevent $ expansion).
  • EXECUTE on dbo procs is GRANTED to kevin_pssaas_dev on 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-staging namespace) 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 npm in WSL OR a containerized build via the docs-site Dockerfile pattern).

Environment state (verified post-A54-fix + canonical Claim-vs-Evidence family adoption)

SurfaceState
Local APIphase-8-superset-ready-a54-fixed
Staging APIphase-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_DemoDataEmpirically Complete in ~30s (A54+A56 RESOLVED via cf8ef8b); allocated_count: 515; pool_guide_count: 515; UE step succeeds with 12 forensic events
F-7-8 cash-trade-slotting 688 rowsSuperseded 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 infrastructure36 + 8 = 44 queries + 6 deploy scripts in infra/superset/; Phase 8 W1 dashboards at IDs 13-20
React frontendDOES NOT EXIST — W2 scaffolds from scratch
EXECUTE permission on PS_DemoDataGranted ✓
Canonical Claim-vs-Evidence familyLIVE (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 planningTrigger-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

DocPurpose
docs-site/docs/specs/powerfill-engine.md §Phased Implementation + §Output APIs + §Data ContractsAuthoritative scope + endpoint contracts
docs-site/docs/handoffs/powerfill-phase-8-completion.mdUpstream W1 completion report; precedent for W2 completion-report shape
docs-site/docs/superset/powerfill-dashboards.mdW1 dashboard URLs (IDs 13-20) for "View in Superset" deep-links
docs-site/docs/handoffs/powerfill-phase-7-completion.mdPhase 7 endpoint contracts + ADR-025 + F-7-8
docs-site/docs/adr/adr-025-powerfill-report-api-pattern.mdPhase 7 freshness-verdict semantics — load-bearing UX signal for W2's banner rendering
docs-site/docs/adr/adr-024-powerfill-async-run-pattern.mdPhase 6e BackgroundService pattern; precedent for any W2 background work + the run state machine W2 polls
src/backend/PowerSeller.SaaS.Modules.PowerFill/Contracts/ReportContracts.csPhase 7 wire-shape source of truth; W2 TypeScript types should mirror these snake_case JSON properties
src/backend/PowerSeller.SaaS.Modules.PowerFill/Contracts/RunContracts.csPhase 6e + 7 wire-shapes for Run / RunSubmission / RunListItem / RunConflictResponse / RunCancelResponse + RunStatus enum
src/backend/PowerSeller.SaaS.Modules.PowerFill/Endpoints/RunEndpoints.csThe 12 endpoint contracts W2 fetches (4 from 6e + 8 from 7)
docs-site/Dockerfile.prodMulti-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:

  1. Code commits — atomic, logically grouped. DO NOT push — the PO pushes; you git add and git commit only.
  2. src/frontend/ scaffolded (Vite + React + TypeScript per Architect default; or whichever framework the Alternatives-First Gate selects).
  3. Run management UX (Submit / Status / List / Reports navigation).
  4. Freshness-aware Note rendering per A60 (4 verdicts → 4 distinct UX states).
  5. "View in Superset" deep-links to W1 dashboards (IDs 13-20).
  6. Build pipeline — new GHCR image + K8s deployment + GitHub Actions workflow.
  7. ADR-026 for the framework choice.
  8. Sentinel bump to phase-8-superset-react-ready.
  9. Spec amendment marking Phase 8 fully done.
  10. Assumption log A67+ for new W2 findings (A65 + A66 already taken).
  11. docs-site/docs/handoffs/powerfill-phase-8-w2-completion.md — W1 completion-report format + multi-page UI walkthrough screenshots.
  12. Devlog entry at docs-site/docs/devlog/2026-04-XX-powerfill-phase-8-w2.md.
  13. 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 Complete end-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 (or phase-8-superset-react-ready-a54-fixed to 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.