@dailephd/my-frontend-observer 0.9.1 → 0.10.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +490 -471
  2. package/LICENSE +21 -21
  3. package/README.md +375 -357
  4. package/dist/application/projectCheckService.d.ts +6 -0
  5. package/dist/application/projectCheckService.js +8 -1
  6. package/dist/application/projectCheckService.js.map +1 -1
  7. package/dist/application/projectWorkflowService.d.ts +7 -2
  8. package/dist/application/projectWorkflowService.js +10 -3
  9. package/dist/application/projectWorkflowService.js.map +1 -1
  10. package/dist/application/visualChangeAgentHandoffService.d.ts +28 -0
  11. package/dist/application/visualChangeAgentHandoffService.js +111 -0
  12. package/dist/application/visualChangeAgentHandoffService.js.map +1 -0
  13. package/dist/application/visualChangeProjectWorkflowService.d.ts +95 -0
  14. package/dist/application/visualChangeProjectWorkflowService.js +376 -0
  15. package/dist/application/visualChangeProjectWorkflowService.js.map +1 -0
  16. package/dist/application/visualChangeReviewService.d.ts +50 -0
  17. package/dist/application/visualChangeReviewService.js +69 -0
  18. package/dist/application/visualChangeReviewService.js.map +1 -0
  19. package/dist/application/visualChangeWorkflowPersistenceService.d.ts +26 -0
  20. package/dist/application/visualChangeWorkflowPersistenceService.js +15 -0
  21. package/dist/application/visualChangeWorkflowPersistenceService.js.map +1 -0
  22. package/dist/artifacts/visualChangeWorkflowArtifactReader.d.ts +9 -0
  23. package/dist/artifacts/visualChangeWorkflowArtifactReader.js +47 -0
  24. package/dist/artifacts/visualChangeWorkflowArtifactReader.js.map +1 -0
  25. package/dist/artifacts/visualChangeWorkflowArtifactWriter.d.ts +20 -0
  26. package/dist/artifacts/visualChangeWorkflowArtifactWriter.js +41 -0
  27. package/dist/artifacts/visualChangeWorkflowArtifactWriter.js.map +1 -0
  28. package/dist/cli.js +9 -7
  29. package/dist/cli.js.map +1 -1
  30. package/dist/domain/visualChangeAgentHandoff.d.ts +82 -0
  31. package/dist/domain/visualChangeAgentHandoff.js +80 -0
  32. package/dist/domain/visualChangeAgentHandoff.js.map +1 -0
  33. package/dist/domain/visualChangeAgentHandoffSerialization.d.ts +2 -0
  34. package/dist/domain/visualChangeAgentHandoffSerialization.js +11 -0
  35. package/dist/domain/visualChangeAgentHandoffSerialization.js.map +1 -0
  36. package/dist/domain/visualChangeCycle.d.ts +8 -0
  37. package/dist/domain/visualChangeCycle.js +7 -0
  38. package/dist/domain/visualChangeCycle.js.map +1 -0
  39. package/dist/domain/visualChangeWorkflow.d.ts +125 -0
  40. package/dist/domain/visualChangeWorkflow.js +109 -0
  41. package/dist/domain/visualChangeWorkflow.js.map +1 -0
  42. package/dist/domain/visualChangeWorkflowIdentity.d.ts +5 -0
  43. package/dist/domain/visualChangeWorkflowIdentity.js +24 -0
  44. package/dist/domain/visualChangeWorkflowIdentity.js.map +1 -0
  45. package/dist/index.d.ts +21 -1
  46. package/dist/index.js +12 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/projectWorkflow/projectPaths.d.ts +3 -0
  49. package/dist/projectWorkflow/projectPaths.js +7 -0
  50. package/dist/projectWorkflow/projectPaths.js.map +1 -1
  51. package/dist/viewer/assets/index-DglJ6f28.css +1 -0
  52. package/dist/viewer/assets/index-DsODREY5.js +9 -0
  53. package/dist/viewer/index.html +15 -15
  54. package/dist/viewer/sw.js +1 -1
  55. package/dist/viewerServer/evidence/classify.d.ts +3 -1
  56. package/dist/viewerServer/evidence/classify.js +10 -0
  57. package/dist/viewerServer/evidence/classify.js.map +1 -1
  58. package/dist/viewerServer/evidence/handles.js +1 -0
  59. package/dist/viewerServer/evidence/handles.js.map +1 -1
  60. package/dist/viewerServer/evidence/projection.d.ts +5 -0
  61. package/dist/viewerServer/evidence/projection.js +19 -0
  62. package/dist/viewerServer/evidence/projection.js.map +1 -1
  63. package/dist/viewerServer/evidence/visualChangeWorkflowView.d.ts +31 -0
  64. package/dist/viewerServer/evidence/visualChangeWorkflowView.js +36 -0
  65. package/dist/viewerServer/evidence/visualChangeWorkflowView.js.map +1 -0
  66. package/dist/viewerServer/httpServer.js +323 -1
  67. package/dist/viewerServer/httpServer.js.map +1 -1
  68. package/dist/viewerServer/referenceApproval.d.ts +22 -0
  69. package/dist/viewerServer/referenceApproval.js +42 -0
  70. package/dist/viewerServer/referenceApproval.js.map +1 -0
  71. package/dist/viewerServer/referenceVisualChangeAuthoring.d.ts +28 -0
  72. package/dist/viewerServer/referenceVisualChangeAuthoring.js +134 -0
  73. package/dist/viewerServer/referenceVisualChangeAuthoring.js.map +1 -0
  74. package/dist/viewerServer/runtimeVisualChangeAuthoring.d.ts +33 -0
  75. package/dist/viewerServer/runtimeVisualChangeAuthoring.js +81 -0
  76. package/dist/viewerServer/runtimeVisualChangeAuthoring.js.map +1 -0
  77. package/dist/viewerServer/visualChangeAuthoring.d.ts +46 -0
  78. package/dist/viewerServer/visualChangeAuthoring.js +63 -0
  79. package/dist/viewerServer/visualChangeAuthoring.js.map +1 -0
  80. package/dist/viewerServer/visualChangeHandoff.d.ts +23 -0
  81. package/dist/viewerServer/visualChangeHandoff.js +31 -0
  82. package/dist/viewerServer/visualChangeHandoff.js.map +1 -0
  83. package/dist/viewerServer/visualChangeReview.d.ts +30 -0
  84. package/dist/viewerServer/visualChangeReview.js +46 -0
  85. package/dist/viewerServer/visualChangeReview.js.map +1 -0
  86. package/docs/ARCHITECTURE.md +1394 -1373
  87. package/docs/CI_CD.md +349 -327
  88. package/docs/COMMANDS.md +1035 -1012
  89. package/docs/CONTRACTS.md +1971 -1926
  90. package/docs/CURRENT_STATE.md +1277 -1238
  91. package/docs/DEVELOPMENT.md +240 -237
  92. package/docs/DOCUMENTATION_PRESERVATION_POLICY.md +50 -50
  93. package/docs/PROJECT_DESCRIPTION.md +2248 -2224
  94. package/docs/PROJECT_MILESTONES.md +2681 -2558
  95. package/docs/PROJECT_OVERVIEW.md +200 -191
  96. package/docs/QUICKSTART.md +100 -96
  97. package/docs/RELEASE.md +37 -33
  98. package/docs/ROADMAP.md +1105 -1033
  99. package/docs/SECURITY.md +297 -275
  100. package/docs/WORKFLOWS.md +806 -770
  101. package/docs/plans/v0.10-implementation-plan.md +1509 -0
  102. package/docs/plans/v0.8-implementation-plan.md +655 -655
  103. package/docs/plans/v0.8.1-cli-usability-patch-plan.md +505 -505
  104. package/docs/plans/v0.9-implementation-plan.md +1529 -1529
  105. package/docs/plans/v0.9.1-implementation-plan.md +468 -468
  106. package/docs/reports/v0.10-batch1-visual-change-workflow-foundation.md +102 -0
  107. package/docs/reports/v0.10-batch2-project-composition-check-recording.md +103 -0
  108. package/docs/reports/v0.10-batch3-viewer-visual-change-workspace.md +93 -0
  109. package/docs/reports/v0.10-batch4-actual-frontend-entry.md +59 -0
  110. package/docs/reports/v0.10-batch5-reference-driven-entry.md +238 -0
  111. package/docs/reports/v0.10-batch6-coding-agent-handoff.md +85 -0
  112. package/docs/reports/v0.10-batch7-correction-review-acceptance.md +145 -0
  113. package/docs/reports/v0.10-batch8-integrated-acceptance.md +109 -0
  114. package/docs/reports/v0.10-implementation-completeness-documentation-reconciliation.md +344 -0
  115. package/docs/reports/v0.10-pre-release-readiness.md +120 -0
  116. package/docs/reports/v0.10-release-preparation.md +70 -0
  117. package/docs/reports/v0.10.1-project-check-baseline-context-implementation.md +86 -0
  118. package/docs/reports/v0.7-bounded-fidelity-context-prompt7.md +243 -243
  119. package/docs/reports/v0.7-implementation-completeness-documentation-reconciliation.md +497 -497
  120. package/docs/reports/v0.7-pre-release-readiness.md +337 -337
  121. package/docs/reports/v0.7-reference-binding-prompt5.md +223 -223
  122. package/docs/reports/v0.7-reference-compatibility-prompt4.md +234 -234
  123. package/docs/reports/v0.7-reference-correction-workflow-prompt8.md +222 -222
  124. package/docs/reports/v0.7-reference-fidelity-prompt6.md +216 -216
  125. package/docs/reports/v0.7-reference-foundation-prompt1.md +151 -151
  126. package/docs/reports/v0.7-reference-regions-prompt2.md +195 -195
  127. package/docs/reports/v0.7-reference-requirements-prompt3.md +217 -217
  128. package/docs/reports/v0.7-release-prep.md +423 -423
  129. package/docs/reports/v0.8-binding-fidelity-interaction-batch6.md +279 -279
  130. package/docs/reports/v0.8-bounded-context-correlation-batch7.md +233 -233
  131. package/docs/reports/v0.8-comparison-contract-inspection-batch4.md +279 -279
  132. package/docs/reports/v0.8-evidence-index-readers-batch2.md +247 -247
  133. package/docs/reports/v0.8-implementation-completeness-documentation-reconciliation.md +741 -741
  134. package/docs/reports/v0.8-integrated-viewer-acceptance-batch8.md +128 -128
  135. package/docs/reports/v0.8-observation-svg-inspection-batch3.md +223 -223
  136. package/docs/reports/v0.8-prerelease-readiness-cross-platform-security-code-rot.md +687 -687
  137. package/docs/reports/v0.8-reference-candidate-inspection-batch5.md +232 -232
  138. package/docs/reports/v0.8-viewer-runtime-pwa-batch1.md +278 -278
  139. package/docs/reports/v0.8.1-implementation-completeness-documentation-reconciliation.md +114 -114
  140. package/docs/reports/v0.8.1-prerelease-readiness-cross-platform-security-code-rot.md +170 -170
  141. package/docs/reports/v0.9-architecture-retrieval.md +14 -37
  142. package/docs/reports/v0.9-final-pre-release-readiness.md +209 -209
  143. package/docs/reports/v0.9-final-readiness-corrections.md +530 -530
  144. package/docs/reports/v0.9-pre-release-readiness.md +169 -169
  145. package/docs/reports/v0.9.1-batch1-pwa-hard-gate-isolation.md +359 -359
  146. package/docs/reports/v0.9.1-batch2-hard-gate-validation-integration.md +262 -262
  147. package/docs/reports/v0.9.1-pre-release-readiness.md +206 -206
  148. package/package.json +59 -59
  149. package/dist/viewer/assets/index-BN41MI7m.css +0 -1
  150. package/dist/viewer/assets/index-CkKXnlrI.js +0 -9
@@ -1,237 +1,240 @@
1
- # Development
2
-
3
- The released v0.9.1 package is published as
4
- `@dailephd/my-frontend-observer@0.9.1` (CLI `my-frontend-observer`). It keeps
5
- the v0.8.1 project workflow and adds structured visual annotation.
6
-
7
- The v0.8.1 workflow is exercised through unit and real-Chromium tests. Project fixtures use `init`, `capture baseline`, and `check`; coding-agent consumers use bounded `check --json`. `tests/browser/projectCheckWorkflow.test.ts` covers REVIEW_REQUIRED, contract FAIL-to-PASS, reference FAIL/PASS/BLOCKED, incomparable BLOCKED, current history, and contained acceptance paths. `scripts/ci/runPackedViewerSmoke.mjs` is the single installed-package viewer/project-workflow smoke owner: it repeats REVIEW_REQUIRED and unchanged-contract FAIL-to-PASS before alias-aware viewer proof. Run the full unit, browser, security, build, documentation, and packed-consumer validations before release readiness.
8
-
9
- Install the current scaffold with `npm install`. Node.js 24+ is required.
10
-
11
- Since Batch 2, the package depends on `playwright` for the Chromium browser
12
- boundary. Install the browser binary once per machine with:
13
-
14
- ```powershell
15
- npx playwright install chromium
16
- ```
17
-
18
- The applicable foundation validation chain is:
19
-
20
- ```powershell
21
- npm run typecheck
22
- npm run lint
23
- npm test
24
- npm run test:browser
25
- npm run build
26
- npm run check:docs
27
- npm pack --dry-run
28
- ```
29
-
30
- `npm test` runs the fast unit suite only (`tests/unit/`; as of v0.8 Batch 8,
31
- 1156 passing tests across 63 files, including the v0.6 bounded-agent-context
32
- projection/correlation and v0.8 viewer-server coverage). `npm run
33
- test:browser` runs the real-Chromium integration suite (`tests/browser/`; as
34
- of v0.8 Batch 8, 178 passing tests across 19 files, including the v0.8
35
- viewer/PWA real-browser proof) against deterministic local fixtures under
36
- `tests/fixtures/` and requires the Chromium binary above to be installed
37
- first; it is kept out of `npm test` because it launches a real browser and
38
- is slower. Exact counts drift as the suite grows - run the commands above
39
- for the current numbers rather than trusting this document.
40
-
41
- ## Hard/security/acceptance gate isolation
42
-
43
- Tests explicitly designated `HARD GATE`, `SECURITY GATE`, or
44
- `ACCEPTANCE GATE` must be independently reproducible. A passing full suite is
45
- not sufficient evidence if the gate itself only succeeds because another test
46
- ran first or because a prior run left browser/cache/filesystem state behind.
47
-
48
- For browser-based gates, the gate must own or explicitly establish every
49
- precondition material to its claim. That includes disposable evidence state,
50
- servers, browser profiles/contexts, service-worker control, relevant cache
51
- state, and cleanup. Fixed persistent profiles must not be used as hidden
52
- fixtures for a hard acceptance claim.
53
-
54
- v0.9.1 applies this rule to the PWA server-down safety proof in
55
- `tests/browser/pwaHardening.test.ts`. The hard gate owns its evidence root,
56
- viewer server, temporary Chromium profile, and context. It must pass when
57
- selected alone and must also continue to pass in the complete browser and
58
- security suites.
59
-
60
- Run the gate by itself with:
61
-
62
- ```powershell
63
- npm run test:pwa-hard-gate
64
- ```
65
-
66
- Run this command when working on PWA, service-worker, viewer-server, or
67
- security behavior. It must pass on its own, not only after other tests have
68
- run. `npm run test:security` also runs it after the rest of the security
69
- suite. See `docs/plans/v0.9.1-implementation-plan.md`.
70
-
71
- ROADMAP v0.1 and Project Milestone 1 require browser-level validation once the
72
- observation capability is planned and implemented. Static checks must not later
73
- be substituted for that required browser evidence. `npm run test:browser` is
74
- that required browser evidence and covers the full source-checkout v0.1
75
- workflow end to end: page/target evidence, atomic artifact persistence, and
76
- the real `observe` CLI (including a built `node dist/cli.js observe ...`
77
- smoke run) are all implemented and covered, including a deterministic
78
- real-navigation-failure case (distinct from a readiness timeout or a
79
- pre-launch safety rejection).
80
-
81
- For maintainers validating the package boundary itself (not required for
82
- routine development): `npm pack --dry-run` inspects the tarball contents;
83
- installing the real tarball (`npm pack --json`, then `npm install
84
- <tarball>` in a clean temporary directory) and running the installed bin
85
- against a disposable local HTTP target is the way to confirm the packaged
86
- CLI performs a real observation independent of the source checkout. This is
87
- local package validation only, not a release procedure.
88
-
89
- `npm run test:security` runs only the safety-relevant subset of the suite
90
- (`tests/unit/policy.test.ts` plus the real-Chromium enforcement cases in
91
- `tests/browser/chromiumAdapter.test.ts`) - a discoverable entry point for
92
- security review tooling, not a replacement for `npm test`/`npm run
93
- test:browser`.
94
-
95
- `scripts/ci/runPackedObservationSmoke.mjs <tarball-path>` is the same
96
- packed-candidate smoke described above, packaged as a reusable script: it
97
- installs the given tarball into a fresh temporary consumer directory,
98
- installs Chromium via that consumer's own Playwright dependency, runs the
99
- installed bin against a disposable local HTTP target it creates itself, and
100
- validates the resulting artifact - exiting nonzero on any contract failure.
101
- It is what `.github/workflows/pre-release-readiness.yml` runs identically on
102
- Windows, Linux, and macOS against one shared candidate tarball (see
103
- `docs/CI_CD.md`); it can also be run locally the same way the workflow runs
104
- it. It is readiness/CI infrastructure only, not part of the published
105
- package and never imported by production code. In the same run it
106
- exercises the legacy CSS-shorthand `--target` packed-observation shape,
107
- the structured semantic `--targets-file` shape, a `window-scroll-by`
108
- scroll scenario, and a `target-scroll-by` scroll scenario - see
109
- `docs/CI_CD.md` for the current readiness coverage.
110
-
111
- `scripts/dev/builtCliTargetsFileSmoke.mjs` is a separate, narrower v0.2
112
- development smoke, added alongside the `--targets-file` implementation: it
113
- runs the built `dist/cli.js` directly (`node dist/cli.js observe
114
- --targets-file ...`) against an inline disposable local HTTP fixture and a
115
- temporary JSON target file, proving a real semantic observation persists a
116
- valid schema-`1.2.0` artifact with no packed-tarball step involved. Run it
117
- locally after `npm run build`:
118
-
119
- ```powershell
120
- node scripts/dev/builtCliTargetsFileSmoke.mjs
121
- ```
122
-
123
- `scripts/dev/builtCliScrollScenarioSmoke.mjs` is the v0.3 equivalent, added
124
- alongside the `--scroll-scenario-file` implementation: it runs the built
125
- `dist/cli.js` directly against an inline disposable local HTTP fixture,
126
- once with a temporary `window-scroll-by` scenario file and once with a
127
- temporary structured `--targets-file` plus a `target-scroll-by` scenario
128
- file, proving both real runtime scroll actions persist a valid
129
- schema-`1.2.0` artifact with populated `scrollScenarioEvidence`,
130
- scenario-file path privacy, and target-application immutability. Run it
131
- locally after `npm run build`:
132
-
133
- ```powershell
134
- node scripts/dev/builtCliScrollScenarioSmoke.mjs
135
- ```
136
-
137
- `scripts/dev/builtCliCompareSmoke.mjs` is the v0.4 equivalent, added
138
- alongside the `compare` command implementation (shipped as part of the
139
- published `0.4.0` package - see `docs/CURRENT_STATE.md`): it runs the built
140
- `dist/cli.js` twice as
141
- `observe` against an inline disposable local HTTP fixture whose served
142
- content changes deterministically between the two runs (a real moved/
143
- resized target, and a page-width transition from fitting to exceeding the
144
- viewport), then runs the built `dist/cli.js compare` against the two
145
- resulting persisted observation artifacts. It validates artifact kind/
146
- schema `1.0.0`, `comparability: "comparable"`, source observation
147
- references, at least one real `moved` difference and one real page-width
148
- relationship change, that the comparison directory contains `manifest.json`
149
- only, that no operational filesystem path leaked into the persisted
150
- manifest, and that both source observation manifests are byte-identical
151
- before and after the comparison ran. Run it locally after `npm run build`:
152
-
153
- ```powershell
154
- node scripts/dev/builtCliCompareSmoke.mjs
155
- ```
156
-
157
- `scripts/dev/builtCliFrontendContractsSmoke.mjs` is the v0.5 equivalent,
158
- added alongside the `approve-baseline`/`save-change-contract`/
159
- `evaluate-contract` command implementations (shipped as part of the
160
- published `0.5.0` package - see `docs/CURRENT_STATE.md`). Unlike the other dev smokes, it needs no Chromium
161
- at all: it hand-writes deterministic, schema-`1.2.0`-valid observation
162
- manifests directly to a temporary directory (preserving the public
163
- observation artifact contract without a real browser capture), then runs
164
- the built `dist/cli.js` for `compare`, `approve-baseline`,
165
- `save-change-contract`, and `evaluate-contract` - twice for the final
166
- step, once without `--enforce` and once with it, against the same
167
- milestone-signature contract (requested navigation shrink = pass, expected
168
- workspace expansion = pass, protected right-rail width = fail, preserved
169
- unclipped navigation = fail, overall = `FAIL`). It validates both exit
170
- codes (`0` without `--enforce`, nonzero with it), that both invocations
171
- persist byte-for-byte semantically identical evaluation evidence
172
- (`evaluationRequestId` and `clauseResults` equal), that the evaluation
173
- directory contains `manifest.json` only, that no operational filesystem
174
- path leaked into either persisted evaluation manifest, and that every
175
- source observation/comparison/contract artifact remains unmodified. Run it
176
- locally after `npm run build`:
177
-
178
- ```powershell
179
- node scripts/dev/builtCliFrontendContractsSmoke.mjs
180
- ```
181
-
182
- `scripts/dev/builtCliFrontendContractsBrowserSmoke.mjs` is the v0.5 Batch 5
183
- real-browser equivalent, added alongside
184
- `tests/browser/cliFrontendContracts.test.ts`. Unlike the Chromium-free
185
- `scripts/dev/builtCliFrontendContractsSmoke.mjs` above, this one launches a
186
- real disposable local HTTP fixture and real Playwright Chromium, then drives
187
- the built `dist/cli.js` through the complete `observe` → `approve-baseline`
188
- → `save-change-contract` → `observe` → `compare` → `evaluate-contract`
189
- sequence twice: once against a candidate whose served content produces a
190
- fully successful contract change (all clauses `pass`, overall `PASS`), and
191
- once against a candidate that reproduces the milestone-signature failure - a
192
- real observed navigation clipping regression and a real observed right-rail
193
- width regression alongside an otherwise-successful requested/expected-
194
- dependent change (overall `FAIL`). It validates the same `--enforce`
195
- exit-code/identity behavior, screenshot-free evaluation directory, source
196
- immutability, and path-privacy properties as the Chromium-free smoke, but
197
- against genuine rendered geometry instead of hand-constructed artifacts. Run
198
- it locally after `npm run build` (Chromium must already be installed):
199
-
200
- ```powershell
201
- node scripts/dev/builtCliFrontendContractsBrowserSmoke.mjs
202
- ```
203
-
204
- Since v0.8 Batch 1, `npm run build` also builds the browser-side viewer app
205
- (`viewer/`) with Vite into `dist/viewer` (see `docs/ARCHITECTURE.md` "v0.8
206
- Batch 1"). `npm run typecheck` additionally type-checks `viewer/tsconfig.json`
207
- alongside the existing `tsconfig.json`. To smoke-test the built viewer
208
- locally after `npm run build`:
209
-
210
- ```powershell
211
- node dist/cli.js view --root <evidence-root> --no-open
212
- ```
213
-
214
- optionally adding `--bindings-file <json-file>` and/or `--context-file
215
- <json-file>` (see `docs/COMMANDS.md#view` for their exact shapes), then open
216
- the printed `http://127.0.0.1:4319` URL in a browser (or stop with Ctrl+C).
217
- This starts a real, loopback-only server serving the actual built PWA. As of
218
- v0.8 (all eight implementation batches), it reads `--root` only for bounded,
219
- read-only evidence discovery through the existing canonical
220
- readers/classifiers - it never writes to `--root` or modifies any artifact
221
- under it. The v0.9 annotation authoring surface (implemented, not yet
222
- released) is available only from the project-aware `node dist/cli.js view`
223
- inside an initialized project, never from `--root`. Its end-to-end browser
224
- proof is `tests/browser/v09IntegratedAcceptance.test.ts`, and its packed
225
- installed proof is `scripts/ci/runPackedV09AnnotationSmoke.mjs`.
226
-
227
- Unlike `scripts/ci/runPackedObservationSmoke.mjs`, none of these five dev
228
- smokes is wired into any CI workflow or is a release gate - they are
229
- source-checkout development evidence only, proving the built CLI's
230
- `--targets-file`/`--scroll-scenario-file`/`compare`/frontend-contract
231
- command behavior without installing a packed tarball or requiring
232
- cross-platform infrastructure. None is part of the published package.
233
- Cross-platform packed validation of the v0.1-v0.5 observation/compare/
234
- contract behavior is `scripts/ci/runPackedObservationSmoke.mjs`'s
235
- responsibility (see `docs/CI_CD.md`) - the same script, against the same
236
- single candidate tarball per platform, now including the v0.5 contract/
237
- evaluation CLI.
1
+ # Development
2
+
3
+ The current released package is
4
+ `@dailephd/my-frontend-observer@0.10.1` (CLI `my-frontend-observer`). It
5
+ includes the v0.8.1 project workflow, structured visual annotation, and the
6
+ v0.10 Visual Change workflow and v0.10.1 project-check baseline-context
7
+ replay. Explicit-state replay preserves declared identity metadata and does
8
+ not establish application or session state.
9
+
10
+ The v0.8.1 workflow is exercised through unit and real-Chromium tests. Project fixtures use `init`, `capture baseline`, and `check`; coding-agent consumers use bounded `check --json`. `tests/browser/projectCheckWorkflow.test.ts` covers REVIEW_REQUIRED, contract FAIL-to-PASS, reference FAIL/PASS/BLOCKED, incomparable BLOCKED, current history, and contained acceptance paths. `scripts/ci/runPackedViewerSmoke.mjs` is the single installed-package viewer/project-workflow smoke owner: it repeats REVIEW_REQUIRED and unchanged-contract FAIL-to-PASS before alias-aware viewer proof. Run the full unit, browser, security, build, documentation, and packed-consumer validations before release readiness.
11
+
12
+ Install the current scaffold with `npm install`. Node.js 24+ is required.
13
+
14
+ Since Batch 2, the package depends on `playwright` for the Chromium browser
15
+ boundary. Install the browser binary once per machine with:
16
+
17
+ ```powershell
18
+ npx playwright install chromium
19
+ ```
20
+
21
+ The applicable foundation validation chain is:
22
+
23
+ ```powershell
24
+ npm run typecheck
25
+ npm run lint
26
+ npm test
27
+ npm run test:browser
28
+ npm run build
29
+ npm run check:docs
30
+ npm pack --dry-run
31
+ ```
32
+
33
+ `npm test` runs the fast unit suite only (`tests/unit/`; as of v0.8 Batch 8,
34
+ 1156 passing tests across 63 files, including the v0.6 bounded-agent-context
35
+ projection/correlation and v0.8 viewer-server coverage). `npm run
36
+ test:browser` runs the real-Chromium integration suite (`tests/browser/`; as
37
+ of v0.8 Batch 8, 178 passing tests across 19 files, including the v0.8
38
+ viewer/PWA real-browser proof) against deterministic local fixtures under
39
+ `tests/fixtures/` and requires the Chromium binary above to be installed
40
+ first; it is kept out of `npm test` because it launches a real browser and
41
+ is slower. Exact counts drift as the suite grows - run the commands above
42
+ for the current numbers rather than trusting this document.
43
+
44
+ ## Hard/security/acceptance gate isolation
45
+
46
+ Tests explicitly designated `HARD GATE`, `SECURITY GATE`, or
47
+ `ACCEPTANCE GATE` must be independently reproducible. A passing full suite is
48
+ not sufficient evidence if the gate itself only succeeds because another test
49
+ ran first or because a prior run left browser/cache/filesystem state behind.
50
+
51
+ For browser-based gates, the gate must own or explicitly establish every
52
+ precondition material to its claim. That includes disposable evidence state,
53
+ servers, browser profiles/contexts, service-worker control, relevant cache
54
+ state, and cleanup. Fixed persistent profiles must not be used as hidden
55
+ fixtures for a hard acceptance claim.
56
+
57
+ v0.9.1 applies this rule to the PWA server-down safety proof in
58
+ `tests/browser/pwaHardening.test.ts`. The hard gate owns its evidence root,
59
+ viewer server, temporary Chromium profile, and context. It must pass when
60
+ selected alone and must also continue to pass in the complete browser and
61
+ security suites.
62
+
63
+ Run the gate by itself with:
64
+
65
+ ```powershell
66
+ npm run test:pwa-hard-gate
67
+ ```
68
+
69
+ Run this command when working on PWA, service-worker, viewer-server, or
70
+ security behavior. It must pass on its own, not only after other tests have
71
+ run. `npm run test:security` also runs it after the rest of the security
72
+ suite. See `docs/plans/v0.9.1-implementation-plan.md`.
73
+
74
+ ROADMAP v0.1 and Project Milestone 1 require browser-level validation once the
75
+ observation capability is planned and implemented. Static checks must not later
76
+ be substituted for that required browser evidence. `npm run test:browser` is
77
+ that required browser evidence and covers the full source-checkout v0.1
78
+ workflow end to end: page/target evidence, atomic artifact persistence, and
79
+ the real `observe` CLI (including a built `node dist/cli.js observe ...`
80
+ smoke run) are all implemented and covered, including a deterministic
81
+ real-navigation-failure case (distinct from a readiness timeout or a
82
+ pre-launch safety rejection).
83
+
84
+ For maintainers validating the package boundary itself (not required for
85
+ routine development): `npm pack --dry-run` inspects the tarball contents;
86
+ installing the real tarball (`npm pack --json`, then `npm install
87
+ <tarball>` in a clean temporary directory) and running the installed bin
88
+ against a disposable local HTTP target is the way to confirm the packaged
89
+ CLI performs a real observation independent of the source checkout. This is
90
+ local package validation only, not a release procedure.
91
+
92
+ `npm run test:security` runs only the safety-relevant subset of the suite
93
+ (`tests/unit/policy.test.ts` plus the real-Chromium enforcement cases in
94
+ `tests/browser/chromiumAdapter.test.ts`) - a discoverable entry point for
95
+ security review tooling, not a replacement for `npm test`/`npm run
96
+ test:browser`.
97
+
98
+ `scripts/ci/runPackedObservationSmoke.mjs <tarball-path>` is the same
99
+ packed-candidate smoke described above, packaged as a reusable script: it
100
+ installs the given tarball into a fresh temporary consumer directory,
101
+ installs Chromium via that consumer's own Playwright dependency, runs the
102
+ installed bin against a disposable local HTTP target it creates itself, and
103
+ validates the resulting artifact - exiting nonzero on any contract failure.
104
+ It is what `.github/workflows/pre-release-readiness.yml` runs identically on
105
+ Windows, Linux, and macOS against one shared candidate tarball (see
106
+ `docs/CI_CD.md`); it can also be run locally the same way the workflow runs
107
+ it. It is readiness/CI infrastructure only, not part of the published
108
+ package and never imported by production code. In the same run it
109
+ exercises the legacy CSS-shorthand `--target` packed-observation shape,
110
+ the structured semantic `--targets-file` shape, a `window-scroll-by`
111
+ scroll scenario, and a `target-scroll-by` scroll scenario - see
112
+ `docs/CI_CD.md` for the current readiness coverage.
113
+
114
+ `scripts/dev/builtCliTargetsFileSmoke.mjs` is a separate, narrower v0.2
115
+ development smoke, added alongside the `--targets-file` implementation: it
116
+ runs the built `dist/cli.js` directly (`node dist/cli.js observe
117
+ --targets-file ...`) against an inline disposable local HTTP fixture and a
118
+ temporary JSON target file, proving a real semantic observation persists a
119
+ valid schema-`1.2.0` artifact with no packed-tarball step involved. Run it
120
+ locally after `npm run build`:
121
+
122
+ ```powershell
123
+ node scripts/dev/builtCliTargetsFileSmoke.mjs
124
+ ```
125
+
126
+ `scripts/dev/builtCliScrollScenarioSmoke.mjs` is the v0.3 equivalent, added
127
+ alongside the `--scroll-scenario-file` implementation: it runs the built
128
+ `dist/cli.js` directly against an inline disposable local HTTP fixture,
129
+ once with a temporary `window-scroll-by` scenario file and once with a
130
+ temporary structured `--targets-file` plus a `target-scroll-by` scenario
131
+ file, proving both real runtime scroll actions persist a valid
132
+ schema-`1.2.0` artifact with populated `scrollScenarioEvidence`,
133
+ scenario-file path privacy, and target-application immutability. Run it
134
+ locally after `npm run build`:
135
+
136
+ ```powershell
137
+ node scripts/dev/builtCliScrollScenarioSmoke.mjs
138
+ ```
139
+
140
+ `scripts/dev/builtCliCompareSmoke.mjs` is the v0.4 equivalent, added
141
+ alongside the `compare` command implementation (shipped as part of the
142
+ published `0.4.0` package - see `docs/CURRENT_STATE.md`): it runs the built
143
+ `dist/cli.js` twice as
144
+ `observe` against an inline disposable local HTTP fixture whose served
145
+ content changes deterministically between the two runs (a real moved/
146
+ resized target, and a page-width transition from fitting to exceeding the
147
+ viewport), then runs the built `dist/cli.js compare` against the two
148
+ resulting persisted observation artifacts. It validates artifact kind/
149
+ schema `1.0.0`, `comparability: "comparable"`, source observation
150
+ references, at least one real `moved` difference and one real page-width
151
+ relationship change, that the comparison directory contains `manifest.json`
152
+ only, that no operational filesystem path leaked into the persisted
153
+ manifest, and that both source observation manifests are byte-identical
154
+ before and after the comparison ran. Run it locally after `npm run build`:
155
+
156
+ ```powershell
157
+ node scripts/dev/builtCliCompareSmoke.mjs
158
+ ```
159
+
160
+ `scripts/dev/builtCliFrontendContractsSmoke.mjs` is the v0.5 equivalent,
161
+ added alongside the `approve-baseline`/`save-change-contract`/
162
+ `evaluate-contract` command implementations (shipped as part of the
163
+ published `0.5.0` package - see `docs/CURRENT_STATE.md`). Unlike the other dev smokes, it needs no Chromium
164
+ at all: it hand-writes deterministic, schema-`1.2.0`-valid observation
165
+ manifests directly to a temporary directory (preserving the public
166
+ observation artifact contract without a real browser capture), then runs
167
+ the built `dist/cli.js` for `compare`, `approve-baseline`,
168
+ `save-change-contract`, and `evaluate-contract` - twice for the final
169
+ step, once without `--enforce` and once with it, against the same
170
+ milestone-signature contract (requested navigation shrink = pass, expected
171
+ workspace expansion = pass, protected right-rail width = fail, preserved
172
+ unclipped navigation = fail, overall = `FAIL`). It validates both exit
173
+ codes (`0` without `--enforce`, nonzero with it), that both invocations
174
+ persist byte-for-byte semantically identical evaluation evidence
175
+ (`evaluationRequestId` and `clauseResults` equal), that the evaluation
176
+ directory contains `manifest.json` only, that no operational filesystem
177
+ path leaked into either persisted evaluation manifest, and that every
178
+ source observation/comparison/contract artifact remains unmodified. Run it
179
+ locally after `npm run build`:
180
+
181
+ ```powershell
182
+ node scripts/dev/builtCliFrontendContractsSmoke.mjs
183
+ ```
184
+
185
+ `scripts/dev/builtCliFrontendContractsBrowserSmoke.mjs` is the v0.5 Batch 5
186
+ real-browser equivalent, added alongside
187
+ `tests/browser/cliFrontendContracts.test.ts`. Unlike the Chromium-free
188
+ `scripts/dev/builtCliFrontendContractsSmoke.mjs` above, this one launches a
189
+ real disposable local HTTP fixture and real Playwright Chromium, then drives
190
+ the built `dist/cli.js` through the complete `observe` → `approve-baseline`
191
+ → `save-change-contract` → `observe` → `compare` → `evaluate-contract`
192
+ sequence twice: once against a candidate whose served content produces a
193
+ fully successful contract change (all clauses `pass`, overall `PASS`), and
194
+ once against a candidate that reproduces the milestone-signature failure - a
195
+ real observed navigation clipping regression and a real observed right-rail
196
+ width regression alongside an otherwise-successful requested/expected-
197
+ dependent change (overall `FAIL`). It validates the same `--enforce`
198
+ exit-code/identity behavior, screenshot-free evaluation directory, source
199
+ immutability, and path-privacy properties as the Chromium-free smoke, but
200
+ against genuine rendered geometry instead of hand-constructed artifacts. Run
201
+ it locally after `npm run build` (Chromium must already be installed):
202
+
203
+ ```powershell
204
+ node scripts/dev/builtCliFrontendContractsBrowserSmoke.mjs
205
+ ```
206
+
207
+ Since v0.8 Batch 1, `npm run build` also builds the browser-side viewer app
208
+ (`viewer/`) with Vite into `dist/viewer` (see `docs/ARCHITECTURE.md` "v0.8
209
+ Batch 1"). `npm run typecheck` additionally type-checks `viewer/tsconfig.json`
210
+ alongside the existing `tsconfig.json`. To smoke-test the built viewer
211
+ locally after `npm run build`:
212
+
213
+ ```powershell
214
+ node dist/cli.js view --root <evidence-root> --no-open
215
+ ```
216
+
217
+ optionally adding `--bindings-file <json-file>` and/or `--context-file
218
+ <json-file>` (see `docs/COMMANDS.md#view` for their exact shapes), then open
219
+ the printed `http://127.0.0.1:4319` URL in a browser (or stop with Ctrl+C).
220
+ This starts a real, loopback-only server serving the actual built PWA. As of
221
+ v0.8 (all eight implementation batches), it reads `--root` only for bounded,
222
+ read-only evidence discovery through the existing canonical
223
+ readers/classifiers - it never writes to `--root` or modifies any artifact
224
+ under it. The v0.9 annotation authoring surface (implemented, not yet
225
+ released) is available only from the project-aware `node dist/cli.js view`
226
+ inside an initialized project, never from `--root`. Its end-to-end browser
227
+ proof is `tests/browser/v09IntegratedAcceptance.test.ts`, and its packed
228
+ installed proof is `scripts/ci/runPackedV09AnnotationSmoke.mjs`.
229
+
230
+ Unlike `scripts/ci/runPackedObservationSmoke.mjs`, none of these five dev
231
+ smokes is wired into any CI workflow or is a release gate - they are
232
+ source-checkout development evidence only, proving the built CLI's
233
+ `--targets-file`/`--scroll-scenario-file`/`compare`/frontend-contract
234
+ command behavior without installing a packed tarball or requiring
235
+ cross-platform infrastructure. None is part of the published package.
236
+ Cross-platform packed validation of the v0.1-v0.5 observation/compare/
237
+ contract behavior is `scripts/ci/runPackedObservationSmoke.mjs`'s
238
+ responsibility (see `docs/CI_CD.md`) - the same script, against the same
239
+ single candidate tarball per platform, now including the v0.5 contract/
240
+ evaluation CLI.
@@ -1,50 +1,50 @@
1
- # Documentation Preservation Policy
2
-
3
- Current explicit user decisions have highest authority. The complete
4
- repository-local Project Description then owns durable product intent, and the
5
- complete repository-local Project Milestones owns capability ordering, major
6
- requirements, acceptance expectations, and cross-milestone rules. ROADMAP
7
- derives version-level direction from both. Actual repository evidence is the
8
- authority for claims about current implementation and release state. Accepted
9
- greenfield artifacts may prove an approved design decision but do not alone
10
- prove implementation. Reconnaissance informs decisions but does not replace
11
- intent.
12
-
13
- Responsibilities are distinct:
14
-
15
- - `PROJECT_DESCRIPTION.md` contains complete durable product intent, the three
16
- primary jobs, long-term product model, principles, and ecosystem boundaries.
17
- - `PROJECT_MILESTONES.md` contains the complete ordered capability design,
18
- acceptance expectations, and cross-milestone rules.
19
- - `ROADMAP.md` owns version-level goals, constraints, dependencies, exclusions,
20
- ecosystem implications, acceptance, and unresolved planning decisions.
21
- - `docs/plans/<version>-implementation-plan.md`, when present, owns the frozen
22
- concrete implementation plan produced at version start after the roadmap and
23
- current repository state have been inspected. It may contain implementation
24
- architecture decisions, batch structure, sequencing, batch acceptance gates,
25
- validation expectations, explicit exclusions, and the post-implementation
26
- handoff into documentation reconciliation and release-readiness workflows.
27
- It is a planning authority only and never proves that a batch or version was
28
- actually implemented.
29
- - `CURRENT_STATE.md` describes only actual implementation, scaffold, validation,
30
- and release state.
31
- - `ARCHITECTURE.md` describes implemented architecture and may include clearly
32
- labeled durable or planned extension constraints.
33
- - `PROJECT_OVERVIEW.md` is concise navigation and orientation; it does not
34
- replace the complete authorities.
35
-
36
- Once a version-specific implementation plan is explicitly frozen, coding-agent
37
- prompts for that version must preserve its scope and batch order unless the user
38
- explicitly revises the plan. Batch execution reports may document what happened
39
- but do not silently rewrite the plan. If implementation evidence requires a
40
- change, record the explicit plan revision in the version plan before subsequent
41
- batches are treated as governed by the new sequence.
42
-
43
- ROADMAP must not override Project Description or Project Milestones on durable
44
- intent, and it must never contain prewritten implementation batches, command
45
- transcripts, or execution bookkeeping. A version plan must not promote a
46
- future-version capability into the current version or contradict the roadmap's
47
- version-level scope. Current-state documents do not override future product
48
- intent merely because implementation is incomplete. Before deleting,
49
- relocating, or replacing a source document, verify that all unique information
50
- and useful historical provenance remain.
1
+ # Documentation Preservation Policy
2
+
3
+ Current explicit user decisions have highest authority. The complete
4
+ repository-local Project Description then owns durable product intent, and the
5
+ complete repository-local Project Milestones owns capability ordering, major
6
+ requirements, acceptance expectations, and cross-milestone rules. ROADMAP
7
+ derives version-level direction from both. Actual repository evidence is the
8
+ authority for claims about current implementation and release state. Accepted
9
+ greenfield artifacts may prove an approved design decision but do not alone
10
+ prove implementation. Reconnaissance informs decisions but does not replace
11
+ intent.
12
+
13
+ Responsibilities are distinct:
14
+
15
+ - `PROJECT_DESCRIPTION.md` contains complete durable product intent, the three
16
+ primary jobs, long-term product model, principles, and ecosystem boundaries.
17
+ - `PROJECT_MILESTONES.md` contains the complete ordered capability design,
18
+ acceptance expectations, and cross-milestone rules.
19
+ - `ROADMAP.md` owns version-level goals, constraints, dependencies, exclusions,
20
+ ecosystem implications, acceptance, and unresolved planning decisions.
21
+ - `docs/plans/<version>-implementation-plan.md`, when present, owns the frozen
22
+ concrete implementation plan produced at version start after the roadmap and
23
+ current repository state have been inspected. It may contain implementation
24
+ architecture decisions, batch structure, sequencing, batch acceptance gates,
25
+ validation expectations, explicit exclusions, and the post-implementation
26
+ handoff into documentation reconciliation and release-readiness workflows.
27
+ It is a planning authority only and never proves that a batch or version was
28
+ actually implemented.
29
+ - `CURRENT_STATE.md` describes only actual implementation, scaffold, validation,
30
+ and release state.
31
+ - `ARCHITECTURE.md` describes implemented architecture and may include clearly
32
+ labeled durable or planned extension constraints.
33
+ - `PROJECT_OVERVIEW.md` is concise navigation and orientation; it does not
34
+ replace the complete authorities.
35
+
36
+ Once a version-specific implementation plan is explicitly frozen, coding-agent
37
+ prompts for that version must preserve its scope and batch order unless the user
38
+ explicitly revises the plan. Batch execution reports may document what happened
39
+ but do not silently rewrite the plan. If implementation evidence requires a
40
+ change, record the explicit plan revision in the version plan before subsequent
41
+ batches are treated as governed by the new sequence.
42
+
43
+ ROADMAP must not override Project Description or Project Milestones on durable
44
+ intent, and it must never contain prewritten implementation batches, command
45
+ transcripts, or execution bookkeeping. A version plan must not promote a
46
+ future-version capability into the current version or contradict the roadmap's
47
+ version-level scope. Current-state documents do not override future product
48
+ intent merely because implementation is incomplete. Before deleting,
49
+ relocating, or replacing a source document, verify that all unique information
50
+ and useful historical provenance remain.