|
| 1 | +# Full-Stack Evaluation Demo Smoke Implementation Plan |
| 2 | + |
| 3 | +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. |
| 4 | +
|
| 5 | +**Goal:** Make the existing evaluation backend and admin evaluation page easier to demo as one full-stack workflow without downloading model weights. |
| 6 | + |
| 7 | +**Architecture:** Keep the Java backend as the business and persistence boundary, keep model execution behind the existing evaluation client interface, and keep the React admin UI visual style unchanged. This branch only improves frontend API error messaging, adds a small frontend test boundary, and documents a repeatable demo path. |
| 8 | + |
| 9 | +**Tech Stack:** React 18, TypeScript, Vite, Node built-in test runner, Spring Boot Java backend, Maven, existing deterministic evaluation model client. |
| 10 | + |
| 11 | +## Global Constraints |
| 12 | + |
| 13 | +- Do not download model weights. |
| 14 | +- Do not replace the current frontend visual style. |
| 15 | +- Do not fake successful backend data in the frontend. |
| 16 | +- Keep API calls centralized in `src/api/backend.ts`. |
| 17 | +- Keep docs concise and aligned with `docs/documentation-standards.md`. |
| 18 | +- Verify with `npm run test`, `npm run lint`, `npm run build`, and `mvn -B test`. |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +### Task 1: Add A Frontend API Error Parsing Test |
| 23 | + |
| 24 | +**Files:** |
| 25 | +- Modify: `package.json` |
| 26 | +- Create: `src/api/errorMessage.test.ts` |
| 27 | + |
| 28 | +**Interfaces:** |
| 29 | +- Produces: expected behavior for `formatApiErrorMessage(status: number, bodyText: string): string` |
| 30 | +- Consumes later: `src/api/errorMessage.ts` |
| 31 | + |
| 32 | +- [ ] Add a `test` script using Node's built-in test runner: |
| 33 | + |
| 34 | +```json |
| 35 | +"test": "node --test --experimental-strip-types src/api/errorMessage.test.ts" |
| 36 | +``` |
| 37 | + |
| 38 | +- [ ] Create `src/api/errorMessage.test.ts` with assertions for backend JSON errors, Vite proxy 502 errors, plain text errors, and empty responses. |
| 39 | + |
| 40 | +- [ ] Run `npm run test`. |
| 41 | + |
| 42 | +Expected: FAIL because `src/api/errorMessage.ts` does not exist yet. |
| 43 | + |
| 44 | +### Task 2: Implement Reusable API Error Formatting |
| 45 | + |
| 46 | +**Files:** |
| 47 | +- Create: `src/api/errorMessage.ts` |
| 48 | +- Modify: `src/api/backend.ts` |
| 49 | + |
| 50 | +**Interfaces:** |
| 51 | +- Produces: `formatApiErrorMessage(status: number, bodyText: string): string` |
| 52 | +- `src/api/backend.ts` must call the formatter after `response.text()`. |
| 53 | + |
| 54 | +- [ ] Implement `formatApiErrorMessage`. |
| 55 | +- [ ] Parse backend JSON bodies with `message`, `error`, or `detail` fields. |
| 56 | +- [ ] Map `502`, `503`, and `504` to: |
| 57 | + |
| 58 | +```text |
| 59 | +Backend API unavailable. Start the Java backend and try again. |
| 60 | +``` |
| 61 | + |
| 62 | +- [ ] Preserve non-empty plain text errors for other statuses. |
| 63 | +- [ ] Use `Request failed with status ${status}` for empty bodies. |
| 64 | +- [ ] Run `npm run test`. |
| 65 | + |
| 66 | +Expected: PASS. |
| 67 | + |
| 68 | +### Task 3: Document The Demo Workflow |
| 69 | + |
| 70 | +**Files:** |
| 71 | +- Create: `docs/fullstack-evaluation-demo.md` |
| 72 | +- Modify: `docs/README.md` |
| 73 | +- Modify: `README.md` |
| 74 | +- Modify: `docs/project-worklog.md` |
| 75 | + |
| 76 | +**Interfaces:** |
| 77 | +- Produces a durable runbook that explains how to demo evaluation creation, execution, metrics inspection, and known local environment limits. |
| 78 | + |
| 79 | +- [ ] Add a how-to document with audience, current status, step-by-step run commands, verification checklist, and deferred Docker/GPU work. |
| 80 | +- [ ] Link it from `docs/README.md`. |
| 81 | +- [ ] Add a short pointer in root `README.md`. |
| 82 | +- [ ] Add a dated worklog entry for the branch. |
| 83 | + |
| 84 | +### Task 4: Verify And Publish |
| 85 | + |
| 86 | +**Files:** |
| 87 | +- All changed files. |
| 88 | + |
| 89 | +**Interfaces:** |
| 90 | +- Produces a pushed branch and PR. |
| 91 | + |
| 92 | +- [ ] Run `npm run test`. |
| 93 | +- [ ] Run `npm run lint`. |
| 94 | +- [ ] Run `npm run build`. |
| 95 | +- [ ] Run `mvn -B test` from `backend-java`. |
| 96 | +- [ ] Run `git diff --check`. |
| 97 | +- [ ] Commit as `feat: polish full-stack evaluation demo flow`. |
| 98 | +- [ ] Push `feature/fullstack-evaluation-demo-smoke`. |
| 99 | +- [ ] Open a PR and wait for CI. |
0 commit comments