my-frontend-observer 0.3.0 → 0.4.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 (44) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +32 -8
  3. package/dist/application/comparisonService.d.ts +56 -0
  4. package/dist/application/comparisonService.js +77 -0
  5. package/dist/application/comparisonService.js.map +1 -0
  6. package/dist/artifacts/artifactReader.d.ts +19 -0
  7. package/dist/artifacts/artifactReader.js +36 -0
  8. package/dist/artifacts/artifactReader.js.map +1 -0
  9. package/dist/artifacts/comparisonArtifactWriter.d.ts +41 -0
  10. package/dist/artifacts/comparisonArtifactWriter.js +67 -0
  11. package/dist/artifacts/comparisonArtifactWriter.js.map +1 -0
  12. package/dist/cli.js +220 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/domain/comparison.d.ts +198 -0
  15. package/dist/domain/comparison.js +324 -0
  16. package/dist/domain/comparison.js.map +1 -0
  17. package/dist/domain/comparisonEngine.d.ts +48 -0
  18. package/dist/domain/comparisonEngine.js +694 -0
  19. package/dist/domain/comparisonEngine.js.map +1 -0
  20. package/dist/domain/comparisonIdentity.d.ts +13 -0
  21. package/dist/domain/comparisonIdentity.js +46 -0
  22. package/dist/domain/comparisonIdentity.js.map +1 -0
  23. package/dist/domain/evidence.d.ts +2 -0
  24. package/dist/domain/evidence.js +4 -0
  25. package/dist/domain/evidence.js.map +1 -1
  26. package/dist/domain/relationships.d.ts +168 -0
  27. package/dist/domain/relationships.js +343 -0
  28. package/dist/domain/relationships.js.map +1 -0
  29. package/dist/index.d.ts +14 -1
  30. package/dist/index.js +8 -1
  31. package/dist/index.js.map +1 -1
  32. package/docs/ARCHITECTURE.md +76 -3
  33. package/docs/CI_CD.md +29 -0
  34. package/docs/COMMANDS.md +137 -0
  35. package/docs/CONTRACTS.md +96 -4
  36. package/docs/CURRENT_STATE.md +102 -9
  37. package/docs/DEVELOPMENT.md +33 -10
  38. package/docs/PROJECT_OVERVIEW.md +16 -12
  39. package/docs/QUICKSTART.md +5 -0
  40. package/docs/RELEASE.md +10 -8
  41. package/docs/ROADMAP.md +4 -0
  42. package/docs/SECURITY.md +14 -1
  43. package/docs/WORKFLOWS.md +56 -6
  44. package/package.json +1 -1
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.3.0)
14
+ ## Current observation workflow (published as 0.4.0)
15
15
 
16
- The real `observe` workflow, part of the published `my-frontend-observer@0.3.0`
16
+ The real `observe` workflow, part of the published `my-frontend-observer@0.4.0`
17
17
  package, accepts target configuration through either of two input paths,
18
18
  plus one optional runtime scroll scenario:
19
19
 
@@ -62,11 +62,60 @@ 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
- The future dependency order after observation is:
65
+ ## Current comparison workflow (published as 0.4.0)
66
+
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 -
69
+ it consumes two already-persisted observation artifacts rather than
70
+ producing one, and it never launches a browser:
71
+
72
+ ```text
73
+ two prior real "observe" invocations, each producing its own persisted
74
+ ObservationArtifact (before, after) - unrelated to this workflow itself
75
+ → CLI arguments (--before <root>, --after <root>, --output <directory>,
76
+ optionally --config-file <json-file>)
77
+ → (--config-file only: read + validate the local JSON root shape - a
78
+ non-array object; the file supplies ComparisonConfig directly, with no
79
+ wrapper field)
80
+ → read + validate both observation artifacts (src/artifacts/artifactReader.ts,
81
+ the same isValidObservationArtifact structural gate the writer uses)
82
+ → application comparison use case
83
+ (src/application/comparisonService.ts#compareAndPersistFromArtifactRoots
84
+ → compareAndPersist)
85
+ → pure comparison derivation (src/domain/comparisonEngine.ts#compareObservations):
86
+ comparability first, then - only if comparable/comparable-with-warnings -
87
+ deriveLayoutRelationships for each side plus target/page differences,
88
+ relationship changes, and explicit non-causal dependency evidence
89
+ → atomic comparison-artifact persistence (manifest.json only, no copied
90
+ screenshots), schema 1.0.0 - exactly once, for every comparability
91
+ outcome including "incomparable"
92
+ → concise CLI result (Comparison/State/Artifact/Differences/Relationship
93
+ changes/Diagnostics)
94
+ → process exit status (0 for any successfully computed and persisted
95
+ comparison, including "incomparable"; nonzero only for invalid
96
+ syntax/unreadable or invalid source artifacts/invalid configuration/a
97
+ failed write)
98
+ ```
99
+
100
+ Source observations are never modified by this workflow. Operational paths
101
+ (`--before`/`--after`/`--config-file`/`--output`) never affect
102
+ `comparisonRequestId` and are never written into the persisted manifest.
103
+
104
+ This is exercised by `runCli()`-level tests
105
+ (`tests/unit/cli.test.ts`, `tests/unit/cliCompareOrchestration.test.ts`,
106
+ `tests/unit/cliCompareEndToEnd.test.ts`), a real-Chromium end-to-end test
107
+ (`tests/browser/cliCompare.test.ts`), built `node dist/cli.js compare ...`
108
+ runs against real persisted observations from the deterministic local
109
+ fixture (`scripts/dev/builtCliCompareSmoke.mjs`), and packed-tarball
110
+ validation of the installed `compare` command
111
+ (`scripts/ci/runPackedObservationSmoke.mjs` - see `docs/CI_CD.md`).
112
+
113
+ ## Future workflows
66
114
 
67
115
  ```text
68
116
  stable targets and bounded runtime behavior
69
- → relationships, comparison, and safe-change contracts
117
+ → relationships and before/after comparison (released - see above)
118
+ → safe-change contracts
70
119
  → bounded agent context plus runtime/static ecosystem integration
71
120
  → text/config-driven coding-agent change review
72
121
  → interactive viewer
@@ -74,5 +123,6 @@ stable targets and bounded runtime behavior
74
123
  → full visual human–LLM workflow
75
124
  ```
76
125
 
77
- None of these later workflows is implemented. The v0.7 coding-agent workflow
78
- must work without the v0.8 viewer or v0.9 annotation system.
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-frontend-observer",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Local-first browser runtime evidence producer",
5
5
  "type": "module",
6
6
  "repository": {