@dailephd/my-frontend-observer 0.8.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 +397 -0
- package/LICENSE +21 -0
- package/README.md +255 -0
- package/dist/application/browserCaptureService.d.ts +11 -0
- package/dist/application/browserCaptureService.js +12 -0
- package/dist/application/browserCaptureService.js.map +1 -0
- package/dist/application/comparisonService.d.ts +56 -0
- package/dist/application/comparisonService.js +77 -0
- package/dist/application/comparisonService.js.map +1 -0
- package/dist/application/externalReferencePersistenceService.d.ts +75 -0
- package/dist/application/externalReferencePersistenceService.js +182 -0
- package/dist/application/externalReferencePersistenceService.js.map +1 -0
- package/dist/application/frontendContractEvaluationService.d.ts +49 -0
- package/dist/application/frontendContractEvaluationService.js +112 -0
- package/dist/application/frontendContractEvaluationService.js.map +1 -0
- package/dist/application/frontendContractPersistenceService.d.ts +56 -0
- package/dist/application/frontendContractPersistenceService.js +91 -0
- package/dist/application/frontendContractPersistenceService.js.map +1 -0
- package/dist/application/observationPersistence.d.ts +59 -0
- package/dist/application/observationPersistence.js +79 -0
- package/dist/application/observationPersistence.js.map +1 -0
- package/dist/application/projectCheckService.d.ts +3 -0
- package/dist/application/projectCheckService.js +169 -0
- package/dist/application/projectCheckService.js.map +1 -0
- package/dist/application/projectWorkflowService.d.ts +46 -0
- package/dist/application/projectWorkflowService.js +92 -0
- package/dist/application/projectWorkflowService.js.map +1 -0
- package/dist/application/referenceFidelityEvaluationService.d.ts +28 -0
- package/dist/application/referenceFidelityEvaluationService.js +45 -0
- package/dist/application/referenceFidelityEvaluationService.js.map +1 -0
- package/dist/artifacts/artifactReader.d.ts +19 -0
- package/dist/artifacts/artifactReader.js +36 -0
- package/dist/artifacts/artifactReader.js.map +1 -0
- package/dist/artifacts/artifactWriter.d.ts +25 -0
- package/dist/artifacts/artifactWriter.js +68 -0
- package/dist/artifacts/artifactWriter.js.map +1 -0
- package/dist/artifacts/comparisonArtifactReader.d.ts +18 -0
- package/dist/artifacts/comparisonArtifactReader.js +35 -0
- package/dist/artifacts/comparisonArtifactReader.js.map +1 -0
- package/dist/artifacts/comparisonArtifactWriter.d.ts +41 -0
- package/dist/artifacts/comparisonArtifactWriter.js +67 -0
- package/dist/artifacts/comparisonArtifactWriter.js.map +1 -0
- package/dist/artifacts/externalReferenceArtifactReader.d.ts +18 -0
- package/dist/artifacts/externalReferenceArtifactReader.js +35 -0
- package/dist/artifacts/externalReferenceArtifactReader.js.map +1 -0
- package/dist/artifacts/externalReferenceArtifactWriter.d.ts +44 -0
- package/dist/artifacts/externalReferenceArtifactWriter.js +77 -0
- package/dist/artifacts/externalReferenceArtifactWriter.js.map +1 -0
- package/dist/artifacts/frontendContractArtifactReader.d.ts +24 -0
- package/dist/artifacts/frontendContractArtifactReader.js +47 -0
- package/dist/artifacts/frontendContractArtifactReader.js.map +1 -0
- package/dist/artifacts/frontendContractArtifactWriter.d.ts +34 -0
- package/dist/artifacts/frontendContractArtifactWriter.js +70 -0
- package/dist/artifacts/frontendContractArtifactWriter.js.map +1 -0
- package/dist/artifacts/frontendContractEvaluationArtifactReader.d.ts +17 -0
- package/dist/artifacts/frontendContractEvaluationArtifactReader.js +34 -0
- package/dist/artifacts/frontendContractEvaluationArtifactReader.js.map +1 -0
- package/dist/artifacts/frontendContractEvaluationArtifactWriter.d.ts +32 -0
- package/dist/artifacts/frontendContractEvaluationArtifactWriter.js +58 -0
- package/dist/artifacts/frontendContractEvaluationArtifactWriter.js.map +1 -0
- package/dist/artifacts/types.d.ts +17 -0
- package/dist/artifacts/types.js +2 -0
- package/dist/artifacts/types.js.map +1 -0
- package/dist/browser/chromiumAdapter.d.ts +21 -0
- package/dist/browser/chromiumAdapter.js +204 -0
- package/dist/browser/chromiumAdapter.js.map +1 -0
- package/dist/browser/evidenceCapture.d.ts +62 -0
- package/dist/browser/evidenceCapture.js +500 -0
- package/dist/browser/evidenceCapture.js.map +1 -0
- package/dist/browser/scrollCapture.d.ts +32 -0
- package/dist/browser/scrollCapture.js +163 -0
- package/dist/browser/scrollCapture.js.map +1 -0
- package/dist/browser/types.d.ts +24 -0
- package/dist/browser/types.js +2 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +2411 -0
- package/dist/cli.js.map +1 -0
- package/dist/domain/boundedAgentContext.d.ts +226 -0
- package/dist/domain/boundedAgentContext.js +355 -0
- package/dist/domain/boundedAgentContext.js.map +1 -0
- package/dist/domain/boundedAgentContextCorrelation.d.ts +74 -0
- package/dist/domain/boundedAgentContextCorrelation.js +441 -0
- package/dist/domain/boundedAgentContextCorrelation.js.map +1 -0
- package/dist/domain/boundedAgentContextIdentity.d.ts +26 -0
- package/dist/domain/boundedAgentContextIdentity.js +69 -0
- package/dist/domain/boundedAgentContextIdentity.js.map +1 -0
- package/dist/domain/boundedAgentContextProjection.d.ts +71 -0
- package/dist/domain/boundedAgentContextProjection.js +477 -0
- package/dist/domain/boundedAgentContextProjection.js.map +1 -0
- package/dist/domain/comparison.d.ts +220 -0
- package/dist/domain/comparison.js +350 -0
- package/dist/domain/comparison.js.map +1 -0
- package/dist/domain/comparisonEngine.d.ts +76 -0
- package/dist/domain/comparisonEngine.js +734 -0
- package/dist/domain/comparisonEngine.js.map +1 -0
- package/dist/domain/comparisonIdentity.d.ts +13 -0
- package/dist/domain/comparisonIdentity.js +46 -0
- package/dist/domain/comparisonIdentity.js.map +1 -0
- package/dist/domain/completion.d.ts +30 -0
- package/dist/domain/completion.js +22 -0
- package/dist/domain/completion.js.map +1 -0
- package/dist/domain/diagnostics.d.ts +17 -0
- package/dist/domain/diagnostics.js +77 -0
- package/dist/domain/diagnostics.js.map +1 -0
- package/dist/domain/evidence.d.ts +29 -0
- package/dist/domain/evidence.js +59 -0
- package/dist/domain/evidence.js.map +1 -0
- package/dist/domain/explicitState.d.ts +40 -0
- package/dist/domain/explicitState.js +54 -0
- package/dist/domain/explicitState.js.map +1 -0
- package/dist/domain/externalReference.d.ts +158 -0
- package/dist/domain/externalReference.js +167 -0
- package/dist/domain/externalReference.js.map +1 -0
- package/dist/domain/externalReferenceApplicability.d.ts +43 -0
- package/dist/domain/externalReferenceApplicability.js +52 -0
- package/dist/domain/externalReferenceApplicability.js.map +1 -0
- package/dist/domain/externalReferenceCompatibility.d.ts +40 -0
- package/dist/domain/externalReferenceCompatibility.js +48 -0
- package/dist/domain/externalReferenceCompatibility.js.map +1 -0
- package/dist/domain/externalReferenceFidelity.d.ts +171 -0
- package/dist/domain/externalReferenceFidelity.js +419 -0
- package/dist/domain/externalReferenceFidelity.js.map +1 -0
- package/dist/domain/externalReferenceIdentity.d.ts +38 -0
- package/dist/domain/externalReferenceIdentity.js +70 -0
- package/dist/domain/externalReferenceIdentity.js.map +1 -0
- package/dist/domain/externalReferenceImage.d.ts +35 -0
- package/dist/domain/externalReferenceImage.js +160 -0
- package/dist/domain/externalReferenceImage.js.map +1 -0
- package/dist/domain/externalReferenceRegionRelationships.d.ts +63 -0
- package/dist/domain/externalReferenceRegionRelationships.js +98 -0
- package/dist/domain/externalReferenceRegionRelationships.js.map +1 -0
- package/dist/domain/externalReferenceRegions.d.ts +65 -0
- package/dist/domain/externalReferenceRegions.js +105 -0
- package/dist/domain/externalReferenceRegions.js.map +1 -0
- package/dist/domain/externalReferenceRequirementIdentity.d.ts +12 -0
- package/dist/domain/externalReferenceRequirementIdentity.js +35 -0
- package/dist/domain/externalReferenceRequirementIdentity.js.map +1 -0
- package/dist/domain/externalReferenceRequirements.d.ts +215 -0
- package/dist/domain/externalReferenceRequirements.js +401 -0
- package/dist/domain/externalReferenceRequirements.js.map +1 -0
- package/dist/domain/externalReferenceRuntimeBinding.d.ts +146 -0
- package/dist/domain/externalReferenceRuntimeBinding.js +183 -0
- package/dist/domain/externalReferenceRuntimeBinding.js.map +1 -0
- package/dist/domain/frontendContractEvaluation.d.ts +57 -0
- package/dist/domain/frontendContractEvaluation.js +454 -0
- package/dist/domain/frontendContractEvaluation.js.map +1 -0
- package/dist/domain/frontendContractEvaluationArtifact.d.ts +65 -0
- package/dist/domain/frontendContractEvaluationArtifact.js +108 -0
- package/dist/domain/frontendContractEvaluationArtifact.js.map +1 -0
- package/dist/domain/frontendContractIdentity.d.ts +39 -0
- package/dist/domain/frontendContractIdentity.js +70 -0
- package/dist/domain/frontendContractIdentity.js.map +1 -0
- package/dist/domain/frontendContracts.d.ts +188 -0
- package/dist/domain/frontendContracts.js +260 -0
- package/dist/domain/frontendContracts.js.map +1 -0
- package/dist/domain/identity.d.ts +21 -0
- package/dist/domain/identity.js +47 -0
- package/dist/domain/identity.js.map +1 -0
- package/dist/domain/referenceCorrectionIdentity.d.ts +40 -0
- package/dist/domain/referenceCorrectionIdentity.js +77 -0
- package/dist/domain/referenceCorrectionIdentity.js.map +1 -0
- package/dist/domain/referenceCorrectionWorkflow.d.ts +160 -0
- package/dist/domain/referenceCorrectionWorkflow.js +165 -0
- package/dist/domain/referenceCorrectionWorkflow.js.map +1 -0
- package/dist/domain/referenceFidelityProjection.d.ts +65 -0
- package/dist/domain/referenceFidelityProjection.js +135 -0
- package/dist/domain/referenceFidelityProjection.js.map +1 -0
- package/dist/domain/relationships.d.ts +210 -0
- package/dist/domain/relationships.js +352 -0
- package/dist/domain/relationships.js.map +1 -0
- package/dist/domain/schema.d.ts +269 -0
- package/dist/domain/schema.js +442 -0
- package/dist/domain/schema.js.map +1 -0
- package/dist/domain/scrollEvidence.d.ts +51 -0
- package/dist/domain/scrollEvidence.js +134 -0
- package/dist/domain/scrollEvidence.js.map +1 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/projectWorkflow/aliasCatalog.d.ts +21 -0
- package/dist/projectWorkflow/aliasCatalog.js +67 -0
- package/dist/projectWorkflow/aliasCatalog.js.map +1 -0
- package/dist/projectWorkflow/checkAcceptance.d.ts +25 -0
- package/dist/projectWorkflow/checkAcceptance.js +55 -0
- package/dist/projectWorkflow/checkAcceptance.js.map +1 -0
- package/dist/projectWorkflow/checkResult.d.ts +85 -0
- package/dist/projectWorkflow/checkResult.js +101 -0
- package/dist/projectWorkflow/checkResult.js.map +1 -0
- package/dist/projectWorkflow/projectConfig.d.ts +43 -0
- package/dist/projectWorkflow/projectConfig.js +84 -0
- package/dist/projectWorkflow/projectConfig.js.map +1 -0
- package/dist/projectWorkflow/projectDiscovery.d.ts +9 -0
- package/dist/projectWorkflow/projectDiscovery.js +20 -0
- package/dist/projectWorkflow/projectDiscovery.js.map +1 -0
- package/dist/projectWorkflow/projectPaths.d.ts +8 -0
- package/dist/projectWorkflow/projectPaths.js +23 -0
- package/dist/projectWorkflow/projectPaths.js.map +1 -0
- package/dist/request/paths.d.ts +14 -0
- package/dist/request/paths.js +33 -0
- package/dist/request/paths.js.map +1 -0
- package/dist/request/request.d.ts +111 -0
- package/dist/request/request.js +464 -0
- package/dist/request/request.js.map +1 -0
- package/dist/safety/policy.d.ts +14 -0
- package/dist/safety/policy.js +81 -0
- package/dist/safety/policy.js.map +1 -0
- package/dist/viewer/assets/index-CN_yb9Uf.css +1 -0
- package/dist/viewer/assets/index-D98S1_2d.js +9 -0
- package/dist/viewer/icons/icon-192.png +0 -0
- package/dist/viewer/icons/icon-512.png +0 -0
- package/dist/viewer/index.html +15 -0
- package/dist/viewer/manifest.webmanifest +1 -0
- package/dist/viewer/registerSW.js +1 -0
- package/dist/viewer/sw.js +1 -0
- package/dist/viewer/workbox-9c191d2f.js +1 -0
- package/dist/viewerServer/context.d.ts +48 -0
- package/dist/viewerServer/context.js +60 -0
- package/dist/viewerServer/context.js.map +1 -0
- package/dist/viewerServer/evidence/classify.d.ts +59 -0
- package/dist/viewerServer/evidence/classify.js +124 -0
- package/dist/viewerServer/evidence/classify.js.map +1 -0
- package/dist/viewerServer/evidence/comparisonView.d.ts +28 -0
- package/dist/viewerServer/evidence/comparisonView.js +43 -0
- package/dist/viewerServer/evidence/comparisonView.js.map +1 -0
- package/dist/viewerServer/evidence/contextSourceView.d.ts +25 -0
- package/dist/viewerServer/evidence/contextSourceView.js +20 -0
- package/dist/viewerServer/evidence/contextSourceView.js.map +1 -0
- package/dist/viewerServer/evidence/discovery.d.ts +31 -0
- package/dist/viewerServer/evidence/discovery.js +78 -0
- package/dist/viewerServer/evidence/discovery.js.map +1 -0
- package/dist/viewerServer/evidence/evaluationView.d.ts +32 -0
- package/dist/viewerServer/evidence/evaluationView.js +50 -0
- package/dist/viewerServer/evidence/evaluationView.js.map +1 -0
- package/dist/viewerServer/evidence/handles.d.ts +21 -0
- package/dist/viewerServer/evidence/handles.js +43 -0
- package/dist/viewerServer/evidence/handles.js.map +1 -0
- package/dist/viewerServer/evidence/index.d.ts +41 -0
- package/dist/viewerServer/evidence/index.js +82 -0
- package/dist/viewerServer/evidence/index.js.map +1 -0
- package/dist/viewerServer/evidence/limits.d.ts +27 -0
- package/dist/viewerServer/evidence/limits.js +28 -0
- package/dist/viewerServer/evidence/limits.js.map +1 -0
- package/dist/viewerServer/evidence/linkedEvidence.d.ts +43 -0
- package/dist/viewerServer/evidence/linkedEvidence.js +151 -0
- package/dist/viewerServer/evidence/linkedEvidence.js.map +1 -0
- package/dist/viewerServer/evidence/mediaResolver.d.ts +16 -0
- package/dist/viewerServer/evidence/mediaResolver.js +85 -0
- package/dist/viewerServer/evidence/mediaResolver.js.map +1 -0
- package/dist/viewerServer/evidence/observationView.d.ts +29 -0
- package/dist/viewerServer/evidence/observationView.js +46 -0
- package/dist/viewerServer/evidence/observationView.js.map +1 -0
- package/dist/viewerServer/evidence/pathSafety.d.ts +11 -0
- package/dist/viewerServer/evidence/pathSafety.js +31 -0
- package/dist/viewerServer/evidence/pathSafety.js.map +1 -0
- package/dist/viewerServer/evidence/projection.d.ts +55 -0
- package/dist/viewerServer/evidence/projection.js +152 -0
- package/dist/viewerServer/evidence/projection.js.map +1 -0
- package/dist/viewerServer/evidence/referenceView.d.ts +133 -0
- package/dist/viewerServer/evidence/referenceView.js +169 -0
- package/dist/viewerServer/evidence/referenceView.js.map +1 -0
- package/dist/viewerServer/httpServer.d.ts +27 -0
- package/dist/viewerServer/httpServer.js +381 -0
- package/dist/viewerServer/httpServer.js.map +1 -0
- package/dist/viewerServer/openBrowser.d.ts +7 -0
- package/dist/viewerServer/openBrowser.js +32 -0
- package/dist/viewerServer/openBrowser.js.map +1 -0
- package/dist/viewerServer/port.d.ts +16 -0
- package/dist/viewerServer/port.js +19 -0
- package/dist/viewerServer/port.js.map +1 -0
- package/dist/viewerServer/viewerService.d.ts +62 -0
- package/dist/viewerServer/viewerService.js +88 -0
- package/dist/viewerServer/viewerService.js.map +1 -0
- package/docs/ARCHITECTURE.md +1286 -0
- package/docs/CI_CD.md +250 -0
- package/docs/COMMANDS.md +972 -0
- package/docs/CONTRACTS.md +1856 -0
- package/docs/CURRENT_STATE.md +1049 -0
- package/docs/DEVELOPMENT.md +202 -0
- package/docs/DOCUMENTATION_PRESERVATION_POLICY.md +50 -0
- package/docs/PROJECT_DESCRIPTION.md +2221 -0
- package/docs/PROJECT_MILESTONES.md +2526 -0
- package/docs/PROJECT_OVERVIEW.md +150 -0
- package/docs/QUICKSTART.md +83 -0
- package/docs/RELEASE.md +27 -0
- package/docs/ROADMAP.md +641 -0
- package/docs/SECURITY.md +218 -0
- package/docs/WORKFLOWS.md +642 -0
- package/docs/plans/v0.8-implementation-plan.md +655 -0
- package/docs/plans/v0.8.1-cli-usability-patch-plan.md +505 -0
- package/docs/reports/v0.7-bounded-fidelity-context-prompt7.md +243 -0
- package/docs/reports/v0.7-implementation-completeness-documentation-reconciliation.md +497 -0
- package/docs/reports/v0.7-pre-release-readiness.md +337 -0
- package/docs/reports/v0.7-reference-binding-prompt5.md +223 -0
- package/docs/reports/v0.7-reference-compatibility-prompt4.md +234 -0
- package/docs/reports/v0.7-reference-correction-workflow-prompt8.md +222 -0
- package/docs/reports/v0.7-reference-fidelity-prompt6.md +216 -0
- package/docs/reports/v0.7-reference-foundation-prompt1.md +151 -0
- package/docs/reports/v0.7-reference-regions-prompt2.md +195 -0
- package/docs/reports/v0.7-reference-requirements-prompt3.md +217 -0
- package/docs/reports/v0.7-release-prep.md +423 -0
- package/docs/reports/v0.8-binding-fidelity-interaction-batch6.md +279 -0
- package/docs/reports/v0.8-bounded-context-correlation-batch7.md +233 -0
- package/docs/reports/v0.8-comparison-contract-inspection-batch4.md +279 -0
- package/docs/reports/v0.8-evidence-index-readers-batch2.md +247 -0
- package/docs/reports/v0.8-implementation-completeness-documentation-reconciliation.md +741 -0
- package/docs/reports/v0.8-integrated-viewer-acceptance-batch8.md +128 -0
- package/docs/reports/v0.8-observation-svg-inspection-batch3.md +223 -0
- package/docs/reports/v0.8-prerelease-readiness-cross-platform-security-code-rot.md +687 -0
- package/docs/reports/v0.8-reference-candidate-inspection-batch5.md +232 -0
- package/docs/reports/v0.8-viewer-runtime-pwa-batch1.md +278 -0
- package/docs/reports/v0.8.1-check-orchestration-prompt2.md +69 -0
- package/docs/reports/v0.8.1-implementation-completeness-documentation-reconciliation.md +114 -0
- package/docs/reports/v0.8.1-prerelease-readiness-cross-platform-security-code-rot.md +170 -0
- package/docs/reports/v0.8.1-project-workflow-foundation-prompt1.md +66 -0
- package/package.json +58 -0
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
# Workflows
|
|
2
|
+
|
|
3
|
+
## Project and coding-agent workflow
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
init
|
|
7
|
+
capture baseline
|
|
8
|
+
implement frontend change outside Observer
|
|
9
|
+
check baseline --json
|
|
10
|
+
if FAIL:
|
|
11
|
+
use returned canonical runtime failure evidence
|
|
12
|
+
correct frontend source outside Observer
|
|
13
|
+
run the identical check again
|
|
14
|
+
finish only after PASS
|
|
15
|
+
view
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Observer reports evidence and acceptance. The external human, coding agent, or
|
|
19
|
+
orchestrator edits source; Observer never does. With no executable contract or
|
|
20
|
+
approved reference, successful comparison yields `REVIEW_REQUIRED`, not PASS.
|
|
21
|
+
|
|
22
|
+
## Current validation workflow
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
install dependencies (npm install; npx playwright install chromium)
|
|
26
|
+
→ validate types and lint
|
|
27
|
+
→ run the fast unit suite (npm test)
|
|
28
|
+
→ run the real-Chromium integration suite (npm run test:browser)
|
|
29
|
+
→ build the CLI/library entries (npm run build)
|
|
30
|
+
→ validate documentation (npm run check:docs)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Current observation workflow (published and current in 0.7.0)
|
|
34
|
+
|
|
35
|
+
The real `observe` workflow remains part of the published
|
|
36
|
+
`my-frontend-observer@0.7.0` package. Its browser-observation behavior was
|
|
37
|
+
established in earlier releases and remains unchanged by v0.6/v0.7. It accepts target
|
|
38
|
+
configuration through either of two input paths, plus one optional runtime
|
|
39
|
+
scroll scenario:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
CLI arguments (--url, --viewport, --output, --timeout, exactly one of:
|
|
43
|
+
one-or-more --target <id=css-selector>
|
|
44
|
+
or --targets-file <json-file>,
|
|
45
|
+
plus optionally --scroll-scenario-file <json-file>)
|
|
46
|
+
→ (--targets-file only: read + validate the local JSON root wrapper)
|
|
47
|
+
→ (--scroll-scenario-file only: read + validate the local JSON root shape -
|
|
48
|
+
a non-array object; the file supplies RawObservationRequest.scrollScenario
|
|
49
|
+
directly, with no wrapper field)
|
|
50
|
+
→ request construction (same RawObservationRequest either way)
|
|
51
|
+
→ normalizeRequest() - producing canonical {name, locators} targets and
|
|
52
|
+
validating the optional scrollScenario (supported action kind, delta
|
|
53
|
+
bounds/both-zero rule, stable target-name reference)
|
|
54
|
+
→ application observation use case (src/application/observationPersistence.ts#observe)
|
|
55
|
+
→ Chromium capture: launch, safe navigation, readiness, then - only if a
|
|
56
|
+
scenario was configured - resolve configured targets once, capture an
|
|
57
|
+
initial ScrollRuntimeSnapshot, perform the one immediate scroll
|
|
58
|
+
(window.scrollBy/element.scrollBy, behavior: "instant"), wait exactly two
|
|
59
|
+
requestAnimationFrame cycles, capture a final ScrollRuntimeSnapshot and
|
|
60
|
+
derive transition/scroll-owner evidence; then screenshot and page/target
|
|
61
|
+
evidence (resolving all six locator kinds through the single canonical
|
|
62
|
+
resolver, plus semantic state/landmark/containment evidence), from the
|
|
63
|
+
same live page - exactly once, always describing the final state
|
|
64
|
+
→ atomic artifact persistence (manifest.json + screenshot.png), schema
|
|
65
|
+
1.2.0 - exactly once, only on a successful capture; scrollScenarioEvidence
|
|
66
|
+
is simply one more optional manifest field, never a separate file
|
|
67
|
+
→ concise CLI result (Observation/State/Artifact/Targets/Diagnostics)
|
|
68
|
+
→ process exit status (0 for a persisted observation, including one whose
|
|
69
|
+
state honestly reports "partial"; nonzero otherwise)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
A request with no scroll scenario is unaffected: no extra snapshots, no
|
|
73
|
+
scroll, no extra animation-frame wait, unchanged request identity.
|
|
74
|
+
|
|
75
|
+
This is exercised by `runCli()`-level tests, real-Chromium end-to-end tests
|
|
76
|
+
(`tests/browser/cliObserve.test.ts`, `tests/browser/windowScrollScenario.test.ts`,
|
|
77
|
+
`tests/browser/targetScrollScenario.test.ts`), built `node dist/cli.js
|
|
78
|
+
observe ...` runs against the deterministic local fixture
|
|
79
|
+
(`scripts/dev/builtCliTargetsFileSmoke.mjs` for the semantic `--targets-file`
|
|
80
|
+
path, `scripts/dev/builtCliScrollScenarioSmoke.mjs` for the scroll-scenario
|
|
81
|
+
path), and the real `npm pack` tarball installed and run from a clean
|
|
82
|
+
temporary consumer directory outside the repository, on Windows, Linux, and
|
|
83
|
+
macOS (`scripts/ci/runPackedObservationSmoke.mjs`) - the same workflow,
|
|
84
|
+
independent of the source checkout.
|
|
85
|
+
|
|
86
|
+
## Current comparison workflow (published and current in 0.7.0)
|
|
87
|
+
|
|
88
|
+
**Current status: shipped originally as part of
|
|
89
|
+
`my-frontend-observer@0.4.0` and unchanged through `0.7.0`.** This is a
|
|
90
|
+
separate workflow from the observation workflow above - it consumes two
|
|
91
|
+
already-persisted observation artifacts rather than producing one, and it
|
|
92
|
+
never launches a browser:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
two prior real "observe" invocations, each producing its own persisted
|
|
96
|
+
ObservationArtifact (before, after) - unrelated to this workflow itself
|
|
97
|
+
→ CLI arguments (--before <root>, --after <root>, --output <directory>,
|
|
98
|
+
optionally --config-file <json-file>)
|
|
99
|
+
→ (--config-file only: read + validate the local JSON root shape - a
|
|
100
|
+
non-array object; the file supplies ComparisonConfig directly, with no
|
|
101
|
+
wrapper field)
|
|
102
|
+
→ read + validate both observation artifacts (src/artifacts/artifactReader.ts,
|
|
103
|
+
the same isValidObservationArtifact structural gate the writer uses)
|
|
104
|
+
→ application comparison use case
|
|
105
|
+
(src/application/comparisonService.ts#compareAndPersistFromArtifactRoots
|
|
106
|
+
→ compareAndPersist)
|
|
107
|
+
→ pure comparison derivation (src/domain/comparisonEngine.ts#compareObservations):
|
|
108
|
+
comparability first, then - only if comparable/comparable-with-warnings -
|
|
109
|
+
deriveLayoutRelationships for each side plus target/page differences,
|
|
110
|
+
relationship changes, and explicit non-causal dependency evidence
|
|
111
|
+
→ atomic comparison-artifact persistence (manifest.json only, no copied
|
|
112
|
+
screenshots), schema 1.0.0 - exactly once, for every comparability
|
|
113
|
+
outcome including "incomparable"
|
|
114
|
+
→ concise CLI result (Comparison/State/Artifact/Differences/Relationship
|
|
115
|
+
changes/Diagnostics)
|
|
116
|
+
→ process exit status (0 for any successfully computed and persisted
|
|
117
|
+
comparison, including "incomparable"; nonzero only for invalid
|
|
118
|
+
syntax/unreadable or invalid source artifacts/invalid configuration/a
|
|
119
|
+
failed write)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Source observations are never modified by this workflow. Operational paths
|
|
123
|
+
(`--before`/`--after`/`--config-file`/`--output`) never affect
|
|
124
|
+
`comparisonRequestId` and are never written into the persisted manifest.
|
|
125
|
+
|
|
126
|
+
This is exercised by `runCli()`-level tests
|
|
127
|
+
(`tests/unit/cli.test.ts`, `tests/unit/cliCompareOrchestration.test.ts`,
|
|
128
|
+
`tests/unit/cliCompareEndToEnd.test.ts`), a real-Chromium end-to-end test
|
|
129
|
+
(`tests/browser/cliCompare.test.ts`), built `node dist/cli.js compare ...`
|
|
130
|
+
runs against real persisted observations from the deterministic local
|
|
131
|
+
fixture (`scripts/dev/builtCliCompareSmoke.mjs`), and packed-tarball
|
|
132
|
+
validation of the installed `compare` command
|
|
133
|
+
(`scripts/ci/runPackedObservationSmoke.mjs` - see `docs/CI_CD.md`).
|
|
134
|
+
|
|
135
|
+
## Current frontend contract workflow (published and current in 0.7.0)
|
|
136
|
+
|
|
137
|
+
This text/config-driven workflow shipped in `0.5.0` and remains current in
|
|
138
|
+
`0.7.0`. It is layered downstream of the two workflows above - it does not
|
|
139
|
+
replace them. The complete v0.7 coding-agent workflow (the external-reference
|
|
140
|
+
evidence foundation and end-to-end correction loop) is layered on top of
|
|
141
|
+
it - see "Current external-reference foundation workflow" and "Current
|
|
142
|
+
reference correction workflow" below; baseline selection here remains
|
|
143
|
+
caller-supplied:
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
observe before
|
|
147
|
+
observe after
|
|
148
|
+
compare
|
|
149
|
+
↓
|
|
150
|
+
approve baseline (approve-baseline --observation <before-root>
|
|
151
|
+
--contract-file <PersistentBaselineContract.json> --output <dir>)
|
|
152
|
+
↓
|
|
153
|
+
save per-change contract (save-change-contract
|
|
154
|
+
--contract-file <PerChangeContract.json> --output <dir>)
|
|
155
|
+
↓
|
|
156
|
+
evaluate contract (evaluate-contract --before <root> --after <root>
|
|
157
|
+
--comparison <root> --baseline <root> --change <root> --output <dir>
|
|
158
|
+
[--enforce])
|
|
159
|
+
↓
|
|
160
|
+
persisted evaluation artifact (schema 1.0.0, its own independent family):
|
|
161
|
+
clause results (pass/fail/unavailable/conflict), unexpected changes,
|
|
162
|
+
overall PASS/FAIL
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`approve-baseline` is the only baseline-approval act; a successful `compare`
|
|
166
|
+
or a `PASS` evaluation never approves or supersedes a baseline
|
|
167
|
+
automatically. `evaluate-contract` never launches a browser and never
|
|
168
|
+
recomputes comparison/relationship evidence - it calls the canonical
|
|
169
|
+
`evaluateFrontendContract` exactly once against the supplied evidence and
|
|
170
|
+
persists exactly one evaluation artifact, whether the verdict is `PASS` or
|
|
171
|
+
`FAIL`. `--enforce` affects only the process exit status for a `FAIL`
|
|
172
|
+
verdict, never the persisted evidence itself.
|
|
173
|
+
|
|
174
|
+
This is exercised by `runCli()`-level tests
|
|
175
|
+
(`tests/unit/cliFrontendContracts.test.ts`), a built `node dist/cli.js`
|
|
176
|
+
smoke that needs no Chromium
|
|
177
|
+
(`scripts/dev/builtCliFrontendContractsSmoke.mjs`), a real-Chromium
|
|
178
|
+
end-to-end test (`tests/browser/cliFrontendContracts.test.ts`), and a
|
|
179
|
+
real-Chromium built-CLI smoke
|
|
180
|
+
(`scripts/dev/builtCliFrontendContractsBrowserSmoke.mjs` - see
|
|
181
|
+
`docs/DEVELOPMENT.md`). The real-browser coverage proves both a fully
|
|
182
|
+
successful contract change and the "milestone signature" failure (a locally
|
|
183
|
+
successful requested change coexisting with a genuine protected-property
|
|
184
|
+
regression and a genuine preserved-invariant regression) against actual
|
|
185
|
+
rendered geometry, not hand-constructed artifacts. It is also part of
|
|
186
|
+
packed-tarball validation: `scripts/ci/runPackedObservationSmoke.mjs`
|
|
187
|
+
exercises the installed candidate's `approve-baseline`/`save-change-contract`/
|
|
188
|
+
`evaluate-contract` commands against real installed-candidate `observe`/
|
|
189
|
+
`compare` evidence, proven on Windows, Linux, and macOS (see
|
|
190
|
+
`docs/CI_CD.md`).
|
|
191
|
+
|
|
192
|
+
## Current bounded agent context workflow (released as `0.6.0`)
|
|
193
|
+
|
|
194
|
+
This is a programmatic (library-only) workflow, not a CLI command - it
|
|
195
|
+
consumes already-persisted v0.1-v0.5 evidence in-process rather than reading
|
|
196
|
+
artifact roots from disk:
|
|
197
|
+
|
|
198
|
+
```text
|
|
199
|
+
already-captured evidence (ObservationArtifact(s), ComparisonArtifact,
|
|
200
|
+
PersistentBaselineContract/PerChangeContract, evaluation results)
|
|
201
|
+
→ projectBoundedAgentContext(...)
|
|
202
|
+
(src/domain/boundedAgentContextProjection.ts)
|
|
203
|
+
→ BoundedRuntimeTargetProjection: bounded geometry/behavior/relationships/
|
|
204
|
+
differences/contract-scope evidence, adequacy, omission, truncation
|
|
205
|
+
→ deriveRuntimeStaticCorrelations(...) / attachRuntimeStaticCorrelations(...)
|
|
206
|
+
(src/domain/boundedAgentContextCorrelation.ts), given caller-supplied
|
|
207
|
+
candidate static evidence
|
|
208
|
+
→ RuntimeStaticCorrelation[] (correlated / ambiguous / unavailable -
|
|
209
|
+
competing candidates remain visible, never collapsed to one owner)
|
|
210
|
+
→ consumed programmatically via the public export surface (src/index.ts) -
|
|
211
|
+
by an external orchestrator or coding-agent workflow outside this
|
|
212
|
+
repository, not by a new my-frontend-observer CLI command
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
This is exercised by unit tests covering the projection and correlation
|
|
216
|
+
modules (happy path, boundedness at exact/one-over/large-overflow limits,
|
|
217
|
+
immutability, malformed-input fail-closed behavior, adequacy/omission/
|
|
218
|
+
truncation reporting, and correlation status invariants/determinism/
|
|
219
|
+
deduplication). See `docs/CONTRACTS.md` "v0.6 bounded agent context and
|
|
220
|
+
correlation contract" for the exact shape.
|
|
221
|
+
|
|
222
|
+
**v0.7 Prompt 7 addition (released as `0.7.0`):** `projectBoundedAgentContext`
|
|
223
|
+
now optionally accepts an already-computed v0.7 Prompt 6
|
|
224
|
+
`ReferenceCandidateFidelityEvaluation` (`fidelity`) alongside its existing
|
|
225
|
+
v0.1-v0.5 evidence inputs - never recomputed, never a second fidelity
|
|
226
|
+
engine:
|
|
227
|
+
|
|
228
|
+
```text
|
|
229
|
+
already-computed evaluateReferenceCandidateFidelity(...) result
|
|
230
|
+
→ projectBoundedAgentContext({ ..., fidelity, fidelityRequired? })
|
|
231
|
+
→ projectReferenceFidelity(...) (src/domain/referenceFidelityProjection.ts):
|
|
232
|
+
selects/prioritizes/bounds Prompt 6's non-passing requirement results
|
|
233
|
+
(failed-required, then unavailable-required, then other non-pass) plus
|
|
234
|
+
passing protected/preserved context, and contributes their bound v0.2
|
|
235
|
+
runtime target ids to the exact same required/permitted-target
|
|
236
|
+
allocation contract clauses already compete in
|
|
237
|
+
→ BoundedAgentContextArtifact.fidelity: bounded mismatches/protectedContext
|
|
238
|
+
+ adequacy/compatibility/state pass-through from Prompt 6, folded into
|
|
239
|
+
the same omissions/truncations/adequacy computation as every other
|
|
240
|
+
evidence source (a blocked "not-evaluated" fidelity is never silently
|
|
241
|
+
reported as "no problems")
|
|
242
|
+
→ still consumed programmatically only, unchanged - no CLI surface
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Absent `fidelity`, output is unaffected - identical to the pre-Prompt-7
|
|
246
|
+
behavior described above, including logical identity. See
|
|
247
|
+
`docs/CONTRACTS.md` "v0.7 Prompt 7 bounded reference-fidelity projection and
|
|
248
|
+
v0.6 bounded-agent-context integration" for the full contract.
|
|
249
|
+
|
|
250
|
+
## Current external-reference foundation workflow (released as `0.7.0`)
|
|
251
|
+
|
|
252
|
+
This is the foundation layer only - identity, provenance, bounded image
|
|
253
|
+
metadata, a two-state lifecycle, (Prompt 2) explicit reference regions plus
|
|
254
|
+
reusable geometry relationships, (Prompt 3) selected design requirements,
|
|
255
|
+
tolerance semantics, and reference-evidence adequacy, (Prompt 4) explicit
|
|
256
|
+
reference applicability (viewport/theme/application-state/authenticated-
|
|
257
|
+
state) and reference/candidate compatibility, and (Prompt 5) explicit
|
|
258
|
+
reference-region <-> runtime-target binding, for one externally supplied
|
|
259
|
+
design-reference image. Structured fidelity-evaluation behavior (Prompt 6)
|
|
260
|
+
follows further below in this section, and it never launches a browser or
|
|
261
|
+
reads/writes any observation, comparison, or contract artifact:
|
|
262
|
+
|
|
263
|
+
```text
|
|
264
|
+
import-reference <image-file> --output <dir> [--label] [--supersedes <root>] [--regions-file <json-file>] [--requirements-file <json-file>] [--applicability-file <json-file>]
|
|
265
|
+
→ format detection from header/magic bytes only (png/jpeg/webp; never a
|
|
266
|
+
caller-declared extension), dimension parsing from the same bounded header
|
|
267
|
+
bytes (never a pixel decode), byte-length and dimension bounds checked
|
|
268
|
+
→ (--regions-file only: read + validate the local JSON root shape - an
|
|
269
|
+
object with exactly a "regions" property - then validate each region's id/
|
|
270
|
+
rectangle and the collection's bounds/uniqueness/image-boundary rules)
|
|
271
|
+
→ (--requirements-file only: read + validate the local JSON root shape - an
|
|
272
|
+
object with exactly a "requirements" property - then validate each
|
|
273
|
+
requirement's category/subject/tolerance shape, compute its
|
|
274
|
+
content-derived requirementId, and validate the collection's bounds/
|
|
275
|
+
region-existence/duplicate-subject rules against the regions above)
|
|
276
|
+
→ (--applicability-file only: read + validate the local JSON root shape -
|
|
277
|
+
the raw, unwrapped applicability object, no wrapper property - then
|
|
278
|
+
validate its optional viewport/theme/applicationState/authenticatedState
|
|
279
|
+
fields; caller-declared only, never inferred from the image)
|
|
280
|
+
→ (--supersedes only: read + validate the referenced prior external-reference
|
|
281
|
+
artifact through the same reader the writer's counterpart uses)
|
|
282
|
+
→ deterministic referenceRequestId (pure function of {imageSha256, format,
|
|
283
|
+
width, height, supersedesReferenceId, regions?, requirements?,
|
|
284
|
+
applicability?} only) + fresh referenceId
|
|
285
|
+
→ atomic persistence of one "imported" ExternalReferenceArtifact:
|
|
286
|
+
manifest.json (+ regions/requirements/applicability, when supplied) + its
|
|
287
|
+
own copy of the reference image, schema 1.0.0 - lifecycle.state is always
|
|
288
|
+
"imported"; import never approves
|
|
289
|
+
↓
|
|
290
|
+
approve-reference --reference <imported-artifact-root> --output <dir> [--supersedes <root>]
|
|
291
|
+
→ read + validate the target through the existing reader; refuse anything
|
|
292
|
+
not currently in the "imported" lifecycle state
|
|
293
|
+
→ persist a brand-new "approved" ExternalReferenceArtifact instance (same
|
|
294
|
+
referenceRequestId, fresh referenceId) carrying a sourceReference back to
|
|
295
|
+
the imported artifact's image - no image bytes are copied again, any
|
|
296
|
+
regions/requirements/applicability are carried forward verbatim (never
|
|
297
|
+
re-validated/re-derived), and the imported artifact's own manifest is
|
|
298
|
+
never modified
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
`approve-reference` is the only explicit reference-approval act - it is never
|
|
302
|
+
inferred from a successful import. Supersession (`--supersedes`) is
|
|
303
|
+
represented only as a forward pointer on the newer artifact; the artifact it
|
|
304
|
+
supersedes is never rewritten, so prior reference evidence remains immutable
|
|
305
|
+
regardless of how many later references supersede it. Region/requirement/
|
|
306
|
+
applicability content (added/removed/moved/resized/renamed regions;
|
|
307
|
+
added/removed/changed requirements or tolerances; a changed applicability
|
|
308
|
+
declaration) is identity-bearing, so a differently-structured reference is
|
|
309
|
+
always a distinct logical reference, never a silent rewrite of an existing
|
|
310
|
+
one.
|
|
311
|
+
|
|
312
|
+
Separately, `observe` gained an optional `--state-file <json-file>` (the
|
|
313
|
+
raw, unwrapped `{theme?, applicationState?, authenticatedState?}` object -
|
|
314
|
+
caller-declared only, never inferred), persisted as
|
|
315
|
+
`requestConfig.explicitState` on the resulting `ObservationArtifact` and
|
|
316
|
+
folded into that observation's own request identity. A pure, synchronous
|
|
317
|
+
domain function, `evaluateReferenceCandidateCompatibility(reference,
|
|
318
|
+
candidate)`, then answers "does this reference describe the same frontend
|
|
319
|
+
state as this candidate observation?" by comparing
|
|
320
|
+
`reference.applicability` against `candidate.requestConfig`
|
|
321
|
+
(viewport/explicitState) - reusing v0.4's own comparability result/reason
|
|
322
|
+
vocabulary and its underlying per-dimension comparison rule rather than
|
|
323
|
+
inventing a parallel model. This produces no persisted artifact of its own;
|
|
324
|
+
it is a pure function callers invoke on two already-persisted artifacts. See
|
|
325
|
+
`docs/CONTRACTS.md` "v0.7 Prompt 4 reference applicability and
|
|
326
|
+
candidate-state compatibility" for the full contract.
|
|
327
|
+
|
|
328
|
+
Building on that gate, a second pure, synchronous domain function,
|
|
329
|
+
`evaluateReferenceRuntimeBindings(reference, candidate, declarations)`,
|
|
330
|
+
answers "which stable v0.2 runtime target does this candidate resolve for
|
|
331
|
+
each explicitly declared reference region?" `declarations` is explicit
|
|
332
|
+
user/configuration input (`{referenceRegion, runtimeTarget}` pairs) - never
|
|
333
|
+
inferred from geometry, matching names, or source code. It runs the Prompt
|
|
334
|
+
4 compatibility gate first (reused, never duplicated): an `incomparable`
|
|
335
|
+
reference/candidate pair produces zero evaluated bindings, the blocker
|
|
336
|
+
visible only through the embedded `compatibility` field. Otherwise each
|
|
337
|
+
declaration is resolved against the candidate's own already-captured
|
|
338
|
+
`requestConfig.targets`/`targetEvidence` only - no browser, no second
|
|
339
|
+
target resolver - using the same `targetPresence` classification v0.4's own
|
|
340
|
+
`evaluateComparability` already relies on, yielding `bound`/`ambiguous`/
|
|
341
|
+
`unavailable` per declaration. Like compatibility, this produces no
|
|
342
|
+
persisted artifact of its own and mutates neither the reference nor the
|
|
343
|
+
candidate. See `docs/CONTRACTS.md` "v0.7 Prompt 5 explicit reference-region
|
|
344
|
+
<-> runtime-target binding" for the full contract.
|
|
345
|
+
|
|
346
|
+
Reference-region relationships (`deriveReferenceRegionRelationships()`) are
|
|
347
|
+
a separate, pure, on-demand derivation over an artifact's own `regions` -
|
|
348
|
+
not part of the persisted manifest - reusing the same geometry-only
|
|
349
|
+
relationship families (`left-of`/`above`/`overlaps`/`wider-than`/
|
|
350
|
+
`fits-inside`/`follows-vertically`, etc.) that
|
|
351
|
+
`deriveLayoutRelationships` derives for runtime targets. A reference
|
|
352
|
+
relationship is a fact about the reference image's geometry only, never a
|
|
353
|
+
design requirement or a pass/fail verdict.
|
|
354
|
+
|
|
355
|
+
Selected design requirements (`ExternalReferenceRequirement`) are the
|
|
356
|
+
explicit user/configuration layer on top of that reference evidence - a
|
|
357
|
+
region property, a region-to-region relationship, or a derived two-region
|
|
358
|
+
measurement, tagged with one of v0.5's four authored categories
|
|
359
|
+
(`requested`/`expected-dependent`/`protected`/`preserved`) and (except for
|
|
360
|
+
relationship subjects) a reference-image-pixel or percent tolerance. Nothing
|
|
361
|
+
promotes a property or relationship to a requirement automatically.
|
|
362
|
+
Reference-evidence adequacy (`deriveReferenceRequirementAdequacy()`) reports
|
|
363
|
+
only whether the reference side itself supports every selected requirement -
|
|
364
|
+
`adequate`/`partial`/`inadequate`, never a numeric score, never a claim
|
|
365
|
+
about runtime/candidate availability.
|
|
366
|
+
|
|
367
|
+
Finally, `evaluate-reference-fidelity --reference <root> --candidate <root>
|
|
368
|
+
[--bindings-file <json-file>] [--enforce]` is the first command in this
|
|
369
|
+
stack that actually compares a reference's selected requirements against
|
|
370
|
+
live candidate evidence:
|
|
371
|
+
|
|
372
|
+
```text
|
|
373
|
+
evaluate-reference-fidelity --reference <root> --candidate <root> [--bindings-file <json-file>] [--enforce]
|
|
374
|
+
→ (--bindings-file only: read + validate the local JSON root shape - an
|
|
375
|
+
object with exactly a "bindings" property - the still-unvalidated
|
|
376
|
+
declarations are handed straight through)
|
|
377
|
+
→ read the reference and candidate artifacts through their existing readers
|
|
378
|
+
→ evaluateReferenceCandidateFidelity(reference, candidate, bindings):
|
|
379
|
+
reference/candidate/binding-declaration structural validation
|
|
380
|
+
→ Prompt 3 reference adequacy (inadequate -> "not-evaluated", no
|
|
381
|
+
ordinary result fabricated)
|
|
382
|
+
→ Prompt 4 compatibility (incomparable -> "not-evaluated")
|
|
383
|
+
→ Prompt 5 binding evaluation (ambiguous/unavailable/undeclared binding ->
|
|
384
|
+
the dependent requirement is "unavailable", never guessed)
|
|
385
|
+
→ per requirement: reference-image-pixel <-> CSS-pixel coordinate mapping
|
|
386
|
+
(from reference.applicability.viewport and the image's own dimensions;
|
|
387
|
+
no viewport or an incoherent aspect ratio -> numeric requirements
|
|
388
|
+
"unavailable", never a fabricated result) then a Prompt-3-tolerance
|
|
389
|
+
comparison (region-property/region-measurement subjects) or a
|
|
390
|
+
family-scoped v0.4 relationship comparison (region-relationship
|
|
391
|
+
subjects)
|
|
392
|
+
→ overall state: "pass" only when every requirement result is "pass";
|
|
393
|
+
any "fail"/"unavailable" forces "fail"
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
This produces no persisted artifact - the structured result exists only for
|
|
397
|
+
this invocation, printed as a concise summary (reference adequacy,
|
|
398
|
+
compatibility state, overall fidelity state, and a pass/fail/unavailable
|
|
399
|
+
requirement breakdown). `--enforce` mirrors `evaluate-contract`'s exact
|
|
400
|
+
precedent: it changes only the process exit status for an already-computed
|
|
401
|
+
`fail` result, never its content, and never affects a `not-evaluated`
|
|
402
|
+
result (always exits 0 - a blocked evaluation is a successful, honest
|
|
403
|
+
outcome, not a design mismatch). See `docs/CONTRACTS.md` "v0.7 Prompt 6
|
|
404
|
+
structured reference-vs-candidate fidelity evaluation" for the full
|
|
405
|
+
contract.
|
|
406
|
+
|
|
407
|
+
This is exercised by unit tests covering the pure image-format/dimension
|
|
408
|
+
boundary, region geometry/validation, reference-region relationship
|
|
409
|
+
derivation, requirement validation/measurement derivation/reference-
|
|
410
|
+
expectation derivation/adequacy, identity (including region- and
|
|
411
|
+
requirement-content/order sensitivity), the domain validator, writer/reader
|
|
412
|
+
round-trip symmetry, the application-level import/approve use cases,
|
|
413
|
+
coordinate-mapping/tolerance/relationship fidelity evaluation (every
|
|
414
|
+
behavior in the Prompt 6 report's behavior model, including the exact
|
|
415
|
+
worked 2x-scale example from the task specification), and `runCli()`-level
|
|
416
|
+
CLI coverage (no Chromium involved - see `tests/unit/externalReference*.test.ts`,
|
|
417
|
+
`tests/unit/cliExternalReference.test.ts`, and
|
|
418
|
+
`tests/unit/cliEvaluateReferenceFidelity.test.ts`).
|
|
419
|
+
|
|
420
|
+
## Current reference correction workflow (released as `0.7.0`)
|
|
421
|
+
|
|
422
|
+
The first complete, controlled correction cycle - a programmatic (library-
|
|
423
|
+
only) workflow, exactly like the v0.6 bounded-context workflow above, with
|
|
424
|
+
one explicit, un-automatable seam where an external implementation actor
|
|
425
|
+
edits target source:
|
|
426
|
+
|
|
427
|
+
```text
|
|
428
|
+
approved ExternalReferenceArtifact + approved baseline ObservationArtifact
|
|
429
|
+
+ active PersistentBaselineContract + PerChangeContract + binding
|
|
430
|
+
declarations + current (pre-change) ObservationArtifact
|
|
431
|
+
→ prepareReferenceCorrection(...) (src/domain/referenceCorrectionWorkflow.ts)
|
|
432
|
+
→ evaluateReferenceCandidateFidelity(...) (v0.7 Prompt 6, reused)
|
|
433
|
+
→ not-evaluated (inadequate reference / incompatible state)?
|
|
434
|
+
→ { status: 'blocked-not-evaluated' } - no fabricated handoff
|
|
435
|
+
→ otherwise: projectBoundedAgentContext({ ..., fidelity }) (v0.7 Prompt 7/v0.6, reused)
|
|
436
|
+
→ { status: 'handoff-ready', handoff: ReferenceCorrectionHandoff }
|
|
437
|
+
↓
|
|
438
|
+
EXTERNAL implementation actor edits target source (never observer code)
|
|
439
|
+
↓
|
|
440
|
+
fresh real-Chromium candidate ObservationArtifact
|
|
441
|
+
(existing observe()/runBrowserCapture pipeline, reused unchanged)
|
|
442
|
+
↓
|
|
443
|
+
reviewReferenceCorrectionAttempt(...)
|
|
444
|
+
→ compareObservations(baseline, candidate) (v0.4, reused)
|
|
445
|
+
→ evaluateReferenceCandidateFidelity(reference, candidate, bindings) (Prompt 6, reused)
|
|
446
|
+
→ evaluateFrontendContract({ before: baseline, after: candidate, comparison, baseline: baselineContract, change: changeContract }) (v0.5, reused)
|
|
447
|
+
→ overall: 'not-evaluated' iff fidelity not-evaluated; else 'pass' iff
|
|
448
|
+
fidelity PASS AND contract evaluation PASS; else 'fail'
|
|
449
|
+
↓
|
|
450
|
+
FAIL? → prepareReferenceCorrection(..., currentObservation: <this failed candidate>)
|
|
451
|
+
derives a FRESH bounded handoff from the newest failed evidence
|
|
452
|
+
↓
|
|
453
|
+
external correction → fresh candidate → review again (caller-controlled, never automatic)
|
|
454
|
+
↓
|
|
455
|
+
PASS? → approvalEligible: true (a plain flag) - explicit
|
|
456
|
+
approve-baseline/approve-reference remain the caller's own,
|
|
457
|
+
separate, unautomated actions
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
Every attempt (`reviewReferenceCorrectionAttempt` call) evaluates against
|
|
461
|
+
the *same* supplied approved baseline - there is no attempt-to-attempt
|
|
462
|
+
comparison path - and `reviewRequestId` (a deterministic hash of
|
|
463
|
+
`{referenceRequestId, baselineObservationId, baselineContractId,
|
|
464
|
+
baselineContractClauses, changeContractId, changeContractClauses,
|
|
465
|
+
bindingDeclarations}`) is recomputed and checked on every review call. The
|
|
466
|
+
contract clause contents are identity-bearing as well as the caller-authored
|
|
467
|
+
contract ids, so a same-id contract with different clauses cannot be silently
|
|
468
|
+
substituted between attempts. Attempt identity (`attemptId`, a deterministic
|
|
469
|
+
hash of `{reviewRequestId, candidateObservationId}`) distinguishes every
|
|
470
|
+
candidate execution without ever using a timestamp; because both workflow
|
|
471
|
+
functions are pure, a returned attempt result can never be overwritten by a
|
|
472
|
+
later call - callers that keep every result they receive have a complete,
|
|
473
|
+
immutable attempt history for free.
|
|
474
|
+
|
|
475
|
+
This is exercised by unit tests covering preparation (valid handoff,
|
|
476
|
+
unapproved-reference rejection, inadequate-reference and incompatible-state
|
|
477
|
+
blocking, ambiguous-binding handling, review-identity determinism),
|
|
478
|
+
attempt review (all four overall-composition cases - both PASS, reference
|
|
479
|
+
FAIL, contract FAIL including a protected regression, and not-evaluated -
|
|
480
|
+
plus reviewRequestId coherence, attempt-identity determinism/distinctness,
|
|
481
|
+
`priorAttemptId` traceability, and input immutability), and a real-Chromium
|
|
482
|
+
end-to-end suite (`tests/browser/referenceCorrectionWorkflow.test.ts`)
|
|
483
|
+
proving: an initial genuine design mismatch measured against real rendered
|
|
484
|
+
geometry; a controlled, deterministic, test-only "external actor" (living
|
|
485
|
+
entirely outside `src/`) editing a disposable copy of a tracked HTML
|
|
486
|
+
fixture template and the observer capturing the change through the
|
|
487
|
+
unmodified real browser pipeline; a full success correction; a protected-
|
|
488
|
+
regression case where the candidate visually satisfies the reference but a
|
|
489
|
+
real Chromium-observed element becomes hidden, still producing overall
|
|
490
|
+
`FAIL`; a two-attempt correction iteration with both attempts remaining
|
|
491
|
+
distinct and traceable to the same baseline; and a blocking case
|
|
492
|
+
(incompatible reference/candidate viewport) that never produces a handoff.
|
|
493
|
+
The tracked fixture template is verified byte-identical before and after
|
|
494
|
+
the proof - only its disposable, repository-local copy is ever edited. See
|
|
495
|
+
`docs/CONTRACTS.md` "v0.7 Prompt 8 controlled end-to-end external-reference
|
|
496
|
+
coding-agent correction workflow" for the full contract.
|
|
497
|
+
|
|
498
|
+
## Current interactive viewer workflow (v0.8, released as `0.8.0`)
|
|
499
|
+
|
|
500
|
+
v0.7 (text/config-driven coding-agent change review, the external
|
|
501
|
+
visual-reference evidence foundation, structured reference-vs-candidate
|
|
502
|
+
fidelity evaluation, and the end-to-end correction workflow) is released as
|
|
503
|
+
package version `0.7.0` - see "Current external-reference foundation
|
|
504
|
+
workflow" and "Current reference correction workflow" above, and
|
|
505
|
+
`docs/CURRENT_STATE.md` for release state. v0.8 adds an interactive local
|
|
506
|
+
viewer over that same evidence, released as package version `0.8.0`:
|
|
507
|
+
|
|
508
|
+
```text
|
|
509
|
+
my-frontend-observer view --root <evidence-root>
|
|
510
|
+
[--bindings-file <json-file>] [--context-file <json-file>]
|
|
511
|
+
→ one loopback-only (127.0.0.1) Node server, default port 4319
|
|
512
|
+
→ metadata-first evidence discovery (GET /api/index)
|
|
513
|
+
→ canonical artifact readers, on-demand (full artifact/media fetched only
|
|
514
|
+
once explicitly selected)
|
|
515
|
+
→ viewer modes:
|
|
516
|
+
observation (screenshot + SVG target overlays, geometry/semantics/
|
|
517
|
+
visibility/overflow/scroll/relationships)
|
|
518
|
+
comparison/contracts (before/after side-by-side, clause results, overall
|
|
519
|
+
verdict)
|
|
520
|
+
reference/candidate (reference image + region overlays, explicit
|
|
521
|
+
candidate selection, compatibility/adequacy/applicability)
|
|
522
|
+
bounded context (only when --context-file was supplied)
|
|
523
|
+
→ served to a normal browser or an installed Progressive Web App
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
Where `--bindings-file` is supplied:
|
|
527
|
+
|
|
528
|
+
```text
|
|
529
|
+
--bindings-file { "bindings": [{ "referenceRegion", "runtimeTarget" }] }
|
|
530
|
+
→ explicit binding evaluation (evaluateReferenceRuntimeBindings, the same
|
|
531
|
+
canonical function evaluate-reference-fidelity uses)
|
|
532
|
+
→ binding-driven cross-selection (selecting a bound reference region
|
|
533
|
+
highlights every runtime target it names; selecting a bound runtime
|
|
534
|
+
target highlights every reference region that names it)
|
|
535
|
+
→ on-demand fidelity evaluation ("Evaluate Fidelity" action, never
|
|
536
|
+
automatic), shown independently alongside any selected contract
|
|
537
|
+
evaluation - neither overrides the other
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
Where `--context-file` is supplied:
|
|
541
|
+
|
|
542
|
+
```text
|
|
543
|
+
--context-file <one BoundedAgentContextArtifact value, no wrapper>
|
|
544
|
+
→ canonical bounded-context inspection: identity, adequacy, omissions/
|
|
545
|
+
truncations (required loss visually distinct from optional loss),
|
|
546
|
+
runtime/static correlation (correlated/ambiguous/unavailable)
|
|
547
|
+
→ provenance: exact-identity resolution of the context's source references
|
|
548
|
+
against the current evidence root
|
|
549
|
+
→ safe navigation to the raw structured evidence behind a resolved source
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
The viewer is optional: every CLI/programmatic workflow above remains
|
|
553
|
+
independently functional without it. The viewer never modifies target
|
|
554
|
+
source or any Observer evidence artifact; never runs
|
|
555
|
+
`@dailephd/my-dev-kit`; never rebuilds a bounded context
|
|
556
|
+
(`projectBoundedAgentContext` is not called at runtime) or its correlation
|
|
557
|
+
(`deriveRuntimeStaticCorrelations`/`attachRuntimeStaticCorrelations` are not
|
|
558
|
+
called at runtime) - it only displays the exact context and bindings it was
|
|
559
|
+
started with. See `docs/COMMANDS.md#view` for the full flag reference and
|
|
560
|
+
`docs/ARCHITECTURE.md` "v0.8 Batch 1" through "v0.8 Batch 8" for the
|
|
561
|
+
implementation record.
|
|
562
|
+
|
|
563
|
+
## Future workflows (v0.9–v0.10)
|
|
564
|
+
|
|
565
|
+
The still-future sequence on top of the v0.7/v0.8 foundation above preserves
|
|
566
|
+
the current engines and lets later graphical interfaces consume rather than
|
|
567
|
+
invent the reference model:
|
|
568
|
+
|
|
569
|
+
```text
|
|
570
|
+
stable targets and bounded runtime behavior
|
|
571
|
+
→ relationships and before/after comparison (released - see above)
|
|
572
|
+
→ safe-change contracts (contract model, evaluation, persistence, and CLI
|
|
573
|
+
released as 0.5.0 - see above; baseline approval remains a single explicit
|
|
574
|
+
command, not a policy engine)
|
|
575
|
+
→ bounded agent context plus runtime/static correlation (released as
|
|
576
|
+
`0.6.0` - see above; orchestrator/lab-side ecosystem integration is
|
|
577
|
+
separate sibling-repository work, not part of this repository)
|
|
578
|
+
→ v0.7 text/config-driven coding-agent change review
|
|
579
|
+
+ external visual-reference evidence foundation
|
|
580
|
+
+ structured reference-vs-candidate fidelity evaluation
|
|
581
|
+
+ end-to-end correction workflow (released as `0.7.0` - see above)
|
|
582
|
+
→ v0.8 interactive viewer with reference/candidate inspection (released as
|
|
583
|
+
package version `0.8.0` - see "Current interactive viewer workflow" above)
|
|
584
|
+
→ v0.9 structured visual annotation on runtime screenshots and references
|
|
585
|
+
→ v0.10 full visual human–LLM workflow with both actual-frontend-driven and
|
|
586
|
+
reference-driven entry modes
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
### v0.7 reference-driven correction flow (released as `0.7.0`)
|
|
590
|
+
|
|
591
|
+
The non-graphical reference path, now released exactly as originally
|
|
592
|
+
planned, is:
|
|
593
|
+
|
|
594
|
+
```text
|
|
595
|
+
external visual reference
|
|
596
|
+
→ explicit reference identity/provenance
|
|
597
|
+
+ bounded reference regions and reusable geometry relationships
|
|
598
|
+
+ selected design requirements, tolerance semantics, and reference-
|
|
599
|
+
evidence adequacy
|
|
600
|
+
+ explicit applicability/theme/viewport compatibility
|
|
601
|
+
(all implemented - see "Current external-reference foundation workflow"
|
|
602
|
+
above)
|
|
603
|
+
→ explicit reference-region ↔ runtime-target binding (implemented - v0.7
|
|
604
|
+
Prompt 5)
|
|
605
|
+
→ candidate rendered through the existing Chromium observation engine
|
|
606
|
+
→ structured reference-vs-candidate evaluation
|
|
607
|
+
→ bounded measurable fidelity mismatches
|
|
608
|
+
→ relevant bounded runtime/static context
|
|
609
|
+
→ external coding agent modifies source
|
|
610
|
+
→ rerender
|
|
611
|
+
→ reevaluate reference fidelity
|
|
612
|
+
+ rerun before/after comparison
|
|
613
|
+
+ rerun per-change and persistent baseline contracts
|
|
614
|
+
→ PASS or actionable fidelity/regression failure
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
This does not turn an imported image into an observation or approved baseline.
|
|
618
|
+
Reference design vs candidate remains distinct from before vs after comparison.
|
|
619
|
+
Executable reference requirements reuse the existing canonical requested/
|
|
620
|
+
expected-dependent/protected/preserved semantics. Informational reference detail
|
|
621
|
+
may remain non-executable. Pixel/image similarity can supplement structured
|
|
622
|
+
geometry/relationship/style evidence where reliable, but it never becomes
|
|
623
|
+
the only success criterion.
|
|
624
|
+
|
|
625
|
+
Theme, application state, viewport, and other applicability dimensions are
|
|
626
|
+
checked before reference fidelity is interpreted. A mismatched reference and
|
|
627
|
+
candidate state yields an explicit incompatible/incomparable outcome rather
|
|
628
|
+
than fabricated visual failures.
|
|
629
|
+
|
|
630
|
+
The v0.7 coding-agent workflow and reference foundation are released as
|
|
631
|
+
part of this repository and work without the v0.8 viewer or v0.9
|
|
632
|
+
annotation system. v0.8, implemented in the current repository (not yet
|
|
633
|
+
released), consumes the v0.7 reference/evaluation model exactly as
|
|
634
|
+
required - it does not create a second UI-only one (see "Current
|
|
635
|
+
interactive viewer workflow" above). v0.9 remains future and must preserve
|
|
636
|
+
the same constraint when implemented.
|
|
637
|
+
# v0.8.1 release workflow
|
|
638
|
+
|
|
639
|
+
The published package is `@dailephd/my-frontend-observer@0.8.1`; install it
|
|
640
|
+
with npm and use the `my-frontend-observer` CLI. The ordinary workflow is
|
|
641
|
+
`init`, `capture baseline`, `check baseline`, then `view`. Existing sections
|
|
642
|
+
below retain the historical low-level and viewer workflows for compatibility.
|