@nebulacomponents/citable 1.18.2 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +12 -1
  3. package/dist/universal/.agents/skills/citable/SKILL.md +11 -2
  4. package/dist/universal/.agents/skills/citable/VERSION +1 -1
  5. package/dist/universal/.agents/skills/citable/manifest.json +19 -13
  6. package/dist/universal/.agents/skills/citable/schemas/action-plan.schema.json +38 -1
  7. package/dist/universal/.agents/skills/citable/schemas/audit-coverage.schema.json +118 -0
  8. package/dist/universal/.agents/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  9. package/dist/universal/.agents/skills/citable/schemas/browser-network-events.schema.json +142 -0
  10. package/dist/universal/.agents/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  11. package/dist/universal/.agents/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  12. package/dist/universal/.agents/skills/citable/schemas/collection-result.schema.json +35 -0
  13. package/dist/universal/.agents/skills/citable/schemas/config.schema.json +2 -0
  14. package/dist/universal/.agents/skills/citable/schemas/cro-report.schema.json +8 -1
  15. package/dist/universal/.agents/skills/citable/schemas/finding.schema.json +105 -2
  16. package/dist/universal/.agents/skills/citable/schemas/remediation-verification.schema.json +12 -1
  17. package/dist/universal/.agents/skills/citable/schemas/run.schema.json +15 -2
  18. package/dist/universal/.agents/skills/citable/schemas/search-report.schema.json +8 -1
  19. package/dist/universal/.agents/skills/citable/schemas/summary.schema.json +41 -0
  20. package/dist/universal/.claude/agents/citable/manifest.json +2 -2
  21. package/dist/universal/.claude/skills/citable/SKILL.md +11 -2
  22. package/dist/universal/.claude/skills/citable/VERSION +1 -1
  23. package/dist/universal/.claude/skills/citable/manifest.json +19 -13
  24. package/dist/universal/.claude/skills/citable/schemas/action-plan.schema.json +38 -1
  25. package/dist/universal/.claude/skills/citable/schemas/audit-coverage.schema.json +118 -0
  26. package/dist/universal/.claude/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  27. package/dist/universal/.claude/skills/citable/schemas/browser-network-events.schema.json +142 -0
  28. package/dist/universal/.claude/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  29. package/dist/universal/.claude/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  30. package/dist/universal/.claude/skills/citable/schemas/collection-result.schema.json +35 -0
  31. package/dist/universal/.claude/skills/citable/schemas/config.schema.json +2 -0
  32. package/dist/universal/.claude/skills/citable/schemas/cro-report.schema.json +8 -1
  33. package/dist/universal/.claude/skills/citable/schemas/finding.schema.json +105 -2
  34. package/dist/universal/.claude/skills/citable/schemas/remediation-verification.schema.json +12 -1
  35. package/dist/universal/.claude/skills/citable/schemas/run.schema.json +15 -2
  36. package/dist/universal/.claude/skills/citable/schemas/search-report.schema.json +8 -1
  37. package/dist/universal/.claude/skills/citable/schemas/summary.schema.json +41 -0
  38. package/dist/universal/.cursor/skills/citable/SKILL.md +11 -2
  39. package/dist/universal/.cursor/skills/citable/VERSION +1 -1
  40. package/dist/universal/.cursor/skills/citable/manifest.json +19 -13
  41. package/dist/universal/.cursor/skills/citable/schemas/action-plan.schema.json +38 -1
  42. package/dist/universal/.cursor/skills/citable/schemas/audit-coverage.schema.json +118 -0
  43. package/dist/universal/.cursor/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  44. package/dist/universal/.cursor/skills/citable/schemas/browser-network-events.schema.json +142 -0
  45. package/dist/universal/.cursor/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  46. package/dist/universal/.cursor/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  47. package/dist/universal/.cursor/skills/citable/schemas/collection-result.schema.json +35 -0
  48. package/dist/universal/.cursor/skills/citable/schemas/config.schema.json +2 -0
  49. package/dist/universal/.cursor/skills/citable/schemas/cro-report.schema.json +8 -1
  50. package/dist/universal/.cursor/skills/citable/schemas/finding.schema.json +105 -2
  51. package/dist/universal/.cursor/skills/citable/schemas/remediation-verification.schema.json +12 -1
  52. package/dist/universal/.cursor/skills/citable/schemas/run.schema.json +15 -2
  53. package/dist/universal/.cursor/skills/citable/schemas/search-report.schema.json +8 -1
  54. package/dist/universal/.cursor/skills/citable/schemas/summary.schema.json +41 -0
  55. package/dist/universal/.gemini/skills/citable/SKILL.md +11 -2
  56. package/dist/universal/.gemini/skills/citable/VERSION +1 -1
  57. package/dist/universal/.gemini/skills/citable/manifest.json +19 -13
  58. package/dist/universal/.gemini/skills/citable/schemas/action-plan.schema.json +38 -1
  59. package/dist/universal/.gemini/skills/citable/schemas/audit-coverage.schema.json +118 -0
  60. package/dist/universal/.gemini/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  61. package/dist/universal/.gemini/skills/citable/schemas/browser-network-events.schema.json +142 -0
  62. package/dist/universal/.gemini/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  63. package/dist/universal/.gemini/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  64. package/dist/universal/.gemini/skills/citable/schemas/collection-result.schema.json +35 -0
  65. package/dist/universal/.gemini/skills/citable/schemas/config.schema.json +2 -0
  66. package/dist/universal/.gemini/skills/citable/schemas/cro-report.schema.json +8 -1
  67. package/dist/universal/.gemini/skills/citable/schemas/finding.schema.json +105 -2
  68. package/dist/universal/.gemini/skills/citable/schemas/remediation-verification.schema.json +12 -1
  69. package/dist/universal/.gemini/skills/citable/schemas/run.schema.json +15 -2
  70. package/dist/universal/.gemini/skills/citable/schemas/search-report.schema.json +8 -1
  71. package/dist/universal/.gemini/skills/citable/schemas/summary.schema.json +41 -0
  72. package/dist/universal/.github/skills/citable/SKILL.md +11 -2
  73. package/dist/universal/.github/skills/citable/VERSION +1 -1
  74. package/dist/universal/.github/skills/citable/manifest.json +19 -13
  75. package/dist/universal/.github/skills/citable/schemas/action-plan.schema.json +38 -1
  76. package/dist/universal/.github/skills/citable/schemas/audit-coverage.schema.json +118 -0
  77. package/dist/universal/.github/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  78. package/dist/universal/.github/skills/citable/schemas/browser-network-events.schema.json +142 -0
  79. package/dist/universal/.github/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  80. package/dist/universal/.github/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  81. package/dist/universal/.github/skills/citable/schemas/collection-result.schema.json +35 -0
  82. package/dist/universal/.github/skills/citable/schemas/config.schema.json +2 -0
  83. package/dist/universal/.github/skills/citable/schemas/cro-report.schema.json +8 -1
  84. package/dist/universal/.github/skills/citable/schemas/finding.schema.json +105 -2
  85. package/dist/universal/.github/skills/citable/schemas/remediation-verification.schema.json +12 -1
  86. package/dist/universal/.github/skills/citable/schemas/run.schema.json +15 -2
  87. package/dist/universal/.github/skills/citable/schemas/search-report.schema.json +8 -1
  88. package/dist/universal/.github/skills/citable/schemas/summary.schema.json +41 -0
  89. package/dist/universal/.kiro/skills/citable/SKILL.md +11 -2
  90. package/dist/universal/.kiro/skills/citable/VERSION +1 -1
  91. package/dist/universal/.kiro/skills/citable/manifest.json +19 -13
  92. package/dist/universal/.kiro/skills/citable/schemas/action-plan.schema.json +38 -1
  93. package/dist/universal/.kiro/skills/citable/schemas/audit-coverage.schema.json +118 -0
  94. package/dist/universal/.kiro/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  95. package/dist/universal/.kiro/skills/citable/schemas/browser-network-events.schema.json +142 -0
  96. package/dist/universal/.kiro/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  97. package/dist/universal/.kiro/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  98. package/dist/universal/.kiro/skills/citable/schemas/collection-result.schema.json +35 -0
  99. package/dist/universal/.kiro/skills/citable/schemas/config.schema.json +2 -0
  100. package/dist/universal/.kiro/skills/citable/schemas/cro-report.schema.json +8 -1
  101. package/dist/universal/.kiro/skills/citable/schemas/finding.schema.json +105 -2
  102. package/dist/universal/.kiro/skills/citable/schemas/remediation-verification.schema.json +12 -1
  103. package/dist/universal/.kiro/skills/citable/schemas/run.schema.json +15 -2
  104. package/dist/universal/.kiro/skills/citable/schemas/search-report.schema.json +8 -1
  105. package/dist/universal/.kiro/skills/citable/schemas/summary.schema.json +41 -0
  106. package/dist/universal/.opencode/skills/citable/SKILL.md +11 -2
  107. package/dist/universal/.opencode/skills/citable/VERSION +1 -1
  108. package/dist/universal/.opencode/skills/citable/manifest.json +19 -13
  109. package/dist/universal/.opencode/skills/citable/schemas/action-plan.schema.json +38 -1
  110. package/dist/universal/.opencode/skills/citable/schemas/audit-coverage.schema.json +118 -0
  111. package/dist/universal/.opencode/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  112. package/dist/universal/.opencode/skills/citable/schemas/browser-network-events.schema.json +142 -0
  113. package/dist/universal/.opencode/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  114. package/dist/universal/.opencode/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  115. package/dist/universal/.opencode/skills/citable/schemas/collection-result.schema.json +35 -0
  116. package/dist/universal/.opencode/skills/citable/schemas/config.schema.json +2 -0
  117. package/dist/universal/.opencode/skills/citable/schemas/cro-report.schema.json +8 -1
  118. package/dist/universal/.opencode/skills/citable/schemas/finding.schema.json +105 -2
  119. package/dist/universal/.opencode/skills/citable/schemas/remediation-verification.schema.json +12 -1
  120. package/dist/universal/.opencode/skills/citable/schemas/run.schema.json +15 -2
  121. package/dist/universal/.opencode/skills/citable/schemas/search-report.schema.json +8 -1
  122. package/dist/universal/.opencode/skills/citable/schemas/summary.schema.json +41 -0
  123. package/dist/universal/.pi/agent/skills/citable/SKILL.md +11 -2
  124. package/dist/universal/.pi/agent/skills/citable/VERSION +1 -1
  125. package/dist/universal/.pi/agent/skills/citable/manifest.json +19 -13
  126. package/dist/universal/.pi/agent/skills/citable/schemas/action-plan.schema.json +38 -1
  127. package/dist/universal/.pi/agent/skills/citable/schemas/audit-coverage.schema.json +118 -0
  128. package/dist/universal/.pi/agent/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  129. package/dist/universal/.pi/agent/skills/citable/schemas/browser-network-events.schema.json +142 -0
  130. package/dist/universal/.pi/agent/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  131. package/dist/universal/.pi/agent/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  132. package/dist/universal/.pi/agent/skills/citable/schemas/collection-result.schema.json +35 -0
  133. package/dist/universal/.pi/agent/skills/citable/schemas/config.schema.json +2 -0
  134. package/dist/universal/.pi/agent/skills/citable/schemas/cro-report.schema.json +8 -1
  135. package/dist/universal/.pi/agent/skills/citable/schemas/finding.schema.json +105 -2
  136. package/dist/universal/.pi/agent/skills/citable/schemas/remediation-verification.schema.json +12 -1
  137. package/dist/universal/.pi/agent/skills/citable/schemas/run.schema.json +15 -2
  138. package/dist/universal/.pi/agent/skills/citable/schemas/search-report.schema.json +8 -1
  139. package/dist/universal/.pi/agent/skills/citable/schemas/summary.schema.json +41 -0
  140. package/dist/universal/.qoder/skills/citable/SKILL.md +11 -2
  141. package/dist/universal/.qoder/skills/citable/VERSION +1 -1
  142. package/dist/universal/.qoder/skills/citable/manifest.json +19 -13
  143. package/dist/universal/.qoder/skills/citable/schemas/action-plan.schema.json +38 -1
  144. package/dist/universal/.qoder/skills/citable/schemas/audit-coverage.schema.json +118 -0
  145. package/dist/universal/.qoder/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  146. package/dist/universal/.qoder/skills/citable/schemas/browser-network-events.schema.json +142 -0
  147. package/dist/universal/.qoder/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  148. package/dist/universal/.qoder/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  149. package/dist/universal/.qoder/skills/citable/schemas/collection-result.schema.json +35 -0
  150. package/dist/universal/.qoder/skills/citable/schemas/config.schema.json +2 -0
  151. package/dist/universal/.qoder/skills/citable/schemas/cro-report.schema.json +8 -1
  152. package/dist/universal/.qoder/skills/citable/schemas/finding.schema.json +105 -2
  153. package/dist/universal/.qoder/skills/citable/schemas/remediation-verification.schema.json +12 -1
  154. package/dist/universal/.qoder/skills/citable/schemas/run.schema.json +15 -2
  155. package/dist/universal/.qoder/skills/citable/schemas/search-report.schema.json +8 -1
  156. package/dist/universal/.qoder/skills/citable/schemas/summary.schema.json +41 -0
  157. package/dist/universal/.rovodev/skills/citable/SKILL.md +11 -2
  158. package/dist/universal/.rovodev/skills/citable/VERSION +1 -1
  159. package/dist/universal/.rovodev/skills/citable/manifest.json +19 -13
  160. package/dist/universal/.rovodev/skills/citable/schemas/action-plan.schema.json +38 -1
  161. package/dist/universal/.rovodev/skills/citable/schemas/audit-coverage.schema.json +118 -0
  162. package/dist/universal/.rovodev/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  163. package/dist/universal/.rovodev/skills/citable/schemas/browser-network-events.schema.json +142 -0
  164. package/dist/universal/.rovodev/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  165. package/dist/universal/.rovodev/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  166. package/dist/universal/.rovodev/skills/citable/schemas/collection-result.schema.json +35 -0
  167. package/dist/universal/.rovodev/skills/citable/schemas/config.schema.json +2 -0
  168. package/dist/universal/.rovodev/skills/citable/schemas/cro-report.schema.json +8 -1
  169. package/dist/universal/.rovodev/skills/citable/schemas/finding.schema.json +105 -2
  170. package/dist/universal/.rovodev/skills/citable/schemas/remediation-verification.schema.json +12 -1
  171. package/dist/universal/.rovodev/skills/citable/schemas/run.schema.json +15 -2
  172. package/dist/universal/.rovodev/skills/citable/schemas/search-report.schema.json +8 -1
  173. package/dist/universal/.rovodev/skills/citable/schemas/summary.schema.json +41 -0
  174. package/dist/universal/.trae/skills/citable/SKILL.md +11 -2
  175. package/dist/universal/.trae/skills/citable/VERSION +1 -1
  176. package/dist/universal/.trae/skills/citable/manifest.json +19 -13
  177. package/dist/universal/.trae/skills/citable/schemas/action-plan.schema.json +38 -1
  178. package/dist/universal/.trae/skills/citable/schemas/audit-coverage.schema.json +118 -0
  179. package/dist/universal/.trae/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  180. package/dist/universal/.trae/skills/citable/schemas/browser-network-events.schema.json +142 -0
  181. package/dist/universal/.trae/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  182. package/dist/universal/.trae/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  183. package/dist/universal/.trae/skills/citable/schemas/collection-result.schema.json +35 -0
  184. package/dist/universal/.trae/skills/citable/schemas/config.schema.json +2 -0
  185. package/dist/universal/.trae/skills/citable/schemas/cro-report.schema.json +8 -1
  186. package/dist/universal/.trae/skills/citable/schemas/finding.schema.json +105 -2
  187. package/dist/universal/.trae/skills/citable/schemas/remediation-verification.schema.json +12 -1
  188. package/dist/universal/.trae/skills/citable/schemas/run.schema.json +15 -2
  189. package/dist/universal/.trae/skills/citable/schemas/search-report.schema.json +8 -1
  190. package/dist/universal/.trae/skills/citable/schemas/summary.schema.json +41 -0
  191. package/dist/universal/.trae-cn/skills/citable/SKILL.md +11 -2
  192. package/dist/universal/.trae-cn/skills/citable/VERSION +1 -1
  193. package/dist/universal/.trae-cn/skills/citable/manifest.json +19 -13
  194. package/dist/universal/.trae-cn/skills/citable/schemas/action-plan.schema.json +38 -1
  195. package/dist/universal/.trae-cn/skills/citable/schemas/audit-coverage.schema.json +118 -0
  196. package/dist/universal/.trae-cn/skills/citable/schemas/browser-evidence-plan.schema.json +186 -3
  197. package/dist/universal/.trae-cn/skills/citable/schemas/browser-network-events.schema.json +142 -0
  198. package/dist/universal/.trae-cn/skills/citable/schemas/browser-runtime-events.schema.json +112 -0
  199. package/dist/universal/.trae-cn/skills/citable/schemas/browser-state-observations.schema.json +97 -0
  200. package/dist/universal/.trae-cn/skills/citable/schemas/collection-result.schema.json +35 -0
  201. package/dist/universal/.trae-cn/skills/citable/schemas/config.schema.json +2 -0
  202. package/dist/universal/.trae-cn/skills/citable/schemas/cro-report.schema.json +8 -1
  203. package/dist/universal/.trae-cn/skills/citable/schemas/finding.schema.json +105 -2
  204. package/dist/universal/.trae-cn/skills/citable/schemas/remediation-verification.schema.json +12 -1
  205. package/dist/universal/.trae-cn/skills/citable/schemas/run.schema.json +15 -2
  206. package/dist/universal/.trae-cn/skills/citable/schemas/search-report.schema.json +8 -1
  207. package/dist/universal/.trae-cn/skills/citable/schemas/summary.schema.json +41 -0
  208. package/dist/universal/manifest.json +232 -160
  209. package/package.json +1 -1
  210. package/schemas/action-plan.schema.json +38 -1
  211. package/schemas/audit-coverage.schema.json +118 -0
  212. package/schemas/browser-evidence-plan.schema.json +186 -3
  213. package/schemas/browser-network-events.schema.json +142 -0
  214. package/schemas/browser-runtime-events.schema.json +112 -0
  215. package/schemas/browser-state-observations.schema.json +97 -0
  216. package/schemas/collection-result.schema.json +35 -0
  217. package/schemas/config.schema.json +2 -0
  218. package/schemas/cro-report.schema.json +8 -1
  219. package/schemas/finding.schema.json +105 -2
  220. package/schemas/remediation-verification.schema.json +12 -1
  221. package/schemas/run.schema.json +15 -2
  222. package/schemas/search-report.schema.json +8 -1
  223. package/schemas/summary.schema.json +41 -0
  224. package/skill/SKILL.md +11 -2
  225. package/src/acceptance/reproducibility.js +5 -25
  226. package/src/analysis/croRoadmap.js +3 -3
  227. package/src/analysis/strategicRoadmap.js +3 -3
  228. package/src/artifacts/interchange.js +2 -6
  229. package/src/cli/index.js +15 -3
  230. package/src/commands/actionPlan.js +46 -5
  231. package/src/commands/applyRemediation.js +5 -5
  232. package/src/commands/audit.js +75 -8
  233. package/src/commands/ciWorkflow.js +7 -2
  234. package/src/commands/compareSnapshots.js +155 -47
  235. package/src/commands/connect.js +24 -4
  236. package/src/commands/context.js +41 -2
  237. package/src/commands/croSuite.js +51 -13
  238. package/src/commands/delivery.js +7 -7
  239. package/src/commands/governance.js +9 -10
  240. package/src/commands/implementationKit.js +2 -1
  241. package/src/commands/init.js +8 -1
  242. package/src/commands/previewCro.js +1 -1
  243. package/src/commands/prioritize.js +3 -2
  244. package/src/commands/reviews.js +31 -5
  245. package/src/commands/roadmapCmd.js +7 -13
  246. package/src/commands/sweep.js +15 -2
  247. package/src/commands/verifyRemediation.js +94 -19
  248. package/src/connectors/collectionResult.js +80 -0
  249. package/src/connectors/ga4.js +46 -11
  250. package/src/connectors/gsc.js +41 -6
  251. package/src/connectors/index.js +1 -1
  252. package/src/connectors/webflow.js +140 -10
  253. package/src/connectors/wordpress.js +92 -8
  254. package/src/crawler/fetch.js +220 -24
  255. package/src/crawler/resourceValidity.js +119 -0
  256. package/src/crawler/sitemap.js +435 -16
  257. package/src/crawler/sitemapCollector.js +364 -0
  258. package/src/crawler/urlIdentity.js +97 -0
  259. package/src/detectors/agent.js +11 -0
  260. package/src/detectors/ans.js +16 -1
  261. package/src/detectors/arch.js +6 -0
  262. package/src/detectors/claim.js +9 -0
  263. package/src/detectors/crawl.js +7 -0
  264. package/src/detectors/cro.js +21 -0
  265. package/src/detectors/cwv.js +4 -0
  266. package/src/detectors/entity.js +7 -0
  267. package/src/detectors/evd.js +9 -0
  268. package/src/detectors/framework.js +28 -2
  269. package/src/detectors/geoReco.js +16 -0
  270. package/src/detectors/hreflang.js +3 -0
  271. package/src/detectors/lifeMeas.js +9 -0
  272. package/src/detectors/link.js +6 -1
  273. package/src/detectors/page.js +11 -0
  274. package/src/detectors/schemaData.js +16 -1
  275. package/src/detectors/tech.js +34 -3
  276. package/src/evidence/coverage.js +448 -0
  277. package/src/evidence/determination.js +157 -0
  278. package/src/evidence/downstream.js +110 -0
  279. package/src/evidence/hashes.js +109 -0
  280. package/src/evidence/run.js +68 -8
  281. package/src/extractor/page.js +29 -2
  282. package/src/extractor/site.js +298 -50
  283. package/src/observations/browser/correlation.js +83 -0
  284. package/src/observations/browser/networkCollector.js +413 -0
  285. package/src/observations/browser/runtimeEventCollector.js +337 -0
  286. package/src/observations/browser/sanitizer.js +322 -0
  287. package/src/observations/browser/stateCollector.js +386 -0
  288. package/src/observations/browserJourney.js +131 -3
  289. package/src/reporting/executiveCroReport.js +37 -14
  290. package/src/reporting/executiveExport.js +45 -16
  291. package/src/reporting/executiveSearchReport.js +57 -23
  292. package/src/reporting/report.js +56 -9
  293. package/src/shared/epistemicLanguage.js +86 -0
  294. package/src/shared/evidenceSourceResolver.js +48 -17
  295. package/src/shared/htmlEscape.js +8 -4
  296. package/src/shared/runPackageVerifier.js +99 -8
  297. package/src/shared/verifiedRunLoader.js +129 -0
  298. package/src/sow/generateSow.js +1 -1
@@ -29,6 +29,7 @@ import {
29
29
  } from '../shared/htmlEscape.js';
30
30
  import { extractHostname } from '../shared/domainUtils.js';
31
31
  import { validateAgainst } from '../shared/schemaValidator.js';
32
+ import { assertEpistemicLanguage, hasVerifiedEvidenceScope } from '../shared/epistemicLanguage.js';
32
33
 
33
34
  function formatVal(v, suffix = '') {
34
35
  if (v === null || v === undefined) return 'NOT OBSERVED';
@@ -522,13 +523,20 @@ export async function buildExecutiveCroReport(root, options = {}) {
522
523
 
523
524
  const generationProvenance = {
524
525
  generated_at: generatedAt,
525
- generator_version: '1.18.2',
526
+ generator_version: '1.19.0',
526
527
  generation_mode: resolved.generation_mode,
527
528
  source_type: resolved.source_type,
528
529
  source_identifier: resolved.source_identifier,
529
530
  source_findings_count: findings.length,
530
531
  integrity_hash: resolved.integrity_hash,
531
532
  synthetic_evidence: isSample,
533
+ package_verified: resolved.package_verified === true,
534
+ integrity_mode: resolved.integrity_mode || 'unknown',
535
+ legacy: resolved.legacy === true,
536
+ coverage_status: resolved.coverage_status || 'indeterminate',
537
+ determination_status: resolved.determination_status || 'indeterminate',
538
+ evaluated: resolved.coverage?.populations?.evaluated ?? null,
539
+ eligible: resolved.coverage?.populations?.eligible ?? null,
532
540
  };
533
541
 
534
542
  const report = {
@@ -542,7 +550,7 @@ export async function buildExecutiveCroReport(root, options = {}) {
542
550
  epistemological_framework: {
543
551
  observation: 'Raw empirical facts measured directly from DOM geometry, HTTP status, or analytics telemetry',
544
552
  hypothesis: 'Testable causal explanations predicting why the observed friction occurs',
545
- causation: 'Statistically verified outcomes demonstrated under controlled A/B experiments with SRM checks',
553
+ causation: 'No current causal outcome is established; controlled A/B experiment evidence is required',
546
554
  unknowns: 'Gaps in telemetry or attribution that require further instrumentation before forming hypotheses',
547
555
  },
548
556
  pillars: {
@@ -588,7 +596,11 @@ export async function buildExecutiveCroReport(root, options = {}) {
588
596
  /**
589
597
  * Render CRO Executive Report as GitHub-flavored Markdown
590
598
  */
591
- export function renderCroReportMarkdown(report) {
599
+ export function renderCroReportMarkdown(report, evidenceContext = null) {
600
+ const context = evidenceContext || report.generation_provenance || {};
601
+ const verifiedScope = hasVerifiedEvidenceScope(context);
602
+ const causalEvidenceVerified = verifiedScope && context.causal_evidence_verified === true;
603
+ const evidenceRegisterTitle = `${verifiedScope ? 'Verified Conversion Evidence Register' : 'Conversion Evidence Register (scope-limited; verified status not established)'}`;
592
604
  const p = report.pillars;
593
605
  const ds = report.decision_summary;
594
606
  const lines = [
@@ -597,7 +609,7 @@ export function renderCroReportMarkdown(report) {
597
609
  `- **Client / Property**: \`${sanitizeForMarkdown(report.client_name)}\` (\`${sanitizeForMarkdown(report.target_domain)}\`)`,
598
610
  `- **Generated At**: \`${report.generated_at}\``,
599
611
  `- **Conversion Readiness Index**: **${report.overall_conversion_readiness} / 100**`,
600
- `- **Evidence Register Traceability**: ${report.evidence_register.length} verified evidence references`,
612
+ `- **Evidence Register Traceability**: ${report.evidence_register.length} evidence references (authority and scope recorded below)`,
601
613
  `- **Generation Mode**: \`${report.generation_provenance.generation_mode}\`${report.generation_provenance.synthetic_evidence ? ' *(Synthetic Demo Evidence)*' : ''}`,
602
614
  ``,
603
615
  `> **Scientific Epistemology & Governance Notice**: Citable enforces a strict separation between **Observable Facts**, **Predictive Hypotheses**, and **Causal Evidence**. In adherence to empirical governance, **no conversion rates, ARR lift, or metric improvements are guaranteed**.`,
@@ -613,8 +625,8 @@ export function renderCroReportMarkdown(report) {
613
625
  `*(Testable causal predictions requiring validation under controlled experimentation)*`,
614
626
  ...ds.evidence_supported_hypotheses.map((h) => `- [ ] **[HYPOTHESIS]** ${sanitizeForMarkdown(h)}`),
615
627
  ``,
616
- `### 3. Causal Findings (Verified Under Controlled Experiments)`,
617
- `*(Demonstrated metric shifts under A/B testing with Sample Ratio Mismatch guardrails)*`,
628
+ `### 3. ${causalEvidenceVerified ? 'Causal Findings (Verified Under Controlled Experiments)' : 'Causal Findings (Causal Evidence Not Established)'}`,
629
+ `*(${causalEvidenceVerified ? 'Demonstrated metric shifts under A/B testing with Sample Ratio Mismatch guardrails' : 'No current causal outcome is established from this report; controlled experiment evidence is required'})*`,
618
630
  ...ds.causal_findings.map((c) => `- [=] **[CAUSAL]** ${sanitizeForMarkdown(c)}`),
619
631
  ``,
620
632
  `### 4. Critical Unresolved Unknowns (Measurement Gaps)`,
@@ -694,7 +706,7 @@ export function renderCroReportMarkdown(report) {
694
706
  `- **Evidence Link**: \`${p[15].data.evidence_ref}\``,
695
707
  ...(p[15].data.top_customer_objections || []).map((o) => `- "${sanitizeForMarkdown(o)}"`),
696
708
  ``,
697
- `## 15. Verified Conversion Evidence Register`,
709
+ `## 15. ${evidenceRegisterTitle}`,
698
710
  `| Evidence ID | Source Channel | Methodology | Confidence | Observation Date |`,
699
711
  `| :--- | :--- | :--- | :--- | :--- |`,
700
712
  ...report.evidence_register.map((e) => `| **${e.evidence_id}** | \`${escapeMarkdownTableCell(e.source)}\` | ${escapeMarkdownTableCell((e.methodology || '').slice(0, 50))}... | \`${e.confidence_level}\` | ${e.observation_date} |`),
@@ -720,16 +732,24 @@ export function renderCroReportMarkdown(report) {
720
732
  ``,
721
733
  ];
722
734
 
723
- return lines.join('\n');
735
+ const rendered = lines.join('\n');
736
+ assertEpistemicLanguage(rendered, { ...context, package_verified: context.package_verified === true });
737
+ return rendered;
724
738
  }
725
739
 
726
740
  /**
727
741
  * Render CRO Executive Report as Standalone Enterprise HTML
728
742
  */
729
- export function renderCroReportHtml(report) {
743
+ export function renderCroReportHtml(report, evidenceContext = null) {
730
744
  const p = report.pillars;
731
745
  const ds = report.decision_summary;
732
- return `<!DOCTYPE html>
746
+ const context = evidenceContext || report.generation_provenance || {};
747
+ const verifiedScope = hasVerifiedEvidenceScope(context);
748
+ const causalEvidenceVerified = verifiedScope && context.causal_evidence_verified === true;
749
+ const evidenceRegisterTitle = verifiedScope
750
+ ? 'Verified Conversion Evidence Register'
751
+ : 'Conversion Evidence Register (scope-limited; verified status not established)';
752
+ const rendered = `<!DOCTYPE html>
733
753
  <html lang="en">
734
754
  <head>
735
755
  <meta charset="UTF-8">
@@ -817,13 +837,13 @@ export function renderCroReportHtml(report) {
817
837
 
818
838
  <div class="epistemic-box" style="border-left: 4px solid var(--accent-light);">
819
839
  <span class="epistemic-tag badge-causal">Causal Findings</span>
820
- <p style="font-size:12px; color:var(--muted); margin: 0 0 8px 0;">Statistically verified outcomes verified under controlled A/B experiments with SRM checks.</p>
840
+ <p style="font-size:12px; color:var(--muted); margin: 0 0 8px 0;">${causalEvidenceVerified ? 'Statistically verified outcomes under controlled A/B experiments with SRM checks.' : 'Causal evidence is not established; controlled A/B experiment evidence is required.'}</p>
821
841
  <ul>
822
842
  ${ds.causal_findings.map((c) => `<li>${escapeHtml(c)}</li>`).join('')}
823
843
  </ul>
824
844
  </div>
825
845
 
826
- <h2 class="section-title">Verified Conversion Evidence Register (${report.evidence_register.length} Observations)</h2>
846
+ <h2 class="section-title">${evidenceRegisterTitle} (${report.evidence_register.length} Observations)</h2>
827
847
  <table>
828
848
  <thead>
829
849
  <tr>
@@ -858,6 +878,8 @@ export function renderCroReportHtml(report) {
858
878
  </div>
859
879
  </body>
860
880
  </html>`;
881
+ assertEpistemicLanguage(rendered, { ...context, package_verified: context.package_verified === true });
882
+ return rendered;
861
883
  }
862
884
 
863
885
  /**
@@ -865,15 +887,16 @@ export function renderCroReportHtml(report) {
865
887
  */
866
888
  export async function exportExecutiveCroReport(root, options = {}) {
867
889
  const report = await buildExecutiveCroReport(root, options);
890
+ const evidenceContext = report.generation_provenance;
868
891
  const format = options.format || 'markdown';
869
892
  let content = '';
870
893
 
871
894
  if (format === 'html' || format === 'html-brief') {
872
- content = renderCroReportHtml(report);
895
+ content = renderCroReportHtml(report, evidenceContext);
873
896
  } else if (format === 'json') {
874
897
  content = JSON.stringify(report, null, 2);
875
898
  } else {
876
- content = renderCroReportMarkdown(report);
899
+ content = renderCroReportMarkdown(report, evidenceContext);
877
900
  }
878
901
 
879
902
  let outputPath = null;
@@ -3,6 +3,9 @@ import path from "node:path";
3
3
  import { readJson } from "../shared/io.js";
4
4
  import { exportExecutiveSearchReport, buildExecutiveSearchReport, renderSearchReportMarkdown, renderSearchReportHtml } from "./executiveSearchReport.js";
5
5
  import { exportExecutiveCroReport, buildExecutiveCroReport, renderCroReportMarkdown, renderCroReportHtml } from "./executiveCroReport.js";
6
+ import { downstreamEnvelope } from '../evidence/downstream.js';
7
+ import { loadVerifiedRun } from '../shared/verifiedRunLoader.js';
8
+ import { assertEpistemicLanguage, evidenceScopeStatement } from '../shared/epistemicLanguage.js';
6
9
 
7
10
  export {
8
11
  exportExecutiveSearchReport,
@@ -78,7 +81,7 @@ export async function exportExecutiveReport(root, runId, {
78
81
  }
79
82
 
80
83
  const runsDir = path.join(root, ".citable", "runs");
81
- let targetRun = runId;
84
+ let targetRun = runId && fs.existsSync(path.join(root, '.citable', 'runs', runId)) ? runId : null;
82
85
 
83
86
  if (!targetRun && fs.existsSync(runsDir)) {
84
87
  const runs = fs.readdirSync(runsDir).filter((d) => !d.startsWith("."));
@@ -86,23 +89,41 @@ export async function exportExecutiveReport(root, runId, {
86
89
  }
87
90
 
88
91
  let summary = {
89
- counts: { critical: 0, high: 2, medium: 4, low: 1 },
92
+ counts: { critical: 0, high: 0, medium: 0, low: 0 },
90
93
  posture: { retrieval: "eligible", support: "suitable", citation: "observed" },
94
+ coverage_status: 'indeterminate',
95
+ determination_status: 'indeterminate',
91
96
  };
92
97
  let findings = [];
98
+ let coverage = null;
99
+ let packageVerified = false;
93
100
 
94
101
  if (targetRun) {
95
- const sumPath = path.join(runsDir, targetRun, "summary.json");
96
- if (fs.existsSync(sumPath)) {
97
- try { summary = readJson(sumPath); } catch {}
98
- }
99
- const findPath = path.join(runsDir, targetRun, "findings.json");
100
- if (fs.existsSync(findPath)) {
101
- try { findings = readJson(findPath); } catch {}
102
- }
102
+ const loaded = loadVerifiedRun(path.join(runsDir, targetRun), { requireCompletedExecution: false, allowLegacy: true, requireCoverage: false });
103
+ summary = loaded.summary || summary;
104
+ findings = loaded.findings;
105
+ coverage = loaded.coverage;
106
+ packageVerified = loaded.verified === true && loaded.integrity_mode === 'sealed';
107
+ summary.coverage_status = loaded.coverage_status;
108
+ summary.determination_status = loaded.determination_status;
103
109
  }
104
110
 
111
+ const evidence = downstreamEnvelope(coverage);
112
+ summary.coverage_status = evidence.coverage_status;
113
+ summary.determination_status = evidence.determination_status;
114
+ summary.coverage = {
115
+ ...evidence.evidence_scope,
116
+ limitations: evidence.limitations,
117
+ };
118
+
105
119
  let content = "";
120
+ const evidenceNotice = `Evidence determination: ${summary.determination_status} (coverage: ${summary.coverage_status}; evaluated ${summary.coverage.evaluated ?? 0} of ${summary.coverage.eligible ?? 'unknown'} eligible). ${summary.coverage.limitations.join('; ') || evidenceScopeStatement({
121
+ coverage_status: summary.coverage_status,
122
+ determination_status: summary.determination_status,
123
+ evaluated: summary.coverage.evaluated,
124
+ eligible: summary.coverage.eligible,
125
+ package_verified: packageVerified,
126
+ })}`;
106
127
 
107
128
  if (format === "html-brief") {
108
129
  content = `<!DOCTYPE html>
@@ -136,6 +157,7 @@ export async function exportExecutiveReport(root, runId, {
136
157
  <div class="disclosure">
137
158
  <strong>Regulatory & Governance Notice:</strong> Citable measures observable retrieval suitability, source extraction fidelity, and external AI citation outcomes. Citable does not guarantee search crawling, indexing, ranking, citation, recommendation, or conversion.
138
159
  </div>
160
+ <p class="disclosure"><strong>${evidenceNotice}</strong></p>
139
161
 
140
162
  <div class="kpi-grid">
141
163
  <div class="kpi-card"><div>Critical Risks</div><div class="kpi-val ${(summary.counts?.critical || 0) > 0 ? "crit" : "healthy"}">${summary.counts?.critical || 0}</div></div>
@@ -150,10 +172,7 @@ export async function exportExecutiveReport(root, runId, {
150
172
  <tr><th>Detector</th><th>Severity</th><th>Summary</th><th>Required Remediation</th></tr>
151
173
  </thead>
152
174
  <tbody>
153
- ${(findings.length > 0 ? findings : [
154
- { detector_id: "CRO-015", severity: "low", summary: "Mobile touch target below 44px on primary CTA", remediation: "Increase button min-height to 48px" },
155
- { detector_id: "GEO-008", severity: "high", summary: "Attribution distortion in AI search citation", remediation: "Corroborate claims directly on landing page" },
156
- ]).map((f) => `
175
+ ${(findings.length > 0 ? findings : [{ detector_id: "—", severity: "informational", summary: evidenceNotice, remediation: "Collect sufficient evidence before drawing a site-wide determination" }]).map((f) => `
157
176
  <tr>
158
177
  <td><code>${f.detector_id}</code></td>
159
178
  <td><span class="badge badge-${f.severity}">${f.severity.toUpperCase()}</span></td>
@@ -174,11 +193,13 @@ export async function exportExecutiveReport(root, runId, {
174
193
  - **High Severity Findings**: ${summary.counts?.high || 0}
175
194
  - **Medium Severity Findings**: ${summary.counts?.medium || 0}
176
195
 
196
+ > **${evidenceNotice}** Findings remain limited to the evaluated evidence scope.
197
+
177
198
  > Citable does not guarantee crawling, indexing, ranking, citation, or conversion.
178
199
 
179
200
  <!-- slide -->
180
201
  ## Prioritized Action Items
181
- ${findings.slice(0, 5).map((f) => `- **[${f.detector_id}]** (${f.severity}): ${f.summary}`).join("\n") || "- No blocking findings detected."}
202
+ ${findings.slice(0, 5).map((f) => `- **[${f.detector_id}]** (${f.severity}): ${f.summary}`).join("\n") || `- No determination established from the available evidence (${summary.determination_status || 'indeterminate'}).`}
182
203
  `;
183
204
  } else if (format === "slides") {
184
205
  const fsa = findings.reduce((acc, f) => {
@@ -263,7 +284,7 @@ ${findings.slice(0, 5).map((f) => `- **[${f.detector_id}]** (${f.severity}): ${f
263
284
  <h2>Prioritized Remediations</h2>
264
285
  <p>Every finding maps directly to a production-ready, accessible Nebula Component:</p>
265
286
  <div style="background:#1e293b; border-radius:0.75rem; padding:1.5rem; border:1px solid #334155;">
266
- ${findings.slice(0, 4).map((f) => `<div style="padding:0.5rem 0; border-bottom:1px solid #334155; font-size:1.1rem;"><strong>[${f.detector_id || "CRO"}]</strong>: ${f.summary || "Conversion action friction"}</div>`).join("") || "<p>All conversion pathways verified clean.</p>"}
287
+ ${findings.slice(0, 4).map((f) => `<div style="padding:0.5rem 0; border-bottom:1px solid #334155; font-size:1.1rem;"><strong>[${f.detector_id || "CRO"}]</strong>: ${f.summary || "Conversion action friction"}</div>`).join("") || `<p>No determination established from the available evidence (${summary.determination_status || 'indeterminate'}).</p>`}
267
288
  </div>
268
289
  <div style="margin-top:1.5rem; font-family:monospace; background:#0f172a; padding:1rem; border-radius:0.5rem; border:1px solid #334155; color:#38bdf8;">
269
290
  $ npx @nebulacomponents/citable remediate --finding CRO-007 --write
@@ -300,6 +321,14 @@ ${findings.slice(0, 5).map((f) => `- **[${f.detector_id}]** (${f.severity}): ${f
300
321
  fs.writeFileSync(path.resolve(root, output), content, "utf8");
301
322
  }
302
323
 
324
+ const languageContext = {
325
+ coverage_status: summary.coverage_status,
326
+ determination_status: summary.determination_status,
327
+ evaluated: summary.coverage.evaluated,
328
+ eligible: summary.coverage.eligible,
329
+ package_verified: packageVerified,
330
+ };
331
+ assertEpistemicLanguage(content, languageContext);
303
332
  return {
304
333
  format,
305
334
  client_name: clientName,
@@ -31,6 +31,7 @@ import {
31
31
  } from '../shared/htmlEscape.js';
32
32
  import { extractHostname } from '../shared/domainUtils.js';
33
33
  import { validateAgainst } from '../shared/schemaValidator.js';
34
+ import { assertEpistemicLanguage, hasVerifiedEvidenceScope } from '../shared/epistemicLanguage.js';
34
35
 
35
36
  function formatVal(v, suffix = '') {
36
37
  if (v === null || v === undefined) return 'NOT OBSERVED';
@@ -613,13 +614,20 @@ export async function buildExecutiveSearchReport(root, options = {}) {
613
614
 
614
615
  const generationProvenance = {
615
616
  generated_at: generatedAt,
616
- generator_version: '1.18.2',
617
+ generator_version: '1.19.0',
617
618
  generation_mode: resolved.generation_mode,
618
619
  source_type: resolved.source_type,
619
620
  source_identifier: resolved.source_identifier,
620
621
  source_findings_count: findings.length,
621
622
  integrity_hash: resolved.integrity_hash,
622
623
  synthetic_evidence: isSample,
624
+ package_verified: resolved.package_verified === true,
625
+ integrity_mode: resolved.integrity_mode || 'unknown',
626
+ legacy: resolved.legacy === true,
627
+ coverage_status: resolved.coverage_status || 'indeterminate',
628
+ determination_status: resolved.determination_status || 'indeterminate',
629
+ evaluated: resolved.coverage?.populations?.evaluated ?? null,
630
+ eligible: resolved.coverage?.populations?.eligible ?? null,
623
631
  };
624
632
 
625
633
  const report = {
@@ -667,7 +675,15 @@ export async function buildExecutiveSearchReport(root, options = {}) {
667
675
  /**
668
676
  * Render Search Executive Report as GitHub-flavored Markdown
669
677
  */
670
- export function renderSearchReportMarkdown(report) {
678
+ export function renderSearchReportMarkdown(report, evidenceContext = null) {
679
+ const context = evidenceContext || report.generation_provenance || {};
680
+ const verifiedScope = hasVerifiedEvidenceScope(context);
681
+ const scopedValue = (value) => {
682
+ if (!verifiedScope && typeof value === 'string' && /\b(?:verified|clean|resolved|optimal|passed)\b|(?:verified_source|clean_profile)/i.test(value)) return 'NOT ESTABLISHED';
683
+ return value;
684
+ };
685
+ const scopedFormat = (value, suffix = '') => scopedValue(formatVal(value, suffix));
686
+ const evidenceRegisterTitle = `${verifiedScope ? 'Verified Evidence Register' : 'Evidence Register (scope-limited; verified status not established)'} (Traceability Engine)`;
671
687
  const p = report.pillars;
672
688
  const lines = [
673
689
  `# ${sanitizeForMarkdown(report.report_title)}`,
@@ -675,7 +691,7 @@ export function renderSearchReportMarkdown(report) {
675
691
  `- **Client / Property**: \`${sanitizeForMarkdown(report.client_name)}\` (\`${sanitizeForMarkdown(report.target_domain)}\`)`,
676
692
  `- **Generated At**: \`${report.generated_at}\``,
677
693
  `- **Overall Search & AEO Readiness Score**: **${report.overall_readiness_score} / 100**`,
678
- `- **Evidence Register Traceability**: ${report.evidence_register.length} verified evidence references`,
694
+ `- **Evidence Register Traceability**: ${report.evidence_register.length} evidence references (authority and scope recorded below)`,
679
695
  `- **Generation Mode**: \`${report.generation_provenance.generation_mode}\`${report.generation_provenance.synthetic_evidence ? ' *(Synthetic Demo Evidence)*' : ''}`,
680
696
  ``,
681
697
  `> **Operating Premise & Governance Notice**: This executive report presents observable technical search infrastructure, content extraction posture, and controlled citation behavior. In adherence to Citable governance principles, **no search ranking, AI citation, or conversion outcomes are guaranteed**.`,
@@ -684,7 +700,7 @@ export function renderSearchReportMarkdown(report) {
684
700
  `## Executive Decision Summary (Traceable Conclusions)`,
685
701
  ``,
686
702
  `### 1. Confirmed Findings (Deterministic Observations)`,
687
- ...report.decision_summary.confirmed_findings.map((f) => `- [x] **[VERIFIED]** ${sanitizeForMarkdown(f)}`),
703
+ ...report.decision_summary.confirmed_findings.map((f) => `- [x] **[OBSERVED]** ${sanitizeForMarkdown(f)}`),
688
704
  ``,
689
705
  `### 2. Inferred Opportunities (Modeled Projections)`,
690
706
  ...report.decision_summary.inferred_opportunities.map((o) => `- [ ] **[OPPORTUNITY]** ${sanitizeForMarkdown(o)}`),
@@ -703,13 +719,13 @@ export function renderSearchReportMarkdown(report) {
703
719
  `- **Evidence Link**: \`${p[1].data.evidence_ref}\``,
704
720
  `- **Google Organic Indexing**: ${formatVal(p[1].data.google_organic?.indexed_status).toUpperCase()}`,
705
721
  `- **Google AI Overviews**: ${formatVal(p[1].data.google_ai_overviews?.inclusion_rate_pct, '%')} inclusion rate (Risk: \`${formatVal(p[1].data.google_ai_overviews?.risk_exposure)}\`)`,
706
- `- **AI Engine Presence**: Perplexity (\`${formatVal(p[1].data.ai_answer_engines?.perplexity)}\`), ChatGPT (\`${formatVal(p[1].data.ai_answer_engines?.chatgpt_search)}\`), Copilot (\`${formatVal(p[1].data.ai_answer_engines?.copilot)}\`)`,
722
+ `- **AI Engine Presence**: Perplexity (\`${scopedFormat(p[1].data.ai_answer_engines?.perplexity)}\`), ChatGPT (\`${scopedFormat(p[1].data.ai_answer_engines?.chatgpt_search)}\`), Copilot (\`${scopedFormat(p[1].data.ai_answer_engines?.copilot)}\`)`,
707
723
  ``,
708
724
  `## 2. Technical Search Infrastructure & Core Web Vitals`,
709
725
  `- **Evidence Link**: \`${p[2].data.evidence_ref}\``,
710
- `- **Crawlability & Canonicals**: ${formatVal(p[2].data.canonical_integrity).toUpperCase()}`,
711
- `- **LCP Readiness**: ${formatVal(p[2].data.core_web_vitals?.lcp_status).toUpperCase()} (${formatVal(p[2].data.core_web_vitals?.render_blocking_scripts)} render-blocking assets)`,
712
- `- **CLS Readiness**: ${formatVal(p[2].data.core_web_vitals?.cls_status).toUpperCase()} (${formatVal(p[2].data.core_web_vitals?.unsized_images)} unsized images)`,
726
+ `- **Crawlability & Canonicals**: ${scopedFormat(p[2].data.canonical_integrity).toUpperCase()}`,
727
+ `- **LCP Readiness**: ${scopedFormat(p[2].data.core_web_vitals?.lcp_status).toUpperCase()} (${formatVal(p[2].data.core_web_vitals?.render_blocking_scripts)} render-blocking assets)`,
728
+ `- **CLS Readiness**: ${scopedFormat(p[2].data.core_web_vitals?.cls_status).toUpperCase()} (${formatVal(p[2].data.core_web_vitals?.unsized_images)} unsized images)`,
713
729
  ``,
714
730
  `## 3. Organic Performance & Search Intent Analysis`,
715
731
  `- **Evidence Link**: \`${p[3].data.evidence_ref}\``,
@@ -724,7 +740,7 @@ export function renderSearchReportMarkdown(report) {
724
740
  ``,
725
741
  `## 5. AEO Readiness Assessment (Answer Engine Optimization)`,
726
742
  `- **Evidence Link**: \`${p[5].data.evidence_ref}\``,
727
- `- **Overall AEO Readiness Score**: **${formatVal(p[5].data.readiness_score)} / 100** (${formatVal(p[5].data.status).toUpperCase()})`,
743
+ `- **Overall AEO Readiness Score**: **${formatVal(p[5].data.readiness_score)} / 100** (${scopedFormat(p[5].data.status).toUpperCase()})`,
728
744
  `- **Direct Answer Density**: ${formatVal(p[5].data.direct_extract_density)}`,
729
745
  ``,
730
746
  `## 6. GEO Assessment (Generative Engine Optimization)`,
@@ -743,7 +759,7 @@ export function renderSearchReportMarkdown(report) {
743
759
  `## 8. Entity & Knowledge Graph Integrity`,
744
760
  `- **Evidence Link**: \`${p[8].data.evidence_ref}\``,
745
761
  `- **Organization Node Resolved**: ${p[8].data.organization_node_resolved ? 'YES' : 'NO'}`,
746
- `- **External Corroboration**: ${formatVal(p[8].data.wikidata_corroboration).toUpperCase()}`,
762
+ `- **External Corroboration**: ${scopedFormat(p[8].data.wikidata_corroboration).toUpperCase()}`,
747
763
  ``,
748
764
  `## 9. Structured-Data & Schema Architecture`,
749
765
  `- **Evidence Link**: \`${p[9].data.evidence_ref}\``,
@@ -753,12 +769,12 @@ export function renderSearchReportMarkdown(report) {
753
769
  `## 10. Competitive Search Intelligence & Share of Voice`,
754
770
  `- **Evidence Link**: \`${p[10].data.evidence_ref}\``,
755
771
  `- **1st-Party Citation Share**: **${formatVal(p[10].data.first_party_citation_share_pct, '%')}** vs Competitors (${formatVal(p[10].data.top_competitor_share_pct, '%')})`,
756
- `- **Primary Gap**: ${formatVal(p[10].data.primary_authority_gap)}`,
772
+ `- **Primary Gap**: ${scopedFormat(p[10].data.primary_authority_gap)}`,
757
773
  ``,
758
774
  `## 11. Backlink & Off-Page Authority Profile`,
759
775
  `- **Evidence Link**: \`${p[11].data.evidence_ref}\``,
760
776
  `- **Referring Domains**: ${formatVal(p[11].data.referring_domains)} (Authority Score: ${formatVal(p[11].data.authority_score)}/100)`,
761
- `- **Toxic Domains**: ${formatVal(p[11].data.toxic_domain_count)} flagged (\`${formatVal(p[11].data.disavow_recommendation)}\`)`,
777
+ `- **Toxic Domains**: ${formatVal(p[11].data.toxic_domain_count)} flagged (\`${scopedFormat(p[11].data.disavow_recommendation)}\`)`,
762
778
  ``,
763
779
  `## 12. Search Demand & Addressable Market Opportunity`,
764
780
  ];
@@ -782,11 +798,11 @@ export function renderSearchReportMarkdown(report) {
782
798
  `- **Assisted Conversions Share**: ${formatVal(p[13].data.assisted_conversions_share_pct, '%')}`,
783
799
  ``,
784
800
  `## 14. Measurement Integrity & Analytics Instrumentation`,
785
- `- **GA4 & GSC**: ${formatVal(p[14].data.ga4_instrumentation).toUpperCase()} / ${formatVal(p[14].data.gsc_property_binding).toUpperCase()}`,
801
+ `- **GA4 & GSC**: ${formatVal(scopedValue(p[14].data.ga4_instrumentation)).toUpperCase()} / ${formatVal(scopedValue(p[14].data.gsc_property_binding)).toUpperCase()}`,
786
802
  `- **Consent Mode Data Loss**: ${formatVal(p[14].data.consent_mode_v2_loss_pct, '%')}`,
787
803
  `- **Limitations**: ${(p[14].data.known_limitations || []).map((l) => sanitizeForMarkdown(l)).join('; ')}`,
788
804
  ``,
789
- `## 15. Verified Evidence Register (Traceability Engine)`,
805
+ `## 15. ${evidenceRegisterTitle}`,
790
806
  `| Evidence ID | Source | Methodology | Confidence | Observation Date |`,
791
807
  `| :--- | :--- | :--- | :--- | :--- |`,
792
808
  ...report.evidence_register.map((e) => `| **${e.evidence_id}** | \`${escapeMarkdownTableCell(e.source)}\` | ${escapeMarkdownTableCell((e.methodology || '').slice(0, 50))}... | \`${e.confidence_level}\` | ${e.observation_date} |`),
@@ -806,15 +822,30 @@ export function renderSearchReportMarkdown(report) {
806
822
  ``
807
823
  );
808
824
 
809
- return lines.join('\n');
825
+ const rendered = lines.join('\n');
826
+ assertEpistemicLanguage(rendered, { ...context, package_verified: context.package_verified === true });
827
+ return rendered;
810
828
  }
811
829
 
812
830
  /**
813
831
  * Render Search Executive Report as Standalone Enterprise HTML
814
832
  */
815
- export function renderSearchReportHtml(report) {
833
+ export function renderSearchReportHtml(report, evidenceContext = null) {
816
834
  const p = report.pillars;
817
- return `<!DOCTYPE html>
835
+ const context = evidenceContext || report.generation_provenance || {};
836
+ const verifiedScope = hasVerifiedEvidenceScope(context);
837
+ const evidenceRegisterTitle = verifiedScope
838
+ ? 'Verified Evidence Register'
839
+ : 'Evidence Register (scope-limited; verified status not established)';
840
+ const readinessLabel = verifiedScope ? (report.overall_readiness_score >= 70 ? 'Strong observed posture' : 'Needs optimization') : 'Not established';
841
+ const cwvLabel = verifiedScope && p[2].data.core_web_vitals?.render_blocking_scripts === 0 ? 'No flagged blockers' : 'Not established';
842
+ const scopedFormat = (value, suffix = '') => {
843
+ const rendered = formatVal(value, suffix);
844
+ return !verifiedScope && typeof rendered === 'string' && /\b(?:verified|clean|resolved|optimal|passed)\b|(?:verified_source|clean_profile)/i.test(rendered)
845
+ ? 'NOT ESTABLISHED'
846
+ : rendered;
847
+ };
848
+ const rendered = `<!DOCTYPE html>
818
849
  <html lang="en">
819
850
  <head>
820
851
  <meta charset="UTF-8">
@@ -861,12 +892,12 @@ export function renderSearchReportHtml(report) {
861
892
  <div class="card">
862
893
  <div style="font-size:12px; color:var(--muted); text-transform:uppercase;">Composite Search Readiness</div>
863
894
  <div class="card-num">${report.overall_readiness_score} / 100</div>
864
- <span class="badge ${report.overall_readiness_score >= 70 ? 'badge-success' : 'badge-warning'}">${report.overall_readiness_score >= 70 ? 'Optimal' : 'Needs Optimization'}</span>
895
+ <span class="badge ${verifiedScope && report.overall_readiness_score >= 70 ? 'badge-success' : 'badge-warning'}">${readinessLabel}</span>
865
896
  </div>
866
897
  <div class="card">
867
898
  <div style="font-size:12px; color:var(--muted); text-transform:uppercase;">AEO Direct Extraction</div>
868
899
  <div class="card-num">${formatVal(p[5].data.readiness_score)}</div>
869
- <span class="badge badge-success">${formatVal(p[5].data.status).toUpperCase()}</span>
900
+ <span class="badge badge-success">${scopedFormat(p[5].data.status).toUpperCase()}</span>
870
901
  </div>
871
902
  <div class="card">
872
903
  <div style="font-size:12px; color:var(--muted); text-transform:uppercase;">E-E-A-T Quality Score</div>
@@ -876,11 +907,11 @@ export function renderSearchReportHtml(report) {
876
907
  <div class="card">
877
908
  <div style="font-size:12px; color:var(--muted); text-transform:uppercase;">Core Web Vitals Blockers</div>
878
909
  <div class="card-num">${formatVal(p[2].data.core_web_vitals?.render_blocking_scripts)}</div>
879
- <span class="badge ${p[2].data.core_web_vitals?.render_blocking_scripts === 0 ? 'badge-success' : 'badge-danger'}">${p[2].data.core_web_vitals?.render_blocking_scripts === 0 ? 'Clean' : 'Action Required'}</span>
910
+ <span class="badge ${verifiedScope && p[2].data.core_web_vitals?.render_blocking_scripts === 0 ? 'badge-success' : 'badge-danger'}">${cwvLabel}</span>
880
911
  </div>
881
912
  </div>
882
913
 
883
- <h2 class="section-title">Verified Evidence Register (${report.evidence_register.length} Observations)</h2>
914
+ <h2 class="section-title">${evidenceRegisterTitle} (${report.evidence_register.length} Observations)</h2>
884
915
  <table>
885
916
  <thead>
886
917
  <tr>
@@ -915,6 +946,8 @@ export function renderSearchReportHtml(report) {
915
946
  </div>
916
947
  </body>
917
948
  </html>`;
949
+ assertEpistemicLanguage(rendered, { ...context, package_verified: context.package_verified === true });
950
+ return rendered;
918
951
  }
919
952
 
920
953
  /**
@@ -922,15 +955,16 @@ export function renderSearchReportHtml(report) {
922
955
  */
923
956
  export async function exportExecutiveSearchReport(root, options = {}) {
924
957
  const report = await buildExecutiveSearchReport(root, options);
958
+ const evidenceContext = report.generation_provenance;
925
959
  const format = options.format || 'markdown';
926
960
  let content = '';
927
961
 
928
962
  if (format === 'html' || format === 'html-brief') {
929
- content = renderSearchReportHtml(report);
963
+ content = renderSearchReportHtml(report, evidenceContext);
930
964
  } else if (format === 'json') {
931
965
  content = JSON.stringify(report, null, 2);
932
966
  } else {
933
- content = renderSearchReportMarkdown(report);
967
+ content = renderSearchReportMarkdown(report, evidenceContext);
934
968
  }
935
969
 
936
970
  let outputPath = null;
@@ -1,3 +1,5 @@
1
+ import { assertEpistemicLanguage, evidenceScopeStatement } from '../shared/epistemicLanguage.js';
2
+
1
3
  const SEV_ORDER = { critical: 0, high: 1, medium: 2, low: 3, informational: 4, experimental: 5 };
2
4
 
3
5
  const RETRIEVAL_NAMESPACES = new Set(['TECH', 'CRAWL', 'LINK', 'HREFLANG']);
@@ -39,7 +41,7 @@ function citationPosture(promptResults, targetOrigin) {
39
41
  };
40
42
  }
41
43
 
42
- export function summarize(findings, { detectorsRun = [], detectorsSkipped = [], promptResults = [], targetOrigin = null } = {}) {
44
+ export function summarize(findings, { detectorsRun = [], detectorsSkipped = [], promptResults = [], targetOrigin = null, coverage = null } = {}) {
43
45
  const bySeverity = {};
44
46
  const byNamespace = {};
45
47
  const byDiscipline = { seo: 0, aeo: 0, geo: 0 };
@@ -51,6 +53,18 @@ export function summarize(findings, { detectorsRun = [], detectorsSkipped = [],
51
53
  for (const d of f.discipline) byDiscipline[d] = (byDiscipline[d] || 0) + 1;
52
54
  if (f.classification.deterministic) deterministic++;
53
55
  }
56
+ const coverageIncomplete = coverage && coverage.coverage_status !== 'complete';
57
+ const posture = {
58
+ retrieval_eligibility: readinessPosture(findings, detectorsRun, detectorsSkipped, RETRIEVAL_NAMESPACES),
59
+ source_extraction_and_support: readinessPosture(findings, detectorsRun, detectorsSkipped, SOURCE_NAMESPACES),
60
+ observed_citation_behavior: citationPosture(promptResults, targetOrigin),
61
+ };
62
+ if (coverageIncomplete) {
63
+ for (const key of ['retrieval_eligibility', 'source_extraction_and_support']) {
64
+ posture[key].result = 'qualified';
65
+ posture[key].coverage_status = coverage.coverage_status;
66
+ }
67
+ }
54
68
  return {
55
69
  total: findings.length,
56
70
  deterministic_observations: deterministic,
@@ -58,15 +72,22 @@ export function summarize(findings, { detectorsRun = [], detectorsSkipped = [],
58
72
  by_severity: bySeverity,
59
73
  by_namespace: byNamespace,
60
74
  by_discipline: byDiscipline,
61
- posture: {
62
- retrieval_eligibility: readinessPosture(findings, detectorsRun, detectorsSkipped, RETRIEVAL_NAMESPACES),
63
- source_extraction_and_support: readinessPosture(findings, detectorsRun, detectorsSkipped, SOURCE_NAMESPACES),
64
- observed_citation_behavior: citationPosture(promptResults, targetOrigin),
65
- },
75
+ coverage: coverage ? {
76
+ status: coverage.coverage_status,
77
+ populations: coverage.populations,
78
+ stop_reason: coverage.stop_reason,
79
+ } : null,
80
+ posture,
66
81
  };
67
82
  }
68
83
 
69
- export function renderMarkdownReport({ findings, manifest, summary, detectorsSkipped = [] }) {
84
+ export function renderMarkdownReport({ findings, manifest, summary, detectorsSkipped = [], coverage = null, verifiedRun = null }) {
85
+ // Only the verified loader can establish package integrity. Manifest flags
86
+ // are part of the package input and therefore cannot establish their own
87
+ // trustworthiness when this renderer is called directly.
88
+ const packageVerified = verifiedRun?.verified === true
89
+ && verifiedRun?.integrity_mode === 'sealed'
90
+ && typeof verifiedRun?.verification_version === 'string';
70
91
  const lines = [];
71
92
  lines.push(`# Citable audit report`);
72
93
  lines.push('');
@@ -85,10 +106,18 @@ export function renderMarkdownReport({ findings, manifest, summary, detectorsSki
85
106
  lines.push(`| Total findings | ${summary.total} |`);
86
107
  lines.push(`| Deterministic observations | ${summary.deterministic_observations} |`);
87
108
  lines.push(`| Heuristic / semantic findings | ${summary.semantic_or_heuristic} |`);
109
+ if (coverage) {
110
+ lines.push(`| Coverage status | ${coverage.coverage_status} |`);
111
+ lines.push(`| Evaluated resources | ${coverage.populations.evaluated} of ${coverage.populations.discovered - coverage.populations.excluded} eligible |`);
112
+ }
88
113
  for (const [sev, n] of Object.entries(summary.by_severity).sort((a, b) => SEV_ORDER[a[0]] - SEV_ORDER[b[0]])) {
89
114
  lines.push(`| ${sev} | ${n} |`);
90
115
  }
91
116
  lines.push('');
117
+ if (coverage && coverage.coverage_status !== 'complete') {
118
+ lines.push(`> Coverage status: **${coverage.coverage_status}**. This report describes the observed corpus and does not establish a complete site-wide determination.`);
119
+ lines.push('');
120
+ }
92
121
  lines.push('## Separate eligibility and observation states');
93
122
  lines.push('');
94
123
  lines.push('| Dimension | Result | Evidence |');
@@ -132,8 +161,26 @@ export function renderMarkdownReport({ findings, manifest, summary, detectorsSki
132
161
  lines.push('');
133
162
  }
134
163
  if (findings.length === 0) {
135
- lines.push(`No findings from the executed detectors. Absence of findings is not proof of eligibility — see skipped and incomplete checks above.`);
164
+ const population = coverage?.populations?.evaluated ?? 0;
165
+ lines.push(population > 0
166
+ ? `No findings were produced for the ${population} successfully evaluated resource(s). Absence of findings is not proof of eligibility — see skipped and incomplete checks above.`
167
+ : evidenceScopeStatement({
168
+ coverage_status: coverage?.coverage_status || 'indeterminate',
169
+ determination_status: summary?.posture?.source_extraction_and_support?.result === 'pass' ? 'supported' : 'indeterminate',
170
+ evaluated: 0,
171
+ eligible: coverage?.populations?.eligible ?? 0,
172
+ legacy: !coverage,
173
+ }));
136
174
  lines.push('');
137
175
  }
138
- return lines.join('\n');
176
+ const rendered = lines.join('\n');
177
+ assertEpistemicLanguage(rendered, {
178
+ coverage_status: coverage?.coverage_status || 'indeterminate',
179
+ determination_status: coverage?.coverage_status === 'complete' ? 'supported' : 'indeterminate',
180
+ evaluated: coverage?.populations?.evaluated ?? 0,
181
+ eligible: coverage?.populations?.eligible ?? 0,
182
+ package_verified: packageVerified,
183
+ legacy: verifiedRun?.legacy === true || !coverage,
184
+ });
185
+ return rendered;
139
186
  }