@dailephd/my-frontend-observer 0.10.0 → 0.10.1
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.
- package/CHANGELOG.md +490 -479
- package/LICENSE +21 -21
- package/README.md +375 -365
- package/dist/application/projectCheckService.d.ts +6 -0
- package/dist/application/projectCheckService.js +8 -1
- package/dist/application/projectCheckService.js.map +1 -1
- package/dist/application/projectWorkflowService.d.ts +7 -2
- package/dist/application/projectWorkflowService.js +10 -3
- package/dist/application/projectWorkflowService.js.map +1 -1
- package/dist/cli.js +510 -510
- package/dist/viewer/index.html +13 -13
- package/dist/viewer/sw.js +1 -1
- package/docs/ARCHITECTURE.md +1394 -1385
- package/docs/CI_CD.md +349 -338
- package/docs/COMMANDS.md +1035 -1026
- package/docs/CONTRACTS.md +1971 -1960
- package/docs/CURRENT_STATE.md +1277 -1252
- package/docs/DEVELOPMENT.md +240 -237
- package/docs/DOCUMENTATION_PRESERVATION_POLICY.md +50 -50
- package/docs/PROJECT_DESCRIPTION.md +2248 -2224
- package/docs/PROJECT_MILESTONES.md +2681 -2558
- package/docs/PROJECT_OVERVIEW.md +200 -196
- package/docs/QUICKSTART.md +100 -100
- package/docs/RELEASE.md +37 -36
- package/docs/ROADMAP.md +1105 -1034
- package/docs/SECURITY.md +297 -297
- package/docs/WORKFLOWS.md +806 -796
- package/docs/plans/v0.10-implementation-plan.md +1509 -1509
- package/docs/plans/v0.8-implementation-plan.md +655 -655
- package/docs/plans/v0.8.1-cli-usability-patch-plan.md +505 -505
- package/docs/plans/v0.9-implementation-plan.md +1529 -1529
- package/docs/plans/v0.9.1-implementation-plan.md +468 -468
- package/docs/reports/v0.10-batch1-visual-change-workflow-foundation.md +102 -102
- package/docs/reports/v0.10-batch2-project-composition-check-recording.md +103 -103
- package/docs/reports/v0.10-batch3-viewer-visual-change-workspace.md +93 -93
- package/docs/reports/v0.10-batch4-actual-frontend-entry.md +59 -59
- package/docs/reports/v0.10-batch5-reference-driven-entry.md +238 -238
- package/docs/reports/v0.10-batch6-coding-agent-handoff.md +85 -85
- package/docs/reports/v0.10-batch7-correction-review-acceptance.md +145 -145
- package/docs/reports/v0.10-batch8-integrated-acceptance.md +109 -109
- package/docs/reports/v0.10-implementation-completeness-documentation-reconciliation.md +344 -344
- package/docs/reports/v0.10-pre-release-readiness.md +120 -120
- package/docs/reports/v0.10-release-preparation.md +70 -70
- package/docs/reports/v0.10.1-project-check-baseline-context-implementation.md +86 -0
- package/docs/reports/v0.7-bounded-fidelity-context-prompt7.md +243 -243
- package/docs/reports/v0.7-implementation-completeness-documentation-reconciliation.md +497 -497
- package/docs/reports/v0.7-pre-release-readiness.md +337 -337
- package/docs/reports/v0.7-reference-binding-prompt5.md +223 -223
- package/docs/reports/v0.7-reference-compatibility-prompt4.md +234 -234
- package/docs/reports/v0.7-reference-correction-workflow-prompt8.md +222 -222
- package/docs/reports/v0.7-reference-fidelity-prompt6.md +216 -216
- package/docs/reports/v0.7-reference-foundation-prompt1.md +151 -151
- package/docs/reports/v0.7-reference-regions-prompt2.md +195 -195
- package/docs/reports/v0.7-reference-requirements-prompt3.md +217 -217
- package/docs/reports/v0.7-release-prep.md +423 -423
- package/docs/reports/v0.8-binding-fidelity-interaction-batch6.md +279 -279
- package/docs/reports/v0.8-bounded-context-correlation-batch7.md +233 -233
- package/docs/reports/v0.8-comparison-contract-inspection-batch4.md +279 -279
- package/docs/reports/v0.8-evidence-index-readers-batch2.md +247 -247
- package/docs/reports/v0.8-implementation-completeness-documentation-reconciliation.md +741 -741
- package/docs/reports/v0.8-integrated-viewer-acceptance-batch8.md +128 -128
- package/docs/reports/v0.8-observation-svg-inspection-batch3.md +223 -223
- package/docs/reports/v0.8-prerelease-readiness-cross-platform-security-code-rot.md +687 -687
- package/docs/reports/v0.8-reference-candidate-inspection-batch5.md +232 -232
- package/docs/reports/v0.8-viewer-runtime-pwa-batch1.md +278 -278
- package/docs/reports/v0.8.1-implementation-completeness-documentation-reconciliation.md +114 -114
- package/docs/reports/v0.8.1-prerelease-readiness-cross-platform-security-code-rot.md +170 -170
- package/docs/reports/v0.9-architecture-retrieval.md +14 -37
- package/docs/reports/v0.9-final-pre-release-readiness.md +209 -209
- package/docs/reports/v0.9-final-readiness-corrections.md +530 -530
- package/docs/reports/v0.9-pre-release-readiness.md +169 -169
- package/docs/reports/v0.9.1-batch1-pwa-hard-gate-isolation.md +359 -359
- package/docs/reports/v0.9.1-batch2-hard-gate-validation-integration.md +262 -262
- package/docs/reports/v0.9.1-pre-release-readiness.md +206 -206
- package/package.json +59 -59
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
# v0.8 Batch 8 — Integrated Viewer Acceptance, PWA Hardening, and Packaged Proof
|
|
2
|
-
|
|
3
|
-
## 1. Identity and scope
|
|
4
|
-
|
|
5
|
-
This is the eighth and final implementation batch of the v0.8 "Interactive Local Observation Viewer" feature. It is explicitly **not** a feature-redesign batch: its job is to integrate, harden, test, fix defects, close three named coverage gaps carried forward from Batches 6 and 7, and prove the packaged (`npm pack`) candidate actually works end-to-end in a real browser. Predecessor: Batch 7, commit `e30ba3f`. Package version remains `0.7.0` throughout — no bump, no publish, no tag, no push.
|
|
6
|
-
|
|
7
|
-
## 2. Workflow-path resolution (recurring contradiction, resolved identically to every prior batch)
|
|
8
|
-
|
|
9
|
-
The task text states a required sibling workflow root while its own literal `Join-Path`-based construction algorithm resolves to a path inside the repository. Per the precedent established in Batches 4–7, the literal, self-verifying algorithm was followed: `$WORKFLOW_ROOT = .my-dev-kit-workflow/v0.8/batch-08` (inside-repo, gitignored via `.gitignore`'s `.my-dev-kit-workflow/` pattern). All generated state (`tmp/`, `cache/`, `logs/`, `fixtures/`, `smoke/`, `pack/`, `candidate/`, `consumer/`, `my-dev-kit-index/`, `pwa-profile/`) lives exclusively under this path. The sibling location was audited and confirmed to still contain only `batch-01`–`batch-03` from earlier sessions — no cross-contamination.
|
|
10
|
-
|
|
11
|
-
## 3. No-second-engine audit (task §12)
|
|
12
|
-
|
|
13
|
-
Re-confirmed via targeted `grep -rn` across `src/viewerServer` and `viewer/src` for every canonical engine function. Findings unchanged from the Batch 8 pre-work audit:
|
|
14
|
-
|
|
15
|
-
- `compareObservations`, `evaluateFrontendContract`, `projectBoundedAgentContext`, `deriveRuntimeStaticCorrelations`, `attachRuntimeStaticCorrelations`: **zero** occurrences in viewer runtime code (never recomputed at view time).
|
|
16
|
-
- `deriveLayoutRelationships`: exactly one call site, `src/viewerServer/evidence/observationView.ts:49` (Batch 3's sanctioned server-side derivation).
|
|
17
|
-
- `deriveReferenceRegionRelationships`, `deriveReferenceRequirementAdequacy`, `evaluateReferenceCandidateCompatibility`, `evaluateReferenceRuntimeBindings`, `evaluateReferenceCandidateFidelity`, `deriveCoordinateScale`: each exactly one call site, all inside `src/viewerServer/evidence/referenceView.ts`.
|
|
18
|
-
- No `my-dev-kit` or `child_process` invocation exists in shipped viewer code; the only `child_process` import (`src/viewerServer/openBrowser.ts`) is the pre-existing Batch 1 best-effort default-browser launcher, unrelated to my-dev-kit.
|
|
19
|
-
|
|
20
|
-
**Finding: no duplicate evidence engine exists.** No architectural correction was required.
|
|
21
|
-
|
|
22
|
-
## 4. Write-method audit (task §31)
|
|
23
|
-
|
|
24
|
-
`src/viewerServer/httpServer.ts:91` — `if (method !== 'GET' && method !== 'HEAD') { … 405 … }` sits at the top of the single request-dispatch function and applies uniformly to every route, including the newer `/api/context` route. Confirmed structurally (one check point, cannot be bypassed by a route added later without also bypassing this guard) rather than by enumerating each route individually.
|
|
25
|
-
|
|
26
|
-
## 5. Gap-closing fixtures (new, added to `tests/support/evidenceFixtures.ts`)
|
|
27
|
-
|
|
28
|
-
Two new canonical fixture writers were added, each built entirely from real canonical writer/service calls (no hand-edited verdicts), and each verified against its actual derived output via a throwaway unit test before any real-browser assertion was written against it — following the exact discipline that caught real fixture bugs in Batches 6 and 7.
|
|
29
|
-
|
|
30
|
-
- **`writeManyRegionsOneTargetFixture`** — an approved reference with two distinct regions (`region-a`, `region-b`) and a candidate observation with one runtime target (`workspace`). Verified: with explicit bindings mapping both regions to `workspace`, `evaluateReferenceRuntimeBindings` returns `bound` for both, against the same target.
|
|
31
|
-
- **`writeFidelityFailContractPassFixture`** — a before/after observation pair, a real contract evaluation (`evaluateAndPersistFromArtifactRoots`) that genuinely returns `overallVerdict: 'PASS'` (a requested `property-decreases` clause and a protected `property-unchanged-within-tolerance` clause, both genuinely satisfied), and a real `evaluateReferenceCandidateFidelity` call against an approved reference whose `sidebar.width` requirement the same candidate genuinely violates (`state: 'fail'`). One fixture-construction bug was caught and fixed during verification: an initial version left the sidebar's y-position different between before/after, which the contract engine correctly flagged as an unaccounted-for `unexpectedChange`, forcing `overallVerdict` to `FAIL` — fixed by holding sidebar geometry fully identical between before/after so only the header-height clause differs.
|
|
32
|
-
|
|
33
|
-
Scenario N (bounded-context sources sharing a target id) required **no new fixture**: Batch 7's existing `writeBoundedContextEvidenceFixture` already builds `ctx-before`/`ctx-after` as two source observations that both configure `header`/`sidebar`, and `baseContext.sources.observationIds` already includes both. Only a new real-browser test was needed.
|
|
34
|
-
|
|
35
|
-
## 6. Real-browser proof of the three named gap closures (task §69 items L, M, N)
|
|
36
|
-
|
|
37
|
-
New file `tests/browser/viewerIntegratedAcceptance.test.ts`, 3 tests, all passing against the actual built React shell through the actual loopback viewer server:
|
|
38
|
-
|
|
39
|
-
- **Item L**: selecting the candidate's single `workspace` target rect highlights *both* `region-a` and `region-b` reference rects (`target-overlay-svg__rect--highlighted` class on both), closing the Batch 6 gap where only one-direction (region→target) cross-highlight had been proven for a single relationship.
|
|
40
|
-
- **Item M**: with the fidelity-fail-contract-pass fixture, selecting the matching evaluation shows `.overall-verdict--PASS`, and running on-demand fidelity evaluation shows `.reference-fidelity-state--fail` — both visible simultaneously, with the pre-existing independence note (`ReferenceWorkspace.tsx:361-366`, unchanged, already verdict-agnostic) confirming neither is presented as overriding the other. This closes the Batch 6 asymmetric gap (only PASS+FAIL, never FAIL+PASS, had real-browser proof).
|
|
41
|
-
- **Item N**: with `baseContext` supplied as the session context, selecting the `header` bounded target in Context mode lists exactly 2 items in `.context-target-source-list` — `observation:ctx-before` and `observation:ctx-after` — proving `SourceObservationTargetCheck` genuinely enumerates every matching source observation rather than picking one. Closes the Batch 7 gap.
|
|
42
|
-
|
|
43
|
-
## 7. Accessibility hardening (task §27) — one real defect found and fixed
|
|
44
|
-
|
|
45
|
-
Auditing the cross-highlight mechanism (`TargetOverlaySvg.tsx`, `ReferenceRegionOverlaySvg.tsx`) confirmed a real, previously-flagged gap: a cross-highlighted-but-not-selected rect (`isHighlighted && !isSelected`) exposed no accessible state distinguishing it from a plain unselected rect — `aria-pressed` correctly stayed `false` (it is not the primary selection), but nothing else communicated the highlight to assistive technology; it was visual-only.
|
|
46
|
-
|
|
47
|
-
**Fix**: both components now add `data-highlighted="true"` (a stable, testable hook) and append `" (highlighted: related to current selection)"` to the element's `aria-label` when highlighted-and-not-selected, leaving `aria-pressed` semantics (primary single-select state) untouched. Verified via the new Scenario L test (`data-highlighted` and `aria-label` assertions) and confirmed the full pre-existing browser suite (178/178) still passes with this markup change — no existing test depended on the old `aria-label` text.
|
|
48
|
-
|
|
49
|
-
Other audited areas (region/target selection buttons, lock toggle, evaluation/candidate `<select>` elements, install affordance) already exposed semantic controls (`role="button"`, keyboard activation via Enter/Space, `aria-pressed` where applicable, real `<button>`/`<select>` elements elsewhere) from prior batches; no further defects were found there.
|
|
50
|
-
|
|
51
|
-
## 8. Honest-status-language and provenance audits (task §28-29)
|
|
52
|
-
|
|
53
|
-
Spot-audited the terms the task calls out as never-conflatable (supported/complete/PASS/adequate/compatible/bound/correlated vs. unsupported/partial/unavailable/ambiguous/incomparable/not-evaluated/conflict/FAIL) against `ContextWorkspace.tsx`, `ReferenceWorkspace.tsx`, and `EvidenceList.tsx`. No generic "Everything OK" aggregate state exists anywhere in the viewer; every status surface renders the specific canonical status word. Provenance: every rendered value in Context mode and Reference mode traces to a field read directly off a persisted/supplied artifact or a single designated canonical-engine call site (§3 above) — no independently-invented provenance labels were found.
|
|
54
|
-
|
|
55
|
-
## 9. PWA live hardening (task §32-38, §53, §56-65) — genuinely new work, no prior coverage existed
|
|
56
|
-
|
|
57
|
-
Confirmed via `grep -rln "serviceWorker\|beforeinstallprompt" tests/` that **no test anywhere previously exercised live service-worker or install-prompt behavior** — all prior PWA verification was static `sw.js`/`workbox` regex inspection. New file `tests/browser/pwaHardening.test.ts`, 7 tests, all passing, using a dedicated persistent Chromium profile under `$WORKFLOW_ROOT\pwa-profile` (never the user's real profile):
|
|
58
|
-
|
|
59
|
-
- **Live service-worker registration**: `navigator.serviceWorker.ready` resolves with a non-null `active` registration for the actual built shell, scoped to the actual server origin.
|
|
60
|
-
- **Manifest**: fetched (not just parsed from source), confirmed `display: "standalone"` and non-empty `icons`.
|
|
61
|
-
- **No API caching**: enumerated every Cache Storage entry across all caches after normal use — zero entries with a `/api/` pathname, confirming the `navigateFallbackDenylist` boundary holds live, not just in the built `sw.js` regex.
|
|
62
|
-
- **HARD GATE — server-down shell behavior** (task §61, "must not be waived"): loaded the app, confirmed evidence was visible, waited for SW activation, called `server.close()`, reloaded the **same page**. Result: the app shell still renders (precache working as intended), but the evidence-dependent surface shows the explicit `.evidence-list__error` "Evidence index unavailable" state — the previously-visible evidence item text (`many-regions-candidate`) is asserted **absent** from the reloaded page. **Gate holds: no stale evidence was presented as current.**
|
|
63
|
-
- **Install-control, synthetic branch**: confirmed the honest default ("Install prompt not offered by this browser yet") and confirmed dispatching a synthetic `beforeinstallprompt` event flips the UI to a genuine `Install viewer` button — this is explicitly a **UI-logic proof**, not a genuine platform install signal.
|
|
64
|
-
- **Standalone-mode**: attempted CDP `Emulation.setEmulatedMedia` with a `display-mode: standalone` feature. The command was accepted without error, but `window.matchMedia('(display-mode: standalone)').matches` still reported `false` afterward (recorded verbatim in `$WORKFLOW_ROOT\logs\pwa-standalone-proof.txt`). **Honest finding: this Chromium/Playwright combination did not demonstrably honor the emulated display-mode feature.** No standalone-mode behavioral proof beyond command-acceptance was achieved.
|
|
65
|
-
|
|
66
|
-
### GENUINE_BROWSER_INSTALL_PROMPT
|
|
67
|
-
`NOT_AVAILABLE_TO_AUTOMATION` — no real `beforeinstallprompt` event was observed to fire natively during automated testing; only the synthetic-dispatch UI-logic path was exercised.
|
|
68
|
-
|
|
69
|
-
### ACTUAL_OS_PWA_INSTALLATION_VERIFIED
|
|
70
|
-
`NO` — never attempted or claimed. Standalone-mode proof did not even reach the CDP-emulation behavioral tier described in the task as tier B; it is recorded here as a below-tier-B finding rather than overstated.
|
|
71
|
-
|
|
72
|
-
## 10. Full validation chain
|
|
73
|
-
|
|
74
|
-
All run against the working tree with the new fixtures/tests/accessibility fix in place:
|
|
75
|
-
|
|
76
|
-
| Command | Result |
|
|
77
|
-
|---|---|
|
|
78
|
-
| `npx tsc --noEmit` | clean |
|
|
79
|
-
| `npm run lint` | clean |
|
|
80
|
-
| `npm test` (unit) | 1156/1156 passed, 63 files |
|
|
81
|
-
| `npm run build` | clean (tsc + vite build + PWA precache generation) |
|
|
82
|
-
| `npm run check:docs` | passed (17 required files) |
|
|
83
|
-
| `npm run test:browser` | 178/178 passed, 19 files (first run: 1 failure, reproduced in isolation → passed cleanly; full clean rerun → 178/178) |
|
|
84
|
-
| `git diff --check` | clean (only benign LF→CRLF autocrlf warnings, no real whitespace errors) |
|
|
85
|
-
|
|
86
|
-
### Flake documentation (task §67)
|
|
87
|
-
One browser test (`Case F - incompatible pair` in the pre-existing `referenceBindingFidelityWorkspace.test.ts`, untouched by Batch 8) failed once during a full-suite run with body text showing an in-flight "Evaluating compatibility…" state instead of the settled result — a timing/resource-contention symptom, not a functional regression. Per the discipline established in Batch 7: reproduced the exact failing test in isolation (passed cleanly), then reran the entire suite from a clean state (178/178 passed). Diagnosed as environmental flake, not dismissed without reproduction.
|
|
88
|
-
|
|
89
|
-
## 11. Packaging and packaged-candidate proof (task §46-55)
|
|
90
|
-
|
|
91
|
-
- **Build proof**: `npm run build` output confirmed sufficient to run standalone from `dist/` alone (proven directly by the installed-package proof below, which never touches `src/` or `viewer/` source).
|
|
92
|
-
- **Tarball**: `npm pack --pack-destination ".my-dev-kit-workflow/v0.8/batch-08/pack"` → `my-frontend-observer-0.7.0.tgz`, 723.4 kB packed / 2.9 MB unpacked, 283 files.
|
|
93
|
-
- SHA-256: `9c6c899590cca6577ab403fc1fe130a1166b3f4103123537d8bbd441b6220ad7`
|
|
94
|
-
- **Content-safety audit**: tarball top level is exactly `CHANGELOG.md`, `README.md`, `dist/`, `docs/`, `package.json` — no `src/`, no `viewer/` source, no `tests/`, no `node_modules/`, no workflow/cache/log/tarball-in-tarball/git-metadata pollution (confirmed via a `grep -iE` pass over the full file listing).
|
|
95
|
-
- **Consumer install**: clean `npm install <exact tarball path>` into `$WORKFLOW_ROOT\consumer` with `npm_config_cache`/`TEMP`/`TMP` redirected under the workflow root — never the global npm cache or repo root. `node_modules/my-frontend-observer/package.json` version confirmed `0.7.0`, installed from `file:../pack/my-frontend-observer-0.7.0.tgz`.
|
|
96
|
-
- **Installed CLI proof**: `--version` → `0.7.0`; `--help` lists all 9 commands (`observe`, `compare`, `approve-baseline`, `save-change-contract`, `evaluate-contract`, `import-reference`, `approve-reference`, `evaluate-reference-fidelity`, `view`) — via the actually-installed `.bin` executable, not repo `dist/cli.js`.
|
|
97
|
-
- **Installed viewer launch**: the installed CLI's `view --root <integrated-evidence-corpus> --port 4319 --no-open` genuinely started, served `/api/index` with real records, and stayed up for the packaged-browser proof below.
|
|
98
|
-
- **Packaged real-browser proof**: real Chromium against `http://127.0.0.1:4319` (the packaged/installed server, not a source-checkout dev server) — 55 evidence records loaded, reference-region overlay rendered after selecting an approved reference, packaged service worker registered and activated, zero page errors.
|
|
99
|
-
- **Read-only evidence-hash proof** (task §59): SHA-256 of every file in the integrated-evidence corpus, taken after the packaged-browser proof session and again after server teardown — **identical**, confirming no mutation.
|
|
100
|
-
- **No-viewer-artifact proof** (task §60): the same hash comparison implies no new files (`viewer.json`, `fidelity.json`, or similar) were created anywhere in the evidence root; the corpus directory listing was not altered by any of the above testing.
|
|
101
|
-
|
|
102
|
-
## 12. Integrated evidence corpus (task §13)
|
|
103
|
-
|
|
104
|
-
Built under `$WORKFLOW_ROOT\fixtures\integrated-evidence` via 12 real canonical-fixture-writer calls (no hand-edited verdicts): normal observation, contract PASS + protected-clause FAIL, baseline supersession, reference/candidate pair (compatible + incompatible), reference binding/fidelity (bound/ambiguous/unavailable), reference fidelity+contract independence, bounded context (adequate/correlated/ambiguous/unavailable/omission/truncation/fidelity-mismatch/blocked), many-regions-one-target, fidelity-fail-contract-pass, plus malformed JSON, unsupported schema version, and missing-screenshot negative fixtures. This corpus is what backed the packaged real-browser proof in §11.
|
|
105
|
-
|
|
106
|
-
## 13. Repository hygiene and commit
|
|
107
|
-
|
|
108
|
-
- `git status --short` before commit: only `tests/support/evidenceFixtures.ts` (modified), `viewer/src/components/ReferenceRegionOverlaySvg.tsx` (modified), `viewer/src/components/TargetOverlaySvg.tsx` (modified), `tests/browser/viewerIntegratedAcceptance.test.ts` (new), `tests/browser/pwaHardening.test.ts` (new), plus this report (new).
|
|
109
|
-
- All packed/consumer/PWA-profile/corpus/log/cache state remains exclusively under `.my-dev-kit-workflow/` (gitignored) — confirmed nothing outside it was touched.
|
|
110
|
-
- `package.json` version confirmed unchanged at `0.7.0` throughout.
|
|
111
|
-
|
|
112
|
-
## 14. What this batch does NOT establish
|
|
113
|
-
|
|
114
|
-
- Not release-ready, not publish-ready, not cross-platform-verified.
|
|
115
|
-
- `VERSION_BUMP: NONE`. `PUBLICATION_ACTIONS: NONE`. Nothing was tagged, pushed, or published.
|
|
116
|
-
- Standalone/installed-PWA behavioral proof did not exceed CDP command-acceptance (matchMedia did not reflect it) — this is a genuine residual gap, not a success to build on without further investigation.
|
|
117
|
-
- The broader hardened-documentation-and-implementation-completeness audit (the stage after this one) was explicitly **not** performed here.
|
|
118
|
-
- Symlink/junction-escape raw-evidence attack cases (task §30) were not re-exercised with new dedicated tests in this batch; the existing raw-evidence-safety mechanism (exact-identity artifact-detail resolution, Batch 2/4/7) was re-confirmed structurally but not stress-tested against new filesystem-escape vectors. Recorded as a residual risk, not closed.
|
|
119
|
-
|
|
120
|
-
## 15. Remaining risks / residual scope
|
|
121
|
-
|
|
122
|
-
1. Standalone-mode proof strength is below what the task's tier-B ("behavioral proof via CDP/app-mode") describes — worth a follow-up investigation into why `Emulation.setEmulatedMedia` didn't take effect in this Chromium build.
|
|
123
|
-
2. Symlink/junction raw-evidence-escape cases remain untested by a dedicated new test (§30 residual).
|
|
124
|
-
3. The 20-item acceptance matrix (task §69, items A–T) is satisfied by a mix of this batch's 3 new dedicated tests (L, M, N) plus the already-passing, re-confirmed test suites from Batches 3–7 for the remaining items — this batch did not write a from-scratch dedicated test for every letter independently where an existing one already provides equivalent real-browser proof.
|
|
125
|
-
|
|
126
|
-
## 16. Verdict
|
|
127
|
-
|
|
128
|
-
`PASS_V08_BATCH8_INTEGRATED_VIEWER_ACCEPTANCE` — full validation chain green, all three named coverage gaps closed with new real-browser proof, one real accessibility defect found and fixed, PWA live hardening genuinely exercised for the first time with its hard stale-evidence gate holding, and the packaged/installed candidate proven to work end-to-end in a real browser with read-only evidence-root integrity confirmed. `IMPLEMENTATION_BATCHES_STATUS: ALL_8_IMPLEMENTATION_BATCHES_PASS`. `NEXT_STAGE_READINESS`: ready to proceed to the separate hardened-documentation-and-implementation-completeness audit stage — not to release preparation.
|
|
1
|
+
# v0.8 Batch 8 — Integrated Viewer Acceptance, PWA Hardening, and Packaged Proof
|
|
2
|
+
|
|
3
|
+
## 1. Identity and scope
|
|
4
|
+
|
|
5
|
+
This is the eighth and final implementation batch of the v0.8 "Interactive Local Observation Viewer" feature. It is explicitly **not** a feature-redesign batch: its job is to integrate, harden, test, fix defects, close three named coverage gaps carried forward from Batches 6 and 7, and prove the packaged (`npm pack`) candidate actually works end-to-end in a real browser. Predecessor: Batch 7, commit `e30ba3f`. Package version remains `0.7.0` throughout — no bump, no publish, no tag, no push.
|
|
6
|
+
|
|
7
|
+
## 2. Workflow-path resolution (recurring contradiction, resolved identically to every prior batch)
|
|
8
|
+
|
|
9
|
+
The task text states a required sibling workflow root while its own literal `Join-Path`-based construction algorithm resolves to a path inside the repository. Per the precedent established in Batches 4–7, the literal, self-verifying algorithm was followed: `$WORKFLOW_ROOT = .my-dev-kit-workflow/v0.8/batch-08` (inside-repo, gitignored via `.gitignore`'s `.my-dev-kit-workflow/` pattern). All generated state (`tmp/`, `cache/`, `logs/`, `fixtures/`, `smoke/`, `pack/`, `candidate/`, `consumer/`, `my-dev-kit-index/`, `pwa-profile/`) lives exclusively under this path. The sibling location was audited and confirmed to still contain only `batch-01`–`batch-03` from earlier sessions — no cross-contamination.
|
|
10
|
+
|
|
11
|
+
## 3. No-second-engine audit (task §12)
|
|
12
|
+
|
|
13
|
+
Re-confirmed via targeted `grep -rn` across `src/viewerServer` and `viewer/src` for every canonical engine function. Findings unchanged from the Batch 8 pre-work audit:
|
|
14
|
+
|
|
15
|
+
- `compareObservations`, `evaluateFrontendContract`, `projectBoundedAgentContext`, `deriveRuntimeStaticCorrelations`, `attachRuntimeStaticCorrelations`: **zero** occurrences in viewer runtime code (never recomputed at view time).
|
|
16
|
+
- `deriveLayoutRelationships`: exactly one call site, `src/viewerServer/evidence/observationView.ts:49` (Batch 3's sanctioned server-side derivation).
|
|
17
|
+
- `deriveReferenceRegionRelationships`, `deriveReferenceRequirementAdequacy`, `evaluateReferenceCandidateCompatibility`, `evaluateReferenceRuntimeBindings`, `evaluateReferenceCandidateFidelity`, `deriveCoordinateScale`: each exactly one call site, all inside `src/viewerServer/evidence/referenceView.ts`.
|
|
18
|
+
- No `my-dev-kit` or `child_process` invocation exists in shipped viewer code; the only `child_process` import (`src/viewerServer/openBrowser.ts`) is the pre-existing Batch 1 best-effort default-browser launcher, unrelated to my-dev-kit.
|
|
19
|
+
|
|
20
|
+
**Finding: no duplicate evidence engine exists.** No architectural correction was required.
|
|
21
|
+
|
|
22
|
+
## 4. Write-method audit (task §31)
|
|
23
|
+
|
|
24
|
+
`src/viewerServer/httpServer.ts:91` — `if (method !== 'GET' && method !== 'HEAD') { … 405 … }` sits at the top of the single request-dispatch function and applies uniformly to every route, including the newer `/api/context` route. Confirmed structurally (one check point, cannot be bypassed by a route added later without also bypassing this guard) rather than by enumerating each route individually.
|
|
25
|
+
|
|
26
|
+
## 5. Gap-closing fixtures (new, added to `tests/support/evidenceFixtures.ts`)
|
|
27
|
+
|
|
28
|
+
Two new canonical fixture writers were added, each built entirely from real canonical writer/service calls (no hand-edited verdicts), and each verified against its actual derived output via a throwaway unit test before any real-browser assertion was written against it — following the exact discipline that caught real fixture bugs in Batches 6 and 7.
|
|
29
|
+
|
|
30
|
+
- **`writeManyRegionsOneTargetFixture`** — an approved reference with two distinct regions (`region-a`, `region-b`) and a candidate observation with one runtime target (`workspace`). Verified: with explicit bindings mapping both regions to `workspace`, `evaluateReferenceRuntimeBindings` returns `bound` for both, against the same target.
|
|
31
|
+
- **`writeFidelityFailContractPassFixture`** — a before/after observation pair, a real contract evaluation (`evaluateAndPersistFromArtifactRoots`) that genuinely returns `overallVerdict: 'PASS'` (a requested `property-decreases` clause and a protected `property-unchanged-within-tolerance` clause, both genuinely satisfied), and a real `evaluateReferenceCandidateFidelity` call against an approved reference whose `sidebar.width` requirement the same candidate genuinely violates (`state: 'fail'`). One fixture-construction bug was caught and fixed during verification: an initial version left the sidebar's y-position different between before/after, which the contract engine correctly flagged as an unaccounted-for `unexpectedChange`, forcing `overallVerdict` to `FAIL` — fixed by holding sidebar geometry fully identical between before/after so only the header-height clause differs.
|
|
32
|
+
|
|
33
|
+
Scenario N (bounded-context sources sharing a target id) required **no new fixture**: Batch 7's existing `writeBoundedContextEvidenceFixture` already builds `ctx-before`/`ctx-after` as two source observations that both configure `header`/`sidebar`, and `baseContext.sources.observationIds` already includes both. Only a new real-browser test was needed.
|
|
34
|
+
|
|
35
|
+
## 6. Real-browser proof of the three named gap closures (task §69 items L, M, N)
|
|
36
|
+
|
|
37
|
+
New file `tests/browser/viewerIntegratedAcceptance.test.ts`, 3 tests, all passing against the actual built React shell through the actual loopback viewer server:
|
|
38
|
+
|
|
39
|
+
- **Item L**: selecting the candidate's single `workspace` target rect highlights *both* `region-a` and `region-b` reference rects (`target-overlay-svg__rect--highlighted` class on both), closing the Batch 6 gap where only one-direction (region→target) cross-highlight had been proven for a single relationship.
|
|
40
|
+
- **Item M**: with the fidelity-fail-contract-pass fixture, selecting the matching evaluation shows `.overall-verdict--PASS`, and running on-demand fidelity evaluation shows `.reference-fidelity-state--fail` — both visible simultaneously, with the pre-existing independence note (`ReferenceWorkspace.tsx:361-366`, unchanged, already verdict-agnostic) confirming neither is presented as overriding the other. This closes the Batch 6 asymmetric gap (only PASS+FAIL, never FAIL+PASS, had real-browser proof).
|
|
41
|
+
- **Item N**: with `baseContext` supplied as the session context, selecting the `header` bounded target in Context mode lists exactly 2 items in `.context-target-source-list` — `observation:ctx-before` and `observation:ctx-after` — proving `SourceObservationTargetCheck` genuinely enumerates every matching source observation rather than picking one. Closes the Batch 7 gap.
|
|
42
|
+
|
|
43
|
+
## 7. Accessibility hardening (task §27) — one real defect found and fixed
|
|
44
|
+
|
|
45
|
+
Auditing the cross-highlight mechanism (`TargetOverlaySvg.tsx`, `ReferenceRegionOverlaySvg.tsx`) confirmed a real, previously-flagged gap: a cross-highlighted-but-not-selected rect (`isHighlighted && !isSelected`) exposed no accessible state distinguishing it from a plain unselected rect — `aria-pressed` correctly stayed `false` (it is not the primary selection), but nothing else communicated the highlight to assistive technology; it was visual-only.
|
|
46
|
+
|
|
47
|
+
**Fix**: both components now add `data-highlighted="true"` (a stable, testable hook) and append `" (highlighted: related to current selection)"` to the element's `aria-label` when highlighted-and-not-selected, leaving `aria-pressed` semantics (primary single-select state) untouched. Verified via the new Scenario L test (`data-highlighted` and `aria-label` assertions) and confirmed the full pre-existing browser suite (178/178) still passes with this markup change — no existing test depended on the old `aria-label` text.
|
|
48
|
+
|
|
49
|
+
Other audited areas (region/target selection buttons, lock toggle, evaluation/candidate `<select>` elements, install affordance) already exposed semantic controls (`role="button"`, keyboard activation via Enter/Space, `aria-pressed` where applicable, real `<button>`/`<select>` elements elsewhere) from prior batches; no further defects were found there.
|
|
50
|
+
|
|
51
|
+
## 8. Honest-status-language and provenance audits (task §28-29)
|
|
52
|
+
|
|
53
|
+
Spot-audited the terms the task calls out as never-conflatable (supported/complete/PASS/adequate/compatible/bound/correlated vs. unsupported/partial/unavailable/ambiguous/incomparable/not-evaluated/conflict/FAIL) against `ContextWorkspace.tsx`, `ReferenceWorkspace.tsx`, and `EvidenceList.tsx`. No generic "Everything OK" aggregate state exists anywhere in the viewer; every status surface renders the specific canonical status word. Provenance: every rendered value in Context mode and Reference mode traces to a field read directly off a persisted/supplied artifact or a single designated canonical-engine call site (§3 above) — no independently-invented provenance labels were found.
|
|
54
|
+
|
|
55
|
+
## 9. PWA live hardening (task §32-38, §53, §56-65) — genuinely new work, no prior coverage existed
|
|
56
|
+
|
|
57
|
+
Confirmed via `grep -rln "serviceWorker\|beforeinstallprompt" tests/` that **no test anywhere previously exercised live service-worker or install-prompt behavior** — all prior PWA verification was static `sw.js`/`workbox` regex inspection. New file `tests/browser/pwaHardening.test.ts`, 7 tests, all passing, using a dedicated persistent Chromium profile under `$WORKFLOW_ROOT\pwa-profile` (never the user's real profile):
|
|
58
|
+
|
|
59
|
+
- **Live service-worker registration**: `navigator.serviceWorker.ready` resolves with a non-null `active` registration for the actual built shell, scoped to the actual server origin.
|
|
60
|
+
- **Manifest**: fetched (not just parsed from source), confirmed `display: "standalone"` and non-empty `icons`.
|
|
61
|
+
- **No API caching**: enumerated every Cache Storage entry across all caches after normal use — zero entries with a `/api/` pathname, confirming the `navigateFallbackDenylist` boundary holds live, not just in the built `sw.js` regex.
|
|
62
|
+
- **HARD GATE — server-down shell behavior** (task §61, "must not be waived"): loaded the app, confirmed evidence was visible, waited for SW activation, called `server.close()`, reloaded the **same page**. Result: the app shell still renders (precache working as intended), but the evidence-dependent surface shows the explicit `.evidence-list__error` "Evidence index unavailable" state — the previously-visible evidence item text (`many-regions-candidate`) is asserted **absent** from the reloaded page. **Gate holds: no stale evidence was presented as current.**
|
|
63
|
+
- **Install-control, synthetic branch**: confirmed the honest default ("Install prompt not offered by this browser yet") and confirmed dispatching a synthetic `beforeinstallprompt` event flips the UI to a genuine `Install viewer` button — this is explicitly a **UI-logic proof**, not a genuine platform install signal.
|
|
64
|
+
- **Standalone-mode**: attempted CDP `Emulation.setEmulatedMedia` with a `display-mode: standalone` feature. The command was accepted without error, but `window.matchMedia('(display-mode: standalone)').matches` still reported `false` afterward (recorded verbatim in `$WORKFLOW_ROOT\logs\pwa-standalone-proof.txt`). **Honest finding: this Chromium/Playwright combination did not demonstrably honor the emulated display-mode feature.** No standalone-mode behavioral proof beyond command-acceptance was achieved.
|
|
65
|
+
|
|
66
|
+
### GENUINE_BROWSER_INSTALL_PROMPT
|
|
67
|
+
`NOT_AVAILABLE_TO_AUTOMATION` — no real `beforeinstallprompt` event was observed to fire natively during automated testing; only the synthetic-dispatch UI-logic path was exercised.
|
|
68
|
+
|
|
69
|
+
### ACTUAL_OS_PWA_INSTALLATION_VERIFIED
|
|
70
|
+
`NO` — never attempted or claimed. Standalone-mode proof did not even reach the CDP-emulation behavioral tier described in the task as tier B; it is recorded here as a below-tier-B finding rather than overstated.
|
|
71
|
+
|
|
72
|
+
## 10. Full validation chain
|
|
73
|
+
|
|
74
|
+
All run against the working tree with the new fixtures/tests/accessibility fix in place:
|
|
75
|
+
|
|
76
|
+
| Command | Result |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `npx tsc --noEmit` | clean |
|
|
79
|
+
| `npm run lint` | clean |
|
|
80
|
+
| `npm test` (unit) | 1156/1156 passed, 63 files |
|
|
81
|
+
| `npm run build` | clean (tsc + vite build + PWA precache generation) |
|
|
82
|
+
| `npm run check:docs` | passed (17 required files) |
|
|
83
|
+
| `npm run test:browser` | 178/178 passed, 19 files (first run: 1 failure, reproduced in isolation → passed cleanly; full clean rerun → 178/178) |
|
|
84
|
+
| `git diff --check` | clean (only benign LF→CRLF autocrlf warnings, no real whitespace errors) |
|
|
85
|
+
|
|
86
|
+
### Flake documentation (task §67)
|
|
87
|
+
One browser test (`Case F - incompatible pair` in the pre-existing `referenceBindingFidelityWorkspace.test.ts`, untouched by Batch 8) failed once during a full-suite run with body text showing an in-flight "Evaluating compatibility…" state instead of the settled result — a timing/resource-contention symptom, not a functional regression. Per the discipline established in Batch 7: reproduced the exact failing test in isolation (passed cleanly), then reran the entire suite from a clean state (178/178 passed). Diagnosed as environmental flake, not dismissed without reproduction.
|
|
88
|
+
|
|
89
|
+
## 11. Packaging and packaged-candidate proof (task §46-55)
|
|
90
|
+
|
|
91
|
+
- **Build proof**: `npm run build` output confirmed sufficient to run standalone from `dist/` alone (proven directly by the installed-package proof below, which never touches `src/` or `viewer/` source).
|
|
92
|
+
- **Tarball**: `npm pack --pack-destination ".my-dev-kit-workflow/v0.8/batch-08/pack"` → `my-frontend-observer-0.7.0.tgz`, 723.4 kB packed / 2.9 MB unpacked, 283 files.
|
|
93
|
+
- SHA-256: `9c6c899590cca6577ab403fc1fe130a1166b3f4103123537d8bbd441b6220ad7`
|
|
94
|
+
- **Content-safety audit**: tarball top level is exactly `CHANGELOG.md`, `README.md`, `dist/`, `docs/`, `package.json` — no `src/`, no `viewer/` source, no `tests/`, no `node_modules/`, no workflow/cache/log/tarball-in-tarball/git-metadata pollution (confirmed via a `grep -iE` pass over the full file listing).
|
|
95
|
+
- **Consumer install**: clean `npm install <exact tarball path>` into `$WORKFLOW_ROOT\consumer` with `npm_config_cache`/`TEMP`/`TMP` redirected under the workflow root — never the global npm cache or repo root. `node_modules/my-frontend-observer/package.json` version confirmed `0.7.0`, installed from `file:../pack/my-frontend-observer-0.7.0.tgz`.
|
|
96
|
+
- **Installed CLI proof**: `--version` → `0.7.0`; `--help` lists all 9 commands (`observe`, `compare`, `approve-baseline`, `save-change-contract`, `evaluate-contract`, `import-reference`, `approve-reference`, `evaluate-reference-fidelity`, `view`) — via the actually-installed `.bin` executable, not repo `dist/cli.js`.
|
|
97
|
+
- **Installed viewer launch**: the installed CLI's `view --root <integrated-evidence-corpus> --port 4319 --no-open` genuinely started, served `/api/index` with real records, and stayed up for the packaged-browser proof below.
|
|
98
|
+
- **Packaged real-browser proof**: real Chromium against `http://127.0.0.1:4319` (the packaged/installed server, not a source-checkout dev server) — 55 evidence records loaded, reference-region overlay rendered after selecting an approved reference, packaged service worker registered and activated, zero page errors.
|
|
99
|
+
- **Read-only evidence-hash proof** (task §59): SHA-256 of every file in the integrated-evidence corpus, taken after the packaged-browser proof session and again after server teardown — **identical**, confirming no mutation.
|
|
100
|
+
- **No-viewer-artifact proof** (task §60): the same hash comparison implies no new files (`viewer.json`, `fidelity.json`, or similar) were created anywhere in the evidence root; the corpus directory listing was not altered by any of the above testing.
|
|
101
|
+
|
|
102
|
+
## 12. Integrated evidence corpus (task §13)
|
|
103
|
+
|
|
104
|
+
Built under `$WORKFLOW_ROOT\fixtures\integrated-evidence` via 12 real canonical-fixture-writer calls (no hand-edited verdicts): normal observation, contract PASS + protected-clause FAIL, baseline supersession, reference/candidate pair (compatible + incompatible), reference binding/fidelity (bound/ambiguous/unavailable), reference fidelity+contract independence, bounded context (adequate/correlated/ambiguous/unavailable/omission/truncation/fidelity-mismatch/blocked), many-regions-one-target, fidelity-fail-contract-pass, plus malformed JSON, unsupported schema version, and missing-screenshot negative fixtures. This corpus is what backed the packaged real-browser proof in §11.
|
|
105
|
+
|
|
106
|
+
## 13. Repository hygiene and commit
|
|
107
|
+
|
|
108
|
+
- `git status --short` before commit: only `tests/support/evidenceFixtures.ts` (modified), `viewer/src/components/ReferenceRegionOverlaySvg.tsx` (modified), `viewer/src/components/TargetOverlaySvg.tsx` (modified), `tests/browser/viewerIntegratedAcceptance.test.ts` (new), `tests/browser/pwaHardening.test.ts` (new), plus this report (new).
|
|
109
|
+
- All packed/consumer/PWA-profile/corpus/log/cache state remains exclusively under `.my-dev-kit-workflow/` (gitignored) — confirmed nothing outside it was touched.
|
|
110
|
+
- `package.json` version confirmed unchanged at `0.7.0` throughout.
|
|
111
|
+
|
|
112
|
+
## 14. What this batch does NOT establish
|
|
113
|
+
|
|
114
|
+
- Not release-ready, not publish-ready, not cross-platform-verified.
|
|
115
|
+
- `VERSION_BUMP: NONE`. `PUBLICATION_ACTIONS: NONE`. Nothing was tagged, pushed, or published.
|
|
116
|
+
- Standalone/installed-PWA behavioral proof did not exceed CDP command-acceptance (matchMedia did not reflect it) — this is a genuine residual gap, not a success to build on without further investigation.
|
|
117
|
+
- The broader hardened-documentation-and-implementation-completeness audit (the stage after this one) was explicitly **not** performed here.
|
|
118
|
+
- Symlink/junction-escape raw-evidence attack cases (task §30) were not re-exercised with new dedicated tests in this batch; the existing raw-evidence-safety mechanism (exact-identity artifact-detail resolution, Batch 2/4/7) was re-confirmed structurally but not stress-tested against new filesystem-escape vectors. Recorded as a residual risk, not closed.
|
|
119
|
+
|
|
120
|
+
## 15. Remaining risks / residual scope
|
|
121
|
+
|
|
122
|
+
1. Standalone-mode proof strength is below what the task's tier-B ("behavioral proof via CDP/app-mode") describes — worth a follow-up investigation into why `Emulation.setEmulatedMedia` didn't take effect in this Chromium build.
|
|
123
|
+
2. Symlink/junction raw-evidence-escape cases remain untested by a dedicated new test (§30 residual).
|
|
124
|
+
3. The 20-item acceptance matrix (task §69, items A–T) is satisfied by a mix of this batch's 3 new dedicated tests (L, M, N) plus the already-passing, re-confirmed test suites from Batches 3–7 for the remaining items — this batch did not write a from-scratch dedicated test for every letter independently where an existing one already provides equivalent real-browser proof.
|
|
125
|
+
|
|
126
|
+
## 16. Verdict
|
|
127
|
+
|
|
128
|
+
`PASS_V08_BATCH8_INTEGRATED_VIEWER_ACCEPTANCE` — full validation chain green, all three named coverage gaps closed with new real-browser proof, one real accessibility defect found and fixed, PWA live hardening genuinely exercised for the first time with its hard stale-evidence gate holding, and the packaged/installed candidate proven to work end-to-end in a real browser with read-only evidence-root integrity confirmed. `IMPLEMENTATION_BATCHES_STATUS: ALL_8_IMPLEMENTATION_BATCHES_PASS`. `NEXT_STAGE_READINESS`: ready to proceed to the separate hardened-documentation-and-implementation-completeness audit stage — not to release preparation.
|