my-frontend-observer 0.2.0 → 0.3.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 (43) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +24 -10
  3. package/dist/application/observationPersistence.js +1 -0
  4. package/dist/application/observationPersistence.js.map +1 -1
  5. package/dist/browser/chromiumAdapter.js +58 -4
  6. package/dist/browser/chromiumAdapter.js.map +1 -1
  7. package/dist/browser/evidenceCapture.d.ts +29 -2
  8. package/dist/browser/evidenceCapture.js +43 -19
  9. package/dist/browser/evidenceCapture.js.map +1 -1
  10. package/dist/browser/scrollCapture.d.ts +32 -0
  11. package/dist/browser/scrollCapture.js +163 -0
  12. package/dist/browser/scrollCapture.js.map +1 -0
  13. package/dist/browser/types.d.ts +3 -1
  14. package/dist/cli.js +79 -1
  15. package/dist/cli.js.map +1 -1
  16. package/dist/domain/identity.d.ts +8 -3
  17. package/dist/domain/identity.js +9 -3
  18. package/dist/domain/identity.js.map +1 -1
  19. package/dist/domain/schema.d.ts +116 -2
  20. package/dist/domain/schema.js +186 -2
  21. package/dist/domain/schema.js.map +1 -1
  22. package/dist/domain/scrollEvidence.d.ts +51 -0
  23. package/dist/domain/scrollEvidence.js +134 -0
  24. package/dist/domain/scrollEvidence.js.map +1 -0
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.js +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/request/request.d.ts +29 -0
  29. package/dist/request/request.js +108 -0
  30. package/dist/request/request.js.map +1 -1
  31. package/docs/ARCHITECTURE.md +35 -2
  32. package/docs/CI_CD.md +33 -6
  33. package/docs/COMMANDS.md +110 -6
  34. package/docs/CONTRACTS.md +77 -4
  35. package/docs/CURRENT_STATE.md +55 -10
  36. package/docs/DEVELOPMENT.md +25 -8
  37. package/docs/PROJECT_OVERVIEW.md +10 -7
  38. package/docs/QUICKSTART.md +2 -1
  39. package/docs/RELEASE.md +10 -5
  40. package/docs/ROADMAP.md +5 -0
  41. package/docs/SECURITY.md +1 -1
  42. package/docs/WORKFLOWS.md +36 -18
  43. package/package.json +1 -1
@@ -21,9 +21,9 @@ npm run check:docs
21
21
  npm pack --dry-run
22
22
  ```
23
23
 
24
- `npm test` runs the fast unit suite only (`tests/unit/`, currently 106
24
+ `npm test` runs the fast unit suite only (`tests/unit/`, currently 176
25
25
  passing tests). `npm run test:browser` runs the real-Chromium integration
26
- suite (`tests/browser/`, currently 69 passing tests) against deterministic
26
+ suite (`tests/browser/`, currently 88 passing tests) against deterministic
27
27
  local fixtures under `tests/fixtures/` and requires the Chromium binary
28
28
  above to be installed first; it is kept out of `npm test` because it
29
29
  launches a real browser and is slower.
@@ -72,15 +72,32 @@ development smoke, added alongside the `--targets-file` implementation: it
72
72
  runs the built `dist/cli.js` directly (`node dist/cli.js observe
73
73
  --targets-file ...`) against an inline disposable local HTTP fixture and a
74
74
  temporary JSON target file, proving a real semantic observation persists a
75
- valid schema-`1.1.0` artifact with no packed-tarball step involved. Run it
75
+ valid schema-`1.2.0` artifact with no packed-tarball step involved. Run it
76
76
  locally after `npm run build`:
77
77
 
78
78
  ```powershell
79
79
  node scripts/dev/builtCliTargetsFileSmoke.mjs
80
80
  ```
81
81
 
82
- Unlike `scripts/ci/runPackedObservationSmoke.mjs`, it is not wired into any
83
- CI workflow and is not a release gate - it is source-checkout development
84
- evidence only, proving the built CLI's `--targets-file` behavior without
85
- installing a packed tarball or requiring cross-platform infrastructure. It
86
- is not part of the published package.
82
+ `scripts/dev/builtCliScrollScenarioSmoke.mjs` is the v0.3 equivalent, added
83
+ alongside the `--scroll-scenario-file` implementation: it runs the built
84
+ `dist/cli.js` directly against an inline disposable local HTTP fixture,
85
+ once with a temporary `window-scroll-by` scenario file and once with a
86
+ temporary structured `--targets-file` plus a `target-scroll-by` scenario
87
+ file, proving both real runtime scroll actions persist a valid
88
+ schema-`1.2.0` artifact with populated `scrollScenarioEvidence`,
89
+ scenario-file path privacy, and target-application immutability. Run it
90
+ locally after `npm run build`:
91
+
92
+ ```powershell
93
+ node scripts/dev/builtCliScrollScenarioSmoke.mjs
94
+ ```
95
+
96
+ Unlike `scripts/ci/runPackedObservationSmoke.mjs`, neither of these dev
97
+ smokes is wired into any CI workflow or is a release gate - they are
98
+ source-checkout development evidence only, proving the built CLI's
99
+ `--targets-file`/`--scroll-scenario-file` behavior without installing a
100
+ packed tarball or requiring cross-platform infrastructure. Neither is part
101
+ of the published package. Cross-platform packed validation of the v0.3
102
+ scroll-scenario behavior is `scripts/ci/runPackedObservationSmoke.mjs`'s
103
+ responsibility (see `docs/CI_CD.md`), and has been completed.
@@ -15,15 +15,18 @@ The responsibility split is stable:
15
15
 
16
16
  ## Current repository state
17
17
 
18
- v0.1, Runtime Observation Foundation, and v0.2, Stable Semantic Targets and
19
- Region Identity, are released, published to npm (current version `0.2.0`,
20
- observation schema `1.1.0`) and validated as a packed npm tarball in a
18
+ v0.1, Runtime Observation Foundation; v0.2, Stable Semantic Targets and
19
+ Region Identity; and v0.3, Runtime Scrolling, Overflow, and Visibility
20
+ Behavior, are released, published to npm (current version `0.3.0`,
21
+ observation schema `1.2.0`) and validated as a packed npm tarball in a
21
22
  clean consumer environment across Windows, Linux, and macOS: a real
22
23
  `observe` CLI command launches Chromium, enforces loopback-only safety,
23
- captures bounded page/target evidence via either legacy CSS-shorthand
24
- targets or structured semantic `--targets-file` targets, and persists one
25
- portable local artifact - see `docs/CURRENT_STATE.md` for the
26
- implementation summary. v0.3–v0.10 remain future and unimplemented.
24
+ captures bounded page/target evidence via legacy CSS-shorthand targets,
25
+ structured semantic `--targets-file` targets, or a bounded
26
+ `--scroll-scenario-file` runtime scroll scenario (`window-scroll-by` or
27
+ `target-scroll-by`), and persists one portable local artifact - see
28
+ `docs/CURRENT_STATE.md` for the implementation summary. v0.4–v0.10 remain
29
+ future and unimplemented.
27
30
 
28
31
  The revised dependency path reaches practical coding-agent use before graphical
29
32
  interaction:
@@ -22,7 +22,8 @@ node dist/cli.js observe `
22
22
  This launches Chromium, captures a screenshot plus bounded page/target
23
23
  evidence, and writes one portable artifact under `observations/<observation-id>/`.
24
24
  See [COMMANDS.md](COMMANDS.md) for the full flag reference, including the
25
- `--targets-file` structured semantic-target input.
25
+ `--targets-file` structured semantic-target input and the
26
+ `--scroll-scenario-file` bounded runtime scroll scenario input.
26
27
 
27
28
  To validate the repository itself instead:
28
29
 
package/docs/RELEASE.md CHANGED
@@ -1,11 +1,16 @@
1
1
  # Release
2
2
 
3
- `v0.2.0` is published to npm as `my-frontend-observer`, validated on
3
+ `v0.3.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
- publication (covering both the legacy CSS-shorthand `--target` path and the
6
- structured semantic `--targets-file` path). No project license has been
7
- declared yet; that decision remains open for a later explicit task.
5
+ publication (covering the legacy CSS-shorthand `--target` path, the
6
+ structured semantic `--targets-file` path, and the bounded
7
+ `--scroll-scenario-file` `window-scroll-by`/`target-scroll-by` runtime
8
+ scroll scenario path). No project license has been declared yet; that
9
+ decision remains open for a later explicit task.
8
10
 
9
11
  Observation schema version and package version remain separate: package
10
- version is `0.2.0`; observation schema is `1.1.0` and does not change
12
+ version is `0.3.0`; observation schema is `1.2.0` and does not change
11
13
  automatically with the package version.
14
+
15
+ Prior releases: `v0.2.0` (Stable Semantic Targets and Region Identity),
16
+ `v0.1.0` (Runtime Observation Foundation) - see `CHANGELOG.md`.
package/docs/ROADMAP.md CHANGED
@@ -60,6 +60,11 @@ identity persistence rules from current evidence.
60
60
 
61
61
  ## v0.3 — Runtime Scrolling, Overflow, and Visibility Behavior
62
62
 
63
+ Current status: released as `0.3.0`, published to npm and validated as a
64
+ packed npm tarball in a clean consumer environment on Windows, Linux, and
65
+ macOS (observation schema `1.2.0`). See `docs/CURRENT_STATE.md` for the
66
+ implementation summary.
67
+
63
68
  Objective/problem: show which container actually scrolls and what becomes
64
69
  visible, clipped, or overflowing after controlled actions. Required capabilities
65
70
  are bounded action scenarios, before/after window and target scroll positions,
package/docs/SECURITY.md CHANGED
@@ -29,7 +29,7 @@ tests:
29
29
  Certificate-failure-specific handling, permission-prompt-specific handling
30
30
  (Chromium's default deny-all applies; no permission is ever explicitly
31
31
  granted), and any non-loopback/remote browsing mode remain unimplemented and
32
- out of scope. `my-frontend-observer@0.2.0` is published to npm, and a
32
+ out of scope. `my-frontend-observer@0.3.0` is published to npm, and a
33
33
  pre-release readiness CI workflow (Windows/Linux/macOS packed-candidate
34
34
  validation) already exists (see `docs/CI_CD.md`); these are no longer future
35
35
  decisions. Those facts do not expand the security scope above: remote
package/docs/WORKFLOWS.md CHANGED
@@ -11,38 +11,56 @@ 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.2.0)
14
+ ## Current observation workflow (published as 0.3.0)
15
15
 
16
- The real `observe` workflow, part of the published `my-frontend-observer@0.2.0`
17
- package, accepts target configuration through either of two input paths:
16
+ The real `observe` workflow, part of the published `my-frontend-observer@0.3.0`
17
+ package, accepts target configuration through either of two input paths,
18
+ plus one optional runtime scroll scenario:
18
19
 
19
20
  ```text
20
- CLI arguments (--url, --viewport, --output, --timeout, and exactly one of:
21
+ CLI arguments (--url, --viewport, --output, --timeout, exactly one of:
21
22
  one-or-more --target <id=css-selector>
22
- or --targets-file <json-file>)
23
+ or --targets-file <json-file>,
24
+ plus optionally --scroll-scenario-file <json-file>)
23
25
  → (--targets-file only: read + validate the local JSON root wrapper)
26
+ → (--scroll-scenario-file only: read + validate the local JSON root shape -
27
+ a non-array object; the file supplies RawObservationRequest.scrollScenario
28
+ directly, with no wrapper field)
24
29
  → request construction (same RawObservationRequest either way)
25
- → normalizeRequest() - producing canonical {name, locators} targets
30
+ → normalizeRequest() - producing canonical {name, locators} targets and
31
+ validating the optional scrollScenario (supported action kind, delta
32
+ bounds/both-zero rule, stable target-name reference)
26
33
  → application observation use case (src/application/observationPersistence.ts#observe)
27
- → Chromium capture (launch, safe navigation, readiness, screenshot,
28
- page/target evidence), resolving all six locator kinds through the single
29
- canonical resolver, plus semantic state/landmark/containment evidence,
30
- from the same live page - exactly once
34
+ → Chromium capture: launch, safe navigation, readiness, then - only if a
35
+ scenario was configured - resolve configured targets once, capture an
36
+ initial ScrollRuntimeSnapshot, perform the one immediate scroll
37
+ (window.scrollBy/element.scrollBy, behavior: "instant"), wait exactly two
38
+ requestAnimationFrame cycles, capture a final ScrollRuntimeSnapshot and
39
+ derive transition/scroll-owner evidence; then screenshot and page/target
40
+ evidence (resolving all six locator kinds through the single canonical
41
+ resolver, plus semantic state/landmark/containment evidence), from the
42
+ same live page - exactly once, always describing the final state
31
43
  → atomic artifact persistence (manifest.json + screenshot.png), schema
32
- 1.1.0 - exactly once, only on a successful capture
44
+ 1.2.0 - exactly once, only on a successful capture; scrollScenarioEvidence
45
+ is simply one more optional manifest field, never a separate file
33
46
  → concise CLI result (Observation/State/Artifact/Targets/Diagnostics)
34
47
  → process exit status (0 for a persisted observation, including one whose
35
48
  state honestly reports "partial"; nonzero otherwise)
36
49
  ```
37
50
 
51
+ A request with no scroll scenario is unaffected: no extra snapshots, no
52
+ scroll, no extra animation-frame wait, unchanged request identity.
53
+
38
54
  This is exercised by `runCli()`-level tests, real-Chromium end-to-end tests
39
- (`tests/browser/cliObserve.test.ts`), a built
40
- `node dist/cli.js observe ...` run against the deterministic local fixture
41
- (including `scripts/dev/builtCliTargetsFileSmoke.mjs` for the semantic
42
- `--targets-file` path), and the real `npm pack` tarball installed and run
43
- from a clean temporary consumer directory outside the repository, on
44
- Windows, Linux, and macOS - the same workflow, independent of the source
45
- checkout.
55
+ (`tests/browser/cliObserve.test.ts`, `tests/browser/windowScrollScenario.test.ts`,
56
+ `tests/browser/targetScrollScenario.test.ts`), built `node dist/cli.js
57
+ observe ...` runs against the deterministic local fixture
58
+ (`scripts/dev/builtCliTargetsFileSmoke.mjs` for the semantic `--targets-file`
59
+ path, `scripts/dev/builtCliScrollScenarioSmoke.mjs` for the scroll-scenario
60
+ path), and the real `npm pack` tarball installed and run from a clean
61
+ temporary consumer directory outside the repository, on Windows, Linux, and
62
+ macOS (`scripts/ci/runPackedObservationSmoke.mjs`) - the same workflow,
63
+ independent of the source checkout.
46
64
 
47
65
  The future dependency order after observation is:
48
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-frontend-observer",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Local-first browser runtime evidence producer",
5
5
  "type": "module",
6
6
  "repository": {