diff --git a/aidlc-docs/features/redesign-modern-timetravel/aidlc-state.md b/aidlc-docs/features/redesign-modern-timetravel/aidlc-state.md index ce2aa21..a7f6d6c 100644 --- a/aidlc-docs/features/redesign-modern-timetravel/aidlc-state.md +++ b/aidlc-docs/features/redesign-modern-timetravel/aidlc-state.md @@ -5,7 +5,7 @@ - **Feature Slug**: redesign-modern-timetravel - **Project Type**: Brownfield - **Start Date**: 2026-11-09T13:00:00Z -- **Current Stage**: CONSTRUCTION - U3 packages-block Code Generation plan (awaiting approval) +- **Current Stage**: CONSTRUCTION - U4 contact-form Code Generation plan (awaiting approval) - **Branch**: feature/redesign-modern-timetravel ## Workspace State diff --git a/aidlc-docs/features/redesign-modern-timetravel/audit.md b/aidlc-docs/features/redesign-modern-timetravel/audit.md index 314761c..a703878 100644 --- a/aidlc-docs/features/redesign-modern-timetravel/audit.md +++ b/aidlc-docs/features/redesign-modern-timetravel/audit.md @@ -646,3 +646,75 @@ **Context**: Code Generation Part 1 for U3. --- + +## U3 Code Generation Complete + +**Timestamp**: 2026-11-10T15:00:00Z + +**User Input**: "approve plan" + +**AI Response**: "Executed all 7 steps of packages-block-code-generation-plan.md. Tests 13 files/122 tests before, 14 files/154 after, all passed; lint 0 errors (2 pre-existing warnings); build OK. Committed on feature/redesign-modern-timetravel, no push. Summary at construction/packages-block/code/summary.md. Completion message presented." + +**Context**: Code Generation U3 complete; awaiting approval before U4. + +--- + +## U3 Approved; U4 Functional Design Started + +**Timestamp**: 2026-11-10T16:00:00Z + +**User Input**: "ga verder" / (interactive) "Zin met bewaartermijn, zonder link (Recommended)" + +**AI Response**: "U3 approved. Read the CMS phase-1 handoff (routes, limits, error shapes, switches) as input. U4 contact-form Functional Design: privacy sentence = 'Je gegevens gebruik ik alleen om op je bericht te reageren; ik bewaar ze maximaal 12 maanden.' (no link). Decisions taken without asking: progressive enhancement (the panel shows the mailto call-to-action by default and is upgraded to the form once the token endpoint answers 200; 404 = closed = stay on mailto), no build-time flag (the server decides), radio 'aanvraag/vraag' and phone field of the canvas dropped (fixed four fields), captcha slot supported by the hook but no widget in this repo (captcha enabled server-side => mailto fallback), honeypot DOM name free (JSON hpCheck)." + +**Context**: Functional Design U4. + +--- + +## U4 Functional Design Complete + +**Timestamp**: 2026-11-10T16:30:00Z + +**User Input**: "(none)" + +**AI Response**: "Generated contact-form-functional-design-plan.md, contact-form-fd-questions.md and construction/contact-form/functional-design/{domain-entities, business-rules (BR-U4-1..16), business-logic-model, frontend-components}.md. Completion message presented; NFR Requirements, NFR Design and Infrastructure Design for U4 follow as separate stages." + +**Context**: Functional Design U4 awaiting approval. + +--- + +## Production Deploy and ASF Merge in Progress; Builder Released After Completion + +**Timestamp**: 2026-11-10T16:45:00Z + +**User Input**: "Ze zijn nu bezig met deployen naar productie voor SlpSoftware en mergen van changes van ASF in de backend. houdt dat even in de gaten. zodra dat klaar is kan `SLS Software ` ook verder en gaan die changes vanaf master of main (ik weet even niet meer welke van de 2 branchnamen hie rgebruikt wordt) gaan mergen" + +**AI Response**: "Checked the CMS repo read-only: origin/master is still d9cc539, the ASF branch is not merged yet; main branch is master. Told the builder (SLS Software - CMS) that once origin/master contains the ASF branch it may rebase feature/contact-forms-module onto master (no force/push), switch the rate-limit key to ClientPartitionKey, run all tests, and send the rebase result plus plans for CMS-U5/U6/U7. Contact:Enabled stays off; no push/merge/PR/deploy without Bryan. To be re-checked when the ASF session reports or the user asks." + +**Context**: Coordination; this is the explicit go for CMS phase 2 conditional on the ASF merge. + +--- + +## U4 Functional Design Approved; NFR and Infrastructure Docs Written + +**Timestamp**: 2026-11-10T18:00:00Z + +**User Input**: "Functional Design is goed. Ga verder" / (interactive) "SLP software heeft al een api. Die hoeft niet verplaatst te worden toch?" + +**AI Response**: "U4 FD approved. Wrote NFR Requirements (NFR-U4-1..9, Security Baseline summary), tech-stack decisions (no runtime deps, fast-check dev dep), NFR design patterns, logical components and Infrastructure Design. Existing proxy routing and header setup are unconfirmed (CMS and API asked Pi-Main and the CMS session) and are documented as unconfirmed, SECURITY-04 open. Confirmed by CMS and API: the production release now contains no contact routes. Builder told to wait for the merge commit (PR 11, CI run 637); System/capabilities marker commit approved." + +**Context**: Construction U4; combined NFR/Infra completion presented; next Code Generation plan. + +--- + +## U4 NFR and Infrastructure Approved; Code Generation Plan Ready + +**Timestamp**: 2026-11-10T19:00:00Z + +**User Input**: "Ga verder" + +**AI Response**: "NFR Requirements, NFR Design and Infrastructure Design for U4 accepted. Updated the infrastructure doc with confirmed facts from CMS and API (apps on Pi-Main test :5100 prod :5101, CMS host sets security headers, nginx on Pi-Main sets none, production release has no contact routes) and marked the unconfirmed points. Created construction/plans/contact-form-code-generation-plan.md (9 steps). Plan approval prompt presented." + +**Context**: Code Generation Part 1 for U4. + +--- diff --git a/aidlc-docs/features/redesign-modern-timetravel/construction/contact-form/code/summary.md b/aidlc-docs/features/redesign-modern-timetravel/construction/contact-form/code/summary.md new file mode 100644 index 0000000..f8944ab --- /dev/null +++ b/aidlc-docs/features/redesign-modern-timetravel/construction/contact-form/code/summary.md @@ -0,0 +1,30 @@ +# Code Summary — contact-form (U4) + +## What was built +- **Movable package `src/cms-client/`** (no imports from the app; ESLint `no-restricted-imports` plus a boundary test): `http/` (`apiUrl`, `fetchJson` with 10 s timeout, problem+json parsing), `contact/` (`validateContact`, `contactFormReducer`, `createContactClient`, `messages.nl`, `useContactForm`, types), `README.md`. +- **Validation** equal to the API (trim; 100/254/100/2000; email regex; control characters rejected except line breaks in the message; first failing rule per field). **Reducer**: `sent` only leaves through `reset`; edits and a second submit are ignored while `sending`; input is kept on `failed`. +- **Client**: `getToken` (200 → token, 404 → closed, anything else → failed, malformed body → failed) and `submit` (202 ok; 400 → field errors or token expired; 413; 404; 429 with `Retry-After`; 5xx/network → failed). Never throws, never logs. +- **Hook `useContactForm`**: prop getters with ids from `idPrefix`, `aria-invalid`/`aria-describedby`, honeypot props (silent success without a request when filled), one idempotency key per attempt series (reused on retry, renewed after success/reset), a single automatic token refresh on `expired`, preselect with change counter (unknown values ignored), focus on the first invalid field after the render, telemetry only through `onEvent('sent' | 'failed')`. +- **UI**: `ContactPanel` (mailto panel by default, upgrades to the form when `GET …/token` answers 200 without captcha; min height 280px), `MailtoPanel`, `ContactFormView` (design B: panel colours, underline inputs on `bg-field`, brand submit button, errors outside the labels, `role=alert` failure with the mail address, `role=status` success with focus, privacy sentence), hidden honeypot field. `useContactAvailability` starts the token request when the section nears the viewport (IntersectionObserver, `rootMargin 300px`), or on first focus without IntersectionObserver. Subject options = offerings (slug/title) + "Overig". `trackEvent('contact-sent' | 'contact-failed')` without data. +- **Tokens**: new `--color-danger` (error text) in all four sets, contrast-tested against `panel` and `field`. +- **Dependencies**: `fast-check` (dev) for property-based tests; no runtime dependency. + +## Verification (Step 13.5, real output) +- Before this unit (after U3): 14 files / 154 tests. After: **19 files / 239 tests passed**; `pnpm lint` 0 errors (same 2 existing warnings, boundary rule active); `pnpm build` OK (JS 466 kB, CSS 58.8 kB). +- Found and fixed by the tests: (1) field errors inside the `