@dailephd/my-frontend-observer 0.9.0 → 0.10.0

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.
Files changed (110) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +17 -7
  3. package/dist/application/visualChangeAgentHandoffService.d.ts +28 -0
  4. package/dist/application/visualChangeAgentHandoffService.js +111 -0
  5. package/dist/application/visualChangeAgentHandoffService.js.map +1 -0
  6. package/dist/application/visualChangeProjectWorkflowService.d.ts +95 -0
  7. package/dist/application/visualChangeProjectWorkflowService.js +376 -0
  8. package/dist/application/visualChangeProjectWorkflowService.js.map +1 -0
  9. package/dist/application/visualChangeReviewService.d.ts +50 -0
  10. package/dist/application/visualChangeReviewService.js +69 -0
  11. package/dist/application/visualChangeReviewService.js.map +1 -0
  12. package/dist/application/visualChangeWorkflowPersistenceService.d.ts +26 -0
  13. package/dist/application/visualChangeWorkflowPersistenceService.js +15 -0
  14. package/dist/application/visualChangeWorkflowPersistenceService.js.map +1 -0
  15. package/dist/artifacts/visualChangeWorkflowArtifactReader.d.ts +9 -0
  16. package/dist/artifacts/visualChangeWorkflowArtifactReader.js +47 -0
  17. package/dist/artifacts/visualChangeWorkflowArtifactReader.js.map +1 -0
  18. package/dist/artifacts/visualChangeWorkflowArtifactWriter.d.ts +20 -0
  19. package/dist/artifacts/visualChangeWorkflowArtifactWriter.js +41 -0
  20. package/dist/artifacts/visualChangeWorkflowArtifactWriter.js.map +1 -0
  21. package/dist/cli.js +510 -508
  22. package/dist/cli.js.map +1 -1
  23. package/dist/domain/visualChangeAgentHandoff.d.ts +82 -0
  24. package/dist/domain/visualChangeAgentHandoff.js +80 -0
  25. package/dist/domain/visualChangeAgentHandoff.js.map +1 -0
  26. package/dist/domain/visualChangeAgentHandoffSerialization.d.ts +2 -0
  27. package/dist/domain/visualChangeAgentHandoffSerialization.js +11 -0
  28. package/dist/domain/visualChangeAgentHandoffSerialization.js.map +1 -0
  29. package/dist/domain/visualChangeCycle.d.ts +8 -0
  30. package/dist/domain/visualChangeCycle.js +7 -0
  31. package/dist/domain/visualChangeCycle.js.map +1 -0
  32. package/dist/domain/visualChangeWorkflow.d.ts +125 -0
  33. package/dist/domain/visualChangeWorkflow.js +109 -0
  34. package/dist/domain/visualChangeWorkflow.js.map +1 -0
  35. package/dist/domain/visualChangeWorkflowIdentity.d.ts +5 -0
  36. package/dist/domain/visualChangeWorkflowIdentity.js +24 -0
  37. package/dist/domain/visualChangeWorkflowIdentity.js.map +1 -0
  38. package/dist/index.d.ts +21 -1
  39. package/dist/index.js +12 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/projectWorkflow/projectPaths.d.ts +3 -0
  42. package/dist/projectWorkflow/projectPaths.js +7 -0
  43. package/dist/projectWorkflow/projectPaths.js.map +1 -1
  44. package/dist/viewer/assets/index-DglJ6f28.css +1 -0
  45. package/dist/viewer/assets/index-DsODREY5.js +9 -0
  46. package/dist/viewer/index.html +2 -2
  47. package/dist/viewer/sw.js +1 -1
  48. package/dist/viewerServer/evidence/classify.d.ts +3 -1
  49. package/dist/viewerServer/evidence/classify.js +10 -0
  50. package/dist/viewerServer/evidence/classify.js.map +1 -1
  51. package/dist/viewerServer/evidence/handles.js +1 -0
  52. package/dist/viewerServer/evidence/handles.js.map +1 -1
  53. package/dist/viewerServer/evidence/projection.d.ts +5 -0
  54. package/dist/viewerServer/evidence/projection.js +19 -0
  55. package/dist/viewerServer/evidence/projection.js.map +1 -1
  56. package/dist/viewerServer/evidence/visualChangeWorkflowView.d.ts +31 -0
  57. package/dist/viewerServer/evidence/visualChangeWorkflowView.js +36 -0
  58. package/dist/viewerServer/evidence/visualChangeWorkflowView.js.map +1 -0
  59. package/dist/viewerServer/httpServer.js +323 -1
  60. package/dist/viewerServer/httpServer.js.map +1 -1
  61. package/dist/viewerServer/referenceApproval.d.ts +22 -0
  62. package/dist/viewerServer/referenceApproval.js +42 -0
  63. package/dist/viewerServer/referenceApproval.js.map +1 -0
  64. package/dist/viewerServer/referenceVisualChangeAuthoring.d.ts +28 -0
  65. package/dist/viewerServer/referenceVisualChangeAuthoring.js +134 -0
  66. package/dist/viewerServer/referenceVisualChangeAuthoring.js.map +1 -0
  67. package/dist/viewerServer/runtimeVisualChangeAuthoring.d.ts +33 -0
  68. package/dist/viewerServer/runtimeVisualChangeAuthoring.js +81 -0
  69. package/dist/viewerServer/runtimeVisualChangeAuthoring.js.map +1 -0
  70. package/dist/viewerServer/visualChangeAuthoring.d.ts +46 -0
  71. package/dist/viewerServer/visualChangeAuthoring.js +63 -0
  72. package/dist/viewerServer/visualChangeAuthoring.js.map +1 -0
  73. package/dist/viewerServer/visualChangeHandoff.d.ts +23 -0
  74. package/dist/viewerServer/visualChangeHandoff.js +31 -0
  75. package/dist/viewerServer/visualChangeHandoff.js.map +1 -0
  76. package/dist/viewerServer/visualChangeReview.d.ts +30 -0
  77. package/dist/viewerServer/visualChangeReview.js +46 -0
  78. package/dist/viewerServer/visualChangeReview.js.map +1 -0
  79. package/docs/ARCHITECTURE.md +17 -5
  80. package/docs/CI_CD.md +33 -1
  81. package/docs/COMMANDS.md +19 -5
  82. package/docs/CONTRACTS.md +38 -4
  83. package/docs/CURRENT_STATE.md +92 -11
  84. package/docs/DEVELOPMENT.md +32 -2
  85. package/docs/PROJECT_MILESTONES.md +28 -0
  86. package/docs/PROJECT_OVERVIEW.md +36 -14
  87. package/docs/QUICKSTART.md +7 -3
  88. package/docs/RELEASE.md +15 -11
  89. package/docs/ROADMAP.md +55 -2
  90. package/docs/SECURITY.md +25 -3
  91. package/docs/WORKFLOWS.md +29 -3
  92. package/docs/plans/v0.10-implementation-plan.md +1509 -0
  93. package/docs/plans/v0.9.1-implementation-plan.md +468 -0
  94. package/docs/reports/v0.10-batch1-visual-change-workflow-foundation.md +102 -0
  95. package/docs/reports/v0.10-batch2-project-composition-check-recording.md +103 -0
  96. package/docs/reports/v0.10-batch3-viewer-visual-change-workspace.md +93 -0
  97. package/docs/reports/v0.10-batch4-actual-frontend-entry.md +59 -0
  98. package/docs/reports/v0.10-batch5-reference-driven-entry.md +238 -0
  99. package/docs/reports/v0.10-batch6-coding-agent-handoff.md +85 -0
  100. package/docs/reports/v0.10-batch7-correction-review-acceptance.md +145 -0
  101. package/docs/reports/v0.10-batch8-integrated-acceptance.md +109 -0
  102. package/docs/reports/v0.10-implementation-completeness-documentation-reconciliation.md +344 -0
  103. package/docs/reports/v0.10-pre-release-readiness.md +120 -0
  104. package/docs/reports/v0.10-release-preparation.md +70 -0
  105. package/docs/reports/v0.9.1-batch1-pwa-hard-gate-isolation.md +359 -0
  106. package/docs/reports/v0.9.1-batch2-hard-gate-validation-integration.md +262 -0
  107. package/docs/reports/v0.9.1-pre-release-readiness.md +206 -0
  108. package/package.json +3 -2
  109. package/dist/viewer/assets/index-BN41MI7m.css +0 -1
  110. package/dist/viewer/assets/index-CkKXnlrI.js +0 -9
@@ -0,0 +1,468 @@
1
+ # v0.9.1 Implementation Plan — PWA Hard-Gate Isolation
2
+
3
+ Status: frozen planning authority; implementation not started.
4
+
5
+ Base release: v0.9.0.
6
+
7
+ Target maintenance version: v0.9.1.
8
+
9
+ Primary defect owner: `tests/browser/pwaHardening.test.ts`.
10
+
11
+ This plan is concrete implementation authority for the bounded v0.9.1
12
+ maintenance patch. ROADMAP owns the version-level goal and constraints; this
13
+ file owns the exact correction strategy, sequencing, tests, and gates.
14
+
15
+ ## 1. Problem statement
16
+
17
+ The released PWA browser coverage contains a test named:
18
+
19
+ `HARD GATE: after the server goes down, a reload never presents previously-fetched evidence as current`.
20
+
21
+ That test passes in the normal file/suite order but fails when selected alone
22
+ with Vitest `-t`.
23
+
24
+ The current first PWA `describe` block creates one evidence root, one viewer
25
+ server, and one persistent Chromium context in `beforeAll`. It launches that
26
+ context from a fixed profile under:
27
+
28
+ `.my-dev-kit-workflow/v0.8/batch-08/pwa-profile`.
29
+
30
+ Earlier tests in the same block register/activate the service worker, navigate
31
+ the app, and exercise cache behavior before the hard gate runs. The hard gate
32
+ therefore benefits from state that it did not establish itself. The fixed
33
+ profile can also retain service-worker/cache state across local runs.
34
+
35
+ The hard gate currently waits for an active service-worker registration before
36
+ shutting down the server. An active registration is not equivalent to proving
37
+ that the current page is controlled by that worker or that the shell needed for
38
+ offline reload has definitely been precached.
39
+
40
+ This is a test-isolation defect. There is currently no evidence that v0.9.0
41
+ serves stale evidence as current or that production PWA semantics are wrong.
42
+
43
+ ## 2. Frozen maintenance invariant
44
+
45
+ A test explicitly designated `HARD GATE`, `SECURITY GATE`, or
46
+ `ACCEPTANCE GATE` must:
47
+
48
+ - establish every prerequisite material to the claim it makes;
49
+ - pass when selected independently in a fresh process/environment;
50
+ - not require another test to run first;
51
+ - not depend on a fixed browser profile or historical cache/filesystem state;
52
+ - own and clean up disposable servers, evidence roots, browser profiles,
53
+ contexts, and similar mutable state where those resources are part of the
54
+ experiment.
55
+
56
+ The PWA hard gate is the first explicit application of this invariant.
57
+
58
+ ## 3. Scope
59
+
60
+ v0.9.1 owns:
61
+
62
+ - isolation of the PWA hard-gate experiment;
63
+ - removal of hidden dependency on the historical fixed Chromium profile for
64
+ that gate;
65
+ - explicit service-worker control proof;
66
+ - explicit app-shell cache prerequisite proof;
67
+ - explicit `/api/` cache exclusion proof within the hard gate;
68
+ - explicit server/network-unavailable proof before the offline reload;
69
+ - explicit stale-evidence-absence proof after the offline reload;
70
+ - deterministic cleanup;
71
+ - a dedicated command/gate that runs the hard gate by itself;
72
+ - complete browser/security regression after the correction;
73
+ - documentation reconciliation and normal patch readiness if the user elects
74
+ to publish v0.9.1.
75
+
76
+ ## 4. Explicit exclusions
77
+
78
+ The patch must not, merely to make the test pass:
79
+
80
+ - change production service-worker caching policy;
81
+ - add runtime caching for `/api/` or evidence/media;
82
+ - weaken the stale-evidence hard gate;
83
+ - change Viewer protocol or evidence schemas;
84
+ - add a product feature or CLI command;
85
+ - add v0.10 workflow behavior;
86
+ - add arbitrary sleeps/retries as a substitute for state proof;
87
+ - enforce test ordering;
88
+ - retain a fixed persistent profile as an implicit fixture.
89
+
90
+ If the corrected self-contained experiment fails after all prerequisites are
91
+ proven, stop and classify a product defect before modifying production code.
92
+
93
+ ## 5. Target test architecture
94
+
95
+ The hard gate becomes one complete experiment with this lifecycle:
96
+
97
+ ```text
98
+ fresh temporary evidence root
99
+ → populate deterministic reference/annotation fixture
100
+ → fresh viewer server
101
+ → fresh temporary persistent Chromium profile
102
+ → fresh BrowserContext
103
+ → fresh page
104
+ → navigate while server is live
105
+ → wait for service-worker registration/activation
106
+ → prove current page is service-worker controlled
107
+ → prove required application shell is present in Cache Storage
108
+ → prove /api/ entries are absent from Cache Storage
109
+ → prove live evidence is visible
110
+ → close viewer server
111
+ → prove server/API network is unavailable
112
+ → reload
113
+ → prove shell still renders
114
+ → prove evidence surface reports unavailable
115
+ → prove previously visible evidence identity is absent
116
+ → close context
117
+ → close server if still open
118
+ → remove evidence root
119
+ → remove browser profile
120
+ ```
121
+
122
+ No prior `it()` may be part of this lifecycle.
123
+
124
+ ## 6. Resource ownership
125
+
126
+ ### 6.1 Evidence root
127
+
128
+ Create a test-owned root with `mkdtemp()` under the OS temporary directory.
129
+
130
+ Populate it through the existing canonical deterministic fixture helpers used by
131
+ the current PWA test. The hard gate should still include the real annotation
132
+ needed for annotation/media route coverage when that remains relevant to the
133
+ cache boundary.
134
+
135
+ Remove the root in `finally`/test cleanup even after a failed assertion where
136
+ practical.
137
+
138
+ ### 6.2 Viewer server
139
+
140
+ Start a dedicated viewer server for the hard gate. Do not reuse a server from a
141
+ describe-level `beforeAll`.
142
+
143
+ The server may be closed deliberately in the middle of the experiment; cleanup
144
+ must tolerate an already-closed server.
145
+
146
+ ### 6.3 Chromium profile/context
147
+
148
+ Create a fresh temporary persistent profile, for example:
149
+
150
+ ```ts
151
+ const profileRoot = await mkdtemp(
152
+ path.join(tmpdir(), 'my-frontend-observer-pwa-hard-gate-'),
153
+ );
154
+ ```
155
+
156
+ Launch:
157
+
158
+ ```ts
159
+ const context = await chromium.launchPersistentContext(profileRoot, {
160
+ headless: true,
161
+ });
162
+ ```
163
+
164
+ The hard gate must not use
165
+ `.my-dev-kit-workflow/v0.8/batch-08/pwa-profile`.
166
+
167
+ Remove the temporary profile after closing the context.
168
+
169
+ ## 7. Service-worker readiness proof
170
+
171
+ Before shutting down the server, prove two distinct conditions.
172
+
173
+ First, the registration is ready and has an active worker:
174
+
175
+ ```ts
176
+ const registrationState = await page.evaluate(async () => {
177
+ const registration = await navigator.serviceWorker.ready;
178
+ return {
179
+ active: registration.active !== null,
180
+ scope: registration.scope,
181
+ };
182
+ });
183
+ ```
184
+
185
+ Second, the current page is actually controlled:
186
+
187
+ ```ts
188
+ await page.waitForFunction(
189
+ () => navigator.serviceWorker.controller !== null,
190
+ undefined,
191
+ { timeout: 10_000 },
192
+ );
193
+ ```
194
+
195
+ If the first navigation installs/activates the worker without immediately
196
+ controlling the current page, perform a normal reload while the server is still
197
+ available, then wait for `navigator.serviceWorker.controller !== null`.
198
+
199
+ Do not replace these proofs with a fixed sleep.
200
+
201
+ ## 8. App-shell cache proof
202
+
203
+ Before server shutdown, inspect Cache Storage from the page and prove that the
204
+ Workbox/app-shell precache contains the resources necessary for the offline
205
+ navigation shell.
206
+
207
+ The assertion should use stable build-level expectations rather than hashed
208
+ asset filenames where possible. It must prove that a cache exists and that a
209
+ navigation/app-shell response is available; it must not simply infer cache
210
+ readiness from `registration.active`.
211
+
212
+ If the exact stable cache representation requires inspection during
213
+ implementation, record that concrete representation in the implementation
214
+ report and test the narrowest durable condition.
215
+
216
+ ## 9. API cache exclusion proof
217
+
218
+ The hard gate itself must inspect Cache Storage and prove that cached requests
219
+ do not contain paths beginning with:
220
+
221
+ `/api/`.
222
+
223
+ The separate focused `never caches /api/ responses` test may remain, but the
224
+ hard gate cannot rely on that test having run first.
225
+
226
+ No runtime caching rule for evidence/API may be added.
227
+
228
+ ## 10. Live evidence proof
229
+
230
+ Before server shutdown:
231
+
232
+ - wait for the first real evidence item;
233
+ - prove it is visible;
234
+ - capture/assert a deterministic evidence identity/text such as the fixture's
235
+ `many-regions-candidate` identity.
236
+
237
+ That exact previously visible identity becomes the stale-data negative
238
+ assertion after the offline reload.
239
+
240
+ ## 11. Server/network-down proof
241
+
242
+ After `server.close()`, prove that the authoritative network endpoint is no
243
+ longer available before evaluating offline behavior.
244
+
245
+ Use a bounded direct request/fetch that must fail because the server is gone.
246
+ Do not infer network unavailability solely from the fact that `close()`
247
+ resolved.
248
+
249
+ The cache/service-worker may still satisfy app-shell navigation; the proof of
250
+ server unavailability must target server-backed evidence/API behavior.
251
+
252
+ ## 12. Offline reload proof
253
+
254
+ Reload the controlled page after the server is proven unavailable.
255
+
256
+ Require:
257
+
258
+ - the precached viewer shell still renders;
259
+ - the evidence-dependent UI reaches its explicit unavailable/error state;
260
+ - body/UI text contains the existing unavailable message;
261
+ - the previously visible evidence identity is absent.
262
+
263
+ The safety invariant remains unchanged: a cached shell is permitted; stale
264
+ authoritative evidence is not.
265
+
266
+ ## 13. Cleanup guarantees
267
+
268
+ Cleanup must be deterministic and tolerant of the intentional mid-test server
269
+ shutdown.
270
+
271
+ At minimum:
272
+
273
+ - close page/context;
274
+ - close server if not already closed;
275
+ - remove evidence root recursively;
276
+ - remove temporary persistent profile recursively.
277
+
278
+ Do not leave the hard gate's browser state under `.my-dev-kit-workflow`.
279
+
280
+ If cleanup errors are currently swallowed too broadly, preserve enough
281
+ diagnostic information that a leaked profile/server can be debugged without
282
+ turning cleanup into a product semantic change.
283
+
284
+ ## 14. Other PWA tests
285
+
286
+ The focused tests for:
287
+
288
+ - service-worker registration;
289
+ - manifest validity;
290
+ - API cache exclusion;
291
+ - install-control behavior;
292
+ - standalone display-mode proof;
293
+
294
+ remain valuable and should retain their narrow assertions.
295
+
296
+ Where the first PWA describe still uses a shared persistent context for the
297
+ non-hard-gate tests, replace any fixed historical profile with a fresh
298
+ describe-owned temporary profile and remove it in cleanup. This prevents
299
+ cross-run contamination even when those focused tests continue sharing state
300
+ within their describe.
301
+
302
+ The hard gate itself must not share that context/profile.
303
+
304
+ ## 15. Dedicated isolated command
305
+
306
+ Add one repository-owned command so isolation remains a permanent gate.
307
+
308
+ Preferred package script:
309
+
310
+ ```json
311
+ "test:pwa-hard-gate": "vitest run --config vitest.browser.config.ts tests/browser/pwaHardening.test.ts -t \"HARD GATE\""
312
+ ```
313
+
314
+ Use repository naming conventions if a better exact script name already exists,
315
+ but keep one explicit isolated command.
316
+
317
+ This command must start from normal test setup and must not require another test
318
+ to have run first.
319
+
320
+ ## 16. Security/readiness integration
321
+
322
+ The isolated hard-gate command must be part of the applicable security or
323
+ release-readiness validation path so future full-suite success cannot hide a
324
+ regression in test independence.
325
+
326
+ Do not remove the normal complete
327
+ `tests/browser/pwaHardening.test.ts`/browser/security execution. The isolated
328
+ proof is additive.
329
+
330
+ If adding the dedicated command to `npm run test:security` would cause the
331
+ same expensive test to run redundantly in a harmful way, keep the command
332
+ separate and wire it into pre-release readiness explicitly. Choose the smallest
333
+ repository-consistent integration, and document the decision.
334
+
335
+ ## 17. Implementation sequence
336
+
337
+ ### Batch 1 — Isolate and strengthen the hard-gate experiment
338
+
339
+ Primary owner:
340
+
341
+ `tests/browser/pwaHardening.test.ts`
342
+
343
+ Expected work:
344
+
345
+ - replace hard-gate shared state with test-owned fresh resources;
346
+ - replace fixed persistent-profile dependence with temporary profile ownership;
347
+ - add explicit active-registration and current-client-controller proof;
348
+ - add explicit shell-cache and API-cache-exclusion proof;
349
+ - add explicit server/API-down proof;
350
+ - preserve the existing offline-shell/stale-evidence assertions;
351
+ - make cleanup deterministic;
352
+ - make the hard gate pass independently.
353
+
354
+ Batch 1 acceptance:
355
+
356
+ ```text
357
+ isolated HARD GATE PASS
358
+ full pwaHardening.test.ts PASS
359
+ no production file modified
360
+ no fixed-profile dependence in the hard gate
361
+ ```
362
+
363
+ If the isolated experiment still demonstrates stale evidence or cannot satisfy
364
+ the existing product contract after all prerequisites are proven, STOP with a
365
+ product-defect verdict before Batch 2.
366
+
367
+ ### Batch 2 — Freeze the isolation gate and run full regression
368
+
369
+ Expected work:
370
+
371
+ - add the dedicated package script;
372
+ - add the isolation proof to the appropriate security/readiness path;
373
+ - update development/CI/current-state documentation from planned to
374
+ implemented wording;
375
+ - run complete unit/browser/security/build/docs/package validation;
376
+ - perform patch release readiness if v0.9.1 publication is requested.
377
+
378
+ Batch 2 acceptance:
379
+
380
+ ```text
381
+ test:pwa-hard-gate PASS
382
+ full browser suite PASS
383
+ security suite PASS
384
+ typecheck PASS
385
+ lint PASS
386
+ unit tests PASS
387
+ build PASS
388
+ docs check PASS
389
+ pack dry run PASS
390
+ no unintended production semantic change
391
+ ```
392
+
393
+ ## 18. Required implementation tests
394
+
395
+ At minimum prove:
396
+
397
+ 1. hard gate passes alone from a clean temporary profile;
398
+ 2. hard gate passes when the whole PWA file runs;
399
+ 3. hard gate passes in the normal full browser suite;
400
+ 4. hard gate passes in the security validation path;
401
+ 5. repeated isolated executions do not depend on state from the prior run;
402
+ 6. no `/api/` request is present in Cache Storage at the shutdown boundary;
403
+ 7. the current client is controlled before shutdown;
404
+ 8. the shell cache prerequisite is explicitly established;
405
+ 9. the server/API is explicitly unavailable before offline reload;
406
+ 10. stale evidence identity is absent after reload;
407
+ 11. temporary profile/evidence state is cleaned up.
408
+
409
+ ## 19. Production-code escalation rule
410
+
411
+ Expected initial classification:
412
+
413
+ ```text
414
+ TEST_DEFECT
415
+ PRODUCT_CHANGE_REQUIRED = false
416
+ ```
417
+
418
+ If the corrected clean-state experiment fails because production behavior
419
+ actually violates the stale-evidence safety contract:
420
+
421
+ - do not loosen the test;
422
+ - do not add retry/sleep until it happens to pass;
423
+ - capture the exact runtime evidence;
424
+ - stop the maintenance batch;
425
+ - report a product defect;
426
+ - revise this plan explicitly before changing production PWA/service-worker
427
+ code.
428
+
429
+ ## 20. Version/package expectations
430
+
431
+ v0.9.1 is a maintenance patch. No canonical evidence schema version is expected
432
+ to change.
433
+
434
+ No new runtime dependency is expected.
435
+
436
+ If implementation remains test/documentation-only, package runtime bytes may be
437
+ unchanged apart from version/docs if the user elects to publish v0.9.1. The
438
+ release decision must be made after implementation evidence rather than by
439
+ inventing a product change solely to justify a package release.
440
+
441
+ ## 21. Documentation reconciliation after implementation
442
+
443
+ When implementation passes:
444
+
445
+ - `CURRENT_STATE.md` changes from planned to implemented status;
446
+ - `ROADMAP.md` records v0.9.1 as implemented/released only when that state is
447
+ actually true;
448
+ - `DEVELOPMENT.md` and `CI_CD.md` retain the durable gate-isolation rule;
449
+ - `CHANGELOG.md` receives the actual implemented correction under
450
+ `[Unreleased]` or the final v0.9.1 section at release preparation;
451
+ - historical v0.9.0 reports remain unchanged.
452
+
453
+ ## 22. Final implementation verdicts
454
+
455
+ Use a precise result.
456
+
457
+ Expected success before release:
458
+
459
+ `PASS_V0_9_1_PWA_HARD_GATE_ISOLATION`
460
+
461
+ Use a blocker such as:
462
+
463
+ `BLOCKED_V0_9_1_PRODUCT_PWA_DEFECT_DISCOVERED`
464
+
465
+ if the self-contained experiment reveals a real production failure.
466
+
467
+ Do not claim v0.9.1 released until the normal release workflow actually
468
+ completes.
@@ -0,0 +1,102 @@
1
+ # v0.10 Batch 1 Visual-Change Workflow Foundation
2
+
3
+ ## 1. Verdict
4
+
5
+ PASS after the validation recorded below.
6
+
7
+ ## 2. Repository and Git state
8
+
9
+ - Repository: `C:\Users\daile\Projects\my-frontend-observer`
10
+ - Starting commit: `0ca6a686ee16447052845227a86f685b91aa54c1`
11
+ - Branch: `feature/v0.10-full-visual-workflow`
12
+ - Intended commit: `feat: add v0.10 visual change workflow foundation`
13
+
14
+ ## 3. Retrieval and index
15
+
16
+ - Published my-dev-kit version: `1.12.3`
17
+ - Index: `.my-dev-kit-context/indexes/my-frontend-observer-v0.9.1-20260922T070928-v010-batch1`
18
+ - Command: `my-dev-kit index --root C:\Users\daile\Projects\my-frontend-observer --src src --src viewer/src --src tests --src scripts --out <index> --call-graph --json`
19
+ - Roots: `src`, `viewer/src`, `tests`, `scripts`
20
+ - Summary: 162 files, 1,606 symbols, 3,471 edges, zero index-level warnings/errors.
21
+ - Partial analyzers: data-model (758 warnings) and classification (1,568 warnings). Syntax, call graph, frontend semantic, and frontend reachability completed.
22
+
23
+ Canonical precedents confirmed:
24
+
25
+ - `src/domain/visualAnnotation.ts` and `visualAnnotationIdentity.ts`: closed validation, sorted-key canonical JSON, SHA-256 request identity, nonce-backed instance identity, producer/provenance, and forward supersession.
26
+ - `src/domain/externalReference.ts`, `externalReferenceIdentity.ts`, and `frontendContractIdentity.ts`: exact request/instance and immutable supersession conventions.
27
+ - `src/domain/externalReferenceRuntimeBinding.ts`: the exact reusable explicit binding declaration type and its identifier, bound, and duplicate semantics.
28
+ - `src/artifacts/visualAnnotationArtifactWriter.ts` and reader: sibling temporary directory, overwrite refusal, cleanup, manifest/media digest validation, and atomic rename.
29
+ - `src/projectWorkflow/projectPaths.ts`: the project evidence-root/path owner.
30
+ - `src/viewerServer/evidence/classify.ts`, `index.ts`, `projection.ts`, `handles.ts`, and `annotationView.ts`: the existing support-state classifier, metadata-first index, safe handles, bounded exact identity lookup, and honest unavailable projection.
31
+ - Existing `EvidenceReference` is structured evaluation provenance and explicitly is not a filesystem reference. Therefore a small workflow-owned project-relative artifact reference was required; no generalized cross-project framework was added.
32
+
33
+ Full source/test file reads: none.
34
+
35
+ ## 4. Production implementation
36
+
37
+ Created:
38
+
39
+ - `src/domain/visualChangeWorkflow.ts`
40
+ - `src/domain/visualChangeWorkflowIdentity.ts`
41
+ - `src/artifacts/visualChangeWorkflowArtifactWriter.ts`
42
+ - `src/artifacts/visualChangeWorkflowArtifactReader.ts`
43
+ - `src/application/visualChangeWorkflowPersistenceService.ts`
44
+ - `src/viewerServer/evidence/visualChangeWorkflowView.ts`
45
+
46
+ Modified:
47
+
48
+ - `src/projectWorkflow/projectPaths.ts`
49
+ - `src/viewerServer/evidence/classify.ts`
50
+ - `src/viewerServer/evidence/handles.ts`
51
+ - `src/viewerServer/evidence/projection.ts`
52
+ - `src/index.ts`
53
+ - `docs/CONTRACTS.md`
54
+
55
+ The artifact kind is exactly `my-frontend-observer/visual-change-workflow`; schema is exactly `1.0.0`; attempts are bounded at 20. The closed domain union contains the two frozen entry modes, exact evidence references, check snapshots, coordination metadata, review state, activation, and governance-result references.
56
+
57
+ Request identity is deterministic over semantic evidence identities and binding content. Storage paths, timestamps, output roots, temp roots, Viewer handles/ports, and coordination filesystem details are excluded. Workflow instance IDs are fresh. Attempt IDs hash request ID plus candidate observation ID. Revisions use `supersedesVisualChangeWorkflowId`; parents are never rewritten.
58
+
59
+ The writer validates, refuses existing final output, uses `.tmp-<workflowId>`, writes canonical bindings when required, verifies its digest, writes the manifest, and atomically renames. The reader checks kind/version/domain validity, exact `bindings.json` path, regular-file status, SHA-256, canonical bytes, declaration equality, and count. No referenced artifact or media is copied.
60
+
61
+ Discovery classifies the new family through the existing support-state machinery. Metadata includes workflow/request identity, mode, baseline, annotation, selected reference, attempt count, latest check/review state, and supersession without embedding attempts. The read projection resolves exact identities using canonical classification and returns explicit unavailable state for missing or ambiguous links.
62
+
63
+ ## 5. Tests
64
+
65
+ Created `tests/unit/visualChangeWorkflow.test.ts`. Its ten focused cases protect:
66
+
67
+ 1. minimal actual/reference validation, closed shapes, wrong kind, and unsupported schema;
68
+ 2. request identity determinism and semantic-scope changes, including operational path exclusion;
69
+ 3. fresh workflow identity and deterministic attempt identity invariants;
70
+ 4. attempt bounds, revision lineage, path safety, and review vocabulary;
71
+ 5. actual-mode round trip, absent bindings file, and overwrite refusal;
72
+ 6. deterministic bindings bytes, digest/count round trip, and tamper rejection;
73
+ 7. temporary-output cleanup on injected failure;
74
+ 8. same-request/different-instance persistence and byte-immutable parent revision;
75
+ 9. supported classification and bounded index metadata;
76
+ 10. exact linked-evidence resolution and honest missing evidence.
77
+
78
+ Existing focused annotation, external-reference, contract, and discovery suites remained unchanged and passed.
79
+
80
+ ## 6. Validation
81
+
82
+ - `npm run typecheck`: PASS.
83
+ - `npm run lint`: PASS after removal of one unused import.
84
+ - Focused five-file Vitest run: PASS, 51 tests.
85
+ - `npm test`: PASS.
86
+ - `npm run build`: PASS.
87
+ - `npm run check:docs`: PASS.
88
+ - `git diff --check`: PASS.
89
+
90
+ Existing constants remain observation `1.2.0`, comparison `1.0.0`, frontend contract `1.0.0`, evaluation `1.0.0`, bounded-agent-context `1.0.0`, external-reference `1.0.0`, visual annotation `1.0.0`, and Viewer protocol `1.3.0`.
91
+
92
+ ## 7. Exclusions and risk
93
+
94
+ No project activation/restoration, live `checkProject` mapping, Viewer UI/POST routes, entry-mode UI, handoff, orchestrator execution, rerender/correction loop, acceptance action, governance operation, tutorial, version bump, or release work was implemented.
95
+
96
+ Remaining risk is limited to later-batch composition: Batch 2 must map canonical `CheckWorkflowResult` into the frozen snapshot, activate/restore project acceptance explicitly, and record attempts without scope drift. Batch 1 deliberately does not enforce accepted-requires-PASS.
97
+
98
+ ## 8. Batch 2 handoff
99
+
100
+ Start from this Batch 1 commit. Reuse `persistVisualChangeWorkflow`, `readVisualChangeWorkflowArtifact`, `buildVisualChangeAttemptIdentity`, `visualChangeOutputLocation`, and the existing `checkProject` owner. Implement only explicit acceptance activation/restore and canonical check-to-snapshot attempt recording, preserving all Batch 1 identities and schema `1.0.0`.
101
+
102
+ Generated state is confined to `.my-dev-kit-workflow/` and `.my-dev-kit-context/`; neither path is staged.
@@ -0,0 +1,103 @@
1
+ # v0.10 Batch 2 Project Composition and Check Recording
2
+
3
+ ## 1. Verdict
4
+
5
+ PASS. Batch 2 project composition, explicit activation and restoration, drift gates, canonical project-check reuse, and immutable attempt recording are implemented.
6
+
7
+ ## 2. Repository and Git state
8
+
9
+ - Repository: `C:\Users\daile\Projects\my-frontend-observer`
10
+ - Starting commit: `62c4df47dd278c1fbd431824ca6e773366f1d1fb`
11
+ - Branch: `feature/v0.10-full-visual-workflow`
12
+ - Commit message: `feat: add v0.10 project visual change composition`
13
+
14
+ The preflight worktree was clean. Local and remote shared branches both pointed to the authoritative Batch 1 commit.
15
+
16
+ ## 3. my-dev-kit retrieval
17
+
18
+ - Resolved published version: `1.12.3`
19
+ - Install: `.my-dev-kit-workflow/tools/v0.10-batch2/`
20
+ - CLI version: `1.12.3`
21
+ - Verified commands: `index`, `search`, `lookup`, `slice`, `source`, `graph-diff`, and `context`
22
+ - Fresh index: `.my-dev-kit-context/indexes/my-frontend-observer-v0.10-batch2-20260922`
23
+ - Exact index command: `node .my-dev-kit-workflow/tools/v0.10-batch2/node_modules/@dailephd/my-dev-kit/dist/cli.js index --root C:\Users\daile\Projects\my-frontend-observer --src src --src viewer/src --src tests --src scripts --out C:\Users\daile\Projects\my-frontend-observer\.my-dev-kit-context\indexes\my-frontend-observer-v0.10-batch2-20260922 --call-graph --json`
24
+ - Index summary: 168 files, 1,669 symbols, 3,581 edges, zero index-level warnings or errors.
25
+ - Complete analyzers: syntax, call graph, frontend semantic, frontend reachability.
26
+ - Partial analyzers: data model with 790 warnings; classification with 1,621 warnings.
27
+ - Skipped/not-run analyzers were Android-specific and model-view lineage.
28
+
29
+ Retrieval used search, lookup, slice, exact symbol source, local dependency expansion, bounded file ranges, and continuation markers. It verified `activateProjectChangeContract`, `FrontendObserverAcceptanceConfig`, `checkProject`, `CheckWorkflowResult`, the alias catalog, canonical observation/contract/reference readers, `persistVisualChangeWorkflow`, `readVisualChangeWorkflowArtifact`, and `buildVisualChangeAttemptIdentity`.
30
+
31
+ ## 4. Reused owners
32
+
33
+ - `src/application/projectWorkflowService.ts`: existing atomic activation precedent; unchanged behavior.
34
+ - `src/projectWorkflow/projectConfig.ts`: unchanged project schema and validation.
35
+ - `src/projectWorkflow/aliasCatalog.ts`: exact baseline alias identity and location.
36
+ - `src/application/projectCheckService.ts`: sole capture, comparison, contract, reference, blocker, and final-status owner.
37
+ - `src/projectWorkflow/checkResult.ts`: canonical bounded result fields and truncation.
38
+ - Canonical artifact readers for observations, annotations, baseline/change contracts, external references, and visual-change workflows.
39
+ - `src/application/visualChangeWorkflowPersistenceService.ts`: all new immutable workflow revisions.
40
+ - `src/domain/visualChangeWorkflowIdentity.ts`: existing attempt identity helper.
41
+
42
+ ## 5. Application service
43
+
44
+ Created `src/application/visualChangeProjectWorkflowService.ts`. It exports project-aware create/freeze, activation, restoration, canonical check recording, and the pure snapshot mapper. `src/index.ts` exposes the application surface through the established public convention.
45
+
46
+ Create/freeze validates the project configuration and every referenced project-contained artifact. It checks baseline observation ID, request ID, and path, annotation identity, optional baseline-contract identity, actual-mode change-contract identity/request identity, and reference identity/request identity. It persists through the Batch 1 owner without activation, attempts, or project-config mutation.
47
+
48
+ ## 6. Activation and rollback
49
+
50
+ Actual activation requires an existing contract block, exact frozen baseline-contract path and identity, and exact change-contract evidence. It changes only `acceptance.contract.changeArtifact`.
51
+
52
+ Reference activation requires an existing reference block, the exact frozen approved reference, reader-verified workflow bindings, and contract/baseline consistency. It changes only the approved reference artifact and the source workflow's project-relative `bindings.json`.
53
+
54
+ Both modes snapshot all represented mutable acceptance selection fields. They atomically write a validated updated configuration and then persist a new workflow revision with the same request ID, unchanged attempts/governance data, activation before/after/activatedAt, and forward supersession. A persistence failure restores the exact original config bytes. A failed compensation returns distinct `partial-state-failure` language stating manual repair may be required.
55
+
56
+ ## 7. Restore
57
+
58
+ Restore requires a live activation and exact equality with `activation.after`. Drift is non-mutating. Actual restore changes only the prior change-contract selection. Reference restore restores the prior reference and exact optional bindings presence/value. The successful immutable revision adds only `restoredAt` and forward supersession. Persistence failure compensates back to the exact activated configuration.
59
+
60
+ ## 8. Baseline and drift rules
61
+
62
+ Baseline resolution first prefers `defaultBaseline` only when observation ID, request ID, and exact project-relative artifact location all match. Otherwise it chooses the lexicographically first exact matching alias. No exact alias returns `baseline-drift` before `checkProject`.
63
+
64
+ The pre-check gate requires a valid active non-restored workflow, exact acceptance selection, exact baseline, exact baseline/change contract identities where active, exact approved reference identity, exact bindings selection, and reader-verified frozen bindings bytes. Represented changes return `acceptance-drift` or `baseline-drift` without evaluation.
65
+
66
+ ## 9. Canonical check and snapshot
67
+
68
+ The service calls only `checkProject(projectRoot, resolvedAlias)`. The pure mapper directly projects status, baseline/candidate IDs, complete comparison/evaluation references, verified active contract IDs, canonical reference ID/fidelity state, ordered failed/unavailable clause and requirement IDs, bounded unexpected-change count, and blockers. Blockers are capped at 50. Snapshot truncation combines canonical overall, contract, reference, and blocker projection truncation.
69
+
70
+ A result without both baseline and candidate is returned as `candidate-not-produced` and is not recorded. Post-check baseline or reference mismatch returns `check-scope-mismatch`.
71
+
72
+ ## 10. Attempt persistence
73
+
74
+ Candidate identity/path comes only from the canonical result and is containment checked. Attempt identity uses `buildVisualChangeAttemptIdentity`. New attempts are pending, timestamped, and link to the immediately prior attempt. Duplicate IDs and a twenty-first attempt are rejected without truncation. Persistence produces a new revision with identical scope/request identity and immutable parent bytes. Persistence failure retains canonical check evidence and reports that history was not updated.
75
+
76
+ ## 11. Tests and validation
77
+
78
+ Created `tests/unit/visualChangeProjectWorkflowService.test.ts`. It covers direct PASS/FAIL/BLOCKED/REVIEW_REQUIRED projection, comparison/evaluation references, clause and reference-requirement ordering, bounded unexpected changes, blocker bounds, canonical truncation, create-without-activation, immutable activation and restore revisions, rollback after persistence failure, and one-call canonical check recording of a pending candidate attempt. Real application tests use canonical artifact writers/readers.
79
+
80
+ Focused validation: 3 files, 25 tests, PASS. This includes the new service, existing Batch 1 visual-change workflow, and existing project check tests.
81
+
82
+ Full validation:
83
+
84
+ - `npm run typecheck`: PASS.
85
+ - `npm run lint`: PASS.
86
+ - `npm test`: PASS, 91 files and 1,477 tests.
87
+ - `npm run build`: PASS.
88
+ - `npm run check:docs`: PASS.
89
+ - `git diff --check`: PASS.
90
+
91
+ Existing `activateProjectChangeContract`, `checkProject`, Batch 1 workflow behavior, schema constants, and Viewer protocol remain unchanged and pass the full suite.
92
+
93
+ ## 12. Full-file read accounting
94
+
95
+ Full source/test file reads: none. my-dev-kit bounded retrieval supplied every required implementation shape. Its symbol index lacks reliable symbol end lines for some declarations, so continuation markers and bounded explicit file ranges were used instead of whole-file reads. Canonical documentation reads are excluded by task rule.
96
+
97
+ ## 13. Exclusions and handoff
98
+
99
+ No Viewer workspace, POST route, annotation UI composition, coding-agent handoff, orchestrator integration, automatic retry, correction action, human acceptance, governance approval, version bump, release, tag, publication, or PR work was implemented.
100
+
101
+ Batch 3 should start from this commit and add only the secure project-aware Viewer workspace/API specified by the frozen plan. It can call this application service without reconstructing activation, drift, check, snapshot, or attempt semantics.
102
+
103
+ Generated state is confined to `.my-dev-kit-workflow/` and `.my-dev-kit-context/`. Neither path is staged.