@dailephd/my-frontend-observer 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,359 @@
1
+ # v0.9.1 Batch 1 report: PWA hard-gate isolation
2
+
3
+ ## 1. VERDICT
4
+
5
+ `PASS_V0_9_1_BATCH1_PWA_HARD_GATE_ISOLATED`
6
+
7
+ The PWA server-down hard gate is now a self-contained experiment. It passes when
8
+ selected alone and when the whole PWA file runs. No production file changed. No
9
+ product defect was found.
10
+
11
+ This report covers Batch 1 only. v0.9.1 is not released. Full repository
12
+ regression and cross-platform release readiness are not complete. Batch 2 owns
13
+ them.
14
+
15
+ ## 2. Repository identity
16
+
17
+ 1. Repository: `C:\Users\daile\Projects\my-frontend-observer`
18
+ 2. Package: `@dailephd/my-frontend-observer`, version `0.9.0` (unchanged)
19
+ 3. Branch: `feature/v0.9.1-pwa-hard-gate-isolation`, created from `master`
20
+ 4. Starting HEAD: `985d0ce47a070fd9f84eae478f4098df00d57bd8` (merge of PR #15)
21
+ 5. Released baseline: v0.9.0 at `eacd543f64d45d8b721e766173af87e6a878152c`
22
+ 6. Runtime: Node `v24.20.0`, Playwright `1.62.1`, Vitest `4.1.11`, Windows 11
23
+
24
+ ## 3. Planning authority
25
+
26
+ 1. PR #15 (`docs: plan v0.9.1 PWA hard-gate isolation`) was merged into `master`
27
+ at 2026-09-21T15:11:04Z as `985d0ce`.
28
+ 2. `docs/plans/v0.9.1-implementation-plan.md` is present on `master` and was
29
+ read in full. It is the frozen authority for this batch.
30
+ 3. The planning doc changes in `ROADMAP.md`, `CURRENT_STATE.md`,
31
+ `DEVELOPMENT.md`, `CI_CD.md`, and `PROJECT_MILESTONES.md`, plus
32
+ `DOCUMENTATION_PRESERVATION_POLICY.md`, were read.
33
+ 4. A first attempt at this prompt stopped with
34
+ `BLOCKED_V0_9_1_PLANNING_NOT_MERGED` because PR #15 was still open. No changes
35
+ were made in that attempt.
36
+
37
+ ## 4. Original isolated failure reproduction
38
+
39
+ After `npm run build` (exit 0), this command ran against the unchanged test:
40
+
41
+ `npx vitest run --config vitest.browser.config.ts tests/browser/pwaHardening.test.ts -t "HARD GATE"`
42
+
43
+ 1. Exit code: 1
44
+ 2. Result: 1 failed, 6 skipped
45
+ 3. Failure step: `await page.reload()` right after `server.close()`
46
+ 4. Failure message: `page.reload: net::ERR_CONNECTION_REFUSED`
47
+ 5. Shell reload failed: yes. The page was not served by a service worker.
48
+ 6. Evidence-unavailable assertion reached: no. The test failed before it.
49
+
50
+ A diagnostic outside the repository (scratchpad only, not committed) repeated
51
+ the original steps and recorded service-worker and cache state at the moment the
52
+ original test shut the server down. The result was the same with the historical
53
+ fixed profile and with a fresh temporary profile:
54
+
55
+ 1. Registration present: true
56
+ 2. Worker state: `installing` = true, `active` = null
57
+ 3. `navigator.serviceWorker.controller`: null
58
+ 4. Cache Storage: one `workbox-precache-v2-<origin>/` cache with 5 entries, so
59
+ the precache was still being filled
60
+ 5. Reload after close: `net::ERR_CONNECTION_REFUSED`
61
+
62
+ So service-worker control and a complete shell cache were both absent at the
63
+ shutdown boundary.
64
+
65
+ ## 5. Root cause
66
+
67
+ Two faults combined.
68
+
69
+ 1. The wait condition was wrong. The old test waited for
70
+ `(await navigator.serviceWorker.getRegistration())?.active !== undefined`.
71
+ `registration.active` is `null`, not `undefined`, while a worker is still
72
+ installing. The condition was therefore true as soon as any registration
73
+ existed. It never proved activation, control, or a filled precache.
74
+ 2. The test relied on shared state. In normal file order, earlier tests in the
75
+ same describe had already used the same server origin and the same
76
+ persistent context. By the time the hard gate ran, the worker was active and
77
+ controlling that origin, so the weak wait did not matter.
78
+
79
+ When selected alone, the viewer server starts on a new random port (`port: 0`).
80
+ That is a new origin with no worker. The fixed profile's older registrations
81
+ belong to other origins and do not help. The page was still uncontrolled when
82
+ the server closed, so the reload went to the network and failed.
83
+
84
+ Classification stays `TEST_DEFECT`. `PRODUCT_CHANGE_REQUIRED = false`.
85
+
86
+ ## 6. Previous shared-state topology
87
+
88
+ In the first describe block, `beforeAll` created and shared:
89
+
90
+ 1. one evidence root from `mkdtemp`
91
+ 2. one viewer server
92
+ 3. one persistent Chromium context launched from the fixed profile
93
+ `.my-dev-kit-workflow/v0.8/batch-08/pwa-profile`
94
+
95
+ The hard gate was the fourth `it()` in that block. The three earlier tests
96
+ registered the worker, fetched the manifest, and warmed the cache on the same
97
+ origin. The fixed profile also kept service-worker and cache data between local
98
+ runs. That block's `afterAll` never closed its server. Only the hard gate's
99
+ mid-test `server.close()` shut it down.
100
+
101
+ ## 7. New hard-gate resource ownership
102
+
103
+ The hard gate now lives in its own describe block:
104
+ `PWA server-down safety - self-contained hard-gate experiment`. It has no
105
+ `beforeAll` and uses no describe-level variables. Inside the test it creates and
106
+ owns:
107
+
108
+ 1. an evidence root:
109
+ `mkdtemp(path.join(tmpdir(), 'my-frontend-observer-pwa-hard-gate-evidence-'))`
110
+ 2. the fixture, through the existing helpers `writeManyRegionsOneTargetFixture`
111
+ and `persistAnnotationUnder`. These are now wrapped by a local
112
+ `writePwaFixture` helper that both describe blocks use. The real annotation
113
+ is kept so the annotation view and media routes are part of the cache
114
+ boundary.
115
+ 3. a dedicated viewer server from `startViewer` on port 0
116
+ 4. a persistent profile:
117
+ `mkdtemp(path.join(tmpdir(), 'my-frontend-observer-pwa-hard-gate-profile-'))`
118
+ 5. a `BrowserContext` from
119
+ `chromium.launchPersistentContext(profileRoot, { headless: true })`
120
+ 6. a fresh page
121
+
122
+ The test name is unchanged, so `-t "HARD GATE"` still selects it.
123
+
124
+ ## 8. Fresh-profile design
125
+
126
+ 1. The hard gate uses its own temporary profile and context. It never shares
127
+ one with any other test.
128
+ 2. The first describe block, which keeps the focused registration, manifest,
129
+ and `/api/` cache tests, now creates its own temporary profile
130
+ (`my-frontend-observer-pwa-profile-*`) in `beforeAll` and deletes it in
131
+ `afterAll`.
132
+ 3. That `afterAll` now also closes its viewer server, since the hard gate no
133
+ longer closes it.
134
+ 4. The constant for `.my-dev-kit-workflow/v0.8/batch-08/pwa-profile` was
135
+ removed. No test uses that path any more. The historical directory itself was
136
+ left on disk untouched.
137
+ 5. Profile and evidence removal uses
138
+ `rm(dir, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 })`,
139
+ because Chromium can briefly hold profile files after close on Windows.
140
+
141
+ ## 9. Service-worker registration proof
142
+
143
+ After the first navigation, the test evaluates `navigator.serviceWorker.ready`
144
+ in the real page and requires:
145
+
146
+ 1. `registration.active !== null` is true
147
+ 2. `registration.scope` equals `<viewer origin>/`
148
+
149
+ `ready` only resolves when a worker is active, so there is no fixed sleep.
150
+
151
+ Observed: `serviceWorkerActive = true`.
152
+
153
+ ## 10. Current-client control proof
154
+
155
+ Control is checked on its own, apart from activation:
156
+
157
+ 1. The test reads `navigator.serviceWorker.controller !== null`.
158
+ 2. If it is null, the page reloads while the server is still live.
159
+ 3. The test then waits (bounded at 10 seconds) for
160
+ `navigator.serviceWorker.controller !== null`.
161
+ 4. It requires `controller.scriptURL` to equal `<viewer origin>/sw.js`.
162
+
163
+ Observed: `controlledOnFirstLoad = true` and `clientControlled = true`. The
164
+ generated worker calls `self.skipWaiting()` and `clientsClaim()`, so once
165
+ activation finishes it takes control of the first page. The reload branch
166
+ stays in place for any platform where control arrives later.
167
+
168
+ ## 11. App-shell cache proof
169
+
170
+ The test reads every Cache Storage entry from the page before shutdown. It
171
+ requires:
172
+
173
+ 1. at least one cache whose name starts with `workbox-precache`
174
+ 2. cached pathnames that include `/index.html`, `/registerSW.js`, and
175
+ `/manifest.webmanifest`
176
+ 3. a cached `/index.html` (matched with `ignoreSearch`, because Workbox adds
177
+ `__WB_REVISION__`) whose body contains `<div id="root"></div>`
178
+ 4. that the module entry script named inside that cached `index.html` matches
179
+ `/assets/*.js` and is itself in the cache
180
+
181
+ Why this is stable: the generated `sw.js` precaches `index.html`,
182
+ `registerSW.js`, and `manifest.webmanifest` under fixed names, and serves
183
+ navigations with `createHandlerBoundToURL("index.html")`. Only the Vite asset
184
+ names are hashed. The test never hardcodes a hash. It reads the entry script
185
+ name from the cached shell, so the check stays valid across rebuilds.
186
+
187
+ Observed: 7 cached entries (index, registerSW, manifest, two icons, one JS
188
+ bundle, one CSS bundle).
189
+
190
+ ## 12. API cache-exclusion proof
191
+
192
+ From the controlled page, the hard gate first fetches `/api/index`, the
193
+ annotation view route, and the annotation overlay media route. It requires each
194
+ to return `200` with `cache-control: no-store`. It then counts cached requests
195
+ whose pathname starts with `/api/` across every cache.
196
+
197
+ Observed: `apiCacheEntryCount = 0`.
198
+
199
+ The separate focused test `never caches /api/ responses at the service-worker
200
+ cache-storage layer` was kept. The hard gate does not depend on it.
201
+
202
+ ## 13. Live evidence proof
203
+
204
+ Before shutdown the test:
205
+
206
+ 1. waits for the first `.evidence-list__item`
207
+ 2. requires it to be visible
208
+ 3. requires the `.evidence-list` text to contain the fixture candidate id
209
+ `many-regions-candidate` (read from the fixture helper's return value, not
210
+ hardcoded)
211
+ 4. makes a direct Node-side `fetch` to `/api/index` (5 second timeout) and
212
+ requires HTTP 200 with a body that contains the same candidate id
213
+
214
+ ## 14. Server-down proof
215
+
216
+ After `await server.close()` the test makes a direct Node-side `fetch` to the
217
+ same `/api/index` URL with a 5 second timeout. A Node request cannot be
218
+ intercepted by the page's service worker, so this tests the origin server alone.
219
+ The test requires the request to fail. If it gets any HTTP response, the test
220
+ fails with that status in the message.
221
+
222
+ The page was not navigated away. The controlled page and worker stayed in place.
223
+
224
+ ## 15. Offline reload proof
225
+
226
+ Only after the checks in sections 9 to 14 pass does the test call
227
+ `page.reload()`. It then requires:
228
+
229
+ 1. `h1, header` to render within 10 seconds, so the shell was served from the
230
+ precache
231
+ 2. `navigator.serviceWorker.controller !== null` after the reload
232
+
233
+ ## 16. Stale-evidence safety proof
234
+
235
+ After the offline reload the test requires:
236
+
237
+ 1. `.evidence-list__error` to appear
238
+ 2. body text to contain `Evidence index unavailable`
239
+ 3. body text not to contain the previously visible candidate id
240
+ 4. zero `.evidence-list__item` elements
241
+
242
+ These assertions are unchanged from the original or stricter. None were
243
+ weakened.
244
+
245
+ ## 17. Cleanup proof
246
+
247
+ Cleanup runs in `finally` in a fixed order: close the context, close the server
248
+ unless it was already closed on purpose, remove the evidence root, remove the
249
+ profile. Each step runs even if an earlier step fails. Errors are collected.
250
+
251
+ 1. If the experiment failed, cleanup errors are logged with `console.error` and
252
+ the original assertion error is what the test reports.
253
+ 2. If the experiment passed but cleanup failed, the test fails with every
254
+ cleanup error listed.
255
+ 3. After cleanup, the test requires that neither the evidence root nor the
256
+ profile directory exists.
257
+
258
+ A leak audit counted `my-frontend-observer-pwa-*` and
259
+ `my-frontend-observer-b8-pwa*` directories under the OS temp directory before
260
+ and after each run. All counts were 0. That covers the hard gate's profile and
261
+ evidence root and the first describe block's temporary profile and evidence
262
+ root.
263
+
264
+ Not executed: the failure-path cleanup (steps 1 and 2 above) was not triggered
265
+ on purpose. It is supported by code inspection only.
266
+
267
+ ## 18. Isolated run #1
268
+
269
+ `npx vitest run --config vitest.browser.config.ts tests/browser/pwaHardening.test.ts -t "HARD GATE"`
270
+
271
+ PASS. 1 passed, 6 skipped. Exit 0. The run came right after a fresh
272
+ `npm run build`.
273
+
274
+ ## 19. Isolated run #2
275
+
276
+ The same command was run again right away. PASS. 1 passed, 6 skipped. Exit 0.
277
+
278
+ The isolated command was run five times in total over the edits. The final two
279
+ runs, on the committed test content, both passed. One of them used
280
+ `--reporter=verbose` and printed the boundary line:
281
+
282
+ `HARD GATE pre-shutdown boundary {"serviceWorkerActive":true,"controlledOnFirstLoad":true,"clientControlled":true,"shellEntryScriptCached":true,"precacheEntryCount":7,"apiCacheEntryCount":0,"liveEvidenceVisible":true}`
283
+
284
+ That line was produced by the test itself after its assertions passed.
285
+
286
+ ## 20. Full PWA file result
287
+
288
+ `npx vitest run --config vitest.browser.config.ts tests/browser/pwaHardening.test.ts`
289
+
290
+ PASS. 7 passed. Exit 0.
291
+
292
+ ## 21. Typecheck/lint
293
+
294
+ 1. `npm run typecheck`: PASS (exit 0).
295
+ 2. `npm run lint`: PASS (exit 0). The first lint run failed with
296
+ `no-unsafe-finally` because the cleanup error was thrown inside `finally`.
297
+ The throw was moved after the `try/finally` block, then isolated runs 1 and 2,
298
+ the full file, typecheck, and lint were all run again and passed.
299
+
300
+ ## 22. Production-code audit
301
+
302
+ `git diff --name-only` lists only `tests/browser/pwaHardening.test.ts` plus this
303
+ report. No file under `src/` or `viewer/` changed. `viewer/vite.config.ts`,
304
+ the service-worker caching policy, `package.json`, `package-lock.json`,
305
+ `.github/workflows/`, and `CHANGELOG.md` were not touched. `git diff --check`
306
+ passed.
307
+
308
+ ## 23. Product-defect decision
309
+
310
+ 1. `PRODUCT_DEFECT_DISCOVERED = false`
311
+ 2. `PRODUCT_CHANGE_REQUIRED = false`
312
+
313
+ With every precondition proven, the released v0.9.0 viewer shell loads offline
314
+ from the precache. The evidence surface shows its explicit unavailable state.
315
+ Previously fetched evidence is not shown as current. The original failure came
316
+ only from the test's weak wait and its reliance on shared state.
317
+
318
+ ## 24. Changed files
319
+
320
+ 1. `tests/browser/pwaHardening.test.ts`
321
+ 2. `docs/reports/v0.9.1-batch1-pwa-hard-gate-isolation.md`
322
+
323
+ Generated paths (all removed by the tests or kept outside the repository):
324
+
325
+ 1. `%TEMP%\my-frontend-observer-pwa-hard-gate-evidence-*` (removed)
326
+ 2. `%TEMP%\my-frontend-observer-pwa-hard-gate-profile-*` (removed)
327
+ 3. `%TEMP%\my-frontend-observer-pwa-profile-*` and
328
+ `%TEMP%\my-frontend-observer-b8-pwa-*` (removed)
329
+ 4. The diagnostic script and config in the Claude Code session scratchpad
330
+ (outside the repository, not committed)
331
+ 5. `dist/` from `npm run build` (ignored build output)
332
+
333
+ These small temporary directories sit under the OS temp directory on `C:\`, as
334
+ the task's `mkdtemp(tmpdir())` design specifies. They are deleted at the end of
335
+ every passing run.
336
+
337
+ ## 25. Batch 2 handoff
338
+
339
+ Batch 2 still owns:
340
+
341
+ 1. the permanent `test:pwa-hard-gate` package script
342
+ 2. wiring that command into the security or pre-release readiness path
343
+ 3. moving `CURRENT_STATE.md`, `ROADMAP.md`, `DEVELOPMENT.md`, `CI_CD.md`, and
344
+ `CHANGELOG.md` from planned to implemented wording
345
+ 4. the full unit, browser, security, build, docs, and pack validation
346
+
347
+ Notes for Batch 2:
348
+
349
+ 1. The focused test `never caches /api/ responses` still uses the same weak
350
+ `?.active !== undefined` wait that the old hard gate used. It stays correct
351
+ in file order, because it runs after the registration test on the same
352
+ origin. If it is ever meant to stand alone, it should wait on
353
+ `navigator.serviceWorker.ready` instead. It was not changed here to keep
354
+ Batch 1 narrow.
355
+ 2. The standalone display-mode test still writes a log to
356
+ `.my-dev-kit-workflow/v0.8/batch-08/logs`. That is a log file, not a browser
357
+ profile, and was not changed.
358
+ 3. The historical directory `.my-dev-kit-workflow/v0.8/batch-08/pwa-profile`
359
+ still exists on disk. No test needs it now. It was not deleted.
@@ -0,0 +1,262 @@
1
+ # v0.9.1 Batch 2 report: hard-gate validation integration
2
+
3
+ ## 1. VERDICT
4
+
5
+ `PASS_V0_9_1_PWA_HARD_GATE_ISOLATION`
6
+
7
+ The isolated PWA hard gate is now a permanent npm command. It is part of
8
+ `npm run test:security`, and through that it is part of pre-release readiness.
9
+ The full regression chain passed. No production file, dependency, or version
10
+ changed. v0.9.1 implementation is complete. v0.9.1 is not released.
11
+
12
+ ## 2. Repository identity
13
+
14
+ 1. Repository: `C:\Users\daile\Projects\my-frontend-observer`
15
+ 2. Branch: `feature/v0.9.1-pwa-hard-gate-isolation`
16
+ 3. Starting HEAD: `6874fd4b9690244673bd1b0e39bad0dd01cf397d` (Batch 1 commit)
17
+ 4. Package version: `0.9.0` in `package.json`, in `package-lock.json`, and in
18
+ `package-lock.json` `packages[""]`
19
+ 5. `docs/reports/v0.9-architecture-retrieval.md` is still marked skip-worktree
20
+ (`git ls-files -v` shows `S`). It was not touched.
21
+ 6. Runtime: Node `v24.20.0`, Playwright `1.62.1`, Vitest `4.1.11`, Windows 11
22
+
23
+ ## 3. Batch 1 entry gate
24
+
25
+ PASS. Batch 1 ended with `PASS_V0_9_1_BATCH1_PWA_HARD_GATE_ISOLATED` at
26
+ `6874fd4`. At the start of Batch 2 the worktree was clean and HEAD was that
27
+ commit. `tests/browser/pwaHardening.test.ts` still has every Batch 1 element: a
28
+ fresh evidence root, server, temporary persistent profile, and BrowserContext
29
+ for the gate. It also has the separate activation and control proofs, the shell
30
+ precache proof, the `/api/` cache exclusion proof, the live evidence proof, the
31
+ Node-side server-down proof, the offline shell reload, the stale-evidence
32
+ absence checks, and deterministic cleanup. Batch 2 did not change that file.
33
+
34
+ ## 4. Root cause carried forward
35
+
36
+ 1. `OLD_READINESS_PREDICATE`: `(await navigator.serviceWorker.getRegistration())?.active !== undefined`
37
+ 2. `OLD_ACTIVE_VALUE_AT_FAILURE`: `null` (the worker was still installing)
38
+ 3. `OLD_CLIENT_CONTROLLER_AT_FAILURE`: `null`
39
+ 4. `WHY_OLD_PREDICATE_PASSED`: `null !== undefined` is `true`. The check passed
40
+ as soon as a registration existed, before activation or control. The server
41
+ then closed too early. The precache held only 5 entries, and the reload
42
+ failed with `net::ERR_CONNECTION_REFUSED`.
43
+ 5. `CORRECT_ACTIVE_PROOF`: `registration.active !== null`, read from
44
+ `await navigator.serviceWorker.ready`
45
+ 6. `CURRENT_CLIENT_CONTROL_PROOF`: `navigator.serviceWorker.controller !== null`
46
+
47
+ Shared state hid the bug in normal order. Earlier tests in the same describe
48
+ block had already activated a controlling worker on the same server origin.
49
+ Selected alone, the server starts on a new random port, so no worker existed yet
50
+ for that origin.
51
+
52
+ Classification remains `TEST_DEFECT`. No product defect was found.
53
+
54
+ ## 5. Dedicated isolated command
55
+
56
+ `package.json` now has exactly one new script:
57
+
58
+ `"test:pwa-hard-gate": "vitest run --config vitest.browser.config.ts tests/browser/pwaHardening.test.ts -t \"HARD GATE\""`
59
+
60
+ No alias was added. The command exists because a passing full browser or
61
+ security suite does not prove that the hard gate can run on its own.
62
+
63
+ Direct runs after adding the script:
64
+
65
+ 1. `npm run test:pwa-hard-gate` run 1: PASS (1 passed, 6 skipped)
66
+ 2. `npm run test:pwa-hard-gate` run 2, straight after: PASS (1 passed,
67
+ 6 skipped)
68
+
69
+ ## 6. Security-suite integration
70
+
71
+ `test:security` now runs three stages joined with `&&`:
72
+
73
+ 1. the existing unit security tests (unchanged)
74
+ 2. the existing browser security tests, including the full
75
+ `tests/browser/pwaHardening.test.ts` (unchanged)
76
+ 3. `npm run test:pwa-hard-gate` (new)
77
+
78
+ The isolated run is added on top. The full PWA file still runs in stage 2.
79
+ `test:browser` was not changed and still runs every `tests/browser/**/*.test.ts`
80
+ file, including the full PWA file.
81
+
82
+ ## 7. Pre-release-readiness integration
83
+
84
+ 1. `PRE_RELEASE_WORKFLOW_ALREADY_CALLS_TEST_SECURITY = true`. The `candidate`
85
+ job in `.github/workflows/pre-release-readiness.yml` has the step
86
+ `Security test suite (npm run test:security)`.
87
+ 2. `WORKFLOW_YAML_CHANGE_REQUIRED = false`. Candidate readiness now gets the
88
+ isolated gate through the updated npm script. The workflow YAML was not
89
+ modified.
90
+
91
+ ## 8. Full PWA file validation
92
+
93
+ `npx vitest run --config vitest.browser.config.ts tests/browser/pwaHardening.test.ts`
94
+
95
+ PASS. 7 passed.
96
+
97
+ ## 9. Isolated hard-gate repeated validation
98
+
99
+ 1. Direct run 1 (section 5): PASS
100
+ 2. Direct run 2 (section 5): PASS
101
+ 3. First step of the regression chain: PASS (1 passed, 6 skipped)
102
+ 4. Inside `npm run test:security`: PASS (1 passed, 6 skipped)
103
+ 5. Last step of the regression chain, after every full suite: PASS
104
+ (1 passed, 6 skipped)
105
+
106
+ Run 5 shows that the full suites did not become a hidden prerequisite again.
107
+
108
+ ## 10. Browser-suite validation
109
+
110
+ `npm run test:browser`: PASS. 29 test files, 275 tests passed.
111
+
112
+ ## 11. Security-suite validation
113
+
114
+ `npm run test:security`: PASS. The output shows all three stages ran:
115
+
116
+ 1. unit security: 16 files, 168 tests passed
117
+ 2. browser security: 3 files, 77 tests passed
118
+ 3. the npm banner `> @dailephd/my-frontend-observer@0.9.0 test:pwa-hard-gate`,
119
+ then 1 file, 1 test passed, 6 skipped
120
+
121
+ Stage 3 was confirmed from the command output, not only from `package.json`.
122
+
123
+ ## 12. Full unit regression
124
+
125
+ `npm test`: PASS. 89 test files, 1454 tests passed.
126
+
127
+ No repository test checks package script strings, so no static script test was
128
+ added. Running `npm run test:pwa-hard-gate` is the primary proof.
129
+
130
+ ## 13. Build validation
131
+
132
+ `npm run build`: PASS. The Workbox precache still has 10 entries (7 unique
133
+ URLs). `sw.js` has no runtime caching rules.
134
+
135
+ ## 14. Documentation validation
136
+
137
+ `npm run check:docs`: PASS (17 required files). It ran in the regression chain
138
+ after the documentation edits. It was run again after this report was written
139
+ (see section 19).
140
+
141
+ ## 15. Package-boundary validation
142
+
143
+ `npm pack --dry-run`: PASS. Candidate filename
144
+ `dailephd-my-frontend-observer-0.9.0.tgz`, 369 files, 1.0 MB packed, 4.0 MB
145
+ unpacked.
146
+
147
+ The file list was searched for `tests/`, `.my-dev-kit-workflow`, `examples/`,
148
+ `pwa-profile`, `hard-gate`, and the agent-control files. The only match was
149
+ `docs/reports/v0.9.1-batch1-pwa-hard-gate-isolation.md`. That is a report
150
+ included by the existing `"files": ["dist", "README.md", "CHANGELOG.md", "docs",
151
+ "LICENSE"]` allowlist, like every other report. No tests, `examples/v09-demo`,
152
+ workflow state, Chromium profiles, or evidence roots are in the package.
153
+
154
+ ## 16. Product-code audit
155
+
156
+ `git diff --name-only 6874fd4` shows no path under `src/`, `viewer/`, or
157
+ `.github/`. `viewer/vite.config.ts` and the service-worker caching policy were
158
+ not changed.
159
+
160
+ 1. `PRODUCTION_FILES_CHANGED = false`
161
+ 2. `PRODUCT_SEMANTICS_CHANGED = false`
162
+ 3. `PRODUCT_DEFECT_DISCOVERED = false`
163
+
164
+ ## 17. Dependency/version audit
165
+
166
+ 1. `dependencies`, `devDependencies`, `peerDependencies`, and
167
+ `optionalDependencies` are the same as at `6874fd4`.
168
+ 2. `package-lock.json` did not change.
169
+ 3. The version is `0.9.0` in all three places.
170
+ 4. No `npm version`, `npm publish`, tag, GitHub Release, or release branch.
171
+
172
+ ## 18. Documentation reconciliation
173
+
174
+ 1. `docs/CURRENT_STATE.md`: the v0.9.1 section now says implementation complete
175
+ and unreleased. It records the reproduction, the two-part root cause, the
176
+ new ownership and proofs, the command integration, and that production
177
+ behavior is unchanged. The planning background is kept below it.
178
+ 2. `docs/ROADMAP.md`: only the v0.9.1 status wording changed, from planned to
179
+ implemented and unreleased. The objective, constraints, exclusions, and
180
+ acceptance are unchanged.
181
+ 3. `docs/PROJECT_OVERVIEW.md`: v0.9.1 is complete but unreleased. PWA
182
+ hard/security acceptance no longer depends on prior test order or
183
+ persistent browser state. v0.10 is still future.
184
+ 4. `docs/PROJECT_MILESTONES.md`: a status line was added to the existing
185
+ v0.9.1 maintenance note. It says the invariant is implemented and release is
186
+ pending. Milestone 9 semantics are unchanged.
187
+ 5. `docs/DEVELOPMENT.md`: the gate-isolation section now gives
188
+ `npm run test:pwa-hard-gate`, says when to run it, and says it must pass on
189
+ its own.
190
+ 6. `docs/CI_CD.md`: the v0.9.1 wording is now implemented. It says
191
+ `test:security` runs the isolated gate, that candidate readiness gets it
192
+ automatically, and that the workflow YAML did not change.
193
+ 7. `CHANGELOG.md`: one maintenance bullet under `[Unreleased]`. No `0.9.1`
194
+ section was created.
195
+
196
+ `docs/plans/v0.9.1-implementation-plan.md`, the historical `docs/reports/v0.9-*.md`
197
+ reports, and the Batch 1 report were not changed.
198
+
199
+ The durable rule stays in `DEVELOPMENT.md`, `CI_CD.md`, and
200
+ `PROJECT_MILESTONES.md`: tests labeled `HARD GATE`, `SECURITY GATE`, or
201
+ `ACCEPTANCE GATE` must set up their own material prerequisites and pass on
202
+ their own from fresh state. It is now implemented policy.
203
+
204
+ ## 19. Changed files
205
+
206
+ 1. `package.json`
207
+ 2. `CHANGELOG.md`
208
+ 3. `docs/CURRENT_STATE.md`
209
+ 4. `docs/ROADMAP.md`
210
+ 5. `docs/PROJECT_MILESTONES.md`
211
+ 6. `docs/PROJECT_OVERVIEW.md`
212
+ 7. `docs/DEVELOPMENT.md`
213
+ 8. `docs/CI_CD.md`
214
+ 9. `docs/reports/v0.9.1-batch2-hard-gate-validation-integration.md`
215
+
216
+ Generated paths:
217
+
218
+ 1. Regression logs in the Claude Code session scratchpad `regression\` folder,
219
+ outside the repository and not committed
220
+ 2. `dist/` from `npm run build` (ignored build output)
221
+ 3. Temporary test directories under the OS temp directory. They were all
222
+ removed. After every run, no `my-frontend-observer-pwa-hard-gate-profile-*`,
223
+ `my-frontend-observer-pwa-hard-gate-evidence-*`, or
224
+ `my-frontend-observer-pwa-profile-*` directories remained.
225
+ 4. `npm pack --dry-run` wrote no tarball.
226
+
227
+ Full regression order, all exit 0:
228
+
229
+ 1. `npm run test:pwa-hard-gate`
230
+ 2. `npm run typecheck`
231
+ 3. `npm run lint`
232
+ 4. `npm test`
233
+ 5. `npm run test:browser`
234
+ 6. `npm run test:security`
235
+ 7. `npm run build`
236
+ 8. `npm run check:docs`
237
+ 9. `npm pack --dry-run`
238
+ 10. `npm run test:pwa-hard-gate`
239
+
240
+ After this report was written, `npm run check:docs` and `git diff --check`
241
+ were run again before the commit.
242
+
243
+ ## 20. Remaining release-readiness work
244
+
245
+ Not done in this batch, and not claimed:
246
+
247
+ 1. the v0.9.1 integration PR from this feature branch into `master`, with
248
+ required PR CI
249
+ 2. exact-candidate cross-platform pre-release readiness: one tarball, hashed,
250
+ installed on Windows, Linux, and macOS. `test:security` now includes the
251
+ isolated gate on each platform.
252
+ 3. release preparation: version bump to `0.9.1`, a `0.9.1` CHANGELOG section,
253
+ and final state documents
254
+ 4. user-authorized publication, tag, and GitHub Release
255
+
256
+ Notes carried from Batch 1:
257
+
258
+ 1. The focused `/api/` cache test still uses the old weak `?.active !== undefined`
259
+ wait. It is correct in file order because it runs after the registration
260
+ test on the same origin. It is not labeled as a gate.
261
+ 2. `.my-dev-kit-workflow/v0.8/batch-08/pwa-profile` still exists on disk. No
262
+ test uses it.