diff --git a/aidlc-docs/_shared/reverse-engineering/architecture.md b/aidlc-docs/_shared/reverse-engineering/architecture.md index 8a2e7eb..4d48611 100644 --- a/aidlc-docs/_shared/reverse-engineering/architecture.md +++ b/aidlc-docs/_shared/reverse-engineering/architecture.md @@ -7,7 +7,7 @@ A single client-side React SPA (`web/`) built with Vite. Routing is file-based v ```mermaid graph TD - Main["main.tsx: Sentry start, router, ChakraProvider"] --> Root["routes/__root.tsx: HeadContent, AppShell, 404 and error components"] + Main["client.tsx: Sentry start, hydration (router.tsx: getRouter)"] --> Root["routes/__root.tsx: HeadContent, AppShell, 404 and error components"] Root --> Shell["components/AppShell.tsx"] Shell --> Skip["SkipNavLink and main landmark"] Shell --> Nav["NavigationBar (NavLink, MobileNav)"] @@ -41,17 +41,17 @@ graph TD class Content,NavData,Seo,Theme,Blocks support; ``` -Text alternative: main.tsx starts Sentry and mounts the router; the root route renders AppShell (skip link, NavigationBar, the page via Outlet, Footer, BackToTop, Umami); the home route renders the Hero and six sections built from shared blocks (one of them lazily loads the contact form); the about route renders the Over mij page; the other routes render placeholder PageIntros; the shoot pages render `shoots/ShootPage`, whose sections follow `shootPageBands(view)` (`lib/shootPageBands.ts`): intro, stories, process, photos, FAQ, package, closing; content, navigation, SEO and theme modules support all of it. +Text alternative: client.tsx starts Sentry and hydrates the prerendered page (prerendering; router from router.tsx); the root route renders AppShell (skip link, NavigationBar, the page via Outlet, Footer, BackToTop, Umami); the home route renders the Hero and six sections built from shared blocks (one of them lazily loads the contact form); the about route renders the Over mij page; the other routes render placeholder PageIntros; the shoot pages render `shoots/ShootPage`, whose sections follow `shootPageBands(view)` (`lib/shootPageBands.ts`): intro, stories, process, photos, FAQ, package, closing; content, navigation, SEO and theme modules support all of it. ## Component Descriptions -### main.tsx +### client.tsx, router.tsx (replace main.tsx; prerendering) - **Purpose**: Application bootstrap -- **Responsibilities**: Starts Sentry (deferred), creates the router (scroll restoration, default error component), mounts ChakraProvider (light only), loads self-hosted fonts, removes static fallback head tags +- **Responsibilities**: `client.tsx` starts Sentry (deferred) and hydrates the prerendered document with `StartClient`; `router.tsx` creates the router (scroll restoration, default error component); ChakraProvider (light only) and the fonts are in the document shell of `routes/__root.tsx` - **Type**: Application ### routes/__root.tsx - **Purpose**: Root route / layout -- **Responsibilities**: Site-wide head (`siteHead`: OG basics + JSON-LD), `HeadContent`, `AppShell`, dev-only router devtools, `NotFound` and `ErrorPage` +- **Responsibilities**: Site-wide head (`siteHead`: OG basics + JSON-LD), `HeadContent`, `AppShell`, dev-only router devtools, `NotFound` and `ErrorPage`; document shell (`shellComponent`, prerendering); `routes/$.tsx` is the catch-all for unknown URLs (prerendered as `404.html`) - **Type**: Application ### components/AppShell.tsx @@ -108,7 +108,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r ### hooks/ - **Purpose**: Shared behaviour -- **Responsibilities**: `useRouteFocus`, `useScrolledPast`, `useInView` (IntersectionObserver), `usePageLoaded` (after the load event), `useReveal` (reveal once, immediately with reduced motion) +- **Responsibilities**: `useRouteFocus`, `useScrolledPast`, `useInView` (IntersectionObserver), `usePageLoaded` (after the load event), `useReveal` (reveal once, immediately with reduced motion), `useHydrated`, `useEmailAddress` (prerendering: the first render equals the prerendered HTML) - **Type**: Application ### seo.ts, sitePages.ts, sitemap.ts @@ -123,7 +123,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r ### config/ (build-time, Node) - **Purpose**: Server configuration as code -- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed +- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed; prerendering adds `pageFiles.ts`, `inlineScripts.ts`, `externalizeInlineScripts.ts` (post-build step: moves inline scripts to `/assets/inline-.js` so the CSP stays) and `previewServer.ts` (serves `dist/client` with the real server rules, 404 for unknown paths) - **Type**: Infrastructure-as-code (small) ### theme.ts / recipes/ @@ -159,6 +159,6 @@ Text alternative: a visitor navigates, the router renders the root layout (AppSh ## Infrastructure Components - **IaC**: None beyond generated web server configs in `web/deploy/` -- **Deployment Model**: Static `dist/` build. Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse) +- **Deployment Model**: Static prerendered build (prerendering: `dist/client` holds one HTML file per page plus `404.html`; `dist/server` is not deployed; server rules still to be changed in unit 3 of prerendering). Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse) - **Security headers**: Strict CSP — `script-src 'self'` + Umami, `connect-src 'self'` + Umami + Sentry, **`form-action 'self'`**, `frame-ancestors 'none'`. Any third-party form or script endpoint must be added here (and regenerated into the server configs) - **Networking**: N/A diff --git a/aidlc-docs/_shared/reverse-engineering/business-overview.md b/aidlc-docs/_shared/reverse-engineering/business-overview.md index e703079..936c4d4 100644 --- a/aidlc-docs/_shared/reverse-engineering/business-overview.md +++ b/aidlc-docs/_shared/reverse-engineering/business-overview.md @@ -4,7 +4,7 @@ ```mermaid graph LR - Visitor["Website visitor (prospective client)"] --> Site["Andrea Slop Fotografie website (React SPA)"] + Visitor["Website visitor (prospective client)"] --> Site["Andrea Slop Fotografie website (React, prerendered)"] Crawler["Search engines and link previews"] --> Site Site --> Social["Facebook and Instagram profiles"] Site --> Mail["E-mail (mailto, address assembled in the browser)"] diff --git a/aidlc-docs/_shared/reverse-engineering/code-structure.md b/aidlc-docs/_shared/reverse-engineering/code-structure.md index ca449e3..39a7402 100644 --- a/aidlc-docs/_shared/reverse-engineering/code-structure.md +++ b/aidlc-docs/_shared/reverse-engineering/code-structure.md @@ -3,8 +3,8 @@ ## Build System - **Type**: pnpm (`packageManager: pnpm@12.11.2`, lockfile `web/pnpm-lock.yaml`) - **Configuration**: - - `web/package.json` — scripts `dev`, `build` (`tsc && vite build`), `preview`, `test` (vitest + coverage), `lint`, `format:check`, `audit:deps`, `audit:dev`, `lighthouse`, `server-config`, and `check` (all of them in sequence) - - `web/vite.config.ts` — TanStack Router plugin (`autoCodeSplitting`) before React plugin, sitemap plugin, security headers on dev/preview, Vitest config (jsdom, 20 s timeout, 100% coverage threshold for `src/lib/**`, `seo.ts`, `sitemap.ts`) + - `web/package.json` — scripts `dev`, `build` (`tsc && vite build` and the script step `config/externalizeInlineScripts.ts`; prerendering), `preview` (`config/previewServer.ts`), `e2e` (browser tests), `test` (vitest + coverage), `lint`, `format:check`, `audit:deps`, `audit:dev`, `lighthouse`, `server-config`, and `check` (all of them in sequence, `e2e` added by prerendering) + - `web/vite.config.ts` — TanStack Start plugin with prerendering (prerendering; replaces the router plugin, code splitting included) before React plugin, sitemap plugin, security headers on dev/preview, Vitest config (jsdom, 20 s timeout, 100% coverage threshold for `src/lib/**`, `seo.ts`, `sitemap.ts`) - `web/tsconfig.json` — bundler mode, `@/*` → `src/*` - `web/eslint.config.js` — JS + typescript-eslint + react-hooks + jsx-a11y recommended - `web/.prettierrc` — 4 spaces, single quotes, semicolons @@ -53,8 +53,8 @@ Text alternative: the root route renders AppShell (NavigationBar, Footer, BackTo ### Existing Files Inventory Candidates for modification are marked with ★ for the over-mij-page feature. -- `web/index.html` — HTML entry; static fallback head for non-JS crawlers -- `web/src/main.tsx` — bootstrap +- `web/index.html` and `web/src/main.tsx` — removed by prerendering; replaced by `src/client.tsx` (hydration entry, Sentry start), `src/router.tsx` (`getRouter`) and the document shell in `routes/__root.tsx` +- `web/src/routes/$.tsx` — catch-all route, renders `NotFound` (prerendered as `404.html`; prerendering) - `web/src/routeTree.gen.ts` — generated (do not edit) - `web/src/routes/__root.tsx` — root layout, site head, 404/error - `web/src/routes/index.tsx` — home (`/`): Hero + six sections, `?pakket=` search param @@ -76,7 +76,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature. - `web/src/content/aboutContent.ts` — about page content; `web/src/assets/about/*` — portrait and duo photos; `web/public/og-over-mij.jpg` — preview image - `web/src/routes/soorten-fotoshoots/index.tsx` — the shoot types page (moved from `routes/soorten-fotoshoots.tsx`); `newborn.tsx`, `zwangerschap.tsx`, `gezin.tsx`, `loveshoot.tsx`, `portret.tsx` — one route per shoot page (`/soorten-fotoshoots/`); `-shootPageSources.ts` — the sources the shoot routes share - `web/src/content/shootPageShared.ts` — shared shoot page content (breadcrumb, process, deposit, shared FAQ items, offer texts); `web/src/content/shootPages/*.ts` — one content module per shoot page, plus `shootPages.test.ts` (content consistency) -- `web/src/test/renderApp.tsx` — `renderApp(path)` and `expectShell()` for the route tests +- `web/src/test/renderApp.tsx` — `renderApp(path)` and `expectShell()` for the route tests (prerendering: with a test shell instead of the document shell); `web/src/test/hydrate.tsx` — hydration helpers incl. `hydrateAppAsStart` - `web/src/shootPages.test.tsx` — route tests for the five shoot pages (unit 2): outline, sections, breadcrumb, `aria-current` (main and menus), package variants, OG registry, axe; the overview's "Lees meer" links - `web/src/routes/portfolio.tsx` — the portfolio (indexed; `?shoot=` filter; `ImageGallery` JSON-LD); `web/src/components/portfolio/PortfolioGallery/`, `web/src/content/portfolioContent.ts`, `web/src/lib/portfolioFilters.ts`, `web/src/assets/portfolio/*` (10 photos × 2 sizes), `web/public/og-portfolio.jpg` - `web/src/routes/{contact,privacyverklaring}.tsx` — placeholders with `PageIntro` @@ -99,7 +99,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature. - ★ `web/src/content/types.ts` — content interfaces (API shape) - ★ `web/src/content/*.ts` — static content (`siteContent`, `heroContent`, `homeContent` (exports `introPhotos`), `instagramContent`, `packages`, `testimonials`, `socialPlatforms`) - `web/src/contact/*` — contact form types and placeholder submit -- `web/src/hooks/*` — `useRouteFocus`, `useScrolledPast`, `useInView`, `usePageLoaded`, `useReveal`, `useSwipe` (shared by the hero and the lightbox) +- `web/src/hooks/*` — `useRouteFocus`, `useScrolledPast`, `useInView`, `usePageLoaded`, `useReveal`, `useSwipe` (shared by the hero and the lightbox), `useHydrated`, `useEmailAddress` (prerendering: first render equals the prerendered HTML) - `web/src/hooks/useDismiss.ts` — Escape and outside pointer down while active (`useDismiss(ref, active, onDismiss)`), used by NavSubmenu and MobileNav (unit 3) - `web/src/components/{PortfolioGrid,Lightbox,FilterBar}/` — gallery building blocks (portfolio-page unit 2): masonry grid in reading order (CSS only), lightbox on Chakra `Dialog` (lazy-loadable default export), single-choice toggle buttons; generic over `GalleryItem` / `FilterOption` - `web/src/lib/*.ts` — pure helpers with tests @@ -113,6 +113,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature. - `web/src/assets/*` — hero photos (8), `home/` (intro 1–4, andrea, deco 1–2, two review photos), light/dark logos - `web/config/securityHeaders.ts` — CSP - `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts` +- `web/config/{pageFiles,inlineScripts,externalizeInlineScripts,previewServer}.ts` — prerendering: page file names, moving inline scripts to files after the build, preview server with the real server rules; `web/e2e/` and `web/vitest.e2e.config.ts` — browser tests on `dist/client` - `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs - `web/public/*` — favicon, logo, og-image, robots.txt, icons.svg; `og-{newborn,zwangerschap,gezin,loveshoot,portret}.jpg` (unit 2: 1200 × 630, the shoot pages' `ogImage`) @@ -156,8 +157,8 @@ Candidates for modification are marked with ★ for the over-mij-page feature. ## Critical Dependencies ### @chakra-ui/react ^3.37.0 - **Usage**: All layout and styling; typegen from `theme.ts` on install -### @tanstack/react-router ^1.170.39 (+ router-plugin ^1.168.40) -- **Usage**: File-based routes, `Link`, `Outlet`, `HeadContent`, typed `RoutePath` +### @tanstack/react-router 1.170.46 (+ @tanstack/react-start 1.169.4; prerendering) +- **Usage**: File-based routes, static prerendering (Start), `Link`, `Outlet`, `HeadContent`, typed `RoutePath` ### @sentry/react ^11.8.0 - **Usage**: Error reporting, lazy-loaded after the load event ### @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1 diff --git a/aidlc-docs/_shared/reverse-engineering/component-inventory.md b/aidlc-docs/_shared/reverse-engineering/component-inventory.md index becfd09..3c7621e 100644 --- a/aidlc-docs/_shared/reverse-engineering/component-inventory.md +++ b/aidlc-docs/_shared/reverse-engineering/component-inventory.md @@ -1,7 +1,7 @@ # Component Inventory ## Application Packages -- `web` — React 19 SPA (Vite, Chakra UI v3, TanStack Router): the public website +- `web` — React 19 site, statically prerendered (Vite, TanStack Start, Chakra UI v3, TanStack Router): the public website ## Infrastructure Packages - `.gitea/workflows/continuous_integration.yaml` — Gitea Actions CI/CD (check, lighthouse, deploy-test, deploy-production) diff --git a/aidlc-docs/_shared/reverse-engineering/dependencies.md b/aidlc-docs/_shared/reverse-engineering/dependencies.md index e195fcb..111b8b2 100644 --- a/aidlc-docs/_shared/reverse-engineering/dependencies.md +++ b/aidlc-docs/_shared/reverse-engineering/dependencies.md @@ -4,7 +4,7 @@ ```mermaid graph LR - main["main.tsx"] --> theme["theme.ts + recipes"] + main["client.tsx"] --> theme["theme.ts + recipes"] main --> routes["routes/*"] main --> monitoring["monitoring/*"] routes --> components["components/*"] @@ -25,7 +25,7 @@ graph LR class config build; ``` -Text alternative: main depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation, assets and the contact form module; build-time config reads monitoring (CSP origins) and SEO (sitemap). +Text alternative: client.tsx (replaces main.tsx; prerendering) depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation, assets and the contact form module; build-time config reads monitoring (CSP origins) and SEO (sitemap). ### routes depend on content and components - **Type**: Compile @@ -41,8 +41,8 @@ Text alternative: main depends on theme, routes and monitoring; routes depend on ## External Dependencies ### @chakra-ui/react ^3.37.0, @emotion/react ^11.14.0 - **Purpose**: Styling system and UI primitives — **License**: MIT -### @tanstack/react-router ^1.170.39 -- **Purpose**: Routing — **License**: MIT +### @tanstack/react-router 1.170.46, @tanstack/react-start 1.169.4 +- **Purpose**: Routing and static prerendering (Start, prerendering) — **License**: MIT ### react / react-dom ^19.3.0 - **Purpose**: UI runtime — **License**: MIT ### @sentry/react ^11.8.0 diff --git a/aidlc-docs/_shared/reverse-engineering/technology-stack.md b/aidlc-docs/_shared/reverse-engineering/technology-stack.md index 4238e48..0ebf440 100644 --- a/aidlc-docs/_shared/reverse-engineering/technology-stack.md +++ b/aidlc-docs/_shared/reverse-engineering/technology-stack.md @@ -8,7 +8,8 @@ ## Frameworks - React — ^19.3.0 — UI - Chakra UI — ^3.37.0 (+ @emotion/react ^11.14.0) — styling system and components -- TanStack Router — ^1.170.39 — file-based routing, head management (devtools ^1.167.2, dev only) +- TanStack Router — 1.170.46 (exact) — file-based routing, head management (devtools ^1.167.2, dev only) +- TanStack Start — @tanstack/react-start 1.169.4 (exact) — static prerendering (prerendering feature) - @fontsource/jost, @fontsource/marcellus — ^5.3.0 — self-hosted fonts - @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1 — offline icons - @sentry/react — ^11.8.0 — error reporting @@ -22,7 +23,7 @@ ## Build Tools - Vite — ^8.3.0 — dev server and bundler - @vitejs/plugin-react — ^6.1.2 -- @tanstack/router-plugin — ^1.168.40 — route tree generation, code splitting +- Route tree generation and code splitting — inside TanStack Start (prerendering; the direct @tanstack/router-plugin was removed) - @chakra-ui/cli — ^3.37.0 — theme typegen - pnpm — 12.11.2 — package manager - Node — 24 (CI) @@ -35,3 +36,4 @@ - ESLint ^9.39.5 + typescript-eslint, react-hooks, jsx-a11y - Prettier ^3.9.9 - @lhci/cli ^0.15.1 — Lighthouse CI (mobile and desktop) +- playwright-core 1.55.0 (exact) — browser tests (`pnpm e2e`, prerendering) diff --git a/aidlc-docs/features/prerendering/aidlc-state.md b/aidlc-docs/features/prerendering/aidlc-state.md index 06a40c8..75423f6 100644 --- a/aidlc-docs/features/prerendering/aidlc-state.md +++ b/aidlc-docs/features/prerendering/aidlc-state.md @@ -5,7 +5,7 @@ - **Feature Slug**: prerendering - **Project Type**: Brownfield - **Start Date**: 2026-10-31T14:15:01Z -- **Current Stage**: CONSTRUCTION - Code Generation (unit 1): B0 done; batch B1 (early proof) done, committed; B2 and B3 running, then B4 +- **Current Stage**: CONSTRUCTION - Code Generation (unit 1): steps 1 to 33 done and committed; Step 34 gate measurement running - **Branch**: feature/prerendering (from master c4c2f83); commits and pushes allowed for this feature (owner, 2026-10-31) - **Worktree**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-prerendering diff --git a/aidlc-docs/features/prerendering/construction/plans/start-migration-code-generation-plan.md b/aidlc-docs/features/prerendering/construction/plans/start-migration-code-generation-plan.md index 2919196..d172d2e 100644 --- a/aidlc-docs/features/prerendering/construction/plans/start-migration-code-generation-plan.md +++ b/aidlc-docs/features/prerendering/construction/plans/start-migration-code-generation-plan.md @@ -472,13 +472,13 @@ Disjoint from B2 and B4. Runs only targeted `vitest run` commands. The editing o - Done when: everything is green, or the unresolved failure and its open question are written in the code summary (Step 32). - Record: counts and outcomes go into the code summary. -### Step 32: Code summary [ ] +### Step 32: Code summary [x] - Executor: Sonnet. - Do: write `aidlc-docs/features/prerendering/construction/start-migration/code/code-summary.md`: list of created/modified/removed files (from `git status --short` and `git diff --stat`), grouped by component group of components.md, with the rule ids each implements; test inventory (files, counts, which properties P1 to P17 where); the verification log (V1 to V18) condensed; the Step 31 outcome; deviations (should be none); what unit 2 and 3 can rely on (business-rules.md § 3); open points for the owner (including the preview and Lighthouse 404 finding of Step 24, and the BR-404-07 observation). Format like `aidlc-docs/features/shoot-type-pages/construction/content-and-seo-foundation/code/code-summary.md` (look at it). - Done when: the file exists and every file of the diff is listed. -### Step 33: Shared reverse-engineering delta [ ] +### Step 33: Shared reverse-engineering delta [x] - Executor: Sonnet. - Implements: NFR-PR-Q-05; team agreement (only this feature's lines are updated). diff --git a/aidlc-docs/features/prerendering/construction/start-migration/code/code-summary.md b/aidlc-docs/features/prerendering/construction/start-migration/code/code-summary.md new file mode 100644 index 0000000..09c7e68 --- /dev/null +++ b/aidlc-docs/features/prerendering/construction/start-migration/code/code-summary.md @@ -0,0 +1,87 @@ +# Code Summary - Unit 1: Start migration and script step + +Plan: [start-migration-code-generation-plan.md](../../plans/start-migration-code-generation-plan.md). Worktree `AndreaSlopFotografie-prerendering`, from master `c4c2f83`. File list from `git diff c4c2f83 --stat` (104 files) and `git log c4c2f83..HEAD`. + +## Status +- Steps 1 to 31 done (checked in the plan); this summary is Step 32, the reverse-engineering delta is Step 33. +- Step 34 (gate measurement) has **not run**. This summary states no performance result, and the feature's goals (NFR-PR-P-03, P-04) are not claimed as met. V10 (placeholder sizes, CLS) is still open until Step 34. +- The build is **not deployable** until unit 3 changes the server rules (see Open points). + +## Commits +Ten commits on top of `c4c2f83`, oldest first: `65c850e` docs (requirements, design, baseline), `c1e90f0` Start migration, `1574726` script step, `2c2e27e` first render equals the prerendered HTML, `0b964b5` preview server, `fe1ec5d` build wiring, `0c5d8b8` gzip in the preview server, `8bf0000` browser tests and 404 hydration fix, `8867c78` CI runs the browser tests, `a68e84c` comment cleanup, `d6f8eb6` hydration test moved out of `routes/`. + +## Files + +### Build and entry (BR-BLD-01 to 12, BR-ENT-01 to 06, BR-404-01, 02, BR-MON-01; FR-PR-01 to 04, 08) +- Created: `web/src/client.tsx` (hydration entry, `startSentry()` first), `web/src/router.tsx` (`routerOptions()`, `getRouter()`), `web/src/routes/$.tsx` (catch-all, `pendingComponent` equals the component) +- Modified: `web/src/routes/__root.tsx` (document shell `shellComponent`, head), `web/vite.config.ts` (Start plugin, page list from `sitePages`, `/404.html`, no Start plugin in test mode), `web/src/routeTree.gen.ts` (regenerated), `web/src/navigation.ts` (`RoutePath` excludes `/$`), `web/config/sitemapPlugin.ts` (client environment only), `web/lighthouserc.cjs` (`notFoundPath` is `/404.html`), `web/package.json`, `web/pnpm-lock.yaml`, `web/pnpm-workspace.yaml`, `web/tsconfig.json`, `web/eslint.config.js`, `web/.gitignore` (`.tanstack`) +- Removed: `web/index.html`, `web/src/main.tsx` +- Created: `web/config/pageFiles.ts` (+ `pageFiles.test.ts`, P10): page path to file name + +### Script step (BR-SCR-01 to 21, BR-SEC-02, 03; FR-PR-19, 20; NFR-PR-SEC-03, 04) +- Created: `web/config/inlineScripts.ts` (+ `.test.ts`, P1 to P9), `web/config/externalizeInlineScripts.ts` (+ `.test.ts`, P11 to P13), `web/src/test/htmlArbitraries.ts` + +### Preview server (BR-SRV-01 to 08; FR-PR-14 preview part; NFR-PR-SEC-01) +- Created: `web/config/previewServer.ts` (+ `.test.ts`, P16, P17), `web/src/test/requestArbitraries.ts` + +### Hydration safety: hooks (BR-HYD-02 to 05, 09) +- Created: `web/src/hooks/useHydrated.ts` (+ test), `web/src/hooks/useEmailAddress.ts` (+ test), `web/src/hooks/useInView.test.tsx` +- Modified: `web/src/hooks/useInView.ts`, `usePageLoaded.ts` (+ test), `useReveal.ts` (+ test), `web/src/components/Hero/useHeroSlider.ts` (+ test) + +### Hydration safety: components, routes, lib (BR-HYD-10 to 14, BR-MAIL-01 to 10, BR-LZY-02, BR-404-04, 05; FR-PR-05 to 07, 15, 22) +- Modified: `web/src/components/Footer/Footer.tsx` (+ test), `ContactDetails/ContactDetails.tsx` (+ test), `ContactForm/ContactFormGate.tsx` (+ test), `ContactForm/ContactForm.tsx` (+ test), `NavigationBar/NavigationBar.tsx` (+ test), `NavigationBar/MobileNav.tsx`, `StatusPage/NotFound.tsx` (+ test), `home/Testimonials/Testimonials.tsx` (+ test), `home/Testimonials/TestimonialCarousel.tsx`, `home/ContactSection/ContactSection.tsx`, `Analytics/UmamiAnalytics.tsx`, `web/src/routes/index.tsx`, `contact.tsx`, `portfolio.tsx` (search gating) +- Modified: `web/src/lib/contactChannels.ts` (+ test, P14), `web/src/lib/emailAddress.ts` (+ test, P15) + +### Tests and harness (BR-TST-01 to 07; NFR-PR-Q-01 to 04) +- Created: `web/src/hydration.test.tsx`, `web/src/prerender.test.tsx`, `web/src/test/hydrate.tsx` (`hydrateApp`, `hydrateAppAsStart`), `web/vitest.e2e.config.ts`, `web/e2e/{hydration,interaction,rawHtml,smoke}.e2e.ts`, `web/e2e/support/{browser,globalSetup,server}.ts` +- Modified: `web/src/test/renderApp.tsx` (test shell), `web/src/test/setup.ts`, `web/src/app.test.tsx`, `web/src/components/DeferredImage/DeferredImage.test.tsx` + +### CI +- Modified: `.gitea/workflows/continuous_integration.yaml` (browser tests on the `dist/client` artifact, BR-BLD-10, BR-TST-05) + +### Documentation +- Created under `aidlc-docs/features/prerendering/`: `aidlc-state.md`, `audit.md`, `inception/*` (requirements, application design, plans, execution plan), `construction/plans/*` (three plans), `construction/start-migration/functional-design/*` (four documents), `construction/start-migration/code/{baseline-checks,measurement-baseline,proof-report,verification-log,code-summary}.md`; modified `aidlc-docs/active-features.md` +- Modified in Step 33: `aidlc-docs/_shared/reverse-engineering/{architecture,code-structure,technology-stack,dependencies,component-inventory,business-overview}.md` (feature lines only) +- Corrected in Step 32: `functional-design/business-rules.md` BR-LZY-01 and BR-MAIL-05 (see Deviations) + +## Test inventory +- Step 1 baseline: 113 files, 888 tests. After Step 31 (before `src/routes/hydration.test.tsx` moved to `src/hydration.test.tsx`): 123 files, 1179 tests, all passing; fast-check seed 1405857762; coverage thresholds met. +- Browser tests (`pnpm e2e`): 4 files, 77 tests, passing. +- Properties: P1 to P9 `config/inlineScripts.test.ts`; P10 `config/pageFiles.test.ts`; P11 to P13 `config/externalizeInlineScripts.test.ts`; P14 `src/lib/contactChannels.test.ts`; P15 `src/lib/emailAddress.test.ts`; P16, P17 `config/previewServer.test.ts`. Hooks and browser flows have example tests only (no PBT properties identified). +- Old tests changed under BR-TST-02: `usePageLoaded.test.tsx`, `DeferredImage.test.tsx`, `useReveal.test.tsx`, `app.test.tsx` (register test ignores `/$`). + +## Verification log (V1 to V18, condensed) +Details: [verification-log.md](verification-log.md). +- OK: V1 (client entry), V2 (shell in jsdom, test shell), V3 (3 moved scripts per page, 5 on `/contact`, 16 files), V4 (keep the minimum of one), V5 (12 pages), V6, V7, V8 (see Deviations), V9, V11, V12, V13, V14, V15, V16, V17, V18. +- Open: V10 (placeholder sizes and CLS; first estimates only, measured in Step 34). + +## Step 31 outcome +- Build: 12 pages, 16 scripts moved (28 files written), no violations. +- `pnpm audit:deps` clean. `pnpm audit` severity counts are identical to master: low 2, moderate 10, high 11, critical 0. +- Lint, format, tests, build and e2e green. + +## Deviations from the design and plan +1. `zod@4: ^4.6.6` override in `pnpm-workspace.yaml` (GHSA-mrhx-c7xc-m3w5 in Start's tree); patch bump, zod 3 untouched. The main session confirms it. +2. Exact pins for `@tanstack/react-start` 1.169.4 and `@tanstack/react-router` 1.170.46 (was `^1.170.39`, raised to avoid two router copies); `playwright-core` pinned 1.55.0. +3. `RoutePath` in `src/navigation.ts` excludes `/$`. +4. `renderApp` renders with a test shell (`HeadContent` + children) instead of the real `shellComponent` (V2). +5. `pendingComponent` on the catch-all route equals its component (through one shared `CatchAll`). Root cause of React error #418 on `404.html`: the HTML is made for `/404`, the browser is at another URL, so Start's `hydrate()` finds a different match id (`#$#404` against `#$#404.html`) and presents the match as pending with `ssr: false`; without a `pendingComponent` the first browser render is empty and React hydrates the Suspense boundary against the full page (a race, so it depends on width, CPU and network). Detail in the verification log. +6. `notFoundPath` in `lighthouserc.cjs` is `/404.html` (Lighthouse refuses a 404 status). +7. Gzip added to the preview server (commit `0c5d8b8`), as the production server is expected to. +8. Gate placeholder is `38ch` (20 + 18 characters) in `ContactFormGate`; BR-MAIL-05 now says so. +9. Extra guard in `useInView`: the effect of the hydrating render still sees the server's `unsupported` (false), so it also checks `IntersectionObserver` itself. +10. Test helper `hydrateAppAsStart` in `src/test/hydrate.tsx`: reproduces the router state Start's `hydrate()` leaves, which `hydrateApp` hides. +11. BR-LZY-01 corrected: on `/contact` the form is in the HTML only as a hidden streamed Suspense segment (`