Adds the URL rules to the preview server, IIS config and deploy
The preview server and web.config now follow the same URLs as nginx, without the SPA fallback. Lighthouse exceptions need a recorded reason and the 404 page is audited through an opt-in route. The deploy checks the build first and the served result afterwards. The IIS rules stay unverified until a host exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
- **Feature Slug**: prerendering
|
||||
- **Project Type**: Brownfield
|
||||
- **Start Date**: 2026-10-31T14:15:01Z
|
||||
- **Current Stage**: CONSTRUCTION - Code Generation (unit 3: hosting-and-targets): CP1 closed (run 593); B2 to B5 running
|
||||
- **Current Stage**: CONSTRUCTION - Code Generation (unit 3: hosting-and-targets): B0 to B5 done; B6 running
|
||||
- **Branch**: feature/prerendering (from master c4c2f83); commits and pushes allowed for this feature (owner, 2026-10-31); workflow dispatch without deploy allowed; deploy to test after all units (owner, 2026-11-01), after the nginx config is placed
|
||||
- **Worktree**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-prerendering
|
||||
|
||||
|
||||
+5
-5
@@ -8,15 +8,15 @@ Status values: OK, BLOCKED, DEVIATION, WITHDRAWN, OPEN.
|
||||
|---|---|---|---|---|---|
|
||||
| V1 | The generated nginx file loads in a real nginx (`nginx -t`) as an `http`-level include without any other directive from the Pi; `map` before `server` works in `conf.d`. Every directive is checked against the nginx 1.30 documentation (the Pi runs 1.30.6; CI has 1.24) | 3 (documentation), 6 (real nginx) | OK on nginx 1.24.0: the generated file loads (nginx -t in the harness runs before every start) as an http-level include, map before server works; documentation part checked earlier (see below). Not proven: nginx 1.30.6 on the Pi (CI has 1.24.0); the real check is nginx -t plus the curl matrix during the Pi rollout (H2, H3). | Checked against nginx.org docs on 2026-11-01: map (context http only; exact string beats regex, first regex in file order wins; ~* case-insensitive; no default gives empty), if/return/rewrite (server, location; rewrite permanent = 301, original args appended unless replacement ends in ?), try_files (server, location), error_page (http, server, location; without = keeps the status), internal (location), absolute_redirect (http, server, location; since 1.11.8, default on), autoindex (http, server, location; default off), gzip/gzip_vary/gzip_proxied/gzip_http_version/gzip_comp_level/gzip_min_length/gzip_types (http, server, location; text/html always compressed). The generated file puts map at http level (conf.d include) and all others in server or location. NOT documented by nginx.org: escaping of the rewrite replacement (BR-HST-06 relies on it; settled only by the real nginx test on //evil.example/ and /evil.example/); the safety of if with only return comes from the nginx wiki, not the page. | CI run 593 (commit 8cb9185), job lighthouse, step Browsertests, nginx/1.24.0 (Ubuntu) on the Pi runner (container, root); e2e/serverRules.e2e.ts: 134 tests, all passed, none skipped (2088 ms), 67 per mime variant (.js as text/javascript and as application/javascript); the run totals 348 tests with 341 passed and 7 failed, all 7 in images.e2e.ts and reveal.e2e.ts (timeouts, unrelated); the test prints "[serverRules] nginx -v: nginx version: nginx/1.24.0 (Ubuntu)" once per variant. Earlier cycles found and fixed three defects through this proof: workers as www-data could not read the mkdtemp fixture (harness, run 592: 403), map plain keys ignore case so /Over-Mij was not redirected (generator), and /%5Cevil.example/ produced Location /evil.example (generator, BR-HST-06). | OK |
|
||||
| V2 | Server-level `if ... return 301` and `rewrite ... permanent` responses carry all five headers and `Cache-Control` with real nginx; `absolute_redirect off` gives a relative `Location`; `/` works without an `index` directive | 6, 16 | OK: 301 from the server-level if and from rewrite carry all five security headers, X-Robots-Tag and exactly one Cache-Control (raw header count); Location is relative (absolute_redirect off); / works without an index directive. Not proven: nginx 1.30.6 on the Pi (CI has 1.24.0); the real check is nginx -t plus the curl matrix during the Pi rollout (H2, H3). | CI run 593 (commit 8cb9185), job lighthouse, step Browsertests, nginx/1.24.0 (Ubuntu) on the Pi runner (container, root); e2e/serverRules.e2e.ts: 134 tests, all passed, none skipped (2088 ms), 67 per mime variant (.js as text/javascript and as application/javascript); the run totals 348 tests with 341 passed and 7 failed, all 7 in images.e2e.ts and reveal.e2e.ts (timeouts, unrelated); the test prints "[serverRules] nginx -v: nginx version: nginx/1.24.0 (Ubuntu)" once per variant. Earlier cycles found and fixed three defects through this proof: workers as www-data could not read the mkdtemp fixture (harness, run 592: 403), map plain keys ignore case so /Over-Mij was not redirected (generator), and /%5Cevil.example/ produced Location /evil.example (generator, BR-HST-06). | OK |
|
||||
| V3 | `/soorten-fotoshoots` (file) and `/soorten-fotoshoots/` (directory) behave as in section 3.1 on nginx and preview; `/assets` and `/assets/` as well | 6, 8, 16 | OK on nginx: /soorten-fotoshoots serves the file with the directory soorten-fotoshoots/ next to it, /soorten-fotoshoots/ gives one 301, /assets gives 404, /assets/ gives 301 to /assets. Preview-server side still open (Step 8/16). Not proven: nginx 1.30.6 on the Pi (CI has 1.24.0); the real check is nginx -t plus the curl matrix during the Pi rollout (H2, H3). | CI run 593 (commit 8cb9185), job lighthouse, step Browsertests, nginx/1.24.0 (Ubuntu) on the Pi runner (container, root); e2e/serverRules.e2e.ts: 134 tests, all passed, none skipped (2088 ms), 67 per mime variant (.js as text/javascript and as application/javascript); the run totals 348 tests with 341 passed and 7 failed, all 7 in images.e2e.ts and reveal.e2e.ts (timeouts, unrelated); the test prints "[serverRules] nginx -v: nginx version: nginx/1.24.0 (Ubuntu)" once per variant. Earlier cycles found and fixed three defects through this proof: workers as www-data could not read the mkdtemp fixture (harness, run 592: 403), map plain keys ignore case so /Over-Mij was not redirected (generator), and /%5Cevil.example/ produced Location /evil.example (generator, BR-HST-06). | OK (nginx part) |
|
||||
| V3 | `/soorten-fotoshoots` (file) and `/soorten-fotoshoots/` (directory) behave as in section 3.1 on nginx and preview; `/assets` and `/assets/` as well | 6, 8, 16 | OK on nginx: /soorten-fotoshoots serves the file with the directory soorten-fotoshoots/ next to it, /soorten-fotoshoots/ gives one 301, /assets gives 404, /assets/ gives 301 to /assets. Preview-server side OK (config/previewServer.test.ts: resolver table and a server-level test with a page next to its directory; /assets 404, /assets/ 301 to /assets); real-nginx parity still open (Step 16). Not proven: nginx 1.30.6 on the Pi (CI has 1.24.0); the real check is nginx -t plus the curl matrix during the Pi rollout (H2, H3). | CI run 593 (commit 8cb9185), job lighthouse, step Browsertests, nginx/1.24.0 (Ubuntu) on the Pi runner (container, root); e2e/serverRules.e2e.ts: 134 tests, all passed, none skipped (2088 ms), 67 per mime variant (.js as text/javascript and as application/javascript); the run totals 348 tests with 341 passed and 7 failed, all 7 in images.e2e.ts and reveal.e2e.ts (timeouts, unrelated); the test prints "[serverRules] nginx -v: nginx version: nginx/1.24.0 (Ubuntu)" once per variant. Earlier cycles found and fixed three defects through this proof: workers as www-data could not read the mkdtemp fixture (harness, run 592: 403), map plain keys ignore case so /Over-Mij was not redirected (generator), and /%5Cevil.example/ produced Location /evil.example (generator, BR-HST-06). | OK (nginx part) |
|
||||
| V4 | `/404` and `/404.html` give 404 with the page and the five headers on nginx; `error_page` keeps the status; HEAD works | 6, 16 | OK: /404 and /404.html give 404 with the page and all headers, a missing asset gives the 404 page with no-cache (not immutable), error_page keeps the status, HEAD works. Not proven: nginx 1.30.6 on the Pi (CI has 1.24.0); the real check is nginx -t plus the curl matrix during the Pi rollout (H2, H3). | CI run 593 (commit 8cb9185), job lighthouse, step Browsertests, nginx/1.24.0 (Ubuntu) on the Pi runner (container, root); e2e/serverRules.e2e.ts: 134 tests, all passed, none skipped (2088 ms), 67 per mime variant (.js as text/javascript and as application/javascript); the run totals 348 tests with 341 passed and 7 failed, all 7 in images.e2e.ts and reveal.e2e.ts (timeouts, unrelated); the test prints "[serverRules] nginx -v: nginx version: nginx/1.24.0 (Ubuntu)" once per variant. Earlier cycles found and fixed three defects through this proof: workers as www-data could not read the mkdtemp fixture (harness, run 592: 403), map plain keys ignore case so /Over-Mij was not redirected (generator), and /%5Cevil.example/ produced Location /evil.example (generator, BR-HST-06). | OK |
|
||||
| V5 | A HTTP/1.0 request with `Accept-Encoding: gzip` to the generated block gets `Content-Encoding: gzip` for `.html`, `.js`, `.css`, `.svg`, `.json`, `.xml` (all sizes above 256 bytes) and not for `.woff2`/images | 6, 16 | OK: HTTP/1.1 and raw HTTP/1.0 requests get gzip for html, js, css, svg, json, xml, txt in both mime variants, none for woff2 and png; Vary: Accept-Encoding present. Not proven: nginx 1.30.6 on the Pi (CI has 1.24.0); the real check is nginx -t plus the curl matrix during the Pi rollout (H2, H3). | CI run 593 (commit 8cb9185), job lighthouse, step Browsertests, nginx/1.24.0 (Ubuntu) on the Pi runner (container, root); e2e/serverRules.e2e.ts: 134 tests, all passed, none skipped (2088 ms), 67 per mime variant (.js as text/javascript and as application/javascript); the run totals 348 tests with 341 passed and 7 failed, all 7 in images.e2e.ts and reveal.e2e.ts (timeouts, unrelated); the test prints "[serverRules] nginx -v: nginx version: nginx/1.24.0 (Ubuntu)" once per variant. Earlier cycles found and fixed three defects through this proof: workers as www-data could not read the mkdtemp fixture (harness, run 592: 403), map plain keys ignore case so /Over-Mij was not redirected (generator), and /%5Cevil.example/ produced Location /evil.example (generator, BR-HST-06). | OK |
|
||||
| V6 | Withdrawn for this unit (IIS needs a host). The checks move to the "Before go-live" list, U1 to U6 | WITHDRAWN (no host) | | | WITHDRAWN |
|
||||
| V7 | `previewServer.ts`: the new `resolveRequest` contract (redirect result, query handling, `--audit-route`); unit 1 tests for BR-SRV-07 are updated (the "interim" rules become final); `pageFiles.ts` stays the single path to file mapping | 7, 8 | | | open |
|
||||
| V7 | `previewServer.ts`: the new `resolveRequest` contract (redirect result, query handling, `--audit-route`); unit 1 tests for BR-SRV-07 are updated (the "interim" rules become final); `pageFiles.ts` stays the single path to file mapping | 7, 8 | OK: `resolveRequest` returns `FileResult` or `RedirectResult` (301) and takes `{ auditRoute }`; `handle()` sends the 301 with a relative `Location` plus the raw query, `Content-Length: 0`, the security headers and no `Cache-Control`, also for HEAD; `/404` and `/404.html` are 404; `/__audit/404` is 200 only with `--audit-route`; `//x` and `/%5Cevil.example/` give the 404 page. The BR-SRV-07 tests are rewritten into the final rules. `pageFiles.ts` is still the only path-to-file mapping. | `pnpm exec vitest run config/previewServer.test.ts`: 89 passed (two runs, seeds 943967193 and 1045251215); `tsc --noEmit` and eslint clean | OK |
|
||||
| V8 | The 301 is followed by Chrome with the query string intact for `?pakket=` and `?shoot=` links, and the hydrated page has 1 title (extend the existing "URL die de server niet kent en de router wel" e2e) | 17 | | | open |
|
||||
| V9 | One Lighthouse run of the 404 page on the preview audit route, and (as comparison) `/404.html` with `ignoreStatusCode`; record best-practices for both, then keep the simpler passing option (O2) | 23 (measurement-final.md) | | | open |
|
||||
| V10 | lftp: dry run against a `file:` target proves that pass 1 skips all nested `*.html` and `web.config`, pass 2 uploads them, pass 3 deletes only stale files | 14 | | | open |
|
||||
| V11 | `verify-deployment.sh` fails against a copy of the old nginx config (home page for `/over-mij`) and passes against the new one | 13 | | | open |
|
||||
| V10 | lftp: dry run against a `file:` target proves that pass 1 skips all nested `*.html` and `web.config`, pass 2 uploads them, pass 3 deletes only stale files | 14 | Not proven: lftp is not installed on this PC (and may not be installed). Script upload-production.sh uses `--exclude-glob '*.html' --exclude-glob web.config` (pass 1), `put -O` of web.config plus `--include-glob '*.html'` (pass 2) and `mirror --reverse --delete` (pass 3); the generated lftp command was checked with a fake lftp, not with lftp. The test in e2e/deployScripts.e2e.ts (file: target, UPLOAD_PASS=1|2|3, upload order from the verbose output) is written and skipped locally with a visible line; in CI it fails when lftp is missing, and the lighthouse job installs lftp. Unverified until the first CI run: whether `--include-glob` alone includes only HTML and still descends into subdirectories, and the `file:///` target form. | e2e/deployScripts.e2e.ts: 5 skipped locally ("lftp niet gevonden"); deploy/upload-production.sh passes bash -n | OPEN |
|
||||
| V11 | `verify-deployment.sh` fails against a copy of the old nginx config (home page for `/over-mij`) and passes against the new one | 13 | OK against stubs: verify-deployment.sh exits 1 against a stub that imitates the old nginx config (index.html with 200 for every path), with the messages "/over-mij: antwoord is niet gelijk aan over-mij.html", "status 200, verwacht 404" and "/over-mij/: status 200, verwacht 301"; it exits 0 against a stub with the new rules (also with a trailing slash on the URL) and against the preview server on the fixture site. Also fails per missing security header, with --test without X-Robots-Tag or gzip; gzip missing only warns without --test. Not run against the real old or new nginx file on the Pi (nothing is contacted); the first deploy-test run shows it against the new config. | pnpm exec vitest run --config vitest.e2e.config.ts e2e/deployScripts.e2e.ts: 22 passed, 5 skipped (lftp) | OK (stubs) |
|
||||
| V12 | CI: the `lighthouse` job (or a new `server-rules` job) installs nginx, `pnpm e2e` includes `serverRules.e2e.ts`, and the job fails if nginx is missing | 5, 16 | OK: the lighthouse job installs nginx and lftp, Browsertests runs with CI=true, serverRules ran with nginx present. The missing-nginx failure path was proven locally (CI=true without nginx fails with "nginx ontbreekt in CI (BR-HST-24)"). | CI run 593 (commit 8cb9185), job lighthouse, step Browsertests, nginx/1.24.0 (Ubuntu) on the Pi runner (container, root); e2e/serverRules.e2e.ts: 134 tests, all passed, none skipped (2088 ms), 67 per mime variant (.js as text/javascript and as application/javascript); the run totals 348 tests with 341 passed and 7 failed, all 7 in images.e2e.ts and reveal.e2e.ts (timeouts, unrelated); the test prints "[serverRules] nginx -v: nginx version: nginx/1.24.0 (Ubuntu)" once per variant. Earlier cycles found and fixed three defects through this proof: workers as www-data could not read the mkdtemp fixture (harness, run 592: 403), map plain keys ignore case so /Over-Mij was not redirected (generator), and /%5Cevil.example/ produced Location /evil.example (generator, BR-HST-06). The install step in run 593 uses policy-rc.d to keep the package from starting a service. | OK |
|
||||
| V13 | `lighthouserc.cjs`: the exception table is empty on delivery unless an owner decision exists; P-HST-11 passes; `pnpm lighthouse` still starts the preview with `--audit-route` and `Local` appears for `startServerReadyPattern` | 11, 12 | | | open |
|
||||
| V13 | `lighthouserc.cjs`: the exception table is empty on delivery unless an owner decision exists; P-HST-11 passes; `pnpm lighthouse` still starts the preview with `--audit-route` and `Local` appears for `startServerReadyPattern` | 11, 12 | Exception table holds the 8 carried-over entries (targets unchanged by plan; decision text "tijdelijk, tot de eindmeting van prerendering" until the owner decides); effective per-URL assertions identical before/after for mobile and desktop, performance level error and warn; `config/lighthouserc.test.ts` + `src/app.test.tsx` 55 tests green; start command has `--audit-route` | Open: `Local` in the `--audit-route` preview output is Step 7 (B2) and not checked here |
|
||||
| V14 | The generated header comment fits the Pi: install path `/etc/nginx/conf.d/andreaslop-test.conf` (included from `nginx.conf:38`), no `sites-enabled`, no global `nginx.conf` change; the file works for a first install and for an update of an existing file | 3 | Header comment rewritten: install path /etc/nginx/conf.d/andreaslop-test.conf, included in http {} from nginx.conf, no sites-enabled, no global nginx.conf change, own gzip block because the Pi has none, works behind an HTTP/1.0 proxy, 444 from 00-default.conf for an unknown host (old WordPress remark removed), server_name and root adaptable, no default_server. The same file serves a first install and an update (it replaces the existing file in place). | Generated deploy/nginx/andreaslop-test.conf (lines 1-12); equals nginxTestConf() (serverConfig.test.ts sync test green) | OK |
|
||||
|
||||
+18
-11
@@ -247,7 +247,7 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
|
||||
## Part C: Preview server (batch B2, Sonnet; parallel with B3, B4, B5)
|
||||
|
||||
### Step 7: New `resolveRequest` contract and audit route (BR-HST-01 to 08, 22; V7) [ ]
|
||||
### Step 7: New `resolveRequest` contract and audit route (BR-HST-01 to 08, 22; V7) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-HST-01 to 08, 11, 13, 22; FR-PR-14, 16, 23.
|
||||
@@ -259,8 +259,9 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
4. `startPreviewServer(clientDir, port, options?: { auditRoute?: boolean })`; `parseArguments` accepts `--audit-route` (boolean) next to `--port`, `--strictPort`, `--dir`; unknown arguments are still ignored. Update the file's header comment: the 404 page is audited through the opt-in route; `/404.html` is a real 404.
|
||||
- Done when: `pnpm exec tsc --noEmit`, `pnpm lint` clean; the tests of § 6 for this file fail as expected and no others (they are rewritten in Step 8).
|
||||
- Record: one line naming the exported types.
|
||||
- Done: exported `FileResult`, `RedirectResult`, `ResolvedRequest` (union), `ResolveOptions`, `PreviewOptions`; `resolveRequest(path, fileExists, options?)` and `startPreviewServer(clientDir, port, options?)`.
|
||||
|
||||
### Step 8: Tests for the preview server (P-HST-01, 05, 06; V3, V7) [ ]
|
||||
### Step 8: Tests for the preview server (P-HST-01, 05, 06; V3, V7) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: P-HST-01, 02, 03, 04, 05, 06; V3, V7.
|
||||
@@ -272,12 +273,13 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
4. Server level with `startPreviewServer`: a redirect response has status 301, a relative `Location` with the query kept byte for byte (P-HST-05, `(invariant)` over `queryString`), the five security headers, no body, and works for HEAD; `/404.html` and `/404` answer 404 with the page and headers; `/__audit/404` is 404 without the option and 200 with it, and `/404.html` stays 404 with the option; `--audit-route` through the command-line tests (`previewServer als opdrachtregel`): with the flag the route answers 200.
|
||||
- Done when: `pnpm exec vitest run config/previewServer.test.ts` green; `pnpm exec tsc --noEmit`, `pnpm lint` clean.
|
||||
- Record: which existing tests changed (names), and the P17 note.
|
||||
- Done: changed the group `tussenregels uit BR-SRV-07` (now `regels uit BR-HST-03 tot 05`), `behandelt een laatste segment met een punt als bestandsverzoek` (`/over-mij.html` is a 301), the drive-letter assertion (now `toEqual(NOT_FOUND)`, stricter), `antwoordt op /404 met status 404` (now `/404` and `/404.html`, 404 with page and headers), `comprimeert elk teksttype` (requests `/over-mij` instead of `/over-mij.html`, same gzip assertions), P16 (redirect results are skipped, `file` checks unchanged) and P17 (the model returns the redirect for any input that `canonicalRedirect` maps, and `/404.html` is 404). `siteDir` gained `soorten-fotoshoots.html` and its directory.
|
||||
|
||||
---
|
||||
|
||||
## Part D: IIS text and config tests (batch B3, Sonnet; parallel with B2, B4, B5)
|
||||
|
||||
### Step 9: The IIS `web.config` text (BR-HST-04, 07, 10, 19) [ ]
|
||||
### Step 9: The IIS `web.config` text (BR-HST-04, 07, 10, 19) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-HST-02, 04, 06, 07, 10, 12, 13, 19; FR-PR-14, 16, 23. **These rules are unverified until a host exists; do not build any tooling to verify them.**
|
||||
@@ -285,8 +287,9 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
- Do: rewrite `iisWebConfig` per infrastructure-design.md § 4.3. Rule order inside `<rewrite><rules>`: `www naar andreaslop.nl` and `HTTPS` unchanged; then `Index naar root`, `Pagina canoniek` (alternation of the page names built from `redirectNames` and `variantPattern`, condition `{R:0}` not matching the exact lower-case canonical form with `ignoreCase="false"`, `Redirect` to `/{ToLower:{R:1}}`, permanent), `Slash weg` (`^([^/\\].*?)/+$`, redirect `/{R:1}`), `404 direct` (`^404(?:\.html)?$`, `CustomResponse` 404), `Pagina bestand` (`^(.+)$`, condition `{REQUEST_FILENAME}.html` `IsFile`, rewrite `{R:1}.html`), `Map zonder pagina` (`^(.+)$`, condition `{REQUEST_FILENAME}` `IsDirectory`, `CustomResponse` 404). All with `stopProcessing="true"`. The "SPA fallback" rule is **removed**. After `<rewrite>`: `<httpErrors errorMode="Custom" existingResponse="Replace">` with `<remove statusCode="404" subStatusCode="-1" />` and `<error statusCode="404" subStatusCode="-1" path="/404.html" responseMode="ExecuteURL" />`; `<urlCompression doStaticCompression="true" doDynamicCompression="false" />`; in `staticContent` the existing `woff2` entry plus remove-then-add MIME pins for `.js` (`text/javascript`), `.svg`, `.json`, `.xml` (`text/xml`) taken from `compressibleTypes.ts`; `clientCache` and the `/assets` location block as now; `httpProtocol` headers as now. No `httpCompression`, no `directoryBrowse`, no `defaultDocument`. Escape all attribute values with the existing `xmlAttribute`. Update the header comment: the rules are generated from the page list; unverified until a host exists (open points U1 to U6 in infrastructure-design.md § 7.2).
|
||||
- Done when: the generated file is well-formed XML (parse it in a test, Step 10); `pnpm exec tsc --noEmit`, `pnpm lint` clean.
|
||||
- Record: one line listing the rule names in order.
|
||||
Record (done): www naar andreaslop.nl, HTTPS, Index naar root, Pagina canoniek, Slash weg, 404 direct, Pagina bestand, Map zonder pagina. Unverified until a host exists (V6 withdrawn).
|
||||
|
||||
### Step 10: Complete `serverConfig.test.ts` (P-HST-07, 08, 10) [ ]
|
||||
### Step 10: Complete `serverConfig.test.ts` (P-HST-07, 08, 10) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: P-HST-07, 08, 10; BR-HST-03, 04, 06, 07, 09 to 13, 19.
|
||||
@@ -297,12 +300,13 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
3. P-HST-10 replacement (example-based text test): `iisWebConfig()` parses as XML (use a small regex-free check with the built-in `DOMParser` via `// @vitest-environment jsdom`, or a string balance check if jsdom is not already used in this file; keep the environment of the file in mind), contains the rule names in the designed order, has no `SPA fallback` and no `index.html` rewrite, contains `ToLower` only inside the canonical rule, `[^/\\]` in the slash rule, `ExecuteURL`, `urlCompression`, and neither `httpCompression` nor `directoryBrowse`; the five headers appear as before.
|
||||
- Done when: `pnpm exec vitest run config/serverConfig.test.ts` green; the number of assertions in the file is higher than before.
|
||||
- Record: the names of replaced tests.
|
||||
Record (done): "IIS heeft een SPA-fallback en een HTTPS-redirect" became "IIS heeft een HTTPS-redirect en geen SPA-fallback" (stricter: also no index.html). The nginx replacements were already in place. 13 tests became 26.
|
||||
|
||||
---
|
||||
|
||||
## Part E: Lighthouse configuration (batch B4, Sonnet; parallel with B2, B3, B5)
|
||||
|
||||
### Step 11: Data-driven `lighthouserc.cjs` and the audit route (BR-HST-21 to 23) [ ]
|
||||
### Step 11: Data-driven `lighthouserc.cjs` and the audit route (BR-HST-21 to 23) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-HST-21, 22, 23; NFR-PR-P-01, P-02, S-01; V13.
|
||||
@@ -313,9 +317,9 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
3. Update `lighthouserc.d.cts` for the new exports.
|
||||
4. Keep the comment block that explains why performance is `warn` in CI; add one line that `numberOfRuns` is 1 on purpose and that a page exactly at 0.90 can fail `pnpm check` by chance (owner decision O6).
|
||||
- Done when: `node -e "const c=require('./lighthouserc.cjs'); console.log(Object.keys(c.mobileExceptions).length, c.notFoundPath, c.ci.collect.startServerCommand)"` prints 8, `/__audit/404` and the new command; the effective targets per URL are identical to before (compare the output of a small script that prints, per URL, the `minScore` of the matching mobile and desktop entries before (from `git stash`-free means: read the original file with `git show HEAD:web/lighthouserc.cjs` into the scratch folder and load both) and after: all equal); `pnpm exec tsc --noEmit`, `pnpm lint` clean.
|
||||
- Record: the before/after table of targets (must be identical).
|
||||
- Record: targets identical before and after (per URL, mobile and desktop, performance level error and warn): `/` 0.8; `/over-mij`, `/soorten-fotoshoots` and the five shoot pages 0.85; `/portfolio`, `/contact`, `/privacyverklaring` and the 404 page 0.9; desktop 0.9 everywhere. The 404 URL changed to `/__audit/404` as the plan prescribes. `photoPagePaths` is kept as a derived export because `src/app.test.tsx` imports it.
|
||||
|
||||
### Step 12: Tests for the Lighthouse configuration (P-HST-11, V13) [ ]
|
||||
### Step 12: Tests for the Lighthouse configuration (P-HST-11, V13) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: P-HST-11; BR-HST-22, 23; V13.
|
||||
@@ -324,13 +328,13 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
1. `app.test.tsx`: `expect(lighthouseConfig.notFoundPath).toBe('/__audit/404')` and update the comment (Lighthouse refuses an error status; the preview serves the 404 page with 200 only through the opt-in route; `/404.html` is a real 404).
|
||||
2. `config/lighthouserc.test.ts` (loads the CJS module with `createRequire`): every exception has a non-empty `decision` string, `minScore < 0.9`, and names a path in `indexedPaths`; no URL of the collect list matches two assert-matrix entries and none matches zero (use each entry's `matchingUrlPattern` as a RegExp); `notFoundPath` is not in `indexedPaths` or `noindexPaths`; `startServerCommand` contains `--audit-route`; `numberOfRuns` is 1; the quality categories accessibility, best-practices, SEO have `minScore: 1` in every entry that has them; the desktop config sets every performance assertion to 0.9. Property-style (`(invariant)`) where useful: for any generated subset of exception entries the matrix builder (if exported as a function; otherwise test the produced matrix) covers each indexed page exactly once. Include an example-based test that a deliberately invalid exception (empty decision, `minScore` 0.9) would be rejected by the validation helper you extract (`validateExceptions` in the CJS file, exported and used by the module itself at load time so a bad table fails at import).
|
||||
- Done when: `pnpm exec vitest run config/lighthouserc.test.ts src/app.test.tsx` green; `pnpm exec tsc --noEmit`, `pnpm lint` clean.
|
||||
- Record: one line.
|
||||
- Record: `config/lighthouserc.test.ts` added (invariants, validation helper, desktop); only the `notFoundPath` assertion and its comment changed in `src/app.test.tsx`; 55 tests green across both files.
|
||||
|
||||
---
|
||||
|
||||
## Part F: Deploy scripts and CI (batch B5, Sonnet; parallel with B2, B3, B4)
|
||||
|
||||
### Step 13: Artifact guard and post-deploy script (BR-HST-15, 18; V11) [ ]
|
||||
### Step 13: Artifact guard and post-deploy script (BR-HST-15, 18; V11) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-HST-15, 18; FR-PR-17; NFR-PR-SEC-03; V11.
|
||||
@@ -341,8 +345,9 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
3. `e2e/deployScripts.e2e.ts`: skipped with a visible line when `bash` or `curl` is missing outside CI (fails in CI). Tests: `check-artifact.sh` passes on a fixture dist and fails for each violation (missing file, `server/`, a `.map`); `verify-deployment.sh` passes against `startPreviewServer` on the fixture site (without `--test`) and **fails against a tiny stub server** that imitates the old behaviour (serves `index.html` with 200 for every path, no 404, no redirects) with a message naming the `/over-mij` byte check (V11); and fails when a security header is missing (stub).
|
||||
- Done when: `pnpm exec vitest run --config vitest.e2e.config.ts e2e/deployScripts.e2e.ts` green (or skipped with the visible line when bash is absent); `pnpm exec tsc --noEmit`, `pnpm lint` clean.
|
||||
- Record: V11 outcome.
|
||||
- Done: check-artifact.sh, verify-deployment.sh and e2e/deployScripts.e2e.ts written. V11: verify-deployment.sh fails against a stub with the old behaviour (homepage with 200 for every path) with "/over-mij: antwoord is niet gelijk aan over-mij.html", and passes against a stub with the new rules and against the preview server on the fixture site. Proven against stubs, not against the real old nginx file. Locally 22 passed, 5 skipped (the lftp tests).
|
||||
|
||||
### Step 14: Production upload script and the lftp passes (BR-HST-14; V10) [ ]
|
||||
### Step 14: Production upload script and the lftp passes (BR-HST-14; V10) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-HST-14, 15; FR-PR-18; V10.
|
||||
@@ -354,8 +359,9 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
4. If `lftp` is not installed locally, the local test does not run and the syntax is **unverified until the first CI run**: state that plainly in the Record and in the verification log V10 (Status OPEN), and do not install lftp.
|
||||
- Done when: the script exists and passes `bash -n`; the test runs green with lftp, or V10 is recorded OPEN with the reason; `pnpm exec tsc --noEmit`, `pnpm lint` clean.
|
||||
- Record: V10 outcome and the chosen syntax with its source.
|
||||
- Done: upload-production.sh written (passes `bash -n`; command text checked with a fake lftp on the PATH). Chosen syntax: `--exclude-glob '*.html' --exclude-glob web.config` for pass 1 and `--include-glob '*.html'` for pass 2 (the design sketch; lftp manual at https://lftp.yar.ru/ not consulted offline). lftp is not installed locally, so V10 is OPEN: the syntax is unverified until the first CI run (the lighthouse job installs lftp and runs the test). Open question for that run: whether `--include-glob` alone includes only HTML and still descends into directories.
|
||||
|
||||
### Step 15: Workflow edits for the deploy jobs (BR-HST-14 to 18) [ ]
|
||||
### Step 15: Workflow edits for the deploy jobs (BR-HST-14 to 18) [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-HST-14 to 18; FR-PR-17, 18.
|
||||
@@ -366,6 +372,7 @@ The riskiest mechanism is the nginx block (a `map`, a server-level `if` and `rew
|
||||
3. Update the header comment of the workflow only if it states something that is now wrong.
|
||||
- Done when: the YAML is valid (same check as Step 5); the diff touches only the two deploy jobs; the lftp command text exists in exactly one place (`upload-production.sh`).
|
||||
- Record: the diff summary.
|
||||
- Done: deploy-test: new step "Controle van de build" (check-artifact.sh) before the upload; "Controle na deploy" runs verify-deployment.sh with --test. deploy-production: the web.config step and the inline lftp block are replaced by one call of upload-production.sh; the post-deploy step runs verify-deployment.sh; if-condition unchanged. YAML parses (yaml 1.10.3 from the pnpm store); no mirror/lftp command text left in the workflow. See `git diff .gitea`.
|
||||
|
||||
**CP2** (merge point after Steps 7 to 15): run `pnpm exec tsc --noEmit`, `pnpm lint`, `pnpm format:check`, `pnpm test`, `pnpm build`, in that order, alone (no parallel batch running). All green, or STOP.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user