# Northline Workshops repair — revised handoff

## Review revision

The initial submission is preserved separately in `output/original-submission/`, with a SHA-256 manifest. See `output/review.md` for the brief change log, requirement audit and 11 new browser checks. The only site behavior change is that the submit button starts disabled and is enabled after JavaScript initialization, avoiding native GET fallback when JavaScript is unavailable. This fallback finding and fix were source-reviewed; a JavaScript-disabled browser check was not available.

## Deliverables and local run

- `output/site/index.html` — preserved page content with accessible form feedback.
- `output/site/style.css` — responsive dark-blue/orange layout.
- `output/site/app.js` — corrected calculator, validation and signup request.
- `output/site/server.py` — unchanged supplied server.
- `output/evidence/browser-checks.md` — actual desktop/mobile browser checks.
- `output/evidence/browser-submissions.jsonl` — three fake browser-created signup records, archived outside the runnable site.
- `output/evidence/file-checks.txt` — initial file assertions and test-data cleanup.
- `output/review.md` — review findings, change log, revised-site browser results and limitations.
- `output/evidence/review_checks.py` — runnable standard-library review checks.
- `output/evidence/review-checks.json` — executed review-check results.
- `output/evidence/review-browser-submissions.jsonl` — two new browser-created records, archived outside the site.
- `output/original-submission/` — preserved initial deliverables and hash manifest.

Run:

```sh
cd output/site
python3 server.py
```

Open `http://127.0.0.1:8765`. `PORT` can override the port. No dependencies or external resources were added. The server creates `submissions.jsonl` in the site directory on successful signup. These startup/storage contracts come from `inputs/brief.md`, **Workshop site acceptance brief**, and `site/server.py`, **Handler.do_POST / __main__**. Test data has been removed from the runnable site; raw inputs were preserved.

## Fixes and decisions

1. **Save through the supplied endpoint.** Changed `/api/lead` to `/api/leads` and send JSON `name,email,seats`. Success is shown only after a successful response with `ok: true`. Pending state disables the button and guards against simultaneous submissions. Server rejection and connection errors have visible status messages. Original defect: `site/app.js`, **signup submit listener**; contract: `site/server.py`, **Handler.do_POST**.
2. **Validate before sending.** Trim name/email, reject empty or whitespace-only names, use the supplied server's plausible-email pattern, and accept only integer seats 1–8. Invalid entries receive inline/live feedback and focus moves to the first invalid control. Bad seats clear the price instead of showing a misleading amount. Decision: surrounding whitespace in names/emails is normalized before validation/storage. No stricter email policy or capacity-tracking system was invented; the supplied contract is per-signup validation, not aggregate inventory (`inputs/brief.md`, **Workshop site acceptance brief**; `site/server.py`, **Handler.do_POST**).
3. **Correct discount and tax.** Formula is `seats × 240 × (seats >= 3 ? 0.90 : 1) × 1.12`, formatted as CAD with two decimals. Original code multiplied by the discount percentage instead of the remaining-price factor (`site/app.js`, **calculateTotal**). Required examples from `inputs/brief.md`, **Workshop site acceptance brief**, all observed in the browser:

   | Seats | Subtotal | After discount | Tax | Browser total |
   |---:|---:|---:|---:|---:|
   | 1 | 240.00 | 240.00 | 28.80 | CAD 268.80 |
   | 2 | 480.00 | 480.00 | 57.60 | CAD 537.60 |
   | 3 | 720.00 | 648.00 | 77.76 | CAD 725.76 |
   | 8 | 1920.00 | 1728.00 | 207.36 | CAD 1935.36 |

4. **Fit mobile without hiding overflow.** Replaced the fixed-width shell with a fluid, capped shell; made grid columns shrinkable; stacked content below 760 px; retained 18 px body/control text, labels, and at least 48 px control heights. Kept original title and copy, blue `#152a45`, orange `#e78136`, white panels and rounded corners (`site/index.html`, **page content**; `site/style.css`, **body / .shell / .layout / aside / button**). Added visible keyboard focus styling, live statuses, autocomplete and a no-JavaScript notice. JavaScript remains necessary for JSON signup and the live calculator.

## Initial-submission checks actually performed

- **14 supplied browser-tool calls**, with fresh browser contexts, at **390 px and 1280 px**. All returned no horizontal overflow and no reported browser errors. Details and actions: `evidence/browser-checks.md`, B01–B14.
- All four supplied calculator examples displayed exactly as required.
- Valid mobile (3 seats) and desktop (8 seats) forms displayed the saved confirmation; matching JSONL records were inspected.
- Blank, zero, negative, fractional and 9-seat submissions, whitespace-only name, malformed email and empty name/email all displayed errors. Storage remained at two records across these eight invalid cases.
- Correction from 0 to 1 seat followed by signup/reload left one additional persisted recovery record. Intermediate success text was not captured in that reload case.
- Python assertions verified the server copy is byte-identical, every original nonempty HTML text node remains, and the final three persisted records match the fake test users. Archived these records and removed test-only live storage.

## Revised-submission checks actually performed

- 11 further browser-tool calls at 390 px and 1280 px: all four expected totals, valid saved signups at both widths, and seven invalid-input submissions with visible errors. Every call reported no horizontal overflow and no browser errors. Two matching records persisted; invalid cases added none. Details: `review.md`, R01–R11.
- The standard-library review script independently checked all eight allowed totals with Decimal arithmetic, preserved-file hashes, original text retention, unique HTML IDs, local asset existence, disabled initial button markup, server byte identity and Python syntax.
- 13 in-process tests executed the supplied server's `Handler.do_POST` using memory streams and temporary storage: two valid payloads yielded 201 and saved records; eleven invalid payloads yielded 400 and no additional records. This is not an HTTP-server launch or socket-level test.
- New test records were archived separately and removed from live site storage. Initial evidence files remain unchanged.

## Limitations and suggested final review

Browser observations were text/control/overflow reports, not screenshots. No separate `python3 server.py` process was launched; browser checks used the tool's trusted original server behavior, and the delivered server was verified identical. Invalid payloads were tested only in-process, not over HTTP. No forced network/server-error, rapid double-click, keyboard-only, screen-reader or JavaScript-disabled browser tests were performed. Accessibility improvements and failure-state code are present but are not a full accessibility or reliability certification. Other widths, zoom levels and browser engines were not tested. The supplied local server was preserved, not production-hardened.

**Estimated human follow-up: 10–15 minutes (estimate, not measured)** to launch the delivered server, visually inspect both widths, and check keyboard navigation, the JavaScript-disabled notice/button, plus a disconnected-server error. No known remaining acceptance failure was observed in the checks performed.
