my-frontend-observer 0.1.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 (69) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +69 -0
  3. package/dist/application/browserCaptureService.d.ts +11 -0
  4. package/dist/application/browserCaptureService.js +12 -0
  5. package/dist/application/browserCaptureService.js.map +1 -0
  6. package/dist/application/observationPersistence.d.ts +59 -0
  7. package/dist/application/observationPersistence.js +78 -0
  8. package/dist/application/observationPersistence.js.map +1 -0
  9. package/dist/artifacts/artifactWriter.d.ts +25 -0
  10. package/dist/artifacts/artifactWriter.js +68 -0
  11. package/dist/artifacts/artifactWriter.js.map +1 -0
  12. package/dist/artifacts/types.d.ts +17 -0
  13. package/dist/artifacts/types.js +2 -0
  14. package/dist/artifacts/types.js.map +1 -0
  15. package/dist/browser/chromiumAdapter.d.ts +21 -0
  16. package/dist/browser/chromiumAdapter.js +150 -0
  17. package/dist/browser/chromiumAdapter.js.map +1 -0
  18. package/dist/browser/evidenceCapture.d.ts +19 -0
  19. package/dist/browser/evidenceCapture.js +201 -0
  20. package/dist/browser/evidenceCapture.js.map +1 -0
  21. package/dist/browser/types.d.ts +22 -0
  22. package/dist/browser/types.js +2 -0
  23. package/dist/browser/types.js.map +1 -0
  24. package/dist/cli.d.ts +7 -0
  25. package/dist/cli.js +216 -0
  26. package/dist/cli.js.map +1 -0
  27. package/dist/domain/completion.d.ts +30 -0
  28. package/dist/domain/completion.js +22 -0
  29. package/dist/domain/completion.js.map +1 -0
  30. package/dist/domain/diagnostics.d.ts +17 -0
  31. package/dist/domain/diagnostics.js +55 -0
  32. package/dist/domain/diagnostics.js.map +1 -0
  33. package/dist/domain/evidence.d.ts +27 -0
  34. package/dist/domain/evidence.js +55 -0
  35. package/dist/domain/evidence.js.map +1 -0
  36. package/dist/domain/identity.d.ts +13 -0
  37. package/dist/domain/identity.js +37 -0
  38. package/dist/domain/identity.js.map +1 -0
  39. package/dist/domain/schema.d.ts +111 -0
  40. package/dist/domain/schema.js +126 -0
  41. package/dist/domain/schema.js.map +1 -0
  42. package/dist/index.d.ts +21 -0
  43. package/dist/index.js +12 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/request/paths.d.ts +14 -0
  46. package/dist/request/paths.js +33 -0
  47. package/dist/request/paths.js.map +1 -0
  48. package/dist/request/request.d.ts +43 -0
  49. package/dist/request/request.js +174 -0
  50. package/dist/request/request.js.map +1 -0
  51. package/dist/safety/policy.d.ts +14 -0
  52. package/dist/safety/policy.js +81 -0
  53. package/dist/safety/policy.js.map +1 -0
  54. package/docs/ARCHITECTURE.md +85 -0
  55. package/docs/CI_CD.md +28 -0
  56. package/docs/COMMANDS.md +82 -0
  57. package/docs/CONTRACTS.md +54 -0
  58. package/docs/CURRENT_STATE.md +113 -0
  59. package/docs/DEVELOPMENT.md +65 -0
  60. package/docs/DOCUMENTATION_PRESERVATION_POLICY.md +33 -0
  61. package/docs/PROJECT_DESCRIPTION.md +1770 -0
  62. package/docs/PROJECT_MILESTONES.md +2073 -0
  63. package/docs/PROJECT_OVERVIEW.md +53 -0
  64. package/docs/QUICKSTART.md +35 -0
  65. package/docs/RELEASE.md +9 -0
  66. package/docs/ROADMAP.md +352 -0
  67. package/docs/SECURITY.md +33 -0
  68. package/docs/WORKFLOWS.md +51 -0
  69. package/package.json +46 -0
@@ -0,0 +1,53 @@
1
+ # Project Overview
2
+
3
+ `my-frontend-observer` is the rendered browser/runtime evidence producer in
4
+ the my-dev-kit ecosystem. It addresses the gap between source-level evidence
5
+ and what a browser actually renders and supports three durable jobs: human-to-LLM
6
+ design communication, safer LLM-assisted frontend changes, and runtime evidence
7
+ for coordinated ecosystem work.
8
+
9
+ The responsibility split is stable:
10
+
11
+ - `my-dev-kit` produces static repository/source evidence.
12
+ - `my-frontend-observer` produces rendered browser/runtime evidence.
13
+ - `my-dev-kit-orchestrator` coordinates workflows and bounded evidence use.
14
+ - `my-dev-kit-lab` owns compatibility, fixtures, experiments, and evaluation.
15
+
16
+ ## Current repository state
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.
24
+
25
+ The revised dependency path reaches practical coding-agent use before graphical
26
+ interaction:
27
+
28
+ ```text
29
+ runtime observation and stable identity
30
+ → bounded behavior, relationships, comparison, and safe-change contracts
31
+ → bounded agent context plus native ecosystem integration
32
+ → text/config-driven coding-agent change review
33
+ → interactive viewer
34
+ → structured visual annotation
35
+ → full visual human–LLM workflow
36
+ ```
37
+
38
+ Viewer and annotation enhance the proven coding-agent workflow; they are not
39
+ prerequisites for proving it.
40
+
41
+ Repository-local authorities and navigation:
42
+
43
+ - [PROJECT_DESCRIPTION.md](PROJECT_DESCRIPTION.md) contains complete durable
44
+ product intent and responsibility boundaries.
45
+ - [PROJECT_MILESTONES.md](PROJECT_MILESTONES.md) contains the complete ordered
46
+ capability plan and cross-milestone rules.
47
+ - [ROADMAP.md](ROADMAP.md) owns version-level direction without prewritten
48
+ implementation batches.
49
+ - [CURRENT_STATE.md](CURRENT_STATE.md) records only current scaffold and release
50
+ state.
51
+
52
+ Historical greenfield artifacts and reports are retained as evidence that an
53
+ earlier run overreached into v0.1; they are not current-state authority.
@@ -0,0 +1,35 @@
1
+ # Quickstart
2
+
3
+ Prerequisites are Node.js 24 or later and npm.
4
+
5
+ ```powershell
6
+ npm install
7
+ npx playwright install chromium
8
+ npm run build
9
+ ```
10
+
11
+ Run a real observation against your own local frontend:
12
+
13
+ ```powershell
14
+ node dist/cli.js observe `
15
+ --url http://localhost:3000/ `
16
+ --viewport 1280x720 `
17
+ --target header=header `
18
+ --target main-content=main `
19
+ --output observations
20
+ ```
21
+
22
+ This launches Chromium, captures a screenshot plus bounded page/target
23
+ evidence, and writes one portable artifact under `observations/<observation-id>/`.
24
+ See [COMMANDS.md](COMMANDS.md) for the full flag reference.
25
+
26
+ To validate the repository itself instead:
27
+
28
+ ```powershell
29
+ npm run typecheck
30
+ npm run lint
31
+ npm test
32
+ npm run test:browser
33
+ npm run build
34
+ npm run check:docs
35
+ ```
@@ -0,0 +1,9 @@
1
+ # Release
2
+
3
+ `v0.1.0` is published to npm as `my-frontend-observer`, validated on
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.
7
+
8
+ Observation schema version and package version remain separate: schema
9
+ `1.0.0` does not change automatically with the package version.
@@ -0,0 +1,352 @@
1
+ # Roadmap
2
+
3
+ This is a version-level specification, not an implementation checklist.
4
+ Concrete steps and sequencing are designed only when a version begins, after
5
+ the planner reads that version, inspects current repository state, and performs
6
+ needed my-dev-kit retrieval and architecture work.
7
+
8
+ ## v0.1 — Runtime Observation Foundation
9
+
10
+ Current status: released as `0.1.0`, published to npm and validated as a
11
+ packed npm tarball in a clean consumer environment on Windows, Linux, and
12
+ macOS. See `docs/CURRENT_STATE.md` for the implementation summary.
13
+
14
+ Objective and user problem: establish trustworthy evidence of what a local
15
+ frontend actually rendered, rather than relying on source inference.
16
+
17
+ Required capabilities: Node.js 24+ TypeScript CLI; explicit loopback URL,
18
+ viewport, CSS targets, and output; real Playwright Chromium capture; viewport
19
+ PNG; bounded page/target evidence; versioned portable artifact; provenance,
20
+ diagnostics, completion state, and explicit available/unavailable/not-applicable/
21
+ partial semantics.
22
+
23
+ Constraints and contracts: one reusable application service behind a thin CLI,
24
+ one Chromium adapter, external non-destructive targets, loopback-only request/
25
+ redirect/subresource policy, no full DOM/style dump, observer-owned schema
26
+ `1.0.0` independent of package version. Direct browser, computed-browser, and
27
+ derived evidence remain distinguishable.
28
+
29
+ Dependencies/ecosystem/compatibility: greenfield foundation only; no runtime
30
+ dependency or modification of my-dev-kit, orchestrator, or lab. Windows and
31
+ portable structured evidence matter; screenshot bytes need not match across OS.
32
+
33
+ Exclusions: semantic identity expansion, scrolling actions, relationships,
34
+ comparison, contracts, LLM packets, viewer, annotation, integrations, remote
35
+ browsing, credentials, cloud browsers, additional engines, databases, Docker,
36
+ plugins, and static analysis.
37
+
38
+ Acceptance: deterministic loopback fixture drives real Chromium; screenshot is
39
+ a valid nonempty PNG; page and explicit targets expose required measurements;
40
+ missing targets are honest; all validation commands pass. Planning must confirm
41
+ capture-readiness semantics, exact diagnostics, public compatibility boundaries,
42
+ and the concrete dependency/version set before implementation.
43
+
44
+ ## v0.2 — Stable Semantic Targets and Region Identity
45
+
46
+ Objective/problem: let humans and consumers refer reliably to conceptual
47
+ rendered regions across observations without brittle selector-only identity.
48
+ Required capabilities include semantic HTML, accessibility role/name, stable
49
+ id/data attributes, bounded fallbacks, resolution confidence/status, ambiguity,
50
+ and missing evidence. Runtime identity remains observer-owned and distinct from
51
+ source symbols. Depends on v0.1 artifacts and adapter boundaries; schema changes
52
+ must be additive where compatible. No scrolling, comparison, contracts, source
53
+ ownership, or viewer. Acceptance requires repeatable semantic resolution across
54
+ fixtures and explicit ambiguity. Planning must decide selector precedence and
55
+ identity persistence rules from current evidence.
56
+
57
+ ## v0.3 — Runtime Scrolling, Overflow, and Visibility Behavior
58
+
59
+ Objective/problem: show which container actually scrolls and what becomes
60
+ visible, clipped, or overflowing after controlled actions. Required capabilities
61
+ are bounded action scenarios, before/after window and target scroll positions,
62
+ viewport intersection/visibility, document/element overflow, and supported
63
+ derived scroll-owner interpretation. Depends on stable targets. Browser actions
64
+ are authoritative; derived claims cite facts. No general interaction recorder,
65
+ comparison engine, or contract semantics. Acceptance requires real-browser
66
+ fixtures for document and nested scroll owners. Planning must settle action
67
+ syntax, stabilization, and visibility thresholds.
68
+
69
+ ## v0.4 — Layout Relationships, Dependency Evidence, and Before/After Comparison
70
+
71
+ Objective/problem: explain whole-layout consequences rather than isolated
72
+ numbers. Required capabilities are containment/order/overlap/fit relationships,
73
+ comparable observation identity, before/after differences, appearance and
74
+ disappearance, geometry/visibility/overflow/relationship changes, screenshot
75
+ references, and explicit expected dependency evidence. Depends on v0.1–v0.3.
76
+ One canonical relationship and comparison layer serves all consumers;
77
+ co-change does not prove causation; causation requires explicit intent, a
78
+ contract, or another supported dependency source. No executable contracts or UI. Acceptance
79
+ requires bounded deterministic comparison with underlying evidence references.
80
+ Planning must settle comparability and tolerance semantics.
81
+
82
+ ## v0.5 — Executable Frontend Contracts and Explicit Change Scope
83
+
84
+ Objective/problem: prevent a requested local fix from silently breaking an
85
+ approved region or invariant. Required capabilities are baseline invariants,
86
+ requested/expected-dependent/protected/preserved classifications, explicit
87
+ unexpected-change results, responsive tolerances, one canonical evaluation
88
+ engine, actionable verdicts, and baseline supersession history. Both persistent
89
+ baseline contracts and per-change contracts are required. Depends on v0.4
90
+ comparison and explicit intent evidence.
91
+ Existing approved contracts remain active unless the user supersedes them.
92
+ No LLM packaging, viewer, or annotation UI. Acceptance requires fixtures where
93
+ the requested change passes but a protected property fails. Planning must settle
94
+ contract storage, approval, tolerance, and conflict resolution.
95
+
96
+ ## v0.6 — Bounded Agent Context and Native my-dev-kit Ecosystem Integration
97
+
98
+ Objective/problem: make the observer useful to an actual coding-agent workflow
99
+ by answering the smallest trustworthy runtime-plus-static context question. A
100
+ coding agent needs task-relevant rendered facts, change-scope and contract
101
+ evidence, and relevant bounded source evidence without consuming the full
102
+ repository or an unbounded browser dump.
103
+
104
+ Required capabilities: bounded runtime projections containing page/viewport
105
+ identity, stable targets, important geometry and runtime behavior,
106
+ relationships, before/after differences, contract results,
107
+ requested/dependent/protected/preserved scope, diagnostics, artifact/screenshot
108
+ references, provenance, and truncation/omission metadata; adequacy reporting;
109
+ explicit runtime/static correlation to current `my-dev-kit` identities and
110
+ bounded retrieval where reliable; observer correlation/export boundary;
111
+ orchestrator bounded runtime-evidence consumption; and exact lab
112
+ readers/fixtures/evaluation needed to prove compatibility.
113
+
114
+ Architectural/evidence constraints: runtime identity never silently becomes
115
+ source ownership; ambiguity and competing candidates remain explicit. The
116
+ observer owns runtime evidence, bounded runtime projection, and
117
+ correlation/export. `my-dev-kit` owns static indexing, architecture,
118
+ dependencies, probable ownership evidence, and retrieval. The orchestrator
119
+ coordinates bounded runtime plus static evidence but does not run the browser,
120
+ redefine observer semantics, embed huge raw artifacts, or duplicate retrieval.
121
+ The lab evaluates exact supported contracts and is not required for every
122
+ normal frontend edit. Do not introduce a shared schema package without a
123
+ demonstrated ownership/release need.
124
+
125
+ Dependency direction:
126
+
127
+ ```text
128
+ freeze bounded-agent-context and integration contract
129
+ → determine whether my-dev-kit requires a static-side change
130
+ → implement observer bounded projection/correlation/export
131
+ → implement orchestrator bounded runtime-evidence consumption
132
+ → add lab exact readers/fixtures/evaluation needed for compatibility
133
+ → run individual repository readiness
134
+ → run coordinated exact-version validation
135
+ ```
136
+
137
+ This is cross-repository dependency direction, not an implementation batch
138
+ plan. Modify `my-dev-kit` only if current identities/retrieval lack a generic
139
+ static-side capability actually required by the frozen contract.
140
+
141
+ Dependencies/ecosystem/compatibility: depends on v0.1–v0.5 stable observation,
142
+ identity, behavior, comparison, relationship, contract, and change-scope
143
+ semantics. Potentially affected repositories are observer, orchestrator, lab,
144
+ and only when proven necessary, `my-dev-kit`. Pin package/candidate identities,
145
+ schema/artifact/context versions, consumer expectations, and fixture hashes;
146
+ validate downstream consumers against intended candidates rather than stale
147
+ published packages.
148
+
149
+ Exclusions: viewer, visual annotation, source editing, a new static analyzer,
150
+ browser execution in the orchestrator, broad lab product work, external LLM
151
+ APIs, full DOM/style/accessibility dumps, unrelated observations, and embedded
152
+ heavy assets where references suffice.
153
+
154
+ Acceptance: a coding agent or LLM receives bounded traceable runtime problem
155
+ evidence plus change scope/contracts plus relevant static/source evidence;
156
+ adequacy/omission/truncation and correlation ambiguity remain visible; producer
157
+ responsibilities stay distinct; exact lab consumers pass; each affected
158
+ repository passes readiness; and coordinated exact-version validation passes.
159
+ Version-start planning must decide projection profiles, redaction/text limits,
160
+ correlation ownership/evidence, the orchestrator evidence-kind representation,
161
+ whether `my-dev-kit` changes are necessary, and whether any shared contract
162
+ package is justified.
163
+
164
+ ## v0.7 — End-to-End Coding-Agent Frontend Change Review
165
+
166
+ Objective/problem: prove the core practical outcome before graphical work—a
167
+ text/config-driven coding-agent correction loop that cannot call a local
168
+ requested mutation successful while protected behavior regresses.
169
+
170
+ Required capabilities:
171
+
172
+ ```text
173
+ capture approved baseline
174
+ → preserve baseline contracts
175
+ → human expresses requested change in text/config
176
+ → construct requested/dependent/protected/preserved scope
177
+ → generate bounded runtime evidence
178
+ → obtain relevant bounded static evidence
179
+ → assemble coding-agent context
180
+ → external coding agent modifies target source
181
+ → observer captures new state
182
+ → compare before/after
183
+ → evaluate requested changes
184
+ → evaluate expected dependent changes
185
+ → verify protected properties
186
+ → rerun baseline contracts
187
+ → PASS or actionable regression failure
188
+ ```
189
+
190
+ Unexpected changes remain explicit. Existing approved baseline contracts and
191
+ the new per-change contract both remain active unless explicitly superseded.
192
+
193
+ Architectural/evidence constraints: the observer does not edit target source; an
194
+ external coding agent or implementation tool does. All runtime, static,
195
+ workflow, implementation, and verification identities remain traceable to their
196
+ owners. One canonical observer, relationship, comparison, contract, and
197
+ change-scope implementation serves CLI/programmatic and later UI consumers. The
198
+ workflow must not require an interactive viewer, visual drawing, or annotation
199
+ authoring.
200
+
201
+ Dependencies/ecosystem/compatibility: depends on v0.6 bounded integrated agent
202
+ context and v0.1–v0.5 evidence/contract foundations. Use compatible exact
203
+ observer, `my-dev-kit`, orchestrator, and lab contract versions established by
204
+ v0.6; the lab remains optional for ordinary edits once compatibility is proven.
205
+
206
+ Exclusions: graphical inspection as a prerequisite, visual annotation, observer
207
+ source editing, autonomous approval, hidden contract supersession, and treating
208
+ all differences as failures.
209
+
210
+ Acceptance: controlled successful and failing changes complete end-to-end. The
211
+ required failure case has a requested change succeed while a protected property
212
+ or preserved invariant fails, producing overall failure and actionable
213
+ evidence. The agent receives bounded runtime/static context, edits externally,
214
+ the observer rerenders, all active contracts rerun, and the result is traceable.
215
+ Version-start planning must decide the text/config request format, coding-agent
216
+ handoff boundary, controlled target/change mechanism, approval/baseline history,
217
+ failure reporting, and exact workflow entry points.
218
+
219
+ ## v0.8 — Interactive Local Observation Viewer
220
+
221
+ Objective/problem: let developers inspect and understand the same canonical
222
+ evidence already used by the operational coding-agent workflow without opening
223
+ raw artifact files manually.
224
+
225
+ Required capabilities: local artifact/context readers; screenshot and stable
226
+ target inspection; geometry, semantics, scrolling/overflow, visibility,
227
+ relationships, and before/after views; diagnostics and honest evidence states;
228
+ requested/dependent/protected/preserved/unexpected classifications; baseline and
229
+ per-change contract results; source-correlation evidence with uncertainty; and
230
+ navigation between relevant raw evidence and bounded agent-context references.
231
+
232
+ Architectural/evidence constraints: the viewer consumes existing observation,
233
+ relationship, comparison, contract, change-scope, correlation, and bounded
234
+ context engines/contracts. It must not create a second observer, relationship
235
+ engine, comparison engine, contract engine, correlation implementation, or
236
+ context builder. CLI/programmatic paths remain first-class, and viewer state
237
+ does not mutate targets.
238
+
239
+ Dependencies/ecosystem/compatibility: depends on the proven v0.7 workflow and
240
+ stable v0.1–v0.6 artifacts/contracts. It may display ecosystem correlation but
241
+ does not redefine it. Viewer readers must declare supported artifact/context
242
+ versions and show unsupported, missing, partial, derived, and ambiguous evidence
243
+ honestly.
244
+
245
+ Exclusions: annotation authoring, source editing, a second workflow engine,
246
+ cloud hosting, and making the viewer mandatory for observation or coding-agent
247
+ review.
248
+
249
+ Acceptance: a developer can inspect screenshots, targets, runtime behavior,
250
+ relationships, changes, contracts, diagnostics, change scope, and correlation
251
+ evidence through the UI, and the displayed evidence is demonstrably the same
252
+ canonical evidence used by CLI/programmatic and coding-agent workflows.
253
+ Version-start planning must choose UI technology, local process boundary,
254
+ reader/version strategy, coordinate/overlay behavior, and large-artifact loading
255
+ policy from the then-current repository.
256
+
257
+ ## v0.9 — Human Visual Annotation and Design-Intent Capture
258
+
259
+ Objective/problem: add structured visual human intent to the already working
260
+ v0.7 coding-agent workflow through the v0.8 viewer without inventing a separate
261
+ change-semantics system.
262
+
263
+ Required capabilities: a bounded annotation set chosen during planning, such as
264
+ point/select, rectangle/area, arrow, line/boundary, textual note, preserve,
265
+ resize, move, remove, and inspect; structured annotation artifacts preserving
266
+ observation/screenshot identity, geometry, type, text, provenance, and reliable
267
+ target/relationship association; save/reload; annotated screenshot references;
268
+ and explicit interpretation/confirmation state.
269
+
270
+ Canonical intent flow:
271
+
272
+ ```text
273
+ visual annotation
274
+ → target/relationship binding
275
+ → candidate requested/dependent/protected/preserved intent
276
+ → explicit confirmation/interpretation where necessary
277
+ → canonical change contract
278
+ ```
279
+
280
+ Architectural/evidence constraints: annotation feeds the existing canonical
281
+ change-scope, contract, bounded-context, and coding-agent workflow. It must not
282
+ create annotation-only requested/protected semantics or different PASS/FAIL
283
+ rules. Ambiguous drawings never silently become strong requirements. Original
284
+ raw observations remain immutable.
285
+
286
+ Dependencies/ecosystem/compatibility: depends on stable identity, contracts,
287
+ v0.7 coding-agent review, and v0.8 viewer/coordinate mapping. Structured
288
+ annotation/context versions must be explicit and remain traceable to supported
289
+ observation and screenshot identities.
290
+
291
+ Exclusions: flattening intent into pixels only, bypassing confirmation,
292
+ replacing text/config requests, source editing, or making annotation mandatory
293
+ for ordinary coding-agent changes.
294
+
295
+ Acceptance: annotations remain structured and traceable, survive save/reload,
296
+ bind to stable targets/relationships where reliable, require confirmation when
297
+ ambiguous, and can drive the existing coding-agent review through the canonical
298
+ contract model. Version-start planning must select the first annotation set,
299
+ coordinate transforms, persistence/versioning, interpretation/confirmation
300
+ workflow, conflicts, and annotated-image derivation.
301
+
302
+ ## v0.10 — Full Visual Human–LLM Frontend Change Workflow
303
+
304
+ Objective/problem: complete the visual communication branch by combining the
305
+ already operational coding-agent loop with graphical inspection and structured
306
+ annotation.
307
+
308
+ Required workflow:
309
+
310
+ ```text
311
+ human views actual captured frontend
312
+ → points/draws/annotates requested design change
313
+ → observer binds intent to stable runtime regions
314
+ → change scope is constructed/confirmed
315
+ → bounded runtime evidence is produced
316
+ → bounded static evidence is obtained
317
+ → coding-agent context is assembled
318
+ → external coding agent modifies source
319
+ → observer rerenders
320
+ → requested/dependent/protected/preserved behavior is evaluated
321
+ → viewer shows PASS/failure evidence
322
+ → human approves or requests correction
323
+ → successful state may become the new approved baseline
324
+ ```
325
+
326
+ Architectural/evidence constraints: a visual request does not erase existing
327
+ baseline contracts. Unless explicitly superseded, existing approved contracts
328
+ plus the new visual/per-change contract must both pass. Unexpected changes
329
+ remain visible. Runtime, static, annotation, workflow, implementation, and
330
+ approval evidence remain separate and traceable. The observer stays
331
+ non-mutating; the orchestrator coordinates bounded evidence; the lab is not
332
+ required for every normal edit.
333
+
334
+ Dependencies/ecosystem/compatibility: depends on all prior versions, especially
335
+ the v0.7 core loop, v0.8 viewer, and v0.9 annotation intent model. Use exact
336
+ compatible observer/static/orchestrator/context/annotation/viewer contracts and
337
+ retain the four-project responsibility split.
338
+
339
+ Exclusions: replacing the external coding agent with observer source editing,
340
+ visual intent silently overriding baseline contracts, opaque AI-only verdicts,
341
+ untraceable baseline replacement, and making lab evaluation part of every edit.
342
+
343
+ Acceptance: demonstrate a successful visual change; a requested visual change
344
+ that introduces a protected/invariant regression; actionable viewer failure
345
+ evidence; a correction cycle; human approval/new-baseline history; and compatible
346
+ integrated ecosystem evidence. A protected/invariant failure must fail overall
347
+ even when the requested local visual change succeeds. Version-start planning
348
+ must settle visual workflow entry points, approval identity and authority,
349
+ baseline governance, correction iteration history, artifact retention, and
350
+ cross-version compatibility.
351
+
352
+
@@ -0,0 +1,33 @@
1
+ # Security
2
+
3
+ ## Current controls
4
+
5
+ `my-frontend-observer` launches a real, sandboxed Chromium browser
6
+ (`src/browser/chromiumAdapter.ts`) and enforces a conservative, local-first,
7
+ credential-free, non-destructive browser/network boundary
8
+ (`src/safety/policy.ts`) as actual product behavior, covered by real-Chromium
9
+ tests:
10
+
11
+ - allowed schemes are `http`/`https` only;
12
+ - allowed hosts are loopback only (`localhost`, `127.0.0.1`, `::1`, and any
13
+ `127.x.x.x` form) - no DNS resolution, no arbitrary "local dev host";
14
+ - credential-bearing URLs (`user:pass@host`) are rejected;
15
+ - the initial target, every navigation redirect, and every subresource
16
+ request are independently classified against the same loopback policy and
17
+ blocked before being contacted if unsafe;
18
+ - popups and downloads are never followed/saved (reported as non-fatal
19
+ diagnostics);
20
+ - navigation and readiness are bounded by explicit, request-configured
21
+ timeouts - no unbounded wait;
22
+ - the Chromium browser/context/page are reliably closed on every exit path
23
+ (success, safety rejection, navigation/readiness failure, or an
24
+ unexpected internal error);
25
+ - the observed target's own content/source is never modified by observation.
26
+
27
+ ## Not yet addressed
28
+
29
+ Certificate-failure-specific handling, permission-prompt-specific handling
30
+ (Chromium's default deny-all applies; no permission is ever explicitly
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.
@@ -0,0 +1,51 @@
1
+ # Workflows
2
+
3
+ ## Current validation workflow
4
+
5
+ ```text
6
+ install dependencies (npm install; npx playwright install chromium)
7
+ → validate types and lint
8
+ → run the fast unit suite (npm test)
9
+ → run the real-Chromium integration suite (npm run test:browser)
10
+ → build the CLI/library entries (npm run build)
11
+ → validate documentation (npm run check:docs)
12
+ ```
13
+
14
+ ## Current v0.1 observation workflow
15
+
16
+ The real, source-checkout `observe` workflow is:
17
+
18
+ ```text
19
+ CLI arguments (--url, --viewport, --target, --output, --timeout)
20
+ → request construction
21
+ → existing Batch 1 request validation/normalization
22
+ → 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
+ → concise CLI result (Observation/State/Artifact/Targets/Diagnostics)
28
+ → process exit status (0 for a persisted observation, including one whose
29
+ state honestly reports "partial"; nonzero otherwise)
30
+ ```
31
+
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.
37
+
38
+ The future dependency order after observation is:
39
+
40
+ ```text
41
+ stable targets and bounded runtime behavior
42
+ → relationships, comparison, and safe-change contracts
43
+ → bounded agent context plus runtime/static ecosystem integration
44
+ → text/config-driven coding-agent change review
45
+ → interactive viewer
46
+ → structured visual annotation
47
+ → full visual human–LLM workflow
48
+ ```
49
+
50
+ None of these later workflows is implemented. The v0.7 coding-agent workflow
51
+ must work without the v0.8 viewer or v0.9 annotation system.
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "my-frontend-observer",
3
+ "version": "0.1.0",
4
+ "description": "Local-first browser runtime evidence producer",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/dailephd/my-frontend-observer.git"
9
+ },
10
+ "bin": {
11
+ "my-frontend-observer": "dist/cli.js"
12
+ },
13
+ "exports": {
14
+ ".": "./dist/index.js"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "CHANGELOG.md",
20
+ "docs"
21
+ ],
22
+ "engines": {
23
+ "node": ">=24"
24
+ },
25
+ "scripts": {
26
+ "prebuild": "node scripts/clean.mjs",
27
+ "build": "tsc -p tsconfig.json",
28
+ "typecheck": "tsc -p tsconfig.json --noEmit",
29
+ "lint": "eslint .",
30
+ "test": "vitest run --passWithNoTests",
31
+ "test:browser": "vitest run --config vitest.browser.config.ts --passWithNoTests",
32
+ "test:security": "vitest run tests/unit/policy.test.ts && vitest run --config vitest.browser.config.ts tests/browser/chromiumAdapter.test.ts",
33
+ "check:docs": "node scripts/check-docs.mjs"
34
+ },
35
+ "devDependencies": {
36
+ "@eslint/js": "10.0.1",
37
+ "@types/node": "24.13.3",
38
+ "eslint": "10.8.1",
39
+ "typescript": "6.0.3",
40
+ "typescript-eslint": "8.66.0",
41
+ "vitest": "4.1.10"
42
+ },
43
+ "dependencies": {
44
+ "playwright": "^1.62.1"
45
+ }
46
+ }