my-frontend-observer 0.1.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 (46) hide show
  1. package/CHANGELOG.md +82 -1
  2. package/README.md +30 -7
  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 +46 -3
  8. package/dist/browser/evidenceCapture.js +393 -94
  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 +165 -7
  15. package/dist/cli.js.map +1 -1
  16. package/dist/domain/diagnostics.d.ts +1 -1
  17. package/dist/domain/diagnostics.js +2 -0
  18. package/dist/domain/diagnostics.js.map +1 -1
  19. package/dist/domain/identity.d.ts +8 -3
  20. package/dist/domain/identity.js +10 -4
  21. package/dist/domain/identity.js.map +1 -1
  22. package/dist/domain/schema.d.ts +164 -6
  23. package/dist/domain/schema.js +314 -4
  24. package/dist/domain/schema.js.map +1 -1
  25. package/dist/domain/scrollEvidence.d.ts +51 -0
  26. package/dist/domain/scrollEvidence.js +134 -0
  27. package/dist/domain/scrollEvidence.js.map +1 -0
  28. package/dist/index.d.ts +4 -4
  29. package/dist/index.js +2 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/request/request.d.ts +57 -1
  32. package/dist/request/request.js +292 -14
  33. package/dist/request/request.js.map +1 -1
  34. package/docs/ARCHITECTURE.md +62 -1
  35. package/docs/CI_CD.md +49 -8
  36. package/docs/COMMANDS.md +184 -9
  37. package/docs/CONTRACTS.md +135 -6
  38. package/docs/CURRENT_STATE.md +128 -6
  39. package/docs/DEVELOPMENT.md +41 -3
  40. package/docs/PROJECT_OVERVIEW.md +12 -6
  41. package/docs/QUICKSTART.md +3 -1
  42. package/docs/RELEASE.md +12 -5
  43. package/docs/ROADMAP.md +9 -0
  44. package/docs/SECURITY.md +6 -2
  45. package/docs/WORKFLOWS.md +41 -14
  46. package/package.json +1 -1
package/docs/SECURITY.md CHANGED
@@ -29,5 +29,9 @@ 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 v0.1 scope. Package publication and any hosted-CI/release-pipeline
33
- security gate are separate, later decisions - not addressed here.
32
+ out of scope. `my-frontend-observer@0.3.0` is published to npm, and a
33
+ pre-release readiness CI workflow (Windows/Linux/macOS packed-candidate
34
+ validation) already exists (see `docs/CI_CD.md`); these are no longer future
35
+ decisions. Those facts do not expand the security scope above: remote
36
+ browsing, certificate handling, and permission-prompt handling remain
37
+ separate, unimplemented concerns.
package/docs/WORKFLOWS.md CHANGED
@@ -11,29 +11,56 @@ install dependencies (npm install; npx playwright install chromium)
11
11
  → validate documentation (npm run check:docs)
12
12
  ```
13
13
 
14
- ## Current v0.1 observation workflow
14
+ ## Current observation workflow (published as 0.3.0)
15
15
 
16
- The real, source-checkout `observe` workflow is:
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:
17
19
 
18
20
  ```text
19
- CLI arguments (--url, --viewport, --target, --output, --timeout)
20
- → request construction
21
- → existing Batch 1 request validation/normalization
21
+ CLI arguments (--url, --viewport, --output, --timeout, exactly one of:
22
+ one-or-more --target <id=css-selector>
23
+ or --targets-file <json-file>,
24
+ plus optionally --scroll-scenario-file <json-file>)
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)
29
+ → request construction (same RawObservationRequest either way)
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)
22
33
  → application observation use case (src/application/observationPersistence.ts#observe)
23
- → existing Chromium capture (launch, safe navigation, readiness, screenshot,
24
- page/target evidence) - exactly once
25
- → existing atomic artifact persistence (manifest.json + screenshot.png) -
26
- exactly once, only on a successful capture
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
43
+ → atomic artifact persistence (manifest.json + screenshot.png), schema
44
+ 1.2.0 - exactly once, only on a successful capture; scrollScenarioEvidence
45
+ is simply one more optional manifest field, never a separate file
27
46
  → concise CLI result (Observation/State/Artifact/Targets/Diagnostics)
28
47
  → process exit status (0 for a persisted observation, including one whose
29
48
  state honestly reports "partial"; nonzero otherwise)
30
49
  ```
31
50
 
32
- This is exercised by `runCli()`-level tests, by a built
33
- `node dist/cli.js observe ...` run against the deterministic local fixture,
34
- and by the real `npm pack` tarball installed and run from a clean temporary
35
- consumer directory outside the repository - the same workflow, independent
36
- of the source checkout. It has not been published to a registry.
51
+ A request with no scroll scenario is unaffected: no extra snapshots, no
52
+ scroll, no extra animation-frame wait, unchanged request identity.
53
+
54
+ This is exercised by `runCli()`-level tests, real-Chromium end-to-end tests
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.
37
64
 
38
65
  The future dependency order after observation is:
39
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-frontend-observer",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Local-first browser runtime evidence producer",
5
5
  "type": "module",
6
6
  "repository": {