@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,234 @@
|
|
|
1
|
+
# v0.7 Prompt 4 — Reference Applicability and Candidate-State Compatibility
|
|
2
|
+
|
|
3
|
+
**VERDICT: PASS_V0_7_REFERENCE_COMPATIBILITY_PROMPT4**
|
|
4
|
+
|
|
5
|
+
## Repository / branch / heads
|
|
6
|
+
|
|
7
|
+
- Repository: `my-frontend-observer` (path: `Z:\Users\newuser\Projects\my-frontend-observer`)
|
|
8
|
+
- Branch: `implementation/v0.7-reference-compatibility`, branched from Prompt 3's exact completed HEAD
|
|
9
|
+
- Prior HEAD (Prompt 3 report commit): `271087309386342a87aeec5b47d668bc02c457c9`
|
|
10
|
+
- Implementation commit (this prompt): `4da60be63c68a8c2138a0a28c1c6fa48242c2856` — "Add v0.7 Prompt 4 reference applicability and candidate-state compatibility"
|
|
11
|
+
- `git merge-base --is-ancestor` confirmed the branch point is exactly Prompt 3's report commit before any implementation work began.
|
|
12
|
+
|
|
13
|
+
## Git status at time of report
|
|
14
|
+
|
|
15
|
+
Working tree clean except for this report file (about to be added and committed separately). `git status --short` immediately before staging the implementation showed exactly the intentional Prompt 4 file set — 15 modified source files, 3 new source files, 11 modified test files, 3 new test files, and 4 modified docs files — nothing else. `git stash list` still shows exactly one entry, the Prompt 1 stray-fork-writes stash, untouched throughout this prompt (`stash@{0}: On implementation/v0.7-reference-foundation: stray-fork-writes-preserved-for-reference: ...`).
|
|
16
|
+
|
|
17
|
+
## Tooling
|
|
18
|
+
|
|
19
|
+
- `@dailephd/my-dev-kit` resolved version: `1.12.2` (via `npx @dailephd/my-dev-kit --version`).
|
|
20
|
+
- Fresh per-prompt code index built at `.my-dev-kit/index-prompt4/` before any implementation code was written, consulted during precedent review.
|
|
21
|
+
- Package version at time of work: `0.6.0` (unchanged — no schema/package version bump this prompt).
|
|
22
|
+
|
|
23
|
+
## Precedent review
|
|
24
|
+
|
|
25
|
+
Before writing any Prompt 4 code, the following existing modules were read in full (source, not memory, and not the fresh index's summaries alone):
|
|
26
|
+
|
|
27
|
+
- `src/domain/comparison.ts` — v0.4's frozen `ComparabilityState`/`ComparabilityReasonCode`/`ComparabilityReasonSeverity`/`ComparabilityReason`/`ComparabilityResult` vocabulary and its `isValidComparabilityReason` validator.
|
|
28
|
+
- `src/domain/comparisonEngine.ts` — v0.4's `evaluateComparability(before, after)`, including its three unconditional `theme-unassessed`/`authenticated-state-unassessed`/`application-state-unassessed` reason emissions (the exact hook point for this prompt's "additive improvement" requirement).
|
|
29
|
+
- `src/request/request.ts` — `NormalizedObservationRequest`/`RawObservationRequest`, `normalizeRequest()`'s validation-and-diagnostics pattern, and the existing `scrollScenario` additive-field precedent (validate raw input, push `invalid-request` diagnostics on failure, spread the field into the result only when defined).
|
|
30
|
+
- `src/domain/identity.ts` — `buildRequestIdentity`'s exact "new optional trailing parameter, omitted (never `null`) from the hashed semantic view when `undefined`" pattern, applied previously for `scrollScenario`.
|
|
31
|
+
- `src/domain/externalReference.ts`, `externalReferenceIdentity.ts`, `externalReferenceRegions.ts`, `externalReferenceRequirements.ts` — Prompt 1–3's additive-field/identity-parameter conventions, region/requirement validation shape, and the CLI file-loading precedent (`loadScrollScenarioFile`, `--regions-file`/`--requirements-file` wrapped-object convention vs. an unwrapped single-object convention).
|
|
32
|
+
- `src/application/externalReferencePersistenceService.ts` — the `importExternalReference`/`approveExternalReference` validate-then-persist-then-carry-forward pattern used for `regions`/`requirements`, reused identically for `applicability`.
|
|
33
|
+
- `src/domain/diagnostics.ts` — the single-diagnostic-code-per-validation-domain convention (`invalid-reference-region`, `invalid-reference-requirement`) that `invalid-reference-applicability` follows.
|
|
34
|
+
- `src/domain/frontendContracts.ts` — confirmed `AuthoredChangeScopeCategory` reuse precedent was not applicable here (Prompt 4 introduces no new authored-scope concept).
|
|
35
|
+
- `src/cli.ts` — the full `observe`/`import-reference`/`approve-reference` command implementations, their help-text blocks, and argument-parsing conventions (`--scroll-scenario-file`, `--regions-file`, `--requirements-file`) that `--state-file`/`--applicability-file` mirror.
|
|
36
|
+
|
|
37
|
+
No architecture blocker was hit; no `BLOCKED_ESCALATE_TO_FULL_STAGE_CONTEXT` condition applied at any point.
|
|
38
|
+
|
|
39
|
+
## Previous owners reused (not duplicated)
|
|
40
|
+
|
|
41
|
+
- `ComparabilityState`/`ComparabilityReasonCode`/`ComparabilityReasonSeverity`/`ComparabilityReason`/`ComparabilityResult` (from `domain/comparison.ts`) — reused wholesale as the compatibility result's `compatibility` field type. No parallel "compatibility state" enum was invented.
|
|
42
|
+
- `assessOptionalComparabilityDimension` — newly extracted from `comparisonEngine.ts` as an exported pure helper, and reused by both v0.4's `evaluateComparability` and the new `evaluateReferenceCandidateCompatibility`. This is the one point of actual code-sharing between the Observation↔Observation and Reference↔Observation compatibility checks; everything else about the two functions (their input types, their result envelopes) remains separately owned.
|
|
43
|
+
- `AuthenticatedState`/`ExplicitStateDimensions`/label pattern (`domain/explicitState.ts`) — one new, small, independently-owned module shared by both `ExternalReferenceApplicability` (via `extends ExplicitStateDimensions`) and `ObservationArtifact.requestConfig.explicitState`. This is a genuinely new vocabulary (nothing pre-existing captured "explicit state identity"), not a duplication of anything.
|
|
44
|
+
- `isValidStateLabel`/`STATE_LABEL_PATTERN` reuse of the existing `^[A-Za-z0-9_-]{1,64}$` convention already used for target names/region ids — not reinvented.
|
|
45
|
+
- `DIAGNOSTIC_CODES`/`DIAGNOSTIC_SEVERITY` (from `domain/diagnostics.ts`) — extended additively with one new code (`invalid-reference-applicability`), not a new diagnostics subsystem.
|
|
46
|
+
|
|
47
|
+
## State/applicability model
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// domain/explicitState.ts
|
|
51
|
+
export const STATE_LABEL_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
52
|
+
export const AUTHENTICATED_STATE_VALUES = ['authenticated', 'unauthenticated'] as const;
|
|
53
|
+
export type AuthenticatedState = (typeof AUTHENTICATED_STATE_VALUES)[number];
|
|
54
|
+
export interface ExplicitStateDimensions {
|
|
55
|
+
theme?: string;
|
|
56
|
+
applicationState?: string;
|
|
57
|
+
authenticatedState?: AuthenticatedState;
|
|
58
|
+
}
|
|
59
|
+
// isValidExplicitStateDimensions: rejects unknown keys, validates each present
|
|
60
|
+
// field, and requires at least one declared dimension.
|
|
61
|
+
|
|
62
|
+
// domain/externalReferenceApplicability.ts
|
|
63
|
+
export const APPLICABLE_VIEWPORT_MIN = 200;
|
|
64
|
+
export const APPLICABLE_VIEWPORT_MAX = 3840;
|
|
65
|
+
export interface ApplicableViewport { width: number; height: number }
|
|
66
|
+
export interface ExternalReferenceApplicability extends ExplicitStateDimensions {
|
|
67
|
+
viewport?: ApplicableViewport;
|
|
68
|
+
}
|
|
69
|
+
// isValidExternalReferenceApplicability: its own independent validator (not a
|
|
70
|
+
// delegation to isValidExplicitStateDimensions, whose "at least one of three"
|
|
71
|
+
// rule would incorrectly reject a viewport-only object).
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This is a bounded, closed shape — never an arbitrary `Record<string, unknown>` metadata bag. Unknown fields are rejected outright by both validators. Nothing in either module reads a browser, the DOM, a screenshot, a URL, source code, a filename, an accessibility label, `localStorage`, or a cookie; both are pure structural validators over caller-supplied plain objects.
|
|
75
|
+
|
|
76
|
+
## Exact image dimensions vs. applicable viewport
|
|
77
|
+
|
|
78
|
+
`ExternalReferenceImageReference.width/height` (Prompt 1, unchanged) continues to describe only the reference image file's own pixel dimensions, detected from header bytes. `ExternalReferenceApplicability.viewport` is a wholly distinct, independently-validated field describing the CSS-pixel runtime viewport the design represents. Neither field is derived from the other anywhere in the codebase; a reference image may be captured at any resolution/DPI relative to its declared applicable viewport, and `isValidExternalReferenceApplicability` never consults `image.width`/`image.height`.
|
|
79
|
+
|
|
80
|
+
## Provenance / state-identity source
|
|
81
|
+
|
|
82
|
+
`theme`, `applicationState`, and `authenticatedState` are accepted only as caller/config-supplied JSON input, on both the reference-import side (`--applicability-file`) and the observation side (`--state-file`). Neither `chromiumAdapter.ts`, `evidenceCapture.ts`, nor any other browser-facing module was touched by this prompt — there is no automatic state-detection code path anywhere in the repository, and none was added. `authenticatedState` is restricted to the closed two-value vocabulary `authenticated`/`unauthenticated`; nothing in `ExplicitStateDimensions`/`ExternalReferenceApplicability` can carry a password, token, cookie, session id, API key, or authorization header — the type system has no field for any of them, and the validators reject any unrecognized key.
|
|
83
|
+
|
|
84
|
+
## Compatibility result model
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
// domain/externalReferenceCompatibility.ts
|
|
88
|
+
export interface ReferenceCandidateCompatibilityResult {
|
|
89
|
+
referenceId: string;
|
|
90
|
+
referenceRequestId: string;
|
|
91
|
+
candidateObservationId: string;
|
|
92
|
+
candidateRequestId: string;
|
|
93
|
+
compatibility: ComparabilityResult; // reused v0.4 type: { state, reasons[] }
|
|
94
|
+
}
|
|
95
|
+
export function evaluateReferenceCandidateCompatibility(
|
|
96
|
+
reference: ExternalReferenceArtifact,
|
|
97
|
+
candidate: ObservationArtifact,
|
|
98
|
+
): ReferenceCandidateCompatibilityResult;
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Structured, never boolean, never a numeric/visual score. `compatibility.reasons` carries per-dimension `{ code, severity, message, referenceValue?, candidateValue? }` records; `referenceValue`/`candidateValue` are populated only on a mismatch reason (never on an unassessed reason, since there is nothing to compare). The function is pure and synchronous — verified by an explicit "same inputs produce a deep-equal result" test.
|
|
102
|
+
|
|
103
|
+
## Blocking / unassessed / missing-dimension semantics (behaviors A–I)
|
|
104
|
+
|
|
105
|
+
All nine required behaviors are implemented via the single shared helper `assessOptionalComparabilityDimension(mismatchCode, unassessedCode, referenceValue, candidateValue, mismatchMessage, unassessedMessage)`:
|
|
106
|
+
|
|
107
|
+
- Both values defined and equal → no reason emitted (comparable on that dimension).
|
|
108
|
+
- Both values defined and different → a `blocking`-severity mismatch reason, with `referenceValue`/`candidateValue` populated (behaviors B, D, E, F for viewport/theme/application-state/authenticated-state mismatches — all four dimensions use the identical rule).
|
|
109
|
+
- Either value `undefined` (reference constrains but candidate lacks it, reference omits it entirely, or both omit it) → an `unassessed`-severity reason, **never** a fabricated match and **never** a fabricated mismatch (behaviors G, H, I). This is fail-closed: an unassessed dimension never contributes to `compatible`, but it also never forces `incomparable` — only an actual detected mismatch does that.
|
|
110
|
+
- Overall `compatibility.state` is `incomparable` if any reason is `blocking`, else `comparable-with-warnings` if any is `warning` (this prompt introduces no warning-severity reasons of its own — only blocking/unassessed), else `comparable`.
|
|
111
|
+
- A reference declaring no `applicability` at all produces a fully unassessed result across every dimension — verified explicitly; Prompt 1/2/3 references remain fully usable, just unassessed for compatibility until `applicability` is authored.
|
|
112
|
+
|
|
113
|
+
All nine behaviors (A–I) plus the "no applicability at all" and "pure function" cases are covered by dedicated tests in `tests/unit/externalReferenceCompatibility.test.ts`.
|
|
114
|
+
|
|
115
|
+
## v0.4 reuse / refactor proof
|
|
116
|
+
|
|
117
|
+
`assessOptionalComparabilityDimension` was extracted directly out of the body of `evaluateComparability` (its three `theme`/`authenticatedState`/`applicationState` blocks previously called `add('theme-unassessed', ...)` etc. unconditionally). After extraction:
|
|
118
|
+
|
|
119
|
+
- `evaluateComparability`'s three state-dimension blocks now call the shared helper against `before.requestConfig.explicitState`/`after.requestConfig.explicitState`.
|
|
120
|
+
- `evaluateReferenceCandidateCompatibility` calls the identical helper against `reference.applicability`/`candidate.requestConfig` (viewport) and `candidate.requestConfig.explicitState` (theme/authenticatedState/applicationState).
|
|
121
|
+
- The reason-code sort rule (`reasons.sort((a, b) => COMPARABILITY_REASON_CODES.indexOf(a.code) - COMPARABILITY_REASON_CODES.indexOf(b.code))`) and the `state` derivation (`hasBlocking → incomparable`, else `hasWarning → comparable-with-warnings`, else `comparable`) are duplicated verbatim in `externalReferenceCompatibility.ts` (deliberately not extracted into a second shared helper, since a two-line duplication was judged lower-risk than adding a third shared dependency between v0.4 and v0.7 module boundaries for something this small).
|
|
122
|
+
|
|
123
|
+
## Old-behavior-unchanged proof
|
|
124
|
+
|
|
125
|
+
The pre-existing frozen regression test in `tests/unit/comparisonEngine.test.ts` (`'is comparable with no reasons beyond the always-present unassessed dimensions'`) asserts `result.reasons.map((r) => r.code)` equals exactly `['theme-unassessed', 'authenticated-state-unassessed', 'application-state-unassessed']` for a before/after pair with no `explicitState` on either side — this test was **not modified** and still passes unchanged, because neither observation declares `explicitState`, so the shared helper's "either value undefined" branch fires for all three dimensions, exactly reproducing the pre-Prompt-4 unconditional-unassessed behavior. Three new tests were added alongside it exercising the additive "both declare, match", "both declare, mismatch", and "only one declares" cases. Full v0.1–v0.6 regression suites (unit + browser + security) were re-run and are unaffected — see Validation below.
|
|
126
|
+
|
|
127
|
+
## Identity impacts
|
|
128
|
+
|
|
129
|
+
- `buildExternalReferenceRequestIdentity(imageSha256, format, width, height, supersedesReferenceId?, regions?, requirements?, applicability?)` — `applicability` is the new 8th, final, optional parameter, omitted entirely (never `null`) from the hashed semantic view when `undefined`. Verified: `buildExternalReferenceRequestIdentity(...args)` and `buildExternalReferenceRequestIdentity(...args, undefined)` produce byte-identical hashes.
|
|
130
|
+
- `buildRequestIdentity(request)` — `request.explicitState` is now included in the semantic view only when present (`...(request.explicitState ? { explicitState: request.explicitState } : {})`), mirroring the existing `scrollScenario` treatment exactly. The pre-existing frozen regression vector (`buildRequestIdentity(baseRequest())` === a specific fixed hash string) is asserted unchanged by a new test in `identity.test.ts`.
|
|
131
|
+
- No operational file path (`--state-file`'s or `--applicability-file`'s path argument) enters either identity function — both functions take only already-parsed, in-memory values, never a path.
|
|
132
|
+
|
|
133
|
+
## Schema / version decisions
|
|
134
|
+
|
|
135
|
+
No `SCHEMA_VERSION`/`EXTERNAL_REFERENCE_SCHEMA_VERSION` bump. Both new fields (`requestConfig.explicitState`, `ExternalReferenceArtifact.applicability`) are purely additive and optional, following the exact precedent set by `scrollScenario` (Prompt/Batch 3) and `regions`/`requirements` (v0.7 Prompts 2/3), none of which bumped their respective schema versions either.
|
|
136
|
+
|
|
137
|
+
## CLI changes
|
|
138
|
+
|
|
139
|
+
- `observe` gains `--state-file <json-file>`: unwrapped `{theme?, applicationState?, authenticatedState?}` object, no wrapper field, mirroring `--scroll-scenario-file`'s file-loading shape exactly (read → JSON.parse → plain-object-root check only; all semantic validation deferred to `normalizeRequest()`/`isValidExplicitStateDimensions`). Compatible with `--target`/`--targets-file`/`--scroll-scenario-file` (independent, non-conflicting flag).
|
|
140
|
+
- `import-reference` gains `--applicability-file <json-file>`: unwrapped raw applicability object (not a `{"requirements": [...]}`-style wrapper, since applicability is a single object, not a named list) — read → JSON.parse → plain-object-root check only; all semantic validation deferred to `isValidExternalReferenceApplicability`.
|
|
141
|
+
- Both commands' `--help` text, and `approve-reference --help`, were updated to document the new flag and its failure modes.
|
|
142
|
+
- `import-reference`/`approve-reference` success output gained one new line: `Applicability: declared|none`.
|
|
143
|
+
- CLI code owns only flag syntax, file reading, JSON parsing, and object-root shape validation for both new flags — zero semantic validation logic lives in `cli.ts` itself; every actual rule (label pattern, authenticated-state vocabulary, viewport bounds, "at least one dimension") is owned by `domain/explicitState.ts`/`domain/externalReferenceApplicability.ts`.
|
|
144
|
+
|
|
145
|
+
## Persistence decision
|
|
146
|
+
|
|
147
|
+
No new persisted artifact kind was introduced for the compatibility result. `evaluateReferenceCandidateCompatibility` is a pure, synchronous, on-demand function over two already-persisted artifacts (an `ExternalReferenceArtifact` and an `ObservationArtifact`), invoked directly by a caller (application code, a future CLI command, or a test) — never something the observer writes to disk automatically. Rationale: the result is cheap to recompute deterministically from its two inputs; persisting it would introduce a drift risk (a re-imported/re-observed artifact could silently disagree with a stale persisted compatibility record) with no corresponding benefit at this stage of the architecture. This decision may be revisited only if a later v0.7 prompt's architecture proves persistence necessary — documented per instruction, not assumed.
|
|
148
|
+
|
|
149
|
+
## Files changed
|
|
150
|
+
|
|
151
|
+
New:
|
|
152
|
+
- `src/domain/explicitState.ts`
|
|
153
|
+
- `src/domain/externalReferenceApplicability.ts`
|
|
154
|
+
- `src/domain/externalReferenceCompatibility.ts`
|
|
155
|
+
- `tests/unit/explicitState.test.ts`
|
|
156
|
+
- `tests/unit/externalReferenceApplicability.test.ts`
|
|
157
|
+
- `tests/unit/externalReferenceCompatibility.test.ts`
|
|
158
|
+
|
|
159
|
+
Modified:
|
|
160
|
+
- `src/domain/comparison.ts` (4 new reason codes, 2 new optional `ComparabilityReason` fields)
|
|
161
|
+
- `src/domain/comparisonEngine.ts` (extracted+exported `assessOptionalComparabilityDimension`; `evaluateComparability` now uses it additively)
|
|
162
|
+
- `src/domain/diagnostics.ts` (`invalid-reference-applicability` code)
|
|
163
|
+
- `src/domain/externalReference.ts` (`applicability?` field + validation)
|
|
164
|
+
- `src/domain/externalReferenceIdentity.ts` (`applicability` identity parameter)
|
|
165
|
+
- `src/domain/identity.ts` (`explicitState` identity inclusion)
|
|
166
|
+
- `src/domain/schema.ts` (`requestConfig.explicitState` defense-in-depth validation)
|
|
167
|
+
- `src/request/request.ts` (`explicitState` request field + validation)
|
|
168
|
+
- `src/application/externalReferencePersistenceService.ts` (`applicability` import/approve wiring, `hasApplicability` result field)
|
|
169
|
+
- `src/cli.ts` (`--state-file`, `--applicability-file`, help text, output lines)
|
|
170
|
+
- `src/index.ts` (public export surface for all of the above)
|
|
171
|
+
- `docs/ARCHITECTURE.md`, `docs/CONTRACTS.md`, `docs/WORKFLOWS.md`, `docs/COMMANDS.md`
|
|
172
|
+
- 11 existing test files extended with Prompt 4 coverage (see Tests below)
|
|
173
|
+
|
|
174
|
+
## Tests
|
|
175
|
+
|
|
176
|
+
857 unit tests total (779 pre-existing + 78 new/extended this prompt), across:
|
|
177
|
+
- New: `explicitState.test.ts` (10 tests), `externalReferenceApplicability.test.ts` (8 tests), `externalReferenceCompatibility.test.ts` (14 tests covering behaviors A–I plus identity/purity checks).
|
|
178
|
+
- Extended: `comparisonEngine.test.ts` (+3, v0.4 additive-assessment behavior), `identity.test.ts` (+4, `explicitState` identity), `externalReferenceIdentity.test.ts` (+4, `applicability` identity), `externalReference.test.ts` (+4, `applicability` schema validation), `schema.test.ts` (+3, `requestConfig.explicitState` validation), `request.test.ts` (+7, `explicitState` request normalization), `externalReferencePersistenceService.test.ts` (+4, import/approve applicability wiring), `cli.test.ts` (+9, `--state-file` CLI boundary + help text), `cliExternalReference.test.ts` (+6, `--applicability-file` CLI boundary + end-to-end import/approve).
|
|
179
|
+
|
|
180
|
+
## Validation results
|
|
181
|
+
|
|
182
|
+
All commands run from the repository root, after the implementation commit:
|
|
183
|
+
|
|
184
|
+
- `npm run typecheck` — pass, zero errors.
|
|
185
|
+
- `npm run lint` — pass, zero errors/warnings.
|
|
186
|
+
- `npm test` — 45 test files, 857 tests, all pass.
|
|
187
|
+
- `npm run build` — pass, clean `tsc` compile.
|
|
188
|
+
- `npm run check:docs` — pass (17 required files present, `ROADMAP.md` format intact).
|
|
189
|
+
- `git diff --check` — exit 0 (only benign LF→CRLF normalization notices on Windows checkout, no actual whitespace-error content).
|
|
190
|
+
- `npm pack --dry-run` — pass; new `dist/domain/explicitState.js`, `externalReferenceApplicability.js`, `externalReferenceCompatibility.js` (and their `.d.ts`/`.js.map`) confirmed present in the tarball listing alongside updated `dist/index.d.ts`.
|
|
191
|
+
- `npm run test:security` — pass (5 + 63 = 68 tests: `policy.test.ts` + real-Chromium `chromiumAdapter.test.ts`), run because this prompt changes state/config input surface.
|
|
192
|
+
- `npm run test:browser` — pass (9 files, 120 tests, real Chromium), run as full regression confirmation.
|
|
193
|
+
|
|
194
|
+
## Regression results
|
|
195
|
+
|
|
196
|
+
- Full v0.1–v0.6 unit suite: unaffected, all passing (779 pre-existing tests unchanged in assertions, all still passing verbatim).
|
|
197
|
+
- Full real-Chromium browser suite: 120/120 passing, unaffected.
|
|
198
|
+
- Full security suite: 68/68 passing, unaffected.
|
|
199
|
+
- The one pre-existing frozen `evaluateComparability` regression test (no-`explicitState` case) passes unchanged, proving the v0.4 additive-assessment change is genuinely additive, not a behavior change for any historical/legacy observation pair.
|
|
200
|
+
- The one pre-existing frozen `buildRequestIdentity` regression hash (`baseRequest()` with no `scrollScenario`/`explicitState`) passes unchanged, proving the `explicitState` identity extension is genuinely additive.
|
|
201
|
+
|
|
202
|
+
## Security impact
|
|
203
|
+
|
|
204
|
+
- No new external input surface beyond local JSON files the caller already controls (same trust boundary as `--targets-file`/`--scroll-scenario-file`/`--regions-file`/`--requirements-file`).
|
|
205
|
+
- `authenticatedState`'s closed two-value vocabulary and the complete absence of any credential/token/cookie/session-id field in `ExplicitStateDimensions`/`ExternalReferenceApplicability` were verified by direct type/field inspection — there is no field anywhere in either interface capable of holding a secret.
|
|
206
|
+
- `test:security` (policy + real-Chromium adapter tests) re-run and passing, confirming no regression to the existing safety/navigation policy surface (this prompt touches none of that code).
|
|
207
|
+
|
|
208
|
+
## Documentation changes
|
|
209
|
+
|
|
210
|
+
- `docs/CONTRACTS.md` — new "v0.7 Prompt 4 reference applicability and candidate-state compatibility" section (full type shapes, key rules, image-vs-viewport distinction, v0.4 reuse proof, persistence decision, identity impact, CLI summary).
|
|
211
|
+
- `docs/ARCHITECTURE.md` — new paragraph in the "Planned v0.7–v0.10" section describing the Prompt 4 module additions and the v0.4 extraction/reuse story.
|
|
212
|
+
- `docs/WORKFLOWS.md` — "Current external-reference foundation workflow" section retitled to "Prompts 1-4" and extended with `--applicability-file`/`--state-file` steps and the new compatibility-evaluation paragraph.
|
|
213
|
+
- `docs/COMMANDS.md` — `observe` options list extended with `--state-file`.
|
|
214
|
+
|
|
215
|
+
## Tooling incidents
|
|
216
|
+
|
|
217
|
+
None this prompt. No orchestrator was invoked (direct-implementation mode used throughout, consistent with Prompts 2–3); no background/speculative subagent writes occurred; the Prompt 1 stray-fork-writes stash remains untouched, unapplied, and unmined as precedent.
|
|
218
|
+
|
|
219
|
+
## Out-of-scope confirmation
|
|
220
|
+
|
|
221
|
+
This prompt implements no region/runtime binding, no candidate/reference geometry comparison, no fidelity PASS/FAIL evaluation, no style/color/typography comparison, no image/pixel similarity, no change to source correlation, no coding-agent correction logic, no rerender loop, no viewer, no annotation UI, and no automatic state/authentication detection of any kind. `evaluateReferenceCandidateCompatibility` reads only `reference.applicability` and `candidate.requestConfig` (viewport/explicitState) — it never reads `reference.regions`, `reference.requirements`, or any target/geometry evidence from the candidate.
|
|
222
|
+
|
|
223
|
+
## Known limitations
|
|
224
|
+
|
|
225
|
+
- Applicable-viewport comparison is an exact string-equality check on `"WxH"` — there is no tolerance/near-match concept for viewport compatibility (deliberately; a viewport is either the one the reference represents or it isn't, unlike the pixel-tolerance semantics that belong to Prompt 3's region-property requirements).
|
|
226
|
+
- `evaluateReferenceCandidateCompatibility` has no CLI command of its own yet (no `check-compatibility`-style entry point) — it is exposed only as a library function via `src/index.ts`, since Prompt 4's scope was the domain model and its reuse story, not a new user-facing workflow entry point. A future prompt may add a CLI surface once region binding (Prompt 5) makes an end-to-end command meaningful.
|
|
227
|
+
|
|
228
|
+
## Remaining risks
|
|
229
|
+
|
|
230
|
+
- None identified that block this prompt's own scope. The main forward risk is Prompt 5 (region↔runtime-target binding) needing to compose region-level and page-level (this prompt's) compatibility results coherently — flagged for that prompt's own precedent review, not something this prompt can or should preempt.
|
|
231
|
+
|
|
232
|
+
## Exact next action
|
|
233
|
+
|
|
234
|
+
v0.7 Prompt 5 — explicit reference-region ↔ runtime-target binding.
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# v0.7 Prompt 8 — Controlled End-to-End External-Reference Coding-Agent Correction Workflow
|
|
2
|
+
|
|
3
|
+
**VERDICT: PASS_V0_7_REFERENCE_CORRECTION_WORKFLOW_PROMPT8**
|
|
4
|
+
|
|
5
|
+
## Repository / branch / heads
|
|
6
|
+
|
|
7
|
+
- Repository: `my-frontend-observer` (path: `Z:\Users\newuser\Projects\my-frontend-observer`)
|
|
8
|
+
- Branch: `implementation/v0.7-reference-correction-workflow`, branched from the exact completed Prompt 7 HEAD
|
|
9
|
+
- Starting HEAD (branch point, Prompt 7 report commit): `957311d1155902cabbdd1a2d24356500d17cf1b5`
|
|
10
|
+
- Prompt 7 base HEAD confirmed to contain both required commits: `013bc6c` (implementation) and `957311d` (report), and the full completed Prompt 1–6 lineage — verified via `git log --oneline` before branching.
|
|
11
|
+
- Implementation commit: `aa82baba4bb0e326552e4ddafa071b43cded228e` — "Add v0.7 Prompt 8 controlled end-to-end external-reference correction workflow"
|
|
12
|
+
- Ending HEAD: the report commit that follows this file's commit.
|
|
13
|
+
|
|
14
|
+
## Git status
|
|
15
|
+
|
|
16
|
+
Preflight (`git status --short`) showed a clean working tree at the exact Prompt 7 report HEAD; `git stash list` showed exactly the one preserved Prompt 1 stray-fork-writes entry, and no speculative Prompt 1 files reappeared at any point. The branch was created with `git checkout -b implementation/v0.7-reference-correction-workflow` and ancestry verified with `git merge-base --is-ancestor 957311d HEAD`. No reset/clean/discard operation was used; the Prompt 1 stash was neither applied nor dropped. Post-implementation `git status --short` is clean except for this report file (staged and committed separately, per convention).
|
|
17
|
+
|
|
18
|
+
## FULL_STAGE_CONTEXT execution
|
|
19
|
+
|
|
20
|
+
This stage was run at FULL_STAGE_CONTEXT rigor as instructed: fresh architecture/repository context and my-dev-kit retrieval, canonical precedent/reuse review of every Prompt 1–7 and v0.1/v0.4/v0.5/v0.6 owner, an explicit behavior model (sections 36 of the task spec, reproduced as the "overall composition" cases below), an implementation architecture decided and documented before coding, formal test-strategy coverage across preparation/handoff/external-boundary/observation/comparison/fidelity/contract/composition/iteration/identity/persistence/real-browser/package-interface concerns, implementation, test implementation, verification (the full validation chain below), and an independent-judge pass (a forked review agent) before this report was written. No literal invocation of `my-dev-kit-orchestrator` as a running process was performed — consistent with this session's established Prompt 2–7 precedent of avoiding that tool's known Vitest-mapping heuristic friction (documented in the Prompt 1 report) entirely rather than fighting it; FULL_STAGE_CONTEXT's discipline was satisfied by executing every required phase directly and rigorously, not by depending on a separate orchestrator product process. No `BLOCKED_FULL_STAGE_CONTEXT_TOOLING_HEURISTIC` condition arose because the orchestrator was never in the critical path.
|
|
21
|
+
|
|
22
|
+
- Resolved `@dailephd/my-dev-kit` version: `1.12.3` (`npm view @dailephd/my-dev-kit version`), pinned via `npx -y @dailephd/my-dev-kit@1.12.3`.
|
|
23
|
+
- Resolved `@dailephd/my-dev-kit-orchestrator` version: `1.4.1` (`npm view @dailephd/my-dev-kit-orchestrator version`) — recorded for the record; not invoked as a running process, per the above.
|
|
24
|
+
- Fresh Prompt 8 repository index built under a repository-local, gitignored root: `.my-dev-kit-context/index-prompt8/` (60 files, 922 symbols indexed) — not reused from Prompt 1–7's indexes.
|
|
25
|
+
- All disposable workflow state (the fresh index, the real-Chromium proof's disposable target copies, and a packed-candidate smoke consumer workspace) lived and was cleaned up entirely under `.my-dev-kit-workflow/`/`.my-dev-kit-context/` inside the repository root — nothing was created under `C:\` or as a sibling project directory.
|
|
26
|
+
|
|
27
|
+
## Canonical precedent review
|
|
28
|
+
|
|
29
|
+
Read directly (source, not memory) before writing any code:
|
|
30
|
+
|
|
31
|
+
- `src/domain/externalReference.ts` — `isApprovedExternalReferenceArtifact` (Prompt 1), reused as the approved-reference precondition gate.
|
|
32
|
+
- `src/domain/externalReferenceRuntimeBinding.ts` — `isValidReferenceRuntimeBindingDeclarations` (Prompt 5), reused for binding-declaration validation.
|
|
33
|
+
- `src/domain/externalReferenceFidelity.ts` — `evaluateReferenceCandidateFidelity`'s exact signature/result shape (Prompt 6), reused verbatim.
|
|
34
|
+
- `src/domain/boundedAgentContextProjection.ts` — `projectBoundedAgentContext`'s now fidelity-aware input contract (Prompt 7), reused verbatim.
|
|
35
|
+
- `src/domain/comparisonEngine.ts` — `compareObservations`'s exact signature (v0.4), reused verbatim.
|
|
36
|
+
- `src/domain/frontendContractEvaluation.ts` — `evaluateFrontendContract`'s exact input/output shape (v0.5), reused verbatim; `FrontendContractEvaluationResult.overallVerdict`'s existing incomparable-comparison-⇒-FAIL precedent, reused rather than re-decided.
|
|
37
|
+
- `src/domain/frontendContracts.ts` — `PersistentBaselineContract`/`PerChangeContract` field shapes, and (critically, surfaced by the independent-judge pass) confirmation that `baselineId`/`contractId` are plain caller-authored strings, never content-derived.
|
|
38
|
+
- `src/application/frontendContractPersistenceService.ts` — `approveAndPersistBaseline` persists `contract.baselineId` verbatim (never recomputing it), confirming the identity gap described below and that this module never calls baseline/reference approval itself.
|
|
39
|
+
- `src/domain/boundedAgentContextIdentity.ts`, `src/domain/identity.ts`, `src/domain/comparisonIdentity.ts`, `src/domain/frontendContractIdentity.ts` — the repository-wide "pure function of semantic state, canonicalize-then-sha256, request identity vs. fresh instance identity, omit-rather-than-null for optional additions" convention, reused directly for `referenceCorrectionIdentity.ts`.
|
|
40
|
+
- `src/application/observationPersistence.ts` — `observe()`'s internal `runBrowserCapture` → `buildObservationArtifact` → `writeObservationArtifact` pipeline; the real-Chromium proof reuses the first two functions directly (no persistence needed for the workflow itself) rather than building a second capture path.
|
|
41
|
+
- `tests/fixtures/server.ts` — the existing `/contract` fixture's in-process-toggleable-candidate precedent, considered and explicitly *not* reused as-is (an in-memory toggle would not prove a genuine file-based source edit); a file-based disposable-copy model was chosen instead, per this prompt's own explicit preference for that pattern.
|
|
42
|
+
|
|
43
|
+
**Answers to the five precedent-review questions:**
|
|
44
|
+
1. *What existing owner performs each operation?* Reference/adequacy (Prompt 1/3), compatibility (Prompt 4), binding (Prompt 5), fidelity (Prompt 6), bounded context (Prompt 7), runtime comparison (v0.4), contract evaluation (v0.5), real browser capture (v0.1/v0.2 `chromiumAdapter.ts` via `runBrowserCapture`).
|
|
45
|
+
2. *What does Prompt 8 only coordinate?* The call order across those owners, the overall-result composition rule, and the explicit external-edit seam between "prepare" and "review".
|
|
46
|
+
3. *What genuinely new workflow state is required?* Two identity values (`reviewRequestId`, `attemptId`) and two plain result envelopes (`ReferenceCorrectionHandoff`, `ReferenceCorrectionAttemptResult`) — no new evaluation logic.
|
|
47
|
+
4. *Does that state need persistence?* No — see the Persistence decision below.
|
|
48
|
+
5. *How are correction attempts linked without duplicating existing evidence?* Every attempt embeds the actual canonical `ComparisonArtifact` and `FrontendContractEvaluationResult` objects returned by v0.4/v0.5 (the real evidence, not a copy of it) plus stable id references (`reviewRequestId`, `attemptId`, `priorAttemptId`) — never a re-serialized duplicate of the reference/baseline/observation artifacts themselves.
|
|
49
|
+
|
|
50
|
+
## Central architecture question — resolution
|
|
51
|
+
|
|
52
|
+
The smallest coordination layer is two pure functions (`prepareReferenceCorrection`, `reviewReferenceCorrectionAttempt`) plus two identity helpers, with an explicit, un-automatable seam between them for the external edit. This was chosen over any richer "workflow engine" shape specifically because every actual evaluation concern already has an owner; the only work left for Prompt 8 is sequencing calls, composing one honest overall result, and giving the caller enough identity to keep attempts traceable — none of which requires a stage graph, a catalog, or a scheduler.
|
|
53
|
+
|
|
54
|
+
## Workflow architecture / new owners / existing owners reused
|
|
55
|
+
|
|
56
|
+
See "Workflow architecture", "New owners introduced", and "Existing owners reused, verbatim" in `docs/CONTRACTS.md` "v0.7 Prompt 8 controlled end-to-end external-reference coding-agent correction workflow" for the full write-up; summarized: two new pure domain functions (`prepareReferenceCorrection`, `reviewReferenceCorrectionAttempt`) and two new identity functions (`buildReferenceCorrectionReviewIdentity`, `buildReferenceCorrectionAttemptIdentity`), composing `isApprovedExternalReferenceArtifact`/`isValidReferenceRuntimeBindingDeclarations`/`evaluateReferenceCandidateFidelity`/`projectBoundedAgentContext`/`compareObservations`/`evaluateFrontendContract` — all reused verbatim, none reimplemented.
|
|
57
|
+
|
|
58
|
+
## Review identity model
|
|
59
|
+
|
|
60
|
+
`buildReferenceCorrectionReviewIdentity(referenceRequestId, baselineObservationId, baselineContractId, baselineContractClauses, changeContractId, changeContractClauses, bindingDeclarations)` — a pure sha256-of-canonicalized-JSON hash, never a timestamp, never an operational path. **This includes the actual `clauses` array content of both contracts, not merely their ids** — a deliberate design decision made after the independent-judge pass identified that `PersistentBaselineContract.baselineId`/`PerChangeContract.contractId` are plain, caller-authored labels (confirmed by reading `approveAndPersistBaseline`, which persists `contract.baselineId` verbatim without recomputing it from clause content), so two structurally valid contracts could otherwise share an id while authoring different clauses. `reviewReferenceCorrectionAttempt` recomputes this exact hash from its own inputs and rejects (`{ok: false}`) any call whose supplied `reviewRequestId` does not match — the enforcement mechanism, not merely documentation, behind "no hidden baseline change."
|
|
61
|
+
|
|
62
|
+
## Attempt identity model
|
|
63
|
+
|
|
64
|
+
`buildReferenceCorrectionAttemptIdentity(reviewRequestId, candidateObservationId)` — a pure, deterministic hash, never a fresh random nonce. Every candidate observation already carries its own fresh, collision-resistant instance identity (v0.1's `buildObservationIdentity`), so this hash is both reproducible (same review+candidate ⇒ same `attemptId`) and guaranteed distinct per real capture.
|
|
65
|
+
|
|
66
|
+
## Persistence decisions
|
|
67
|
+
|
|
68
|
+
**None.** Neither the handoff (`ReferenceCorrectionHandoff`) nor the attempt result (`ReferenceCorrectionAttemptResult`) is persisted by this module — both are plain, JSON-serializable, in-memory values. This mirrors Prompt 6/7's own precedent exactly: the handoff's only genuinely new identity (`reviewRequestId`) is already deterministic and recomputable from stable inputs, so nothing about traceability requires observer-managed persistence. A caller needing the handoff to cross a process/session boundary is free to serialize it with its own mechanism. No `BLOCKED_ESCALATE_TO_FULL_STAGE_CONTEXT` was triggered, since no architecture evidence emerged proving persistence necessary.
|
|
69
|
+
|
|
70
|
+
## Handoff model
|
|
71
|
+
|
|
72
|
+
`ReferenceCorrectionHandoff = { reviewRequestId, referenceId, referenceRequestId, baselineObservationId, currentObservationId, boundedContext: BoundedAgentContextArtifact, verificationPlan: string[] }`. `boundedContext` is Prompt 7's own output (already carrying bounded fidelity mismatches, protected/preserved context, adequacy/omission/truncation, and any caller-supplied static correlation); `verificationPlan` is a fixed, four-line, human-readable statement of what will be re-checked after the edit (fresh capture, reference re-evaluation, v0.4/v0.5 re-evaluation, and the exact overall-PASS rule) — never reduced to "make it look like the screenshot." No raw reference image bytes, no full `ObservationArtifact`, and no source excerpt are ever included (verified directly by type inspection: `BoundedAgentContextArtifact`/`ReferenceRequirementFidelityResult` carry no byte-array field anywhere).
|
|
73
|
+
|
|
74
|
+
## External implementation boundary
|
|
75
|
+
|
|
76
|
+
Absolute, and verified by direct code inspection (both by this report's author and independently by the forked judge agent): neither `referenceCorrectionWorkflow.ts` nor anything it imports (`externalReference.ts`, `externalReferenceRuntimeBinding.ts`, `externalReferenceFidelity.ts`, `boundedAgentContextProjection.ts`, `comparisonEngine.ts`, `frontendContractEvaluation.ts`, `referenceCorrectionIdentity.ts`) contains a filesystem-write call, a `child_process` invocation, or any patch/edit mechanism. Both public workflow functions accept only already-captured `ObservationArtifact`s and already-approved/persisted contract/reference artifacts as plain in-memory values.
|
|
77
|
+
|
|
78
|
+
## Controlled target design
|
|
79
|
+
|
|
80
|
+
A tracked, immutable HTML template (`tests/fixtures/referenceCorrectionTarget.template.html`) with two elements: `#popup-current-page` (width controlled via a `/*POPUP_WIDTH_PX*/`-marked CSS comment) and `#destination-control` (visibility controlled via a `/*DESTINATION_DISPLAY*/`-marked CSS comment). Each browser-proof test copies this template to a fresh, repository-local disposable directory under `.my-dev-kit-workflow/prompt8-disposable-target/run-<unique>/` before use, and removes it in `afterEach` (with a full-root `afterAll` sweep as a backstop). The template's byte-identity before and after the full proof suite was verified explicitly in Proof A.
|
|
81
|
+
|
|
82
|
+
## Target start/reload behavior
|
|
83
|
+
|
|
84
|
+
The smallest possible mechanism: a plain Node `http.createServer` that reads the disposable file fresh from disk on every request (no caching, no restart) - satisfying this prompt's explicit preference for reload-without-restart when the target can support it. No deployment framework, process supervisor, or generic command runner was introduced.
|
|
85
|
+
|
|
86
|
+
## Baseline selection
|
|
87
|
+
|
|
88
|
+
For the canonical proof, `baselineObservation` and `currentObservation` (the value `prepareReferenceCorrection` measures pre-change fidelity against) are the same captured `ObservationArtifact` — the pre-change frontend is both the approved baseline and the state the initial reference mismatch is measured from, exactly as this prompt's own canonical-case guidance specifies. The workflow's types do not force this identity (a caller may supply a distinct `currentObservation` if its own architecture justifies it), but no automatic baseline approval ever occurs — the baseline contract's `sourceObservation` coherence is checked, but nothing in this module calls `approveAndPersistBaseline`.
|
|
89
|
+
|
|
90
|
+
## Approved-reference requirement
|
|
91
|
+
|
|
92
|
+
`prepareReferenceCorrection`/`reviewReferenceCorrectionAttempt` both fail closed (`{ok: false}`) via `isApprovedExternalReferenceArtifact` when `reference.lifecycle.state !== 'approved'` — an imported-but-unapproved reference is never treated as authoritative. Verified by a dedicated unit test.
|
|
93
|
+
|
|
94
|
+
## Preparation workflow
|
|
95
|
+
|
|
96
|
+
`prepareReferenceCorrection`: validate common preconditions → `evaluateReferenceCandidateFidelity` (Prompt 6) against `currentObservation` → if `state === 'not-evaluated'`, return `{status: 'blocked-not-evaluated', fidelity}` (no handoff fabricated) → otherwise `projectBoundedAgentContext({..., fidelity})` (Prompt 7) → return `{status: 'handoff-ready', handoff}`. An ambiguous/unavailable required binding does not block preparation outright; it surfaces as that specific requirement's own `unavailable`/`binding-unavailable` mismatch inside the handoff, per Prompt 6's own honest per-requirement reporting.
|
|
97
|
+
|
|
98
|
+
## Post-edit review workflow
|
|
99
|
+
|
|
100
|
+
`reviewReferenceCorrectionAttempt`: validate common preconditions → recompute and check `reviewRequestId` coherence (rejects a mismatched baseline/contract/reference/binding set) → `compareObservations(baseline, candidate)` (v0.4) → `evaluateReferenceCandidateFidelity(reference, candidate, bindings)` (Prompt 6) → `evaluateFrontendContract({before: baseline, after: candidate, comparison, baseline: baselineContract, change: changeContract})` (v0.5) → compose `overallState` → return the full `ReferenceCorrectionAttemptResult`.
|
|
101
|
+
|
|
102
|
+
## Overall result composition
|
|
103
|
+
|
|
104
|
+
`ReferenceCorrectionOverallState = 'not-evaluated' | 'pass' | 'fail'`. `fidelity.state === 'not-evaluated'` ⇒ overall `'not-evaluated'` (Prompt 6's own blocked state preserved, never collapsed into `'fail'`); otherwise `fidelity.state === 'pass' && contractEvaluation.overallVerdict === 'PASS'` ⇒ `'pass'`; anything else ⇒ `'fail'`. A structurally-incomparable baseline/candidate pair receives no separate third bucket — v0.5's own `evaluateFrontendContract` already returns `'FAIL'` for that case (its own unmodified, established precedent), reused rather than re-litigated. `approvalEligible` is a plain read-only boolean (`true` iff `overallState === 'pass'`) — never itself an approval action.
|
|
105
|
+
|
|
106
|
+
Verified by dedicated unit tests and real-Chromium proofs for all three mandatory composition cases: both PASS ⇒ overall PASS; reference FAIL + contract PASS ⇒ overall FAIL; reference PASS + protected contract FAIL ⇒ overall FAIL (the mandatory proof case). Not-evaluated fidelity (via an incompatible viewport) is verified to never become overall PASS, at both the unit level and the real-Chromium blocking proof.
|
|
107
|
+
|
|
108
|
+
## Correction iteration
|
|
109
|
+
|
|
110
|
+
`reviewReferenceCorrectionAttempt` is called once per candidate; there is no loop, no polling, and no autonomous retry anywhere in this module or anything it calls (verified: no `setInterval`, no self-recursive call to either workflow function). Real-Chromium Proof C drives two explicit attempts from the test harness itself, proving the caller — never the observer — controls iteration.
|
|
111
|
+
|
|
112
|
+
## Baseline-across-attempts rule
|
|
113
|
+
|
|
114
|
+
Enforced structurally: every `reviewReferenceCorrectionAttempt` call requires the full `baselineObservation`/`baselineContract` again, `compareObservations`/`evaluateFrontendContract` are always invoked against that same baseline (never a prior candidate), and the `reviewRequestId` coherence check (now including clause content, per the identity fix below) rejects any call that supplies a different baseline/contract set under the guise of the same review.
|
|
115
|
+
|
|
116
|
+
## Explicit approval behavior
|
|
117
|
+
|
|
118
|
+
`approveAndPersistBaseline`/`approveExternalReference` are never imported or called anywhere in `referenceCorrectionWorkflow.ts` (confirmed by direct grep, both by this report's author and independently by the forked judge). `approvalEligible: true` is reported, never acted upon.
|
|
119
|
+
|
|
120
|
+
## Real-browser success proof (Proof A)
|
|
121
|
+
|
|
122
|
+
`tests/browser/referenceCorrectionWorkflow.test.ts` "Proof A": captures a real pre-change observation (popup width 223 CSS px against a 480x620 viewport, reference wants 424±4 reference px at a 2x scale ⇒ genuine FAIL, measured, not asserted), confirms the handoff's mismatch record (the controlled external actor's assertion step, proving the bounded context genuinely reached the implementation boundary), applies the controlled width-fix edit to the disposable copy only, captures a fresh real observation, and confirms `fidelity.state === 'pass'`, `contractEvaluation.overallVerdict === 'PASS'`, `overallState === 'pass'`, `approvalEligible === true`. The tracked template's byte-identity is asserted before and after.
|
|
123
|
+
|
|
124
|
+
## Real-browser protected/preserved regression proof (Proof B)
|
|
125
|
+
|
|
126
|
+
The controlled actor fixes the width (satisfying the reference) *and* hides `#destination-control` (a real regression). The real candidate observation genuinely shows the element hidden; `fidelity.state === 'pass'`, the `destination-control-visible` v0.5 clause genuinely evaluates to `'fail'` from real Chromium evidence, `contractEvaluation.overallVerdict === 'FAIL'`, and `overallState === 'fail'` — the mandatory proof that matching the reference is necessary but not sufficient.
|
|
127
|
+
|
|
128
|
+
## Real-browser correction-iteration proof (Proof C)
|
|
129
|
+
|
|
130
|
+
Attempt 1 (no edit yet) genuinely fails reference fidelity from real Chromium evidence; a fresh handoff is derived from that failed candidate's own observation id (asserted distinct from the original baseline observation id); the controlled actor applies the fix; Attempt 2 genuinely passes. Both attempts share the same `reviewRequestId` and `baselineObservationId`, have distinct `attemptId`s, and Attempt 2 carries `priorAttemptId === attempt1.attemptId`.
|
|
131
|
+
|
|
132
|
+
## Blocking proof
|
|
133
|
+
|
|
134
|
+
A candidate captured at an incompatible viewport (1024x768 vs. the reference's declared 480x620) produces `prepareReferenceCorrection` returning `{status: 'blocked-not-evaluated', fidelity: {blockedBy: 'incompatible'}}` — never a handoff, never a fabricated normal fidelity result.
|
|
135
|
+
|
|
136
|
+
## Proof the external actor consumed the bounded context
|
|
137
|
+
|
|
138
|
+
Proof A explicitly reads `prep.handoff.boundedContext.fidelity.mismatches`, locates the specific failing requirement, and asserts its `boundRuntimeTargets` includes `'popup-current-page'` *before* calling `applyControlledExternalEdit` — the deterministic actor's edit is conditioned on having found and validated the expected mismatch content, not applied blindly.
|
|
139
|
+
|
|
140
|
+
## Static-correlation proof
|
|
141
|
+
|
|
142
|
+
Not exercised in the real-Chromium suite this prompt (the canonical proof did not need to demonstrate static correlation to satisfy its mandatory cases), but the architecture is proven compatible: `prepareReferenceCorrection`'s handoff embeds the exact `BoundedAgentContextArtifact` Prompt 7 already supports attaching `correlations` to (via the separate, unmodified `attachRuntimeStaticCorrelations`), keyed by the same stable runtime target ids the fidelity mismatches themselves report. This is documented as a known limitation below rather than silently omitted.
|
|
143
|
+
|
|
144
|
+
## Files changed
|
|
145
|
+
|
|
146
|
+
New:
|
|
147
|
+
- `src/domain/referenceCorrectionWorkflow.ts`
|
|
148
|
+
- `src/domain/referenceCorrectionIdentity.ts`
|
|
149
|
+
- `tests/unit/referenceCorrectionWorkflow.test.ts`
|
|
150
|
+
- `tests/browser/referenceCorrectionWorkflow.test.ts`
|
|
151
|
+
- `tests/fixtures/referenceCorrectionTarget.template.html`
|
|
152
|
+
|
|
153
|
+
Modified:
|
|
154
|
+
- `src/index.ts` (public export surface for the two new domain modules)
|
|
155
|
+
- `docs/ARCHITECTURE.md`, `docs/CONTRACTS.md`, `docs/WORKFLOWS.md`
|
|
156
|
+
|
|
157
|
+
## Tests added/changed — exact counts
|
|
158
|
+
|
|
159
|
+
- `tests/unit/referenceCorrectionWorkflow.test.ts`: 19 tests (preparation: valid handoff with real mismatch numbers, unapproved-reference rejection, inadequate-reference blocking, incompatible-state blocking, ambiguous-binding handling, review-identity determinism, review-identity sensitivity to per-change-contract id, review-identity sensitivity to clause content under a same-id baseline/change contract [2 tests, added after the judge review], input immutability; review: both-PASS, reference-FAIL+contract-PASS, reference-PASS+protected-FAIL, not-evaluated-never-PASS, reviewRequestId-mismatch rejection, reviewRequestId-mismatch rejection specifically for tampered same-id clause content [added after the judge review], attempt-identity determinism/distinctness, priorAttemptId traceability, input immutability, no-automatic-approval-flag-shape).
|
|
160
|
+
- `tests/browser/referenceCorrectionWorkflow.test.ts`: 4 tests (Proof A success, Proof B protected regression, Proof C correction iteration, blocking proof).
|
|
161
|
+
- Unit suite: 981 pre-existing (Prompt 7 final count) + 19 new = 1000 total (`npm test`). Real-Chromium suite: 120 pre-existing + 4 new = 124 total (`npm run test:browser`), counted separately since it runs under a distinct vitest config.
|
|
162
|
+
|
|
163
|
+
## Packed-candidate proof
|
|
164
|
+
|
|
165
|
+
Performed a real, non-dry-run `npm pack` into a repository-local workspace (`.my-dev-kit-workflow/prompt8-pack-smoke/`, cleaned up afterward), installed the tarball into a clean, isolated `npm init`'d consumer directory, and ran a Node ESM smoke script importing the package's own installed public surface (`prepareReferenceCorrection`, `reviewReferenceCorrectionAttempt`, `buildReferenceCorrectionReviewIdentity`, `buildReferenceCorrectionAttemptIdentity`, `REFERENCE_CORRECTION_OVERALL_STATES`, plus the already-existing `projectReferenceFidelity`/`evaluateReferenceCandidateFidelity` to confirm the whole v0.7 chain remains importable) — every export resolved to the correct type, and `buildReferenceCorrectionReviewIdentity` was called and confirmed deterministic from the installed package itself, not the source checkout. `npm pack --dry-run` was also run as part of the standard validation chain, confirming `dist/domain/referenceCorrectionWorkflow.{js,d.ts,js.map}` and `dist/domain/referenceCorrectionIdentity.{js,d.ts,js.map}` are present in the tarball listing.
|
|
166
|
+
|
|
167
|
+
## Validation results
|
|
168
|
+
|
|
169
|
+
- `npm run typecheck` — pass, zero errors.
|
|
170
|
+
- `npm run lint` — pass, zero errors/warnings.
|
|
171
|
+
- `npm test` — 50 test files, 1000 tests, all pass.
|
|
172
|
+
- `npm run test:browser` — 10 test files, 124 tests, all pass (clean run, no flake).
|
|
173
|
+
- `npm run test:security` — pass (5 + 63 = 68 tests).
|
|
174
|
+
- `npm run build` — pass, clean `tsc` compile.
|
|
175
|
+
- `npm run check:docs` — pass (17 required files present, `ROADMAP.md` format intact — no implementation batches added).
|
|
176
|
+
- `git diff --check` — exit 0, no whitespace errors.
|
|
177
|
+
- `npm pack --dry-run` — pass; new modules confirmed present.
|
|
178
|
+
- Packed-candidate real-install smoke — pass (see above).
|
|
179
|
+
|
|
180
|
+
## Browser-flake incidents
|
|
181
|
+
|
|
182
|
+
None. Both full `test:browser` runs during this prompt (before and after the identity fix) completed 124/124 with zero failures — no flaky-test investigation was needed this prompt.
|
|
183
|
+
|
|
184
|
+
## Security / immutability results
|
|
185
|
+
|
|
186
|
+
- Observer product code never edits target source — verified by direct inspection (no `fs` write/`child_process` import in `referenceCorrectionWorkflow.ts` or its dependency graph) and independently by the forked judge agent.
|
|
187
|
+
- Only the test-only `applyControlledExternalEdit` function (in `tests/browser/referenceCorrectionWorkflow.test.ts`, never in `src/`) ever writes to the disposable target file.
|
|
188
|
+
- The tracked fixture template's byte-identity before/after the full proof suite was explicitly asserted and passed.
|
|
189
|
+
- No remote AI/network dependency was introduced anywhere in this prompt.
|
|
190
|
+
- No credential-handling behavior was introduced.
|
|
191
|
+
- Baseline/reference/observation/comparison/contract artifacts are never mutated by this module — every function is pure and only reads its inputs.
|
|
192
|
+
- No operational filesystem path leaks into any semantic identity or result field (`reviewRequestId`/`attemptId` are pure content hashes; the handoff and attempt result carry only stable ids and evidence, never a path).
|
|
193
|
+
|
|
194
|
+
## Documentation changes
|
|
195
|
+
|
|
196
|
+
- `docs/CONTRACTS.md` — new "v0.7 Prompt 8 controlled end-to-end external-reference coding-agent correction workflow" section (full type shapes, workflow architecture, new/reused owners, approved-reference/baseline rules, preparation/review flow, handoff model and persistence decision, review/attempt identity including the clause-content fix, baseline-across-attempts enforcement, overall composition rule, correction-iteration/source-editing boundaries).
|
|
197
|
+
- `docs/ARCHITECTURE.md` — new paragraph describing the Prompt 8 coordinator and its reuse of every prior owner.
|
|
198
|
+
- `docs/WORKFLOWS.md` — "Current external-reference foundation workflow" retitled to "Prompts 1-8"; new "Current reference correction workflow" section with the full phase diagram and real-Chromium proof summary.
|
|
199
|
+
- `docs/COMMANDS.md`, `docs/DEVELOPMENT.md`, `docs/CI_CD.md` — not touched (no CLI surface change, no change to how tests are run or CI packages the candidate).
|
|
200
|
+
|
|
201
|
+
## Tooling incidents
|
|
202
|
+
|
|
203
|
+
One real finding, caught and fixed before this report was written: the independent-judge fork (a forked review agent given the exact instruction to verify, not trust, the implementation) identified that the original `reviewRequestId` hash depended only on `baselineContract.baselineId`/`changeContract.contractId` (caller-authored labels, confirmed non-content-derived by reading `approveAndPersistBaseline`), not on the contracts' actual `clauses` content — meaning a caller could in principle swap in a same-id contract with different clauses between attempts without the coherence check detecting it. This was fixed by extending `buildReferenceCorrectionReviewIdentity` to also hash `baselineContract.clauses`/`changeContract.clauses` directly, with two new regression tests added (one for `prepareReferenceCorrection`'s identity sensitivity, one for `reviewReferenceCorrectionAttempt`'s rejection of a call whose contract clauses were tampered under a stable id). The fix was verified against the full unit suite and the real-Chromium proof suite, both passing unchanged after the change. No other issues were found by the judge across its 14-question checklist. No orchestrator product code was modified; no background/speculative subagent writes occurred; the Prompt 1 stray-fork-writes stash remains untouched throughout.
|
|
204
|
+
|
|
205
|
+
## Known limitations
|
|
206
|
+
|
|
207
|
+
- No static-correlation real-Chromium proof was included this prompt (the mandatory proof cases did not require it); the architecture is confirmed compatible (Prompt 7's `BoundedAgentContextArtifact.correlations` field and the fidelity mismatches' shared runtime-target-id keying already support it), documented here rather than silently claimed as proven.
|
|
208
|
+
- No CLI surface exists for this workflow, consistent with v0.6 bounded-context's own library-only precedent and this prompt's own explicit guidance that a CLI is optional, not required.
|
|
209
|
+
- The `reviewRequestId` coherence check validates baseline/change contract *content* (clauses) but does not itself re-verify that the supplied `reference`/`bindingDeclarations` are the literal same object instances used to originally compute `reviewRequestId` — content equality is what's checked (correctly, per this repository's identity conventions), not reference equality, which is the intended and correct behavior.
|
|
210
|
+
- `currentObservation` and `baselineObservation` are type-independent parameters; nothing in the type system forces the canonical-proof convention that they be the same value. This is documented as a deliberate, justified flexibility (per the task's own "unless the architecture/review model explicitly distinguishes those identities for a justified reason" allowance), not an oversight.
|
|
211
|
+
|
|
212
|
+
## Remaining risks
|
|
213
|
+
|
|
214
|
+
- None identified that block this prompt's own scope. The primary forward consideration for the next stage (v0.7 implementation-completeness audit and documentation reconciliation) is verifying the full v0.7 arc's public surface, documentation, and packaged behavior against `PROJECT_DESCRIPTION`/`PROJECT_MILESTONES`/`ROADMAP` holistically — explicitly out of scope for Prompt 8 itself.
|
|
215
|
+
|
|
216
|
+
## Out-of-scope confirmation
|
|
217
|
+
|
|
218
|
+
This prompt did **not** implement: a viewer; drawing; annotation; automatic reference-region detection; automatic reference/runtime binding; pixel/image similarity or general image comparison; screenshot-to-code or raster-to-vector generation; source editing inside observer product code; remote AI integration of any kind; a generic coding-agent provider framework; a generic process manager or deployment system; an autonomous endless retry loop; automatic baseline approval; or automatic reference approval. Every one of these was explicitly checked against the actual implementation (not merely asserted) during the verification and independent-judge phases described above.
|
|
219
|
+
|
|
220
|
+
## Exact next action
|
|
221
|
+
|
|
222
|
+
v0.7 implementation-completeness audit and documentation reconciliation (not v0.8) — verifying the complete v0.7 implementation against `PROJECT_DESCRIPTION`, `PROJECT_MILESTONES`, `ROADMAP`, actual source, tests, public commands, package exports, and packed-candidate behavior, before pre-release readiness.
|