@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.
Files changed (316) hide show
  1. package/CHANGELOG.md +397 -0
  2. package/LICENSE +21 -0
  3. package/README.md +255 -0
  4. package/dist/application/browserCaptureService.d.ts +11 -0
  5. package/dist/application/browserCaptureService.js +12 -0
  6. package/dist/application/browserCaptureService.js.map +1 -0
  7. package/dist/application/comparisonService.d.ts +56 -0
  8. package/dist/application/comparisonService.js +77 -0
  9. package/dist/application/comparisonService.js.map +1 -0
  10. package/dist/application/externalReferencePersistenceService.d.ts +75 -0
  11. package/dist/application/externalReferencePersistenceService.js +182 -0
  12. package/dist/application/externalReferencePersistenceService.js.map +1 -0
  13. package/dist/application/frontendContractEvaluationService.d.ts +49 -0
  14. package/dist/application/frontendContractEvaluationService.js +112 -0
  15. package/dist/application/frontendContractEvaluationService.js.map +1 -0
  16. package/dist/application/frontendContractPersistenceService.d.ts +56 -0
  17. package/dist/application/frontendContractPersistenceService.js +91 -0
  18. package/dist/application/frontendContractPersistenceService.js.map +1 -0
  19. package/dist/application/observationPersistence.d.ts +59 -0
  20. package/dist/application/observationPersistence.js +79 -0
  21. package/dist/application/observationPersistence.js.map +1 -0
  22. package/dist/application/projectCheckService.d.ts +3 -0
  23. package/dist/application/projectCheckService.js +169 -0
  24. package/dist/application/projectCheckService.js.map +1 -0
  25. package/dist/application/projectWorkflowService.d.ts +46 -0
  26. package/dist/application/projectWorkflowService.js +92 -0
  27. package/dist/application/projectWorkflowService.js.map +1 -0
  28. package/dist/application/referenceFidelityEvaluationService.d.ts +28 -0
  29. package/dist/application/referenceFidelityEvaluationService.js +45 -0
  30. package/dist/application/referenceFidelityEvaluationService.js.map +1 -0
  31. package/dist/artifacts/artifactReader.d.ts +19 -0
  32. package/dist/artifacts/artifactReader.js +36 -0
  33. package/dist/artifacts/artifactReader.js.map +1 -0
  34. package/dist/artifacts/artifactWriter.d.ts +25 -0
  35. package/dist/artifacts/artifactWriter.js +68 -0
  36. package/dist/artifacts/artifactWriter.js.map +1 -0
  37. package/dist/artifacts/comparisonArtifactReader.d.ts +18 -0
  38. package/dist/artifacts/comparisonArtifactReader.js +35 -0
  39. package/dist/artifacts/comparisonArtifactReader.js.map +1 -0
  40. package/dist/artifacts/comparisonArtifactWriter.d.ts +41 -0
  41. package/dist/artifacts/comparisonArtifactWriter.js +67 -0
  42. package/dist/artifacts/comparisonArtifactWriter.js.map +1 -0
  43. package/dist/artifacts/externalReferenceArtifactReader.d.ts +18 -0
  44. package/dist/artifacts/externalReferenceArtifactReader.js +35 -0
  45. package/dist/artifacts/externalReferenceArtifactReader.js.map +1 -0
  46. package/dist/artifacts/externalReferenceArtifactWriter.d.ts +44 -0
  47. package/dist/artifacts/externalReferenceArtifactWriter.js +77 -0
  48. package/dist/artifacts/externalReferenceArtifactWriter.js.map +1 -0
  49. package/dist/artifacts/frontendContractArtifactReader.d.ts +24 -0
  50. package/dist/artifacts/frontendContractArtifactReader.js +47 -0
  51. package/dist/artifacts/frontendContractArtifactReader.js.map +1 -0
  52. package/dist/artifacts/frontendContractArtifactWriter.d.ts +34 -0
  53. package/dist/artifacts/frontendContractArtifactWriter.js +70 -0
  54. package/dist/artifacts/frontendContractArtifactWriter.js.map +1 -0
  55. package/dist/artifacts/frontendContractEvaluationArtifactReader.d.ts +17 -0
  56. package/dist/artifacts/frontendContractEvaluationArtifactReader.js +34 -0
  57. package/dist/artifacts/frontendContractEvaluationArtifactReader.js.map +1 -0
  58. package/dist/artifacts/frontendContractEvaluationArtifactWriter.d.ts +32 -0
  59. package/dist/artifacts/frontendContractEvaluationArtifactWriter.js +58 -0
  60. package/dist/artifacts/frontendContractEvaluationArtifactWriter.js.map +1 -0
  61. package/dist/artifacts/types.d.ts +17 -0
  62. package/dist/artifacts/types.js +2 -0
  63. package/dist/artifacts/types.js.map +1 -0
  64. package/dist/browser/chromiumAdapter.d.ts +21 -0
  65. package/dist/browser/chromiumAdapter.js +204 -0
  66. package/dist/browser/chromiumAdapter.js.map +1 -0
  67. package/dist/browser/evidenceCapture.d.ts +62 -0
  68. package/dist/browser/evidenceCapture.js +500 -0
  69. package/dist/browser/evidenceCapture.js.map +1 -0
  70. package/dist/browser/scrollCapture.d.ts +32 -0
  71. package/dist/browser/scrollCapture.js +163 -0
  72. package/dist/browser/scrollCapture.js.map +1 -0
  73. package/dist/browser/types.d.ts +24 -0
  74. package/dist/browser/types.js +2 -0
  75. package/dist/browser/types.js.map +1 -0
  76. package/dist/cli.d.ts +8 -0
  77. package/dist/cli.js +2411 -0
  78. package/dist/cli.js.map +1 -0
  79. package/dist/domain/boundedAgentContext.d.ts +226 -0
  80. package/dist/domain/boundedAgentContext.js +355 -0
  81. package/dist/domain/boundedAgentContext.js.map +1 -0
  82. package/dist/domain/boundedAgentContextCorrelation.d.ts +74 -0
  83. package/dist/domain/boundedAgentContextCorrelation.js +441 -0
  84. package/dist/domain/boundedAgentContextCorrelation.js.map +1 -0
  85. package/dist/domain/boundedAgentContextIdentity.d.ts +26 -0
  86. package/dist/domain/boundedAgentContextIdentity.js +69 -0
  87. package/dist/domain/boundedAgentContextIdentity.js.map +1 -0
  88. package/dist/domain/boundedAgentContextProjection.d.ts +71 -0
  89. package/dist/domain/boundedAgentContextProjection.js +477 -0
  90. package/dist/domain/boundedAgentContextProjection.js.map +1 -0
  91. package/dist/domain/comparison.d.ts +220 -0
  92. package/dist/domain/comparison.js +350 -0
  93. package/dist/domain/comparison.js.map +1 -0
  94. package/dist/domain/comparisonEngine.d.ts +76 -0
  95. package/dist/domain/comparisonEngine.js +734 -0
  96. package/dist/domain/comparisonEngine.js.map +1 -0
  97. package/dist/domain/comparisonIdentity.d.ts +13 -0
  98. package/dist/domain/comparisonIdentity.js +46 -0
  99. package/dist/domain/comparisonIdentity.js.map +1 -0
  100. package/dist/domain/completion.d.ts +30 -0
  101. package/dist/domain/completion.js +22 -0
  102. package/dist/domain/completion.js.map +1 -0
  103. package/dist/domain/diagnostics.d.ts +17 -0
  104. package/dist/domain/diagnostics.js +77 -0
  105. package/dist/domain/diagnostics.js.map +1 -0
  106. package/dist/domain/evidence.d.ts +29 -0
  107. package/dist/domain/evidence.js +59 -0
  108. package/dist/domain/evidence.js.map +1 -0
  109. package/dist/domain/explicitState.d.ts +40 -0
  110. package/dist/domain/explicitState.js +54 -0
  111. package/dist/domain/explicitState.js.map +1 -0
  112. package/dist/domain/externalReference.d.ts +158 -0
  113. package/dist/domain/externalReference.js +167 -0
  114. package/dist/domain/externalReference.js.map +1 -0
  115. package/dist/domain/externalReferenceApplicability.d.ts +43 -0
  116. package/dist/domain/externalReferenceApplicability.js +52 -0
  117. package/dist/domain/externalReferenceApplicability.js.map +1 -0
  118. package/dist/domain/externalReferenceCompatibility.d.ts +40 -0
  119. package/dist/domain/externalReferenceCompatibility.js +48 -0
  120. package/dist/domain/externalReferenceCompatibility.js.map +1 -0
  121. package/dist/domain/externalReferenceFidelity.d.ts +171 -0
  122. package/dist/domain/externalReferenceFidelity.js +419 -0
  123. package/dist/domain/externalReferenceFidelity.js.map +1 -0
  124. package/dist/domain/externalReferenceIdentity.d.ts +38 -0
  125. package/dist/domain/externalReferenceIdentity.js +70 -0
  126. package/dist/domain/externalReferenceIdentity.js.map +1 -0
  127. package/dist/domain/externalReferenceImage.d.ts +35 -0
  128. package/dist/domain/externalReferenceImage.js +160 -0
  129. package/dist/domain/externalReferenceImage.js.map +1 -0
  130. package/dist/domain/externalReferenceRegionRelationships.d.ts +63 -0
  131. package/dist/domain/externalReferenceRegionRelationships.js +98 -0
  132. package/dist/domain/externalReferenceRegionRelationships.js.map +1 -0
  133. package/dist/domain/externalReferenceRegions.d.ts +65 -0
  134. package/dist/domain/externalReferenceRegions.js +105 -0
  135. package/dist/domain/externalReferenceRegions.js.map +1 -0
  136. package/dist/domain/externalReferenceRequirementIdentity.d.ts +12 -0
  137. package/dist/domain/externalReferenceRequirementIdentity.js +35 -0
  138. package/dist/domain/externalReferenceRequirementIdentity.js.map +1 -0
  139. package/dist/domain/externalReferenceRequirements.d.ts +215 -0
  140. package/dist/domain/externalReferenceRequirements.js +401 -0
  141. package/dist/domain/externalReferenceRequirements.js.map +1 -0
  142. package/dist/domain/externalReferenceRuntimeBinding.d.ts +146 -0
  143. package/dist/domain/externalReferenceRuntimeBinding.js +183 -0
  144. package/dist/domain/externalReferenceRuntimeBinding.js.map +1 -0
  145. package/dist/domain/frontendContractEvaluation.d.ts +57 -0
  146. package/dist/domain/frontendContractEvaluation.js +454 -0
  147. package/dist/domain/frontendContractEvaluation.js.map +1 -0
  148. package/dist/domain/frontendContractEvaluationArtifact.d.ts +65 -0
  149. package/dist/domain/frontendContractEvaluationArtifact.js +108 -0
  150. package/dist/domain/frontendContractEvaluationArtifact.js.map +1 -0
  151. package/dist/domain/frontendContractIdentity.d.ts +39 -0
  152. package/dist/domain/frontendContractIdentity.js +70 -0
  153. package/dist/domain/frontendContractIdentity.js.map +1 -0
  154. package/dist/domain/frontendContracts.d.ts +188 -0
  155. package/dist/domain/frontendContracts.js +260 -0
  156. package/dist/domain/frontendContracts.js.map +1 -0
  157. package/dist/domain/identity.d.ts +21 -0
  158. package/dist/domain/identity.js +47 -0
  159. package/dist/domain/identity.js.map +1 -0
  160. package/dist/domain/referenceCorrectionIdentity.d.ts +40 -0
  161. package/dist/domain/referenceCorrectionIdentity.js +77 -0
  162. package/dist/domain/referenceCorrectionIdentity.js.map +1 -0
  163. package/dist/domain/referenceCorrectionWorkflow.d.ts +160 -0
  164. package/dist/domain/referenceCorrectionWorkflow.js +165 -0
  165. package/dist/domain/referenceCorrectionWorkflow.js.map +1 -0
  166. package/dist/domain/referenceFidelityProjection.d.ts +65 -0
  167. package/dist/domain/referenceFidelityProjection.js +135 -0
  168. package/dist/domain/referenceFidelityProjection.js.map +1 -0
  169. package/dist/domain/relationships.d.ts +210 -0
  170. package/dist/domain/relationships.js +352 -0
  171. package/dist/domain/relationships.js.map +1 -0
  172. package/dist/domain/schema.d.ts +269 -0
  173. package/dist/domain/schema.js +442 -0
  174. package/dist/domain/schema.js.map +1 -0
  175. package/dist/domain/scrollEvidence.d.ts +51 -0
  176. package/dist/domain/scrollEvidence.js +134 -0
  177. package/dist/domain/scrollEvidence.js.map +1 -0
  178. package/dist/index.d.ts +114 -0
  179. package/dist/index.js +64 -0
  180. package/dist/index.js.map +1 -0
  181. package/dist/projectWorkflow/aliasCatalog.d.ts +21 -0
  182. package/dist/projectWorkflow/aliasCatalog.js +67 -0
  183. package/dist/projectWorkflow/aliasCatalog.js.map +1 -0
  184. package/dist/projectWorkflow/checkAcceptance.d.ts +25 -0
  185. package/dist/projectWorkflow/checkAcceptance.js +55 -0
  186. package/dist/projectWorkflow/checkAcceptance.js.map +1 -0
  187. package/dist/projectWorkflow/checkResult.d.ts +85 -0
  188. package/dist/projectWorkflow/checkResult.js +101 -0
  189. package/dist/projectWorkflow/checkResult.js.map +1 -0
  190. package/dist/projectWorkflow/projectConfig.d.ts +43 -0
  191. package/dist/projectWorkflow/projectConfig.js +84 -0
  192. package/dist/projectWorkflow/projectConfig.js.map +1 -0
  193. package/dist/projectWorkflow/projectDiscovery.d.ts +9 -0
  194. package/dist/projectWorkflow/projectDiscovery.js +20 -0
  195. package/dist/projectWorkflow/projectDiscovery.js.map +1 -0
  196. package/dist/projectWorkflow/projectPaths.d.ts +8 -0
  197. package/dist/projectWorkflow/projectPaths.js +23 -0
  198. package/dist/projectWorkflow/projectPaths.js.map +1 -0
  199. package/dist/request/paths.d.ts +14 -0
  200. package/dist/request/paths.js +33 -0
  201. package/dist/request/paths.js.map +1 -0
  202. package/dist/request/request.d.ts +111 -0
  203. package/dist/request/request.js +464 -0
  204. package/dist/request/request.js.map +1 -0
  205. package/dist/safety/policy.d.ts +14 -0
  206. package/dist/safety/policy.js +81 -0
  207. package/dist/safety/policy.js.map +1 -0
  208. package/dist/viewer/assets/index-CN_yb9Uf.css +1 -0
  209. package/dist/viewer/assets/index-D98S1_2d.js +9 -0
  210. package/dist/viewer/icons/icon-192.png +0 -0
  211. package/dist/viewer/icons/icon-512.png +0 -0
  212. package/dist/viewer/index.html +15 -0
  213. package/dist/viewer/manifest.webmanifest +1 -0
  214. package/dist/viewer/registerSW.js +1 -0
  215. package/dist/viewer/sw.js +1 -0
  216. package/dist/viewer/workbox-9c191d2f.js +1 -0
  217. package/dist/viewerServer/context.d.ts +48 -0
  218. package/dist/viewerServer/context.js +60 -0
  219. package/dist/viewerServer/context.js.map +1 -0
  220. package/dist/viewerServer/evidence/classify.d.ts +59 -0
  221. package/dist/viewerServer/evidence/classify.js +124 -0
  222. package/dist/viewerServer/evidence/classify.js.map +1 -0
  223. package/dist/viewerServer/evidence/comparisonView.d.ts +28 -0
  224. package/dist/viewerServer/evidence/comparisonView.js +43 -0
  225. package/dist/viewerServer/evidence/comparisonView.js.map +1 -0
  226. package/dist/viewerServer/evidence/contextSourceView.d.ts +25 -0
  227. package/dist/viewerServer/evidence/contextSourceView.js +20 -0
  228. package/dist/viewerServer/evidence/contextSourceView.js.map +1 -0
  229. package/dist/viewerServer/evidence/discovery.d.ts +31 -0
  230. package/dist/viewerServer/evidence/discovery.js +78 -0
  231. package/dist/viewerServer/evidence/discovery.js.map +1 -0
  232. package/dist/viewerServer/evidence/evaluationView.d.ts +32 -0
  233. package/dist/viewerServer/evidence/evaluationView.js +50 -0
  234. package/dist/viewerServer/evidence/evaluationView.js.map +1 -0
  235. package/dist/viewerServer/evidence/handles.d.ts +21 -0
  236. package/dist/viewerServer/evidence/handles.js +43 -0
  237. package/dist/viewerServer/evidence/handles.js.map +1 -0
  238. package/dist/viewerServer/evidence/index.d.ts +41 -0
  239. package/dist/viewerServer/evidence/index.js +82 -0
  240. package/dist/viewerServer/evidence/index.js.map +1 -0
  241. package/dist/viewerServer/evidence/limits.d.ts +27 -0
  242. package/dist/viewerServer/evidence/limits.js +28 -0
  243. package/dist/viewerServer/evidence/limits.js.map +1 -0
  244. package/dist/viewerServer/evidence/linkedEvidence.d.ts +43 -0
  245. package/dist/viewerServer/evidence/linkedEvidence.js +151 -0
  246. package/dist/viewerServer/evidence/linkedEvidence.js.map +1 -0
  247. package/dist/viewerServer/evidence/mediaResolver.d.ts +16 -0
  248. package/dist/viewerServer/evidence/mediaResolver.js +85 -0
  249. package/dist/viewerServer/evidence/mediaResolver.js.map +1 -0
  250. package/dist/viewerServer/evidence/observationView.d.ts +29 -0
  251. package/dist/viewerServer/evidence/observationView.js +46 -0
  252. package/dist/viewerServer/evidence/observationView.js.map +1 -0
  253. package/dist/viewerServer/evidence/pathSafety.d.ts +11 -0
  254. package/dist/viewerServer/evidence/pathSafety.js +31 -0
  255. package/dist/viewerServer/evidence/pathSafety.js.map +1 -0
  256. package/dist/viewerServer/evidence/projection.d.ts +55 -0
  257. package/dist/viewerServer/evidence/projection.js +152 -0
  258. package/dist/viewerServer/evidence/projection.js.map +1 -0
  259. package/dist/viewerServer/evidence/referenceView.d.ts +133 -0
  260. package/dist/viewerServer/evidence/referenceView.js +169 -0
  261. package/dist/viewerServer/evidence/referenceView.js.map +1 -0
  262. package/dist/viewerServer/httpServer.d.ts +27 -0
  263. package/dist/viewerServer/httpServer.js +381 -0
  264. package/dist/viewerServer/httpServer.js.map +1 -0
  265. package/dist/viewerServer/openBrowser.d.ts +7 -0
  266. package/dist/viewerServer/openBrowser.js +32 -0
  267. package/dist/viewerServer/openBrowser.js.map +1 -0
  268. package/dist/viewerServer/port.d.ts +16 -0
  269. package/dist/viewerServer/port.js +19 -0
  270. package/dist/viewerServer/port.js.map +1 -0
  271. package/dist/viewerServer/viewerService.d.ts +62 -0
  272. package/dist/viewerServer/viewerService.js +88 -0
  273. package/dist/viewerServer/viewerService.js.map +1 -0
  274. package/docs/ARCHITECTURE.md +1286 -0
  275. package/docs/CI_CD.md +250 -0
  276. package/docs/COMMANDS.md +972 -0
  277. package/docs/CONTRACTS.md +1856 -0
  278. package/docs/CURRENT_STATE.md +1049 -0
  279. package/docs/DEVELOPMENT.md +202 -0
  280. package/docs/DOCUMENTATION_PRESERVATION_POLICY.md +50 -0
  281. package/docs/PROJECT_DESCRIPTION.md +2221 -0
  282. package/docs/PROJECT_MILESTONES.md +2526 -0
  283. package/docs/PROJECT_OVERVIEW.md +150 -0
  284. package/docs/QUICKSTART.md +83 -0
  285. package/docs/RELEASE.md +27 -0
  286. package/docs/ROADMAP.md +641 -0
  287. package/docs/SECURITY.md +218 -0
  288. package/docs/WORKFLOWS.md +642 -0
  289. package/docs/plans/v0.8-implementation-plan.md +655 -0
  290. package/docs/plans/v0.8.1-cli-usability-patch-plan.md +505 -0
  291. package/docs/reports/v0.7-bounded-fidelity-context-prompt7.md +243 -0
  292. package/docs/reports/v0.7-implementation-completeness-documentation-reconciliation.md +497 -0
  293. package/docs/reports/v0.7-pre-release-readiness.md +337 -0
  294. package/docs/reports/v0.7-reference-binding-prompt5.md +223 -0
  295. package/docs/reports/v0.7-reference-compatibility-prompt4.md +234 -0
  296. package/docs/reports/v0.7-reference-correction-workflow-prompt8.md +222 -0
  297. package/docs/reports/v0.7-reference-fidelity-prompt6.md +216 -0
  298. package/docs/reports/v0.7-reference-foundation-prompt1.md +151 -0
  299. package/docs/reports/v0.7-reference-regions-prompt2.md +195 -0
  300. package/docs/reports/v0.7-reference-requirements-prompt3.md +217 -0
  301. package/docs/reports/v0.7-release-prep.md +423 -0
  302. package/docs/reports/v0.8-binding-fidelity-interaction-batch6.md +279 -0
  303. package/docs/reports/v0.8-bounded-context-correlation-batch7.md +233 -0
  304. package/docs/reports/v0.8-comparison-contract-inspection-batch4.md +279 -0
  305. package/docs/reports/v0.8-evidence-index-readers-batch2.md +247 -0
  306. package/docs/reports/v0.8-implementation-completeness-documentation-reconciliation.md +741 -0
  307. package/docs/reports/v0.8-integrated-viewer-acceptance-batch8.md +128 -0
  308. package/docs/reports/v0.8-observation-svg-inspection-batch3.md +223 -0
  309. package/docs/reports/v0.8-prerelease-readiness-cross-platform-security-code-rot.md +687 -0
  310. package/docs/reports/v0.8-reference-candidate-inspection-batch5.md +232 -0
  311. package/docs/reports/v0.8-viewer-runtime-pwa-batch1.md +278 -0
  312. package/docs/reports/v0.8.1-check-orchestration-prompt2.md +69 -0
  313. package/docs/reports/v0.8.1-implementation-completeness-documentation-reconciliation.md +114 -0
  314. package/docs/reports/v0.8.1-prerelease-readiness-cross-platform-security-code-rot.md +170 -0
  315. package/docs/reports/v0.8.1-project-workflow-foundation-prompt1.md +66 -0
  316. package/package.json +58 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../src/viewerServer/evidence/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAiBpG,SAAS,eAAe,CAAC,IAAY,EAAE,WAAmB;IACxD,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACxC,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAY;IAClD,MAAM,SAAS,GAAyB,EAAE,CAAC;IAC3C,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAC3B,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,KAAK,UAAU,IAAI,CAAC,GAAW,EAAE,KAAa;QAC5C,IAAI,SAAS;YAAE,OAAO;QACtB,IAAI,KAAK,GAAG,mBAAmB,EAAE,CAAC;YAChC,SAAS,GAAG,IAAI,CAAC;YACjB,OAAO;QACT,CAAC;QACD,IAAI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;oBACnC,WAAW,EAAE,GAAG;oBAChB,WAAW,EAAE,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC;iBACxC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAEpB,yFAAyF;IACzF,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvG,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAClC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { LinkStatus } from './linkedEvidence.js';
2
+ export type EvaluationViewResult = {
3
+ ok: true;
4
+ comparison: LinkStatus;
5
+ baseline: LinkStatus;
6
+ change: LinkStatus;
7
+ before: LinkStatus;
8
+ after: LinkStatus;
9
+ } | {
10
+ ok: false;
11
+ reason: 'unknown-handle';
12
+ } | {
13
+ ok: false;
14
+ reason: 'not-an-evaluation';
15
+ } | {
16
+ ok: false;
17
+ reason: 'not-currently-loadable';
18
+ };
19
+ /**
20
+ * Batch 4's linked-evidence resolver for `FrontendContractEvaluationArtifact`:
21
+ * resolves its `contracts.baselineId`, `contracts.contractId`,
22
+ * `comparisonId`+`comparisonRequestId`, and `before`/`after` references
23
+ * against the current evidence root, all by exact identity
24
+ * (`linkedEvidence.ts`) - never by shape/proximity. Never calls
25
+ * `evaluateFrontendContract`: `overallVerdict`, `clauseResults`,
26
+ * `activeBaselineClauseIds`, `supersededBaselineClauseIds`, and
27
+ * `unexpectedChanges` are read unchanged from the persisted artifact via the
28
+ * existing Batch 2 `GET /api/artifacts/<handle>` - this endpoint only
29
+ * answers "where are its linked contracts/comparison/observations, if
30
+ * anywhere in this root".
31
+ */
32
+ export declare function getEvaluationView(root: string, handle: string): Promise<EvaluationViewResult>;
@@ -0,0 +1,50 @@
1
+ import { join } from 'node:path';
2
+ import { stat } from 'node:fs/promises';
3
+ import { classifyManifest } from './classify.js';
4
+ import { decodeArtifactHandle } from './handles.js';
5
+ import { resolveContainedDir } from './pathSafety.js';
6
+ import { resolveObservationByReference, resolveComparisonByIdentity, resolveBaselineContractById, resolveChangeContractById } from './linkedEvidence.js';
7
+ /**
8
+ * Batch 4's linked-evidence resolver for `FrontendContractEvaluationArtifact`:
9
+ * resolves its `contracts.baselineId`, `contracts.contractId`,
10
+ * `comparisonId`+`comparisonRequestId`, and `before`/`after` references
11
+ * against the current evidence root, all by exact identity
12
+ * (`linkedEvidence.ts`) - never by shape/proximity. Never calls
13
+ * `evaluateFrontendContract`: `overallVerdict`, `clauseResults`,
14
+ * `activeBaselineClauseIds`, `supersededBaselineClauseIds`, and
15
+ * `unexpectedChanges` are read unchanged from the persisted artifact via the
16
+ * existing Batch 2 `GET /api/artifacts/<handle>` - this endpoint only
17
+ * answers "where are its linked contracts/comparison/observations, if
18
+ * anywhere in this root".
19
+ */
20
+ export async function getEvaluationView(root, handle) {
21
+ const decoded = decodeArtifactHandle(handle);
22
+ if (!decoded.ok)
23
+ return { ok: false, reason: 'unknown-handle' };
24
+ const dir = resolveContainedDir(root, decoded.relativeDir);
25
+ if (dir === undefined)
26
+ return { ok: false, reason: 'unknown-handle' };
27
+ try {
28
+ const dirInfo = await stat(dir);
29
+ if (!dirInfo.isDirectory())
30
+ return { ok: false, reason: 'unknown-handle' };
31
+ }
32
+ catch {
33
+ return { ok: false, reason: 'unknown-handle' };
34
+ }
35
+ const classified = await classifyManifest(join(dir, 'manifest.json'));
36
+ if (classified.supportState !== 'supported')
37
+ return { ok: false, reason: 'not-currently-loadable' };
38
+ if (classified.family !== 'contract-evaluation')
39
+ return { ok: false, reason: 'not-an-evaluation' };
40
+ const { artifact } = classified;
41
+ const [comparison, baseline, change, before, after] = await Promise.all([
42
+ resolveComparisonByIdentity(root, artifact.comparisonId, artifact.comparisonRequestId),
43
+ resolveBaselineContractById(root, artifact.contracts.baselineId),
44
+ resolveChangeContractById(root, artifact.contracts.contractId),
45
+ resolveObservationByReference(root, artifact.before),
46
+ resolveObservationByReference(root, artifact.after),
47
+ ]);
48
+ return { ok: true, comparison, baseline, change, before, after };
49
+ }
50
+ //# sourceMappingURL=evaluationView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluationView.js","sourceRoot":"","sources":["../../../src/viewerServer/evidence/evaluationView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AASzJ;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAY,EAAE,MAAc;IAClE,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAEhE,MAAM,GAAG,GAAG,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3D,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAEtE,IAAI,CAAC;QACH,MAAM,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EAAE,CAAC;AACnE,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ArtifactFamily } from './classify.js';
2
+ /**
3
+ * A viewer handle is server-issued, opaque-to-the-browser material: a
4
+ * family-prefixed, percent-encoded root-relative directory path. It is
5
+ * "server-issued" in the sense that it is exactly what discovery/
6
+ * classification already produced - a client can never construct a handle
7
+ * that names a path discovery did not itself walk to and classify.
8
+ * Every route that accepts a handle re-resolves and re-validates it against
9
+ * the evidence root before touching the filesystem (see media.ts/index.ts) -
10
+ * this module only encodes/decodes the opaque string, it never grants
11
+ * filesystem access by itself.
12
+ */
13
+ export declare function encodeArtifactHandle(family: ArtifactFamily, relativeDir: string): string;
14
+ export type DecodedArtifactHandle = {
15
+ ok: true;
16
+ family: ArtifactFamily;
17
+ relativeDir: string;
18
+ } | {
19
+ ok: false;
20
+ };
21
+ export declare function decodeArtifactHandle(handle: string): DecodedArtifactHandle;
@@ -0,0 +1,43 @@
1
+ const FAMILY_SLUGS = {
2
+ observation: 'observation',
3
+ comparison: 'comparison',
4
+ 'baseline-contract': 'baseline-contract',
5
+ 'change-contract': 'change-contract',
6
+ 'contract-evaluation': 'contract-evaluation',
7
+ 'external-reference-imported': 'external-reference-imported',
8
+ 'external-reference-approved': 'external-reference-approved',
9
+ };
10
+ const SLUG_TO_FAMILY = Object.fromEntries(Object.entries(FAMILY_SLUGS).map(([family, slug]) => [slug, family]));
11
+ /**
12
+ * A viewer handle is server-issued, opaque-to-the-browser material: a
13
+ * family-prefixed, percent-encoded root-relative directory path. It is
14
+ * "server-issued" in the sense that it is exactly what discovery/
15
+ * classification already produced - a client can never construct a handle
16
+ * that names a path discovery did not itself walk to and classify.
17
+ * Every route that accepts a handle re-resolves and re-validates it against
18
+ * the evidence root before touching the filesystem (see media.ts/index.ts) -
19
+ * this module only encodes/decodes the opaque string, it never grants
20
+ * filesystem access by itself.
21
+ */
22
+ export function encodeArtifactHandle(family, relativeDir) {
23
+ return `${FAMILY_SLUGS[family]}:${encodeURIComponent(relativeDir)}`;
24
+ }
25
+ export function decodeArtifactHandle(handle) {
26
+ const separatorIndex = handle.indexOf(':');
27
+ if (separatorIndex <= 0)
28
+ return { ok: false };
29
+ const slug = handle.slice(0, separatorIndex);
30
+ const encodedDir = handle.slice(separatorIndex + 1);
31
+ const family = SLUG_TO_FAMILY[slug];
32
+ if (family === undefined || encodedDir.length === 0)
33
+ return { ok: false };
34
+ let relativeDir;
35
+ try {
36
+ relativeDir = decodeURIComponent(encodedDir);
37
+ }
38
+ catch {
39
+ return { ok: false };
40
+ }
41
+ return { ok: true, family, relativeDir };
42
+ }
43
+ //# sourceMappingURL=handles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handles.js","sourceRoot":"","sources":["../../../src/viewerServer/evidence/handles.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAmC;IACnD,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,mBAAmB,EAAE,mBAAmB;IACxC,iBAAiB,EAAE,iBAAiB;IACpC,qBAAqB,EAAE,qBAAqB;IAC5C,6BAA6B,EAAE,6BAA6B;IAC5D,6BAA6B,EAAE,6BAA6B;CAC7D,CAAC;AAEF,MAAM,cAAc,GAAmC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAwB,CAAC,CAAC,CAG/J,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAsB,EAAE,WAAmB;IAC9E,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;AACtE,CAAC;AAID,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,IAAI,cAAc,IAAI,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;IAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,MAAM,KAAK,SAAS,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;IAC1E,IAAI,WAAmB,CAAC;IACxB,IAAI,CAAC;QACH,WAAW,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { EvidenceArtifactDetail, EvidenceMetadataRecord } from './projection.js';
2
+ export interface EvidenceIndexResult {
3
+ records: EvidenceMetadataRecord[];
4
+ truncated: boolean;
5
+ }
6
+ /**
7
+ * The one metadata-first entry point: bounded discovery + narrow
8
+ * classification + canonical-reader dispatch (for anything that looks
9
+ * recognized) + ephemeral metadata projection. Rebuilt on every call rather
10
+ * than cached (frozen plan §30: no persistent viewer cache/database/watcher),
11
+ * so it always reflects the evidence root's current on-disk state.
12
+ */
13
+ export declare function buildEvidenceIndexMetadata(root: string, observationAliasesByRelativeDir?: Readonly<Record<string, string>>): Promise<EvidenceIndexResult>;
14
+ export type LoadArtifactResult = {
15
+ ok: true;
16
+ detail: EvidenceArtifactDetail;
17
+ } | {
18
+ ok: false;
19
+ reason: 'unknown-handle';
20
+ } | {
21
+ ok: false;
22
+ reason: 'not-supported';
23
+ metadata: EvidenceMetadataRecord;
24
+ };
25
+ /**
26
+ * On-demand full-artifact loading (frozen plan §16): decodes and
27
+ * re-validates the handle against the evidence root (never trusts it
28
+ * blindly), then re-classifies *that one candidate* through the same
29
+ * canonical-reader dispatch the index uses - it never returns a cached
30
+ * result and never coerces an unsupported/invalid candidate into a
31
+ * fabricated domain object.
32
+ */
33
+ export declare function loadArtifactByHandle(root: string, handle: string): Promise<LoadArtifactResult>;
34
+ /**
35
+ * Bounded search for the 'imported' external-reference artifact whose
36
+ * `referenceId` matches `referenceId`, used only to resolve an 'approved'
37
+ * artifact's source-owned image (see mediaResolver.ts). Never assumes a
38
+ * fixed relative location - an approved artifact's `sourceReference` carries
39
+ * only a logical `referenceId`, not a filesystem path (frozen plan §18).
40
+ */
41
+ export declare function findImportedReferenceDir(root: string, referenceId: string): Promise<string | undefined>;
@@ -0,0 +1,82 @@
1
+ import { stat } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ import { discoverManifests } from './discovery.js';
4
+ import { classifyManifest } from './classify.js';
5
+ import { buildMetadataRecord, buildArtifactDetail } from './projection.js';
6
+ import { decodeArtifactHandle } from './handles.js';
7
+ import { resolveContainedDir } from './pathSafety.js';
8
+ import { MAX_INDEX_RECORDS } from './limits.js';
9
+ /**
10
+ * The one metadata-first entry point: bounded discovery + narrow
11
+ * classification + canonical-reader dispatch (for anything that looks
12
+ * recognized) + ephemeral metadata projection. Rebuilt on every call rather
13
+ * than cached (frozen plan §30: no persistent viewer cache/database/watcher),
14
+ * so it always reflects the evidence root's current on-disk state.
15
+ */
16
+ export async function buildEvidenceIndexMetadata(root, observationAliasesByRelativeDir = {}) {
17
+ const discovery = await discoverManifests(root);
18
+ const limited = discovery.manifests.slice(0, MAX_INDEX_RECORDS);
19
+ const truncated = discovery.truncated || discovery.manifests.length > MAX_INDEX_RECORDS;
20
+ const records = [];
21
+ for (const manifest of limited) {
22
+ const classified = await classifyManifest(manifest.absolutePath);
23
+ const record = await buildMetadataRecord(classified, manifest.relativeDir, manifest.absoluteDir);
24
+ const alias = record.family === 'observation' ? observationAliasesByRelativeDir[manifest.relativeDir] : undefined;
25
+ records.push(alias === undefined ? record : { ...record, alias });
26
+ }
27
+ return { records, truncated };
28
+ }
29
+ /**
30
+ * On-demand full-artifact loading (frozen plan §16): decodes and
31
+ * re-validates the handle against the evidence root (never trusts it
32
+ * blindly), then re-classifies *that one candidate* through the same
33
+ * canonical-reader dispatch the index uses - it never returns a cached
34
+ * result and never coerces an unsupported/invalid candidate into a
35
+ * fabricated domain object.
36
+ */
37
+ export async function loadArtifactByHandle(root, handle) {
38
+ const decoded = decodeArtifactHandle(handle);
39
+ if (!decoded.ok)
40
+ return { ok: false, reason: 'unknown-handle' };
41
+ const dir = resolveContainedDir(root, decoded.relativeDir);
42
+ if (dir === undefined)
43
+ return { ok: false, reason: 'unknown-handle' };
44
+ try {
45
+ const dirInfo = await stat(dir);
46
+ if (!dirInfo.isDirectory())
47
+ return { ok: false, reason: 'unknown-handle' };
48
+ }
49
+ catch {
50
+ // The handle names a path discovery never actually found on disk (or that has since disappeared) - unknown, not "broken".
51
+ return { ok: false, reason: 'unknown-handle' };
52
+ }
53
+ const classified = await classifyManifest(join(dir, 'manifest.json'));
54
+ if (classified.supportState !== 'supported') {
55
+ const metadata = await buildMetadataRecord(classified, decoded.relativeDir, dir);
56
+ return { ok: false, reason: 'not-supported', metadata };
57
+ }
58
+ if (classified.family !== decoded.family) {
59
+ // The handle named a family that no longer matches on-disk reality (e.g. deleted and replaced between requests) - fail closed as unknown rather than serving a mismatched artifact under a stale handle.
60
+ return { ok: false, reason: 'unknown-handle' };
61
+ }
62
+ return { ok: true, detail: buildArtifactDetail(classified.family, handle, classified.artifact) };
63
+ }
64
+ /**
65
+ * Bounded search for the 'imported' external-reference artifact whose
66
+ * `referenceId` matches `referenceId`, used only to resolve an 'approved'
67
+ * artifact's source-owned image (see mediaResolver.ts). Never assumes a
68
+ * fixed relative location - an approved artifact's `sourceReference` carries
69
+ * only a logical `referenceId`, not a filesystem path (frozen plan §18).
70
+ */
71
+ export async function findImportedReferenceDir(root, referenceId) {
72
+ const discovery = await discoverManifests(root);
73
+ for (const manifest of discovery.manifests.slice(0, MAX_INDEX_RECORDS)) {
74
+ const classified = await classifyManifest(manifest.absolutePath);
75
+ if (classified.supportState === 'supported' && classified.family === 'external-reference-imported' && 'referenceId' in classified.artifact) {
76
+ if (classified.artifact.referenceId === referenceId)
77
+ return manifest.absoluteDir;
78
+ }
79
+ }
80
+ return undefined;
81
+ }
82
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/viewerServer/evidence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAOhD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,IAAY,EAAE,kCAAoE,EAAE;IACnI,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,iBAAiB,CAAC;IAExF,MAAM,OAAO,GAA6B,EAAE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QAAQ,EAAE,CAAC;YAC3I,IAAI,UAAU,CAAC,QAAQ,CAAC,WAAW,KAAK,WAAW;gBAAE,OAAO,QAAQ,CAAC,WAAW,CAAC;QACnF,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * v0.8 Batch 2: conservative, deterministic bounds for evidence-root
3
+ * discovery. Chosen after inspecting every current persisted artifact family
4
+ * (src/artifacts/*Writer.ts): every family writes exactly one
5
+ * `<outputLocation>/<id>/manifest.json` (plus, for observation and imported
6
+ * external-reference artifacts, one sibling media file in that same
7
+ * directory) - a shallow, bounded shape that does not require deep
8
+ * recursion. These bounds are generous relative to that real shape while
9
+ * still refusing to become an unbounded filesystem crawl.
10
+ */
11
+ /** Maximum directory levels traversed below the supplied evidence root (root itself is depth 0). Typical shapes (`<root>/observations/<id>/manifest.json`) need depth 2; this leaves slack for an intentionally nested `--output` without allowing unbounded recursion. */
12
+ export declare const MAX_DISCOVERY_DEPTH = 6;
13
+ /** Maximum number of directories visited during one discovery walk. */
14
+ export declare const MAX_DIRECTORIES_VISITED = 2000;
15
+ /** Maximum number of candidate `manifest.json` files inspected (classified) during one discovery walk. */
16
+ export declare const MAX_MANIFEST_CANDIDATES = 1000;
17
+ /** Maximum number of metadata records returned in one index response. */
18
+ export declare const MAX_INDEX_RECORDS = 500;
19
+ /**
20
+ * Maximum bytes read from a candidate `manifest.json` before classification.
21
+ * Every real persisted manifest is small (identity/geometry/config JSON only
22
+ * - screenshots and reference images are always separate sibling files), so
23
+ * 2,000,000 bytes is generous headroom for a legitimately large observation
24
+ * (many targets/relationships) while refusing to read an arbitrarily large
25
+ * file into memory just because it happens to be named `manifest.json`.
26
+ */
27
+ export declare const MAX_MANIFEST_CANDIDATE_BYTES = 2000000;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * v0.8 Batch 2: conservative, deterministic bounds for evidence-root
3
+ * discovery. Chosen after inspecting every current persisted artifact family
4
+ * (src/artifacts/*Writer.ts): every family writes exactly one
5
+ * `<outputLocation>/<id>/manifest.json` (plus, for observation and imported
6
+ * external-reference artifacts, one sibling media file in that same
7
+ * directory) - a shallow, bounded shape that does not require deep
8
+ * recursion. These bounds are generous relative to that real shape while
9
+ * still refusing to become an unbounded filesystem crawl.
10
+ */
11
+ /** Maximum directory levels traversed below the supplied evidence root (root itself is depth 0). Typical shapes (`<root>/observations/<id>/manifest.json`) need depth 2; this leaves slack for an intentionally nested `--output` without allowing unbounded recursion. */
12
+ export const MAX_DISCOVERY_DEPTH = 6;
13
+ /** Maximum number of directories visited during one discovery walk. */
14
+ export const MAX_DIRECTORIES_VISITED = 2000;
15
+ /** Maximum number of candidate `manifest.json` files inspected (classified) during one discovery walk. */
16
+ export const MAX_MANIFEST_CANDIDATES = 1000;
17
+ /** Maximum number of metadata records returned in one index response. */
18
+ export const MAX_INDEX_RECORDS = 500;
19
+ /**
20
+ * Maximum bytes read from a candidate `manifest.json` before classification.
21
+ * Every real persisted manifest is small (identity/geometry/config JSON only
22
+ * - screenshots and reference images are always separate sibling files), so
23
+ * 2,000,000 bytes is generous headroom for a legitimately large observation
24
+ * (many targets/relationships) while refusing to read an arbitrarily large
25
+ * file into memory just because it happens to be named `manifest.json`.
26
+ */
27
+ export const MAX_MANIFEST_CANDIDATE_BYTES = 2_000_000;
28
+ //# sourceMappingURL=limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../src/viewerServer/evidence/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,2QAA2Q;AAC3Q,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,0GAA0G;AAC1G,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { ComparisonSourceObservationReference } from '../../domain/comparison.js';
2
+ import type { FrontendContractObservationReference } from '../../domain/frontendContracts.js';
3
+ export type LinkStatus = {
4
+ status: 'resolved';
5
+ handle: string;
6
+ } | {
7
+ status: 'missing';
8
+ } | {
9
+ status: 'ambiguous';
10
+ count: number;
11
+ };
12
+ type ObservationReferenceLike = ComparisonSourceObservationReference | FrontendContractObservationReference;
13
+ /**
14
+ * Batch 4 exact-identity linked-evidence resolution: every lookup here walks
15
+ * the bounded evidence tree once (mirroring the exact pattern Batch 2's
16
+ * `evidence/index.ts#findImportedReferenceDir` already established for the
17
+ * approved-external-reference case) and matches by exact canonical identity
18
+ * only - never by folder name, screenshot filename, URL, target-set
19
+ * similarity, or geometry similarity (frozen plan §11). Zero matches ->
20
+ * `missing`; two or more exact matches -> `ambiguous` (never silently pick
21
+ * one). No caller of this module ever calls `compareObservations` or
22
+ * `evaluateFrontendContract` - it only locates and identity-checks already-
23
+ * persisted, already-validated artifacts.
24
+ */
25
+ export declare function resolveObservationByReference(root: string, ref: ObservationReferenceLike): Promise<LinkStatus>;
26
+ export declare function resolveComparisonByIdentity(root: string, comparisonId: string, comparisonRequestId: string): Promise<LinkStatus>;
27
+ export declare function resolveBaselineContractById(root: string, baselineId: string): Promise<LinkStatus>;
28
+ export declare function resolveChangeContractById(root: string, contractId: string): Promise<LinkStatus>;
29
+ /**
30
+ * Batch 7 addition: resolves an observation by bare `observationId` alone
31
+ * (exact match, never a substring/pathname heuristic) - the only identity a
32
+ * `BoundedAgentContextArtifact.sources.observationIds` entry actually
33
+ * carries (unlike the compound `{observationId, requestId, producer,
34
+ * observationSchemaVersion}` reference `resolveObservationByReference`
35
+ * consumes for Batch 4/5 cross-artifact references). Same missing/ambiguous
36
+ * discipline as every other resolver in this module.
37
+ */
38
+ export declare function resolveObservationById(root: string, observationId: string): Promise<LinkStatus>;
39
+ /** Batch 7 addition: resolves a `FrontendContractEvaluationArtifact` by its own exact `evaluationId`+`evaluationRequestId` (a bounded-agent-context source reference, never resolved via the `after` observation the way Batch 5's candidate-context lookup works). */
40
+ export declare function resolveEvaluationByIdentity(root: string, evaluationId: string, evaluationRequestId: string): Promise<LinkStatus>;
41
+ /** Batch 7 addition: resolves an `ExternalReferenceArtifact` (imported or approved) by its own exact `referenceId`+`referenceRequestId` - a bounded-agent-context source reference. Matches either lifecycle family; never assumes which one. */
42
+ export declare function resolveReferenceByIdentity(root: string, referenceId: string, referenceRequestId: string): Promise<LinkStatus>;
43
+ export {};
@@ -0,0 +1,151 @@
1
+ import { discoverManifests } from './discovery.js';
2
+ import { classifyManifest } from './classify.js';
3
+ import { encodeArtifactHandle } from './handles.js';
4
+ import { MAX_INDEX_RECORDS } from './limits.js';
5
+ function referencesMatch(ref, candidateObservationId, candidateRequestId, candidateProducerVersion, candidateSchemaVersion) {
6
+ return ref.observationId === candidateObservationId && ref.requestId === candidateRequestId && ref.producer.version === candidateProducerVersion && ref.observationSchemaVersion === candidateSchemaVersion;
7
+ }
8
+ /**
9
+ * Batch 4 exact-identity linked-evidence resolution: every lookup here walks
10
+ * the bounded evidence tree once (mirroring the exact pattern Batch 2's
11
+ * `evidence/index.ts#findImportedReferenceDir` already established for the
12
+ * approved-external-reference case) and matches by exact canonical identity
13
+ * only - never by folder name, screenshot filename, URL, target-set
14
+ * similarity, or geometry similarity (frozen plan §11). Zero matches ->
15
+ * `missing`; two or more exact matches -> `ambiguous` (never silently pick
16
+ * one). No caller of this module ever calls `compareObservations` or
17
+ * `evaluateFrontendContract` - it only locates and identity-checks already-
18
+ * persisted, already-validated artifacts.
19
+ */
20
+ export async function resolveObservationByReference(root, ref) {
21
+ const discovery = await discoverManifests(root);
22
+ const matches = [];
23
+ for (const manifest of discovery.manifests.slice(0, MAX_INDEX_RECORDS)) {
24
+ const classified = await classifyManifest(manifest.absolutePath);
25
+ if (classified.supportState !== 'supported' || classified.family !== 'observation')
26
+ continue;
27
+ const { artifact } = classified;
28
+ if (referencesMatch(ref, artifact.observationId, artifact.requestId, artifact.producer.version, artifact.schemaVersion)) {
29
+ matches.push(encodeArtifactHandle('observation', manifest.relativeDir));
30
+ }
31
+ }
32
+ if (matches.length === 0)
33
+ return { status: 'missing' };
34
+ if (matches.length > 1)
35
+ return { status: 'ambiguous', count: matches.length };
36
+ return { status: 'resolved', handle: matches[0] };
37
+ }
38
+ export async function resolveComparisonByIdentity(root, comparisonId, comparisonRequestId) {
39
+ const discovery = await discoverManifests(root);
40
+ const matches = [];
41
+ for (const manifest of discovery.manifests.slice(0, MAX_INDEX_RECORDS)) {
42
+ const classified = await classifyManifest(manifest.absolutePath);
43
+ if (classified.supportState !== 'supported' || classified.family !== 'comparison')
44
+ continue;
45
+ if (classified.artifact.comparisonId === comparisonId && classified.artifact.comparisonRequestId === comparisonRequestId) {
46
+ matches.push(encodeArtifactHandle('comparison', manifest.relativeDir));
47
+ }
48
+ }
49
+ if (matches.length === 0)
50
+ return { status: 'missing' };
51
+ if (matches.length > 1)
52
+ return { status: 'ambiguous', count: matches.length };
53
+ return { status: 'resolved', handle: matches[0] };
54
+ }
55
+ export async function resolveBaselineContractById(root, baselineId) {
56
+ const discovery = await discoverManifests(root);
57
+ const matches = [];
58
+ for (const manifest of discovery.manifests.slice(0, MAX_INDEX_RECORDS)) {
59
+ const classified = await classifyManifest(manifest.absolutePath);
60
+ if (classified.supportState !== 'supported' || classified.family !== 'baseline-contract')
61
+ continue;
62
+ if (classified.artifact.baselineId === baselineId) {
63
+ matches.push(encodeArtifactHandle('baseline-contract', manifest.relativeDir));
64
+ }
65
+ }
66
+ if (matches.length === 0)
67
+ return { status: 'missing' };
68
+ if (matches.length > 1)
69
+ return { status: 'ambiguous', count: matches.length };
70
+ return { status: 'resolved', handle: matches[0] };
71
+ }
72
+ export async function resolveChangeContractById(root, contractId) {
73
+ const discovery = await discoverManifests(root);
74
+ const matches = [];
75
+ for (const manifest of discovery.manifests.slice(0, MAX_INDEX_RECORDS)) {
76
+ const classified = await classifyManifest(manifest.absolutePath);
77
+ if (classified.supportState !== 'supported' || classified.family !== 'change-contract')
78
+ continue;
79
+ if (classified.artifact.contractId === contractId) {
80
+ matches.push(encodeArtifactHandle('change-contract', manifest.relativeDir));
81
+ }
82
+ }
83
+ if (matches.length === 0)
84
+ return { status: 'missing' };
85
+ if (matches.length > 1)
86
+ return { status: 'ambiguous', count: matches.length };
87
+ return { status: 'resolved', handle: matches[0] };
88
+ }
89
+ /**
90
+ * Batch 7 addition: resolves an observation by bare `observationId` alone
91
+ * (exact match, never a substring/pathname heuristic) - the only identity a
92
+ * `BoundedAgentContextArtifact.sources.observationIds` entry actually
93
+ * carries (unlike the compound `{observationId, requestId, producer,
94
+ * observationSchemaVersion}` reference `resolveObservationByReference`
95
+ * consumes for Batch 4/5 cross-artifact references). Same missing/ambiguous
96
+ * discipline as every other resolver in this module.
97
+ */
98
+ export async function resolveObservationById(root, observationId) {
99
+ const discovery = await discoverManifests(root);
100
+ const matches = [];
101
+ for (const manifest of discovery.manifests.slice(0, MAX_INDEX_RECORDS)) {
102
+ const classified = await classifyManifest(manifest.absolutePath);
103
+ if (classified.supportState !== 'supported' || classified.family !== 'observation')
104
+ continue;
105
+ if (classified.artifact.observationId === observationId) {
106
+ matches.push(encodeArtifactHandle('observation', manifest.relativeDir));
107
+ }
108
+ }
109
+ if (matches.length === 0)
110
+ return { status: 'missing' };
111
+ if (matches.length > 1)
112
+ return { status: 'ambiguous', count: matches.length };
113
+ return { status: 'resolved', handle: matches[0] };
114
+ }
115
+ /** Batch 7 addition: resolves a `FrontendContractEvaluationArtifact` by its own exact `evaluationId`+`evaluationRequestId` (a bounded-agent-context source reference, never resolved via the `after` observation the way Batch 5's candidate-context lookup works). */
116
+ export async function resolveEvaluationByIdentity(root, evaluationId, evaluationRequestId) {
117
+ const discovery = await discoverManifests(root);
118
+ const matches = [];
119
+ for (const manifest of discovery.manifests.slice(0, MAX_INDEX_RECORDS)) {
120
+ const classified = await classifyManifest(manifest.absolutePath);
121
+ if (classified.supportState !== 'supported' || classified.family !== 'contract-evaluation')
122
+ continue;
123
+ if (classified.artifact.evaluationId === evaluationId && classified.artifact.evaluationRequestId === evaluationRequestId) {
124
+ matches.push(encodeArtifactHandle('contract-evaluation', manifest.relativeDir));
125
+ }
126
+ }
127
+ if (matches.length === 0)
128
+ return { status: 'missing' };
129
+ if (matches.length > 1)
130
+ return { status: 'ambiguous', count: matches.length };
131
+ return { status: 'resolved', handle: matches[0] };
132
+ }
133
+ /** Batch 7 addition: resolves an `ExternalReferenceArtifact` (imported or approved) by its own exact `referenceId`+`referenceRequestId` - a bounded-agent-context source reference. Matches either lifecycle family; never assumes which one. */
134
+ export async function resolveReferenceByIdentity(root, referenceId, referenceRequestId) {
135
+ const discovery = await discoverManifests(root);
136
+ const matches = [];
137
+ for (const manifest of discovery.manifests.slice(0, MAX_INDEX_RECORDS)) {
138
+ const classified = await classifyManifest(manifest.absolutePath);
139
+ if (classified.supportState !== 'supported' || (classified.family !== 'external-reference-imported' && classified.family !== 'external-reference-approved'))
140
+ continue;
141
+ if (classified.artifact.referenceId === referenceId && classified.artifact.referenceRequestId === referenceRequestId) {
142
+ matches.push({ handle: encodeArtifactHandle(classified.family, manifest.relativeDir) });
143
+ }
144
+ }
145
+ if (matches.length === 0)
146
+ return { status: 'missing' };
147
+ if (matches.length > 1)
148
+ return { status: 'ambiguous', count: matches.length };
149
+ return { status: 'resolved', handle: matches[0].handle };
150
+ }
151
+ //# sourceMappingURL=linkedEvidence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkedEvidence.js","sourceRoot":"","sources":["../../../src/viewerServer/evidence/linkedEvidence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,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E,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAE,CAAC,MAAM,EAAE,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,16 @@
1
+ export type MediaRole = 'screenshot' | 'image' | 'source-image';
2
+ export type MediaResolution = {
3
+ ok: true;
4
+ absolutePath: string;
5
+ mimeType: string;
6
+ } | {
7
+ ok: false;
8
+ reason: string;
9
+ };
10
+ /**
11
+ * Resolves one known media role owned/referenced by one known, already
12
+ * indexed-shaped artifact handle - never an arbitrary filesystem path. Every
13
+ * step re-derives and re-validates from the evidence root; nothing here
14
+ * trusts a client-supplied path string beyond the opaque handle/role pair.
15
+ */
16
+ export declare function resolveMedia(root: string, artifactHandle: string, role: string): Promise<MediaResolution>;