# Northline workshop site — handoff

## Deliverables and running

- `output/site/index.html`
- `output/site/style.css`
- `output/site/app.js`
- `output/site/server.py` — byte-for-byte copy of the supplied server.
- `output/browser-checks.md` — desktop/mobile browser observations and calculator evidence.
- `output/browser-records.jsonl` — the two fake signups saved by browser checks (evidence only, outside the runnable site).
- `output/test_server.py` — repeatable standard-library handler/storage checks.
- `output/server-checks.json` — actual results of those checks.
- `output/handoff.md` — this document.

Run from `output/site/` with `python3 server.py`, then open `http://127.0.0.1:8765`. `PORT` can override the port. Successful records go to that directory's `submissions.jsonl`. These run/storage conventions come from `inputs/brief.md`, **Workshop site acceptance brief**, and `site/server.py`, `Handler.do_POST` / main block. No dependencies, framework, remote assets, services or tracking added. Original inputs were preserved; test records were removed from the runnable copy after preserving evidence.

## Fixes

1. Corrected POST endpoint from `/api/lead` to `/api/leads`; sends JSON `name,email,seats`. Shows pending, success and failure messages, and disables the button while the request is in flight. The original endpoint mismatch is in `site/app.js`, submit listener; expected endpoint is specified in `inputs/brief.md`, **Workshop site acceptance brief**.
2. Corrected total to `seats × 240 × (seats >= 3 ? 0.90 : 1) × 1.12`, with `CAD` and two decimals. Invalid seat input displays a prompt instead of a misleading price. The original `site/app.js`, `calculateTotal`, multiplied by the discount fraction instead of its complement. Pricing authority: `inputs/brief.md`, **Workshop site acceptance brief**.
3. Retained native required/email/range/step validation; added trimmed-name, plausible-email and explicit integer seat checks. Invalid submissions receive visible status text. Email plausibility uses the supplied server's dotted-domain pattern; names and emails are trimmed before sending. This is an implementation choice consistent with `site/server.py`, `Handler.do_POST`, and the brief, not deliverability verification.
4. Replaced the fixed-width shell with a fluid max-width shell and responsive grid; stacks below 760px. Kept the title, existing copy, Arial, light background and dark-blue/orange identity from `site/index.html` and `site/style.css`. Added seat guidance, autocomplete, visible keyboard-focus styling and live status/total announcements.

## Checks actually performed

- **12 actual browser calls at 390px/1280px:** all reported no horizontal overflow and no browser errors. Labels and controls were present. Successful signups at both widths visibly confirmed saving. Details: `output/browser-checks.md`, B01–B12.
- **All calculator examples in the browser:** 1 → CAD 268.80, 2 → CAD 537.60, 3 → CAD 725.76, 8 → CAD 1935.36. All match `inputs/brief.md`, **Workshop site acceptance brief**. Arithmetic breakdown appears in `output/browser-checks.md`.
- **Invalid browser submits:** blank, 0, -1, 1.5 and 9 seats; whitespace-only name; email lacking a dotted domain; empty required details. Each showed an error and invalid controls. The final browser-created records file contained only the two valid signups. Saved evidence: `output/browser-records.jsonl`, lines 1–2.
- **22 direct supplied-server handler/storage checks:** four valid seat cases returned 201 and appended exact JSON records; 18 invalid payloads returned 400 without changing the record count. These include bad names/emails, invalid seat types/ranges, malformed JSON and missing fields. Executed `output/test_server.py` successfully (exit 0); full results in `output/server-checks.json`. Disk tests used disposable storage, not the runnable site's records.
- Confirmed delivered `server.py` matches the original byte-for-byte.

## Limitations and final human review

The browser tool served the working copy using its trusted implementation of the original endpoint and produced text/control observations, not screenshots. It also wrote the two expected records, which were inspected. A separate attempt to bind a local server socket from the Python runner failed with `PermissionError: [Errno 1] Operation not permitted`; therefore the independent server tests invoke the actual `Handler.do_POST` directly using in-memory request/response streams and temporary on-disk storage. No separate Python HTTP transport or server-restart check is claimed.

No screenshot-based visual review, physical-device, screen-reader, keyboard-only, cross-engine or network-failure test was performed. Duplicate submissions after a completed request are not deduplicated, and the supplied local server is unchanged; this task does not establish production hardening or total-inventory enforcement. The brief's 1–8 limit is treated as a per-signup seat limit, matching the supplied server.

**Estimated remaining human time: 5–10 minutes** (estimate, not measured): launch the site locally, visually review both widths, tab through controls, and submit one fake `example.test` signup to confirm the record on a normal local server. Remove that test record afterward. No known acceptance failure remains in the checks performed.


## Review addendum

The initial submission is preserved separately in `original_submission/` (the entire former `output/` directory). The runnable site's four files are unchanged after review; no functional correction was indicated by the checks performed.

New deliverables:
- `output/review.md` — acceptance cross-check, four additional actual browser checks (R01–R04), limitations and brief change log.
- `output/review-browser-records.jsonl` — three successful review signups, preserved outside the runnable site.
- `output/review_checks.py` and `output/review-checks.json` — repeatable static/package checks and independent Decimal calculation results.

Reran all 22 original handler checks successfully; results match the original report byte-for-byte. Four additional browser calls at 390px and 1280px reported no overflow/errors; verified successful 1-/8-seat submissions, correction of fractional seats to 3, and malformed-email rejection. The browser-created file contained exactly the three valid review records; test records were removed after preserving evidence. See `output/review.md` for the precise observations and distinctions from the initial tests.

Remaining limitations and estimated human completion time remain as stated above: **5–10 minutes**, an estimate rather than a measured result. No separate live-socket or screenshot-based check was added.
