my-frontend-observer 0.1.0 → 0.2.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.
@@ -1,7 +1,7 @@
1
1
  # Current State
2
2
 
3
- The project is published at package version `0.1.0` (roadmap v0.1, Runtime
4
- Observation Foundation).
3
+ The project is published at package version `0.2.0` (roadmap v0.2, Stable
4
+ Semantic Targets and Region Identity; observation schema `1.1.0`).
5
5
 
6
6
  ## Greenfield foundation established
7
7
 
@@ -102,12 +102,89 @@ tarball/output fully cleaned up afterward. Documentation across the
102
102
  repository was reconciled to this implemented state as part of the same
103
103
  batch.
104
104
 
105
+ ## v0.1 status
106
+
107
+ `v0.1.0` was the first published release (see `CHANGELOG.md` and
108
+ `docs/RELEASE.md`). Everything above this section describes that released
109
+ state, still present unchanged in `v0.2.0`.
110
+
111
+ ## v0.2 status (Stable Semantic Targets and Region Identity) - released as 0.2.0
112
+
113
+ v0.2 is implemented and released as package version `0.2.0`, observation
114
+ schema `1.1.0`.
115
+
116
+ - **Canonical target/locator model.** Each configured target has a stable
117
+ observer-owned `name` plus an ordered, bounded `locators` array
118
+ (`src/request/request.ts#TargetLocator`, `NamedTarget`). This identity is
119
+ distinct from both the browser locator that resolves it and any
120
+ source-code symbol. The legacy `{name, selector}` shape remains accepted
121
+ and normalizes to a one-item `css` locator, so every v0.1 CLI invocation
122
+ continues to work unchanged. Bounds: 20 targets max, 5 locators per
123
+ target max (unchanged/new respectively from v0.1's target count bound).
124
+ - **Six frozen locator kinds, all resolved against real Chromium**: `role`
125
+ (Playwright's accessibility role/name locator, exact name matching),
126
+ `id` and `data-attribute` (exact CSS attribute-equals matching that never
127
+ reinterprets the configured value as selector syntax), `semantic-element`
128
+ (a frozen structural tag set: `header`, `nav`, `main`, `footer`,
129
+ `article`, `section`, `aside`, `form`, `dialog`), `css` (unchanged v0.1
130
+ behavior), and `text` (exact match only, no substring/fuzzy matching).
131
+ Locator order is the fallback order: 0 matches tries the next locator; 1
132
+ match selects and stops; more than 1 match is ambiguous and stops (never
133
+ falls through); an unevaluable locator is unavailable and stops (never
134
+ falls through). All six kinds converge on one measurement path
135
+ (`src/browser/evidenceCapture.ts#captureResolvedTargetRecord`) - locator
136
+ strategy never changes the resulting evidence shape.
137
+ - **Semantic region evidence**, added to every resolved target alongside
138
+ the existing v0.1 role/name capture: `semanticState` (a first bounded
139
+ family of `disabled`/`expanded`/`checked`/`selected`/`pressed`/`current`,
140
+ read from the element's own native/ARIA properties so an explicit `false`
141
+ is always distinguishable from "not applicable"; `checked`/`pressed` also
142
+ support the browser's `'mixed'` value); `landmark` (derived only from the
143
+ already-captured browser-exposed role - never from locator kind or HTML
144
+ tag - against the standard landmark role set `banner`/`navigation`/
145
+ `main`/`complementary`/`contentinfo`/`form`/`region`/`search`); and
146
+ `containment` (bounded DOM containment checked only among the other
147
+ explicitly configured targets in the same observation, in configured
148
+ order - `available`/`partial`/`unavailable`, never a layout/spatial-
149
+ relationship graph).
150
+ - **Proven identity stability**: the same target configuration produces the
151
+ same `requestId` across repeated observations (with a fresh
152
+ `observationId` every time); changing a target's locator strategy while
153
+ keeping its stable name changes `requestId` but not the `targetEvidence`
154
+ key; actual runtime disappearance of a still-configured target changes
155
+ only its resolution status, never the `requestId`.
156
+ - **Public CLI**: `my-frontend-observer observe --targets-file <json-file>`
157
+ supplies a structured `{ "targets": [...] }` collection as an alternative
158
+ to one or more `--target id=css-selector` flags; the two are mutually
159
+ exclusive per invocation. `--targets-file` only validates its own root
160
+ wrapper (readable file, valid JSON, object root with exactly a `targets`
161
+ field); all target/locator-internal validation stays owned by the
162
+ existing `normalizeRequest()`. The file path is operational input only -
163
+ never part of request identity, never persisted into `manifest.json`.
164
+ - **Observation schema `1.1.0`** (`src/domain/schema.ts#SCHEMA_VERSION`):
165
+ additive over the published `1.0.0` - extends `TargetEvidenceRecord` with
166
+ `semanticState`/`landmark`/`containment` and extends `TargetResolution`
167
+ with `selectedLocatorKind`/`selectedLocatorIndex`/`usedFallback`/
168
+ `confidence`/`attempts`. Artifact kind, directory structure, atomic
169
+ persistence, and evidence-state/source vocabularies are unchanged.
170
+ - **Validation on this branch**: `npm run typecheck`, `npm run lint`,
171
+ `npm test`, `npm run test:browser`, `npm run build`, and
172
+ `npm run check:docs` all pass (106 unit tests, 69 real-Chromium tests as
173
+ of this reconciliation; see `docs/DEVELOPMENT.md` for how to reproduce).
174
+ `scripts/dev/builtCliTargetsFileSmoke.mjs` additionally proves the built
175
+ `dist/cli.js` (not just the imported `runCli()` function) performs a real
176
+ semantic `--targets-file` observation end to end.
177
+
105
178
  ## Not implemented
106
179
 
107
- - There is no controlled-scroll behavior, target-source correlation, or
108
- capability beyond the bounded page/target evidence Batches 3-5 established.
109
- - No v0.2–v0.10 capability is implemented.
180
+ - No controlled-scroll behavior, layout/spatial relationship engine,
181
+ before/after comparison, frontend contracts/change scope, source
182
+ ownership, my-dev-kit runtime/static integration, orchestrator/lab
183
+ product integration, viewer, or annotation - all remain v0.3+ and
184
+ unimplemented.
185
+ - No v0.3–v0.10 capability is implemented.
110
186
 
111
187
  ## Next target
112
188
 
113
- v0.1.0 is released. The next allowed workflow is v0.2 planning.
189
+ v0.2 is implemented, validated, and released as `0.2.0`. v0.3 (Controlled
190
+ Scroll and Overflow Scenarios) is the next planned version.
@@ -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 70
24
+ `npm test` runs the fast unit suite only (`tests/unit/`, currently 106
25
25
  passing tests). `npm run test:browser` runs the real-Chromium integration
26
- suite (`tests/browser/`, currently 16 passing tests) against deterministic
26
+ suite (`tests/browser/`, currently 69 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.
@@ -62,4 +62,25 @@ It is what `.github/workflows/pre-release-readiness.yml` runs identically on
62
62
  Windows, Linux, and macOS against one shared candidate tarball (see
63
63
  `docs/CI_CD.md`); it can also be run locally the same way the workflow runs
64
64
  it. It is readiness/CI infrastructure only, not part of the published
65
- package and never imported by production code.
65
+ package and never imported by production code. It exercises both the
66
+ legacy CSS-shorthand `--target` packed-observation shape and the
67
+ structured semantic `--targets-file` shape in the same run - see
68
+ `docs/CI_CD.md` for the current v0.2 readiness coverage.
69
+
70
+ `scripts/dev/builtCliTargetsFileSmoke.mjs` is a separate, narrower v0.2
71
+ development smoke, added alongside the `--targets-file` implementation: it
72
+ runs the built `dist/cli.js` directly (`node dist/cli.js observe
73
+ --targets-file ...`) against an inline disposable local HTTP fixture and a
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
76
+ locally after `npm run build`:
77
+
78
+ ```powershell
79
+ node scripts/dev/builtCliTargetsFileSmoke.mjs
80
+ ```
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.
@@ -15,12 +15,15 @@ The responsibility split is stable:
15
15
 
16
16
  ## Current repository state
17
17
 
18
- v0.1, Runtime Observation Foundation, is released as `0.1.0`, published to
19
- npm and validated as a packed npm tarball in a clean consumer environment: a
20
- real `observe` CLI command launches Chromium, enforces loopback-only safety,
21
- captures bounded page/target evidence and a viewport screenshot, and
22
- persists one portable local artifact. v0.2–v0.10 remain future and
23
- unimplemented.
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
21
+ clean consumer environment across Windows, Linux, and macOS: a real
22
+ `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
27
 
25
28
  The revised dependency path reaches practical coding-agent use before graphical
26
29
  interaction:
@@ -21,7 +21,8 @@ node dist/cli.js observe `
21
21
 
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
- See [COMMANDS.md](COMMANDS.md) for the full flag reference.
24
+ See [COMMANDS.md](COMMANDS.md) for the full flag reference, including the
25
+ `--targets-file` structured semantic-target input.
25
26
 
26
27
  To validate the repository itself instead:
27
28
 
package/docs/RELEASE.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # Release
2
2
 
3
- `v0.1.0` is published to npm as `my-frontend-observer`, validated on
3
+ `v0.2.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. No project license has been declared yet; that decision remains
6
- open for a later explicit task.
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.
7
8
 
8
- Observation schema version and package version remain separate: schema
9
- `1.0.0` does not change automatically with the package version.
9
+ 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
11
+ automatically with the package version.
package/docs/ROADMAP.md CHANGED
@@ -43,6 +43,10 @@ and the concrete dependency/version set before implementation.
43
43
 
44
44
  ## v0.2 — Stable Semantic Targets and Region Identity
45
45
 
46
+ Current status: released as `0.2.0`, published to npm and validated as a
47
+ packed npm tarball in a clean consumer environment on Windows, Linux, and
48
+ macOS. See `docs/CURRENT_STATE.md` for the implementation summary.
49
+
46
50
  Objective/problem: let humans and consumers refer reliably to conceptual
47
51
  rendered regions across observations without brittle selector-only identity.
48
52
  Required capabilities include semantic HTML, accessibility role/name, stable
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.2.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,38 @@ 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.2.0)
15
15
 
16
- The real, source-checkout `observe` workflow is:
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:
17
18
 
18
19
  ```text
19
- CLI arguments (--url, --viewport, --target, --output, --timeout)
20
- → request construction
21
- → existing Batch 1 request validation/normalization
20
+ CLI arguments (--url, --viewport, --output, --timeout, and exactly one of:
21
+ one-or-more --target <id=css-selector>
22
+ or --targets-file <json-file>)
23
+ → (--targets-file only: read + validate the local JSON root wrapper)
24
+ → request construction (same RawObservationRequest either way)
25
+ → normalizeRequest() - producing canonical {name, locators} targets
22
26
  → 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
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
31
+ → atomic artifact persistence (manifest.json + screenshot.png), schema
32
+ 1.1.0 - exactly once, only on a successful capture
27
33
  → concise CLI result (Observation/State/Artifact/Targets/Diagnostics)
28
34
  → process exit status (0 for a persisted observation, including one whose
29
35
  state honestly reports "partial"; nonzero otherwise)
30
36
  ```
31
37
 
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.
38
+ 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.
37
46
 
38
47
  The future dependency order after observation is:
39
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-frontend-observer",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Local-first browser runtime evidence producer",
5
5
  "type": "module",
6
6
  "repository": {