Steps 7a through 10 as one authorised run. Nothing deployed (D11).
7a Lighthouse returns as `lighthouse@13.4.1` + `chrome-launcher`, NOT
`@lhci/cli`. AGENTS.md §7's advisory attribution was wrong: the carriers
were @lhci/cli's own `tmp` and @puppeteer/browsers' `extract-zip`, not
Lighthouse, which audits clean. A deliberate deviation from R11's literal
trigger, recorded with what it costs. Local gate; CI has no Chrome.
7b OG card generator (satori + sharp) discharges R15 — 20 typed cards plus
per-article cards; the portrait stays on / and /about/ by Q40. Insights
plumbing: ArticleCard, Prose, the index, the article route, articleGraph,
and /'s section 7. Card copy is constrained structurally because text in a
JPEG cannot be grepped by check:claims: every headline IS its page's <h1>,
enforced by `npm run og:proof`.
7c Five drafted launch articles, draft: true / reviewedByPouya: false. An
independent compliance audit returned 76 findings and 57 unsourced
assertions; all blocking and should-fix applied.
8 /contact/, the intake form, and backend/intake/ (undeployed). Plain HTML
POST to a same-origin /api/intake with a 303 redirect, so the form works
with zero JavaScript. docs/05 records three deliberate deviations.
9 /fees/ on Q59's ruling — overtime runs from the session cap, and the
reservation point ships adjacent to the rate. One-page PDF bio discharges
R16; /bio/ is its source, so the circulated artefact stays inside the
review apparatus.
10 /legal/privacy/ and /legal/terms/, written to the backend as built. Three
of the policy's statements are derived and cannot drift.
Also: /about/'s inverse credentials band (approved at step 6); Q59 closed;
R15 and R16 discharged; and a fix to shipped copy — /practice/energy/ asserted
the absence of a regulation the source extract says must not be asserted.
Review: adversarial-reviewer, two rounds (D20/D19). Round 1 returned 16
findings including two blocking — an invisible ghost button on /fees/ at
1.00:1 that Lighthouse scored 100, and a privacy policy that named one data
processor when there are two. All 16 acted on.
Lighthouse, 22 pages, mobile: performance 99-100, accessibility 100,
best practices 100, SEO 100 on every indexable page, CLS 0.000.
AGENTS.md entry (ah) has the detail, including four of my own verification
commands that were wrong and what each of them nearly caused.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Md3GndFqWPzK78xAoebsg5
118 lines
4.2 KiB
JavaScript
118 lines
4.2 KiB
JavaScript
/**
|
|
* The intake handler's OWN field table. Spec: docs/05-backend-spec.md §Form fields.
|
|
*
|
|
* ⚠️ THIS IS A SECOND, INDEPENDENT COPY OF THE FORM'S FIELD LIST, AND THE
|
|
* DUPLICATION IS ARCHITECTURAL RATHER THAN AN OVERSIGHT.
|
|
*
|
|
* docs/05: "Client-side validation is a convenience. **The Lambda re-validates
|
|
* everything.**" A server that validates against a list the client shipped it is
|
|
* not validating — it is asking the caller what the rules are. And this file is
|
|
* deployed inside the Lambda zip, which cannot import from `src/` at all.
|
|
*
|
|
* WHAT KEEPS THE TWO HONEST IS A CHECK, NOT A SHARED IMPORT.
|
|
* `npm run check:intake` imports this module and `src/data/intake.ts` and
|
|
* asserts they agree on every field name, on which are required, on every length
|
|
* cap, and on every closed option set. A disagreement means either the form
|
|
* offers something the handler rejects — a lost inquiry that looks like a
|
|
* browser bug — or the handler accepts something no form ever shows.
|
|
*
|
|
* It lives in its own file rather than inside `handler.mjs` so the check can
|
|
* import it. `handler.mjs` calls `requireEnv()` at module scope and throws
|
|
* without a configured environment, so importing THAT would mean inventing
|
|
* fixture credentials to run a check that has nothing to do with them.
|
|
* (The first version of the check scraped this table out of the handler as text
|
|
* and evaluated it. Its "refuse anything executable" guard then rejected the
|
|
* table on the word `process` — which is a FIELD NAME. A guard that fires on the
|
|
* data it exists to protect is worse than no guard, and the fix was to stop
|
|
* scraping.)
|
|
*
|
|
* `select` and `radio` fields carry their option list, and a value outside it is
|
|
* REJECTED rather than coerced — a select is a closed set, and a request that
|
|
* sends something else is not a browser.
|
|
*
|
|
* ⚠️ **`label` IS HERE BECAUSE THE CONFIRMATION EMAIL PRINTED FIELD NAMES.**
|
|
* `summaryLines` was `${f.name}: ${value}`, so the inquirer's receipt read
|
|
* `practiceArea: Construction`, `otherParties: …`, `opposingCounsel: …`. That
|
|
* email is the one artefact an inquirer keeps from this practice, and it is also
|
|
* the artefact that quotes third-party names back at them, so its legibility is
|
|
* not cosmetic. Found by `adversarial-reviewer`, 2026-08-31.
|
|
* `npm run check:intake` compares labels as well as names, requiredness, caps
|
|
* and option sets — so the receipt cannot drift from the form's own wording.
|
|
*/
|
|
export const FIELDS = [
|
|
{ name: 'name', label: 'Your name', required: true, max: 120 },
|
|
{ name: 'email', label: 'Email', required: true, max: 254 },
|
|
{ name: 'phone', label: 'Phone', required: false, max: 40 },
|
|
{
|
|
name: 'role',
|
|
label: 'Your role',
|
|
required: true,
|
|
options: ['Counsel', 'In-house', 'Party', 'Institution', 'Other'],
|
|
},
|
|
{
|
|
name: 'organisation',
|
|
label: 'Firm or organisation',
|
|
required: false,
|
|
max: 160,
|
|
},
|
|
{
|
|
name: 'process',
|
|
label: 'Process sought',
|
|
required: true,
|
|
options: [
|
|
'Mediation',
|
|
'Arbitration',
|
|
'Med-Arb',
|
|
'Early neutral evaluation',
|
|
'Not sure',
|
|
],
|
|
},
|
|
{
|
|
name: 'practiceArea',
|
|
label: 'Subject matter',
|
|
required: true,
|
|
options: [
|
|
'Construction',
|
|
'Technology',
|
|
'Energy',
|
|
'Insurance',
|
|
'Shareholder',
|
|
'Cross-border',
|
|
'Other',
|
|
],
|
|
},
|
|
{ name: 'otherParties', label: 'Other parties', required: false, max: 300 },
|
|
{
|
|
name: 'opposingCounsel',
|
|
label: 'Opposing counsel',
|
|
required: false,
|
|
max: 300,
|
|
},
|
|
{
|
|
name: 'summary',
|
|
label: 'What the dispute is about',
|
|
required: true,
|
|
max: 2000,
|
|
},
|
|
{
|
|
name: 'timing',
|
|
label: 'Timing',
|
|
required: false,
|
|
options: ['Urgent', 'Within 30 days', 'Within 90 days', 'Exploring'],
|
|
},
|
|
{
|
|
name: 'preferredContact',
|
|
label: 'Preferred reply',
|
|
required: false,
|
|
options: ['Email', 'Phone'],
|
|
},
|
|
];
|
|
|
|
/**
|
|
* The honeypot field name. NOT in `FIELDS`, and that is load-bearing: it is
|
|
* checked before validation and a non-empty value gets the SUCCESS page, not a
|
|
* rejection. Telling a bot it was detected is how the next version of the bot
|
|
* stops filling the field. `check:intake` asserts it is absent from `FIELDS`.
|
|
*/
|
|
export const HONEYPOT = 'company_website';
|