my-frontend-observer 0.4.0 → 0.5.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 (53) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +39 -11
  3. package/dist/application/frontendContractEvaluationService.d.ts +49 -0
  4. package/dist/application/frontendContractEvaluationService.js +112 -0
  5. package/dist/application/frontendContractEvaluationService.js.map +1 -0
  6. package/dist/application/frontendContractPersistenceService.d.ts +56 -0
  7. package/dist/application/frontendContractPersistenceService.js +91 -0
  8. package/dist/application/frontendContractPersistenceService.js.map +1 -0
  9. package/dist/artifacts/comparisonArtifactReader.d.ts +18 -0
  10. package/dist/artifacts/comparisonArtifactReader.js +35 -0
  11. package/dist/artifacts/comparisonArtifactReader.js.map +1 -0
  12. package/dist/artifacts/frontendContractArtifactReader.d.ts +24 -0
  13. package/dist/artifacts/frontendContractArtifactReader.js +47 -0
  14. package/dist/artifacts/frontendContractArtifactReader.js.map +1 -0
  15. package/dist/artifacts/frontendContractArtifactWriter.d.ts +34 -0
  16. package/dist/artifacts/frontendContractArtifactWriter.js +70 -0
  17. package/dist/artifacts/frontendContractArtifactWriter.js.map +1 -0
  18. package/dist/artifacts/frontendContractEvaluationArtifactReader.d.ts +17 -0
  19. package/dist/artifacts/frontendContractEvaluationArtifactReader.js +34 -0
  20. package/dist/artifacts/frontendContractEvaluationArtifactReader.js.map +1 -0
  21. package/dist/artifacts/frontendContractEvaluationArtifactWriter.d.ts +32 -0
  22. package/dist/artifacts/frontendContractEvaluationArtifactWriter.js +58 -0
  23. package/dist/artifacts/frontendContractEvaluationArtifactWriter.js.map +1 -0
  24. package/dist/cli.js +496 -6
  25. package/dist/cli.js.map +1 -1
  26. package/dist/domain/frontendContractEvaluation.d.ts +57 -0
  27. package/dist/domain/frontendContractEvaluation.js +454 -0
  28. package/dist/domain/frontendContractEvaluation.js.map +1 -0
  29. package/dist/domain/frontendContractEvaluationArtifact.d.ts +65 -0
  30. package/dist/domain/frontendContractEvaluationArtifact.js +108 -0
  31. package/dist/domain/frontendContractEvaluationArtifact.js.map +1 -0
  32. package/dist/domain/frontendContractIdentity.d.ts +39 -0
  33. package/dist/domain/frontendContractIdentity.js +70 -0
  34. package/dist/domain/frontendContractIdentity.js.map +1 -0
  35. package/dist/domain/frontendContracts.d.ts +188 -0
  36. package/dist/domain/frontendContracts.js +260 -0
  37. package/dist/domain/frontendContracts.js.map +1 -0
  38. package/dist/index.d.ts +22 -0
  39. package/dist/index.js +12 -0
  40. package/dist/index.js.map +1 -1
  41. package/docs/ARCHITECTURE.md +98 -1
  42. package/docs/CI_CD.md +47 -0
  43. package/docs/COMMANDS.md +162 -0
  44. package/docs/CONTRACTS.md +175 -3
  45. package/docs/CURRENT_STATE.md +92 -10
  46. package/docs/DEVELOPMENT.md +58 -10
  47. package/docs/PROJECT_OVERVIEW.md +19 -13
  48. package/docs/QUICKSTART.md +5 -0
  49. package/docs/RELEASE.md +17 -10
  50. package/docs/ROADMAP.md +6 -0
  51. package/docs/SECURITY.md +13 -1
  52. package/docs/WORKFLOWS.md +65 -8
  53. package/package.json +1 -1
package/docs/RELEASE.md CHANGED
@@ -1,18 +1,25 @@
1
1
  # Release
2
2
 
3
- `v0.4.0` is published to npm as `my-frontend-observer`, validated on
3
+ `v0.5.0` is published to npm as `my-frontend-observer`, validated on
4
4
  Windows, Linux, and macOS as an installed packed-tarball consumer prior to
5
5
  publication (covering the legacy CSS-shorthand `--target` path, the
6
6
  structured semantic `--targets-file` path, the bounded
7
7
  `--scroll-scenario-file` `window-scroll-by`/`target-scroll-by` runtime
8
- scroll scenario path, and the installed `compare` command's comparable and
9
- incomparable cases). No project license has been declared yet; that
10
- decision remains open for a later explicit task.
8
+ scroll scenario path, the installed `compare` command's comparable and
9
+ incomparable cases, and the installed `approve-baseline`/
10
+ `save-change-contract`/`evaluate-contract` frontend contract commands -
11
+ including both a fully successful contract change and the milestone-
12
+ signature failure, with `--enforce` exit-status behavior). No project
13
+ license has been declared yet; that decision remains open for a later
14
+ explicit task.
11
15
 
12
- Observation, comparison, and package version remain separate: package
13
- version is `0.4.0`; observation schema is `1.2.0` and comparison schema is
14
- `1.0.0`, neither of which changes automatically with the package version.
16
+ Observation, comparison, frontend contract, evaluation artifact, and package
17
+ version all remain separate: package version is `0.5.0`; observation schema
18
+ is `1.2.0`, comparison schema is `1.0.0`, frontend contract schema is
19
+ `1.0.0`, and evaluation artifact schema is `1.0.0` - none of which changes
20
+ automatically with the package version.
15
21
 
16
- Prior releases: `v0.3.0` (Runtime Scrolling, Overflow, and Visibility
17
- Behavior), `v0.2.0` (Stable Semantic Targets and Region Identity), `v0.1.0`
18
- (Runtime Observation Foundation) - see `CHANGELOG.md`.
22
+ Prior releases: `v0.4.0` (Layout Relationships, Dependency Evidence, and
23
+ Before/After Comparison), `v0.3.0` (Runtime Scrolling, Overflow, and
24
+ Visibility Behavior), `v0.2.0` (Stable Semantic Targets and Region
25
+ Identity), `v0.1.0` (Runtime Observation Foundation) - see `CHANGELOG.md`.
package/docs/ROADMAP.md CHANGED
@@ -94,6 +94,12 @@ Planning must settle comparability and tolerance semantics.
94
94
 
95
95
  ## v0.5 — Executable Frontend Contracts and Explicit Change Scope
96
96
 
97
+ Current status: released as `0.5.0`, published to npm and validated as a
98
+ packed npm tarball in a clean consumer environment on Windows, Linux, and
99
+ macOS (observation schema `1.2.0`, comparison schema `1.0.0`, frontend
100
+ contract schema `1.0.0`, evaluation artifact schema `1.0.0`). See
101
+ `docs/CURRENT_STATE.md` for the implementation summary.
102
+
97
103
  Objective/problem: prevent a requested local fix from silently breaking an
98
104
  approved region or invariant. Required capabilities are baseline invariants,
99
105
  requested/expected-dependent/protected/preserved classifications, explicit
package/docs/SECURITY.md CHANGED
@@ -37,12 +37,24 @@ comparison, and writes one local comparison `manifest.json`
37
37
  as JSON only and is never executed (no `eval`, no dynamic code loading from
38
38
  a manifest).
39
39
 
40
+ ## Frontend contracts (`approve-baseline`/`save-change-contract`/`evaluate-contract`, shipped as part of the published `0.5.0` package)
41
+
42
+ These three commands introduce no new browser or network surface:
43
+ `src/application/frontendContractPersistenceService.ts` and
44
+ `src/application/frontendContractEvaluationService.ts` import nothing from
45
+ `src/browser/` and never launch Chromium. `approve-baseline` and
46
+ `save-change-contract` validate and persist a local JSON contract file
47
+ (parsed as JSON only, never executed); `evaluate-contract` reads
48
+ already-persisted local observation/comparison/contract artifacts and runs
49
+ the pure `evaluateFrontendContract` function. None of the three navigates,
50
+ re-observes a target, or contacts a network resource.
51
+
40
52
  ## Not yet addressed
41
53
 
42
54
  Certificate-failure-specific handling, permission-prompt-specific handling
43
55
  (Chromium's default deny-all applies; no permission is ever explicitly
44
56
  granted), and any non-loopback/remote browsing mode remain unimplemented and
45
- out of scope. `my-frontend-observer@0.4.0` is published to npm, and a
57
+ out of scope. `my-frontend-observer@0.5.0` is published to npm, and a
46
58
  pre-release readiness CI workflow (Windows/Linux/macOS packed-candidate
47
59
  validation) already exists (see `docs/CI_CD.md`); these are no longer future
48
60
  decisions. Those facts do not expand the security scope above: remote
package/docs/WORKFLOWS.md CHANGED
@@ -11,9 +11,9 @@ install dependencies (npm install; npx playwright install chromium)
11
11
  → validate documentation (npm run check:docs)
12
12
  ```
13
13
 
14
- ## Current observation workflow (published as 0.4.0)
14
+ ## Current observation workflow (published as 0.5.0)
15
15
 
16
- The real `observe` workflow, part of the published `my-frontend-observer@0.4.0`
16
+ The real `observe` workflow, part of the published `my-frontend-observer@0.5.0`
17
17
  package, accepts target configuration through either of two input paths,
18
18
  plus one optional runtime scroll scenario:
19
19
 
@@ -62,10 +62,10 @@ temporary consumer directory outside the repository, on Windows, Linux, and
62
62
  macOS (`scripts/ci/runPackedObservationSmoke.mjs`) - the same workflow,
63
63
  independent of the source checkout.
64
64
 
65
- ## Current comparison workflow (published as 0.4.0)
65
+ ## Current comparison workflow (published as 0.5.0)
66
66
 
67
67
  **Current status: shipped as part of the published `my-frontend-observer@0.4.0`
68
- package.** This is a separate workflow from the observation workflow above -
68
+ package (unchanged in `0.5.0`).** This is a separate workflow from the observation workflow above -
69
69
  it consumes two already-persisted observation artifacts rather than
70
70
  producing one, and it never launches a browser:
71
71
 
@@ -110,12 +110,69 @@ fixture (`scripts/dev/builtCliCompareSmoke.mjs`), and packed-tarball
110
110
  validation of the installed `compare` command
111
111
  (`scripts/ci/runPackedObservationSmoke.mjs` - see `docs/CI_CD.md`).
112
112
 
113
+ ## Current frontend contract workflow (published as 0.5.0)
114
+
115
+ This is a text/config-driven workflow layered downstream of the two
116
+ workflows above - it does not replace them, and it is not yet the complete
117
+ v0.7 coding-agent workflow (no bounded agent context, no automatic
118
+ baseline selection, no CLI-level approval policy beyond the explicit
119
+ `approve-baseline` act):
120
+
121
+ ```text
122
+ observe before
123
+ observe after
124
+ compare
125
+ ↓
126
+ approve baseline (approve-baseline --observation <before-root>
127
+ --contract-file <PersistentBaselineContract.json> --output <dir>)
128
+ ↓
129
+ save per-change contract (save-change-contract
130
+ --contract-file <PerChangeContract.json> --output <dir>)
131
+ ↓
132
+ evaluate contract (evaluate-contract --before <root> --after <root>
133
+ --comparison <root> --baseline <root> --change <root> --output <dir>
134
+ [--enforce])
135
+ ↓
136
+ persisted evaluation artifact (schema 1.0.0, its own independent family):
137
+ clause results (pass/fail/unavailable/conflict), unexpected changes,
138
+ overall PASS/FAIL
139
+ ```
140
+
141
+ `approve-baseline` is the only baseline-approval act; a successful `compare`
142
+ or a `PASS` evaluation never approves or supersedes a baseline
143
+ automatically. `evaluate-contract` never launches a browser and never
144
+ recomputes comparison/relationship evidence - it calls the canonical
145
+ `evaluateFrontendContract` exactly once against the supplied evidence and
146
+ persists exactly one evaluation artifact, whether the verdict is `PASS` or
147
+ `FAIL`. `--enforce` affects only the process exit status for a `FAIL`
148
+ verdict, never the persisted evidence itself.
149
+
150
+ This is exercised by `runCli()`-level tests
151
+ (`tests/unit/cliFrontendContracts.test.ts`), a built `node dist/cli.js`
152
+ smoke that needs no Chromium
153
+ (`scripts/dev/builtCliFrontendContractsSmoke.mjs`), a real-Chromium
154
+ end-to-end test (`tests/browser/cliFrontendContracts.test.ts`), and a
155
+ real-Chromium built-CLI smoke
156
+ (`scripts/dev/builtCliFrontendContractsBrowserSmoke.mjs` - see
157
+ `docs/DEVELOPMENT.md`). The real-browser coverage proves both a fully
158
+ successful contract change and the "milestone signature" failure (a locally
159
+ successful requested change coexisting with a genuine protected-property
160
+ regression and a genuine preserved-invariant regression) against actual
161
+ rendered geometry, not hand-constructed artifacts. It is also part of
162
+ packed-tarball validation: `scripts/ci/runPackedObservationSmoke.mjs`
163
+ exercises the installed candidate's `approve-baseline`/`save-change-contract`/
164
+ `evaluate-contract` commands against real installed-candidate `observe`/
165
+ `compare` evidence, proven on Windows, Linux, and macOS (see
166
+ `docs/CI_CD.md`).
167
+
113
168
  ## Future workflows
114
169
 
115
170
  ```text
116
171
  stable targets and bounded runtime behavior
117
172
  → relationships and before/after comparison (released - see above)
118
- → safe-change contracts
173
+ → safe-change contracts (contract model, evaluation, persistence, and CLI
174
+ released as 0.5.0 - see above; baseline approval remains a single explicit
175
+ command, not a policy engine)
119
176
  → bounded agent context plus runtime/static ecosystem integration
120
177
  → text/config-driven coding-agent change review
121
178
  → interactive viewer
@@ -123,6 +180,6 @@ stable targets and bounded runtime behavior
123
180
  → full visual human–LLM workflow
124
181
  ```
125
182
 
126
- Safe-change contracts (v0.5+) and everything after remain unimplemented. The
127
- v0.7 coding-agent workflow must work without the v0.8 viewer or v0.9
128
- annotation system.
183
+ Bounded agent context, ecosystem integration, and everything after remain
184
+ unimplemented. The v0.7 coding-agent workflow must work without the v0.8
185
+ viewer or v0.9 annotation system.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-frontend-observer",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Local-first browser runtime evidence producer",
5
5
  "type": "module",
6
6
  "repository": {