@slicedearth/whoisleuth-cli 2.3.0 → 2.5.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 (418) hide show
  1. package/NOTICE +8 -2
  2. package/README.md +19 -15
  3. package/bin/whoisleuth.mjs +8 -1
  4. package/cli/archive-content-digest.mjs +14 -0
  5. package/cli/archive-inspect.mjs +20 -53
  6. package/cli/argument-values.mjs +55 -0
  7. package/cli/arguments.mjs +24 -408
  8. package/cli/artifact-validation/case-response.mjs +65 -44
  9. package/cli/artifact-validation/investigation-capsule.mjs +52 -31
  10. package/cli/artifact-validation/lookup-evidence.mjs +15 -9
  11. package/cli/artifact-validation/signed-review.mjs +136 -68
  12. package/cli/artifact-validation/structure-primitives.mjs +1 -105
  13. package/cli/artifact-verify.mjs +92 -24
  14. package/cli/assurance-arguments.mjs +56 -0
  15. package/cli/assurance-command-definitions.mjs +179 -0
  16. package/cli/assurance-command-runner.mjs +40 -5
  17. package/cli/bagit-folder.mjs +57 -0
  18. package/cli/bagit-review.mjs +23 -0
  19. package/cli/bounded-json.mjs +1 -1
  20. package/cli/bulk-checkpoint.mjs +1 -1
  21. package/cli/bulk-command-runner.mjs +4 -2
  22. package/cli/bulk-output.mjs +29 -3
  23. package/cli/bulk.mjs +2 -3
  24. package/cli/case-command.mjs +212 -0
  25. package/cli/case-pack.mjs +50 -32
  26. package/cli/ci-report.mjs +6 -3
  27. package/cli/collection-arguments.mjs +123 -0
  28. package/cli/collection-command-definitions.mjs +330 -0
  29. package/cli/collection-preflight.mjs +8 -1
  30. package/cli/command-argument-grammar.mjs +8 -206
  31. package/cli/command-definition.mjs +329 -0
  32. package/cli/command-reference.mjs +94 -1357
  33. package/cli/command-seeds.mjs +18 -0
  34. package/cli/compare.mjs +1 -1
  35. package/cli/completion.mjs +298 -79
  36. package/cli/config-profile.mjs +8 -6
  37. package/cli/ct-event-intake.mjs +16 -16
  38. package/cli/discover.mjs +5 -4
  39. package/cli/discovery-observation-snapshot.mjs +46 -18
  40. package/cli/discovery-scan-command-runner.mjs +5 -3
  41. package/cli/discovery-scan.mjs +7 -4
  42. package/cli/discovery-snapshot.mjs +2 -2
  43. package/cli/discovery-workflow.mjs +5 -5
  44. package/cli/domain-control-monitor.mjs +50 -20
  45. package/cli/domain-control-observations.mjs +151 -103
  46. package/cli/errors.mjs +37 -6
  47. package/cli/evidence-arguments.mjs +46 -0
  48. package/cli/evidence-command-definitions.mjs +69 -0
  49. package/cli/evidence-command-runner.mjs +18 -8
  50. package/cli/evidence-signing.mjs +5 -4
  51. package/cli/external-observation-mapping.mjs +9 -10
  52. package/cli/formatters/terminal-command-formats.mjs +6 -0
  53. package/cli/formatters/terminal-lookup.mjs +24 -46
  54. package/cli/formatters/terminal-shared.mjs +5 -3
  55. package/cli/formatters/terminal-technology.mjs +114 -0
  56. package/cli/history-arguments.mjs +39 -0
  57. package/cli/history-command-definitions.mjs +88 -0
  58. package/cli/indicator-set-command.mjs +33 -0
  59. package/cli/inline-command-families.mjs +6 -46
  60. package/cli/inline-command-runner.mjs +4 -31
  61. package/cli/input.mjs +2 -2
  62. package/cli/intake-command.mjs +107 -0
  63. package/cli/interactive-launcher.mjs +2 -160
  64. package/cli/interchange-report.mjs +8 -10
  65. package/cli/investigation-artifacts.mjs +176 -0
  66. package/cli/investigation-checkpoint.mjs +10 -0
  67. package/cli/investigation-folder.mjs +114 -0
  68. package/cli/investigation-manifest.mjs +1 -112
  69. package/cli/investigation-package-review.mjs +103 -0
  70. package/cli/investigation-plan.mjs +38 -147
  71. package/cli/investigation-recipes.mjs +177 -0
  72. package/cli/investigation-run.mjs +256 -35
  73. package/cli/local-document-checkpoint.mjs +170 -0
  74. package/cli/local-mmdb-review.mjs +197 -17
  75. package/cli/lookalike-calibration.mjs +1 -1
  76. package/cli/lookup-brief.mjs +2 -2
  77. package/cli/lookup-browser.mjs +5 -12
  78. package/cli/lookup-command-runner.mjs +33 -39
  79. package/cli/lookup-diff.mjs +47 -12
  80. package/cli/lookup-plan.mjs +16 -14
  81. package/cli/lookup-reconcile.mjs +15 -12
  82. package/cli/lookup-timeline.mjs +7 -6
  83. package/cli/mail-header-review.mjs +24 -247
  84. package/cli/mail-review.mjs +75 -21
  85. package/cli/manual.mjs +1 -0
  86. package/cli/network-arguments.mjs +51 -0
  87. package/cli/network-command-definitions.mjs +130 -0
  88. package/cli/network-command-runner.mjs +45 -31
  89. package/cli/offline-evidence-review.mjs +39 -6
  90. package/cli/output-file.mjs +31 -5
  91. package/cli/posture.mjs +1 -1
  92. package/cli/registry-doctor.mjs +3 -1
  93. package/cli/registry-fixture-scaffold.mjs +1 -1
  94. package/cli/registry-support.mjs +1 -1
  95. package/cli/retained-artifact-diff.mjs +10 -9
  96. package/cli/review-arguments.mjs +131 -0
  97. package/cli/review-command-definitions.mjs +273 -0
  98. package/cli/review-command-runner.mjs +104 -149
  99. package/cli/risk-calibration.mjs +8 -8
  100. package/cli/runner.mjs +74 -37
  101. package/cli/saved-lookup.mjs +2 -2
  102. package/cli/selected-input-worker.mjs +63 -0
  103. package/cli/sharing-review.mjs +8 -80
  104. package/cli/signer-trust.mjs +104 -0
  105. package/cli/source-reliability.mjs +75 -84
  106. package/cli/support-arguments.mjs +49 -0
  107. package/cli/support-command-definitions.mjs +209 -0
  108. package/cli/support-command-runner.mjs +2 -2
  109. package/cli/terminal-input.mjs +168 -0
  110. package/cli/workflow-arguments.mjs +86 -0
  111. package/cli/workflow-command-definitions.mjs +78 -0
  112. package/cli/workflow-command-runner.mjs +75 -13
  113. package/docs/cli-reference.md +103 -30
  114. package/docs/cli.md +510 -25
  115. package/docs/contextual-reviews.md +155 -0
  116. package/lib/abort.mjs +4 -1
  117. package/lib/analyst-taxonomy.mjs +2 -40
  118. package/lib/application-version.mjs +1 -1
  119. package/lib/availability.mjs +27 -754
  120. package/lib/bounded-contract-normalizers.mjs +4 -0
  121. package/lib/bounded-file.mjs +3 -1
  122. package/lib/bounded-html-document.mjs +125 -0
  123. package/lib/bounded-json.mjs +2 -290
  124. package/lib/browser-library-profile.mjs +99 -130
  125. package/lib/browser-library-worker.mjs +112 -0
  126. package/lib/candidate-provenance-bounds.mjs +2 -0
  127. package/lib/classify.mjs +1 -1
  128. package/lib/client-behavior-profile.mjs +3 -3
  129. package/lib/ct-query.mjs +2 -27
  130. package/lib/ct-response-bounds.mjs +2 -9
  131. package/lib/ct-search.mjs +89 -46
  132. package/lib/dmarc-discovery.mjs +62 -0
  133. package/lib/dns-convergence-review.mjs +21 -8
  134. package/lib/dns-delegation-health.mjs +36 -22
  135. package/lib/dns-inheritance-review.mjs +207 -0
  136. package/lib/dns-intelligence.mjs +44 -29
  137. package/lib/dns-mx.mjs +1 -1
  138. package/lib/dns-query-coverage.mjs +40 -0
  139. package/lib/dnssec-evidence-validation.mjs +11 -3
  140. package/lib/domain-assurance.mjs +1 -1
  141. package/lib/domain-change-packet.mjs +18 -14
  142. package/lib/domain-change-review.mjs +40 -16
  143. package/lib/domain-control-flight-recorder.mjs +301 -124
  144. package/lib/domain-control-manifest.mjs +126 -58
  145. package/lib/domain-posture-analysis.mjs +41 -11
  146. package/lib/domain-posture-parsers.mjs +88 -6
  147. package/lib/domain-posture.mjs +120 -32
  148. package/lib/domain-registration.mjs +392 -0
  149. package/lib/evidence-export-privacy.mjs +568 -0
  150. package/lib/evidence-export.mjs +12 -593
  151. package/lib/evidence-report.mjs +7 -2
  152. package/lib/external-intelligence-risk.mjs +2 -124
  153. package/lib/favicon.mjs +117 -41
  154. package/lib/generated/cisa-kev-catalog.mjs +50 -4
  155. package/lib/generated/registrar-standing-catalogue.mjs +18 -10
  156. package/lib/generated/retire-browser-catalog.mjs +2742 -1034
  157. package/lib/generated/{unicode-confusables-17.mjs → unicode-confusables.mjs} +33 -33
  158. package/lib/html-signals.mjs +87 -85
  159. package/lib/http-evidence-bounds.mjs +2 -7
  160. package/lib/http-intelligence.mjs +52 -27
  161. package/lib/idn-confusable-policy.mjs +6 -4
  162. package/lib/idn-confusables.mjs +1 -1
  163. package/lib/interchange-fidelity-registry.mjs +10 -0
  164. package/lib/lookup-cache.mjs +34 -11
  165. package/lib/lookup-child-profile-contract.mjs +24 -15
  166. package/lib/lookup-contract-primitives.mjs +1 -1
  167. package/lib/lookup-diagnostics.mjs +2 -1
  168. package/lib/lookup-network-evidence-bounds.mjs +1 -10
  169. package/lib/lookup-progress.mjs +79 -13
  170. package/lib/lookup-response-contract.mjs +1077 -0
  171. package/lib/lookup-response.mjs +11 -24
  172. package/lib/lookup-source-progress.mjs +24 -35
  173. package/lib/lookup.mjs +49 -28
  174. package/lib/observed-network-context.mjs +43 -27
  175. package/lib/opportunity-scoring.mjs +2 -107
  176. package/lib/outbound-identity.mjs +1 -1
  177. package/lib/outbound-request-bounds.mjs +4 -1
  178. package/lib/page-fingerprints.mjs +87 -134
  179. package/lib/page-role-profile.mjs +12 -8
  180. package/lib/perceptual-hash-comparison.mjs +2 -34
  181. package/lib/perceptual-hash.mjs +79 -24
  182. package/lib/portable-generator.mjs +2 -29
  183. package/lib/project-metadata.mjs +2 -8
  184. package/lib/rdap-bootstrap.mjs +72 -22
  185. package/lib/rdap-client.mjs +26 -14
  186. package/lib/rdap-normalization.mjs +33 -18
  187. package/lib/rdap-search-workbench.mjs +1 -1
  188. package/lib/rdap-transport.mjs +47 -20
  189. package/lib/rdap-types.mjs +2 -1
  190. package/lib/rdap.mjs +18 -3
  191. package/lib/registrable-domain.mjs +2 -36
  192. package/lib/registrar-standing-contract.mjs +2 -1
  193. package/lib/registrar-standing.mjs +9 -13
  194. package/lib/registry-capabilities.mjs +7 -3
  195. package/lib/registry-capability-catalogue.mjs +29 -20
  196. package/lib/registry-dates.mjs +2 -190
  197. package/lib/registry-insights.mjs +56 -18
  198. package/lib/response-policy.mjs +86 -48
  199. package/lib/risk-calibration-summary.mjs +2 -338
  200. package/lib/risk-scoring.mjs +2 -345
  201. package/lib/rpki-evidence.mjs +8 -5
  202. package/lib/safe-fetch.mjs +54 -47
  203. package/lib/scoring-evidence-quality.mjs +2 -107
  204. package/lib/security-txt.mjs +10 -7
  205. package/lib/semantic-version.mjs +2 -54
  206. package/lib/service-binding-dns.mjs +35 -0
  207. package/lib/smtp-transport-review.mjs +75 -34
  208. package/lib/sslbl-certificates.generated.mjs +141 -138
  209. package/lib/static-html-analysis.mjs +117 -146
  210. package/lib/structured-data-identity.mjs +2 -1
  211. package/lib/technology-markup.mjs +100 -0
  212. package/lib/threat-intelligence-manifests.mjs +11 -139
  213. package/lib/threat-intelligence-runtime.mjs +24 -52
  214. package/lib/threat-intelligence-targets.mjs +6 -34
  215. package/lib/threat-intelligence-types.mjs +2 -36
  216. package/lib/typosquat-generator.mjs +29 -16
  217. package/lib/urlhaus-intelligence.mjs +8 -3
  218. package/lib/urlscan-intelligence.mjs +1 -1
  219. package/lib/website-enrichment.mjs +388 -0
  220. package/lib/website-security-posture.mjs +30 -6
  221. package/lib/website-technology.mjs +111 -71
  222. package/lib/whois-authority.mjs +55 -5
  223. package/lib/whois-chain.mjs +9 -2
  224. package/lib/whois-common-formats.mjs +5 -5
  225. package/lib/whois-contracts.mjs +2 -1
  226. package/lib/whois-dialects.mjs +2 -2
  227. package/lib/whois-normalization.mjs +3 -1
  228. package/lib/whois-parser-support.mjs +8 -1
  229. package/lib/whois-parser.mjs +5 -3
  230. package/lib/whois-transport.mjs +23 -7
  231. package/package.json +14 -14
  232. package/packages/analysis/analyst-taxonomy.mjs +40 -0
  233. package/packages/analysis/bounded-json.mjs +330 -0
  234. package/packages/analysis/candidate-provenance-bounds.mjs +4 -0
  235. package/packages/analysis/cli-argument-grammar.mjs +216 -0
  236. package/packages/analysis/ct-query.mjs +27 -0
  237. package/packages/analysis/ct-response-bounds.mjs +9 -0
  238. package/packages/analysis/external-intelligence-risk.mjs +124 -0
  239. package/packages/analysis/http-evidence-bounds.mjs +8 -0
  240. package/packages/analysis/lookup-network-evidence-bounds.mjs +10 -0
  241. package/packages/analysis/opportunity-scoring.mjs +107 -0
  242. package/packages/analysis/perceptual-hash-comparison.mjs +34 -0
  243. package/packages/analysis/portable-generator.mjs +29 -0
  244. package/packages/analysis/project-metadata.mjs +8 -0
  245. package/packages/analysis/registrable-domain.mjs +56 -0
  246. package/packages/analysis/risk-calibration-summary.mjs +352 -0
  247. package/packages/analysis/risk-scoring.mjs +345 -0
  248. package/packages/analysis/scoring-evidence-quality.mjs +107 -0
  249. package/packages/analysis/semantic-version.mjs +54 -0
  250. package/packages/analysis/threat-intelligence-types.mjs +75 -0
  251. package/packages/cases/case-attachment-model.mjs +83 -0
  252. package/packages/cases/case-evidence-links.mjs +135 -0
  253. package/packages/cases/case-evidence-model.mjs +229 -69
  254. package/packages/cases/case-evidence-quality.mjs +5 -0
  255. package/packages/cases/case-export-input.mjs +55 -0
  256. package/packages/cases/case-incident-context.mjs +52 -0
  257. package/packages/cases/case-markdown.mjs +11 -0
  258. package/packages/cases/case-migration-model.mjs +98 -48
  259. package/packages/cases/case-model.mjs +1 -0
  260. package/packages/cases/case-recheck-model.mjs +149 -0
  261. package/packages/cases/case-record-contracts.mjs +1 -1
  262. package/packages/cases/case-record-core.mjs +4 -3
  263. package/packages/cases/case-record-operations.mjs +123 -133
  264. package/packages/cases/case-record-projection.mjs +30 -20
  265. package/packages/cases/case-record-version-input.mjs +19 -0
  266. package/packages/cases/case-report.mjs +114 -67
  267. package/packages/cases/case-requested-evidence.mjs +146 -0
  268. package/packages/cases/case-response-actions.mjs +756 -0
  269. package/packages/cases/case-response-model.mjs +49 -1129
  270. package/packages/cases/case-response-outcomes.mjs +338 -0
  271. package/packages/cases/case-response-packet-render.mjs +157 -0
  272. package/packages/cases/case-response-packet-types.mjs +1 -0
  273. package/packages/cases/case-response-packet-vocabulary.mjs +48 -0
  274. package/packages/cases/case-response-packet.mjs +58 -593
  275. package/packages/cases/case-response-records.mjs +93 -0
  276. package/packages/cases/case-response-review-inputs.mjs +382 -0
  277. package/packages/cases/case-response-values.mjs +85 -0
  278. package/packages/cases/case-review-package.mjs +45 -0
  279. package/packages/cases/case-selection.mjs +46 -0
  280. package/packages/cases/case-storage-model.mjs +26 -1
  281. package/packages/cases/case-workflow-metadata.mjs +225 -0
  282. package/packages/cases/case-workflow-migration.mjs +43 -0
  283. package/packages/cases/http-summary.mjs +6 -1
  284. package/packages/cases/response-route-freshness.mjs +16 -0
  285. package/packages/comparison/capture-context.mjs +61 -0
  286. package/packages/comparison/comparison-ledger-bulk.mjs +4 -1
  287. package/packages/comparison/favicon-similarity.mjs +1 -1
  288. package/packages/comparison/page-similarity.mjs +3 -2
  289. package/packages/comparison/relationship-evidence.mjs +103 -14
  290. package/packages/comparison/relationship-provenance.mjs +99 -0
  291. package/packages/contracts/analyst-interchange.mjs +234 -0
  292. package/packages/contracts/analyst-review-state-contract.mjs +11 -0
  293. package/packages/contracts/analyst-review-state.mjs +5 -4
  294. package/packages/contracts/case-portability.mjs +370 -114
  295. package/packages/contracts/case-views-contract.mjs +12 -0
  296. package/packages/contracts/case-views.mjs +26 -0
  297. package/packages/contracts/cli-command-semantics.mjs +3 -0
  298. package/packages/contracts/cli-grammar.mjs +6 -0
  299. package/packages/contracts/cli-lookup-brief.mjs +2 -0
  300. package/packages/contracts/cli-lookup.mjs +0 -1
  301. package/packages/contracts/context-review.mjs +24 -0
  302. package/packages/contracts/document-intake.mjs +11 -0
  303. package/packages/contracts/domain-control-flight-recorder.mjs +98 -44
  304. package/packages/contracts/domain-control-manifest.mjs +128 -74
  305. package/packages/contracts/domain-control-monitor.mjs +59 -45
  306. package/packages/contracts/domain-control-review.mjs +200 -121
  307. package/packages/contracts/domain-name.mjs +21 -0
  308. package/packages/contracts/external-observation-interchange.mjs +2 -1
  309. package/packages/contracts/extracted-domain-lifecycle.mjs +11 -32
  310. package/packages/contracts/har-review.mjs +2 -0
  311. package/packages/contracts/http-url.mjs +2 -0
  312. package/packages/contracts/identity-events.mjs +4 -0
  313. package/packages/contracts/investigation-package-limits.mjs +24 -0
  314. package/packages/contracts/investigation-portability.mjs +56 -27
  315. package/packages/contracts/investigation-run.mjs +18 -0
  316. package/packages/contracts/ip-address.mjs +44 -0
  317. package/packages/contracts/lookup-evidence.mjs +35 -0
  318. package/packages/contracts/mail-authentication.mjs +5 -0
  319. package/packages/contracts/message-intake.mjs +31 -0
  320. package/packages/contracts/offline-comparison.mjs +4 -2
  321. package/packages/contracts/page-fingerprints.mjs +15 -0
  322. package/packages/contracts/passive-mail.mjs +10 -0
  323. package/packages/contracts/risk-calibration.mjs +0 -1
  324. package/packages/contracts/schema-compatibility.mjs +1 -1
  325. package/packages/contracts/schema-lifecycle.mjs +83 -153
  326. package/packages/contracts/selected-file-limits.mjs +6 -0
  327. package/packages/contracts/vulnerability-identifiers.mjs +5 -0
  328. package/packages/contracts/web-capture.mjs +10 -0
  329. package/packages/contracts/workspace-portability.mjs +219 -238
  330. package/packages/evidence/artifact-integrity.mjs +8 -2
  331. package/packages/evidence/artifact-structure.mjs +105 -0
  332. package/packages/evidence/collection-quality.mjs +67 -0
  333. package/packages/evidence/decision-fact.mjs +4 -1
  334. package/packages/evidence/dns-query-outcome.mjs +72 -0
  335. package/packages/evidence/domain-control-runtime.mjs +155 -27
  336. package/packages/evidence/domain-posture-context.mjs +79 -0
  337. package/packages/evidence/email-recipient.mjs +18 -0
  338. package/packages/evidence/image-regions.mjs +56 -0
  339. package/packages/evidence/latest-observations.mjs +28 -0
  340. package/packages/evidence/lookup-target.mjs +108 -0
  341. package/packages/evidence/observation.mjs +18 -1
  342. package/packages/evidence/passphrase-encryption.mjs +44 -0
  343. package/packages/evidence/png-pixels.mjs +117 -0
  344. package/packages/evidence/public-address-policy.mjs +83 -0
  345. package/packages/evidence/record-identity.mjs +72 -0
  346. package/packages/evidence/registry-dates.mjs +190 -0
  347. package/packages/evidence/retained-file.mjs +69 -0
  348. package/packages/evidence/review-age.mjs +14 -0
  349. package/packages/interchange/bagit.mjs +342 -0
  350. package/packages/interchange/bounded-zip-extraction.mjs +278 -0
  351. package/packages/interchange/crc32.mjs +17 -0
  352. package/packages/interchange/defensive-indicator-export.mjs +264 -0
  353. package/packages/interchange/external-findings-import.mjs +93 -61
  354. package/packages/interchange/managed-indicator-export.mjs +35 -0
  355. package/packages/interchange/managed-indicator-set.mjs +210 -0
  356. package/packages/interchange/misp-indicator-export.mjs +93 -0
  357. package/packages/interchange/sharing-policy.mjs +56 -0
  358. package/packages/interchange/stix-indicator-export.mjs +129 -0
  359. package/packages/interchange/web-capture-import.mjs +389 -0
  360. package/packages/investigation/acquisition-decision-packet.mjs +1 -1
  361. package/packages/investigation/bulk-mail-exposure.mjs +9 -14
  362. package/packages/investigation/capture-coverage.mjs +57 -0
  363. package/packages/investigation/connector-provenance-review.mjs +100 -0
  364. package/packages/investigation/context-review.mjs +35 -0
  365. package/packages/investigation/document-intake.mjs +81 -0
  366. package/packages/investigation/docx-intake.mjs +133 -0
  367. package/packages/investigation/domain-history-review.mjs +100 -0
  368. package/packages/investigation/domain-transition-review.mjs +47 -0
  369. package/packages/investigation/evidence-coverage-ledger.mjs +9 -1
  370. package/packages/investigation/har-intake.mjs +68 -0
  371. package/packages/investigation/identity-event-intake.mjs +131 -0
  372. package/packages/investigation/identity-incident-review.mjs +39 -0
  373. package/packages/investigation/incident-sequence-review.mjs +58 -0
  374. package/packages/investigation/intake-report.mjs +19 -0
  375. package/packages/investigation/investigation-bagit.mjs +14 -0
  376. package/packages/investigation/investigation-capsule.mjs +33 -5
  377. package/packages/investigation/investigation-manifest.mjs +200 -0
  378. package/packages/investigation/investigation-package-crypto.mjs +98 -0
  379. package/packages/investigation/investigation-package.mjs +200 -0
  380. package/packages/investigation/link-intake.mjs +179 -0
  381. package/packages/investigation/lookup-asset-graph-inputs.mjs +38 -0
  382. package/packages/investigation/lookup-asset-graph.mjs +161 -141
  383. package/packages/investigation/lookup-claim-readiness.mjs +18 -0
  384. package/packages/investigation/lookup-investigation-brief.mjs +3 -3
  385. package/packages/investigation/lookup-task-guidance.mjs +58 -0
  386. package/packages/investigation/mail-authentication-review.mjs +222 -0
  387. package/packages/investigation/mail-header-identity.mjs +209 -0
  388. package/packages/investigation/message-intake.mjs +195 -0
  389. package/packages/investigation/page-behaviour.mjs +113 -0
  390. package/packages/investigation/pdf-intake.mjs +155 -0
  391. package/packages/investigation/platform-continuity-review.mjs +60 -0
  392. package/packages/investigation/qr-intake.mjs +56 -0
  393. package/packages/investigation/requested-action-hints.mjs +11 -0
  394. package/packages/investigation/selected-input-review.mjs +17 -0
  395. package/packages/investigation/storefront-review.mjs +70 -0
  396. package/packages/monitoring/analyst-review-state.mjs +38 -90
  397. package/packages/workspace/brand-profile-model.mjs +160 -22
  398. package/packages/workspace/bulk-columns.mjs +17 -0
  399. package/packages/workspace/bulk-review-model.mjs +39 -31
  400. package/packages/workspace/bulk-session-model.mjs +112 -27
  401. package/packages/workspace/bulk-sort.mjs +1 -0
  402. package/packages/workspace/campaign-model.mjs +1 -1
  403. package/packages/workspace/case-views.mjs +102 -0
  404. package/packages/workspace/detection-rule-model.mjs +1 -1
  405. package/packages/workspace/hostile-input.mjs +29 -8
  406. package/packages/workspace/investigation-guide.mjs +2 -2
  407. package/packages/workspace/investigation-template-model.mjs +45 -6
  408. package/packages/workspace/page-baseline.mjs +20 -17
  409. package/packages/workspace/relationship-observation-model.mjs +54 -35
  410. package/packages/workspace/shortlist-model.mjs +14 -5
  411. package/packages/workspace/watchlist-history.mjs +30 -14
  412. package/packages/workspace/watchlist-store.mjs +24 -6
  413. package/packages/workspace/website-snapshot-model.mjs +98 -33
  414. package/packages/workspace/workspace-archive-crypto.mjs +41 -61
  415. package/packages/workspace/workspace-archive.mjs +90 -25
  416. package/third-party-notices.txt +577 -17
  417. package/lib/hostname.mjs +0 -38
  418. package/packages/investigation/bulk-review-export.mjs +0 -63
@@ -1,112 +1 @@
1
- import { Buffer } from 'node:buffer';
2
- import { createHash } from 'node:crypto';
3
- import { canonicalArtifactJsonV2, SORTED_JSON_V2, sha256ArtifactDigestV2, } from "../packages/evidence/artifact-integrity.mjs";
4
- import { requireBoundedString, requireIsoTimestamp, } from "../lib/bounded-contract-normalizers.mjs";
5
- import { normalizeBoundedSemanticVersion } from "../lib/semantic-version.mjs";
6
- import { parseBoundedJsonObject } from "./bounded-json.mjs";
7
- export const INVESTIGATION_MANIFEST_SCHEMA = 'whoisleuth.investigation-manifest';
8
- export const INVESTIGATION_MANIFEST_VERSION = 2;
9
- export const MAX_INVESTIGATION_MANIFEST_ARTIFACTS = 16;
10
- export const MAX_INVESTIGATION_MANIFEST_ARTIFACT_BYTES = 15 * 1024 * 1024;
11
- export const MAX_INVESTIGATION_MANIFEST_TOTAL_BYTES = 32 * 1024 * 1024;
12
- const SHA256_RE = /^sha256:[a-f0-9]{64}$/u;
13
- function digest(value) {
14
- return `sha256:${createHash('sha256').update(value, 'utf8').digest('hex')}`;
15
- }
16
- function artifactVersion(value) {
17
- const candidate = value.version ?? value.schemaVersion;
18
- return Number.isSafeInteger(candidate) && Number(candidate) > 0 && Number(candidate) <= 1_000
19
- ? Number(candidate)
20
- : null;
21
- }
22
- export async function buildInvestigationManifest(input, generatedAtValue, applicationVersionValue) {
23
- if (!Array.isArray(input.artifacts)
24
- || input.artifacts.length < 1
25
- || input.artifacts.length > MAX_INVESTIGATION_MANIFEST_ARTIFACTS) {
26
- throw new TypeError(`A manifest requires between 1 and ${MAX_INVESTIGATION_MANIFEST_ARTIFACTS} JSON artefacts.`);
27
- }
28
- const generatedAt = requireIsoTimestamp(generatedAtValue, 'generatedAt');
29
- const workflow = requireBoundedString(input.workflow, 'workflow', 160);
30
- const applicationVersion = normalizeBoundedSemanticVersion(applicationVersionValue, 'Application');
31
- const configurationDigestSha256 = input.configurationDigestSha256;
32
- if (configurationDigestSha256 !== null && !SHA256_RE.test(configurationDigestSha256)) {
33
- throw new TypeError('configurationDigestSha256 must be a sha256: hexadecimal digest.');
34
- }
35
- let totalBytes = 0;
36
- const artifacts = input.artifacts.map((artifact, index) => {
37
- if (typeof artifact.content !== 'string')
38
- throw new TypeError(`Artifact ${index + 1} must be UTF-8 JSON text.`);
39
- const byteLength = Buffer.byteLength(artifact.content, 'utf8');
40
- totalBytes += byteLength;
41
- if (byteLength < 1 || byteLength > MAX_INVESTIGATION_MANIFEST_ARTIFACT_BYTES) {
42
- throw new TypeError(`Artifact ${index + 1} must be between 1 byte and ${MAX_INVESTIGATION_MANIFEST_ARTIFACT_BYTES} bytes.`);
43
- }
44
- if (totalBytes > MAX_INVESTIGATION_MANIFEST_TOTAL_BYTES) {
45
- throw new TypeError(`Manifest artefacts exceed the ${MAX_INVESTIGATION_MANIFEST_TOTAL_BYTES}-byte combined limit.`);
46
- }
47
- const value = parseBoundedJsonObject(artifact.content, {
48
- label: `Artifact ${index + 1}`,
49
- maximumBytes: MAX_INVESTIGATION_MANIFEST_ARTIFACT_BYTES,
50
- });
51
- const schema = value.schema === undefined
52
- ? null
53
- : requireBoundedString(value.schema, `Artifact ${index + 1} schema`, 160);
54
- const canonical = canonicalArtifactJsonV2(value);
55
- const contentDigestSha256 = digest(artifact.content);
56
- return Object.freeze({
57
- sequence: index + 1,
58
- id: `artifact-${index + 1}`,
59
- schema,
60
- version: artifactVersion(value),
61
- byteLength,
62
- contentDigestSha256,
63
- canonicalDigestSha256: digest(canonical),
64
- });
65
- });
66
- const unsigned = Object.freeze({
67
- schema: INVESTIGATION_MANIFEST_SCHEMA,
68
- version: INVESTIGATION_MANIFEST_VERSION,
69
- generatedAt,
70
- application: Object.freeze({ name: 'WHOISleuth CLI', version: applicationVersion }),
71
- workflow,
72
- configuration: Object.freeze({ digestSha256: configurationDigestSha256 }),
73
- artifacts: Object.freeze(artifacts),
74
- steps: Object.freeze(artifacts.map((artifact) => Object.freeze({
75
- sequence: artifact.sequence,
76
- artifactId: artifact.id,
77
- contentDigestSha256: artifact.contentDigestSha256,
78
- }))),
79
- summary: Object.freeze({ artifactCount: artifacts.length, totalBytes }),
80
- limitations: Object.freeze([
81
- 'The manifest records ordered content digests, schema metadata, tool version, and an optional configuration digest; it deliberately omits source file paths and content values.',
82
- 'Reproduction still depends on access to the exact input artefacts, compatible source services, and any separately retained configuration represented by the supplied digest.',
83
- 'Matching digests establish content identity, not the accuracy, provenance, or current validity of an observation.',
84
- ]),
85
- });
86
- return Object.freeze({
87
- ...unsigned,
88
- integrity: Object.freeze({
89
- algorithm: 'SHA-256',
90
- canonicalization: SORTED_JSON_V2,
91
- digestSha256: await sha256ArtifactDigestV2(unsigned),
92
- }),
93
- });
94
- }
95
- export function formatInvestigationManifest(manifest) {
96
- const lines = [
97
- 'Investigation manifest',
98
- `Workflow ${manifest.workflow}`,
99
- `Tool version ${manifest.application.version}`,
100
- `Artifacts ${manifest.summary.artifactCount}`,
101
- `Total bytes ${manifest.summary.totalBytes}`,
102
- `Configuration ${manifest.configuration.digestSha256 ?? 'not supplied'}`,
103
- `Integrity ${manifest.integrity.digestSha256}`,
104
- '',
105
- 'Ordered artefacts:',
106
- ];
107
- for (const artifact of manifest.artifacts) {
108
- lines.push(` ${artifact.sequence}. ${artifact.schema ?? 'unversioned JSON'}${artifact.version ? ` v${artifact.version}` : ''} · ${artifact.contentDigestSha256}`);
109
- }
110
- lines.push('', 'No source file paths or artefact contents are retained in this manifest.', '');
111
- return lines.join('\n');
112
- }
1
+ export * from "../packages/investigation/investigation-manifest.mjs";
@@ -0,0 +1,103 @@
1
+ import { sha256ArtifactBytes } from "../packages/evidence/artifact-integrity.mjs";
2
+ import { MAX_INVESTIGATION_PACKAGE_BYTES, encodeInvestigationPackageEntries, inspectInvestigationPackage } from "../packages/investigation/investigation-package.mjs";
3
+ import { INVESTIGATION_MANIFEST_SCHEMA } from "../packages/investigation/investigation-manifest.mjs";
4
+ import { hasEncryptedInvestigationPackagePrefix, MAX_ENCRYPTED_INVESTIGATION_PACKAGE_BYTES } from "../packages/contracts/investigation-package-limits.mjs";
5
+ import { decryptInvestigationPackage } from "../packages/investigation/investigation-package-crypto.mjs";
6
+ import { readEditableCaseExport } from "../packages/cases/case-export-input.mjs";
7
+ import { matchCaseReviewFiles } from "../packages/cases/case-review-package.mjs";
8
+ import { OFFLINE_ARTIFACT_VERIFICATION_SCHEMA, OFFLINE_ARTIFACT_VERIFICATION_VERSION, UnsupportedOfflineArtifactError, isCompleteOfflineArtifactVerification, verifyOfflineArtifact, } from "./artifact-verify.mjs";
9
+ export async function verifyOfflineInvestigationFolder(files) {
10
+ const report = await verifyOfflineInvestigationPackage(encodeInvestigationPackageEntries(files));
11
+ return Object.freeze({ ...report, limitations: Object.freeze([
12
+ 'Folder input was converted in memory to the canonical stored-ZIP representation. Package digest and input byte count identify that representation, not filesystem metadata. No ZIP was written.',
13
+ ...report.limitations,
14
+ ]) });
15
+ }
16
+ export async function verifyOfflineInvestigationPackage(input, passphrase) {
17
+ if (!(input instanceof Uint8Array) || input.byteLength > MAX_ENCRYPTED_INVESTIGATION_PACKAGE_BYTES)
18
+ throw new TypeError('Investigation package exceeds its input limit.');
19
+ if (hasEncryptedInvestigationPackagePrefix(input)) {
20
+ if (typeof passphrase !== 'string')
21
+ throw new TypeError('Encrypted evidence packages require --passphrase-file. No content was decrypted.');
22
+ const decrypted = await decryptInvestigationPackage(input, passphrase);
23
+ try {
24
+ const report = await verifyOfflineInvestigationPackage(decrypted.bytes);
25
+ return Object.freeze({ ...report,
26
+ checks: Object.freeze({ ...report.checks, authenticatedEncryption: 'verified' }),
27
+ summary: Object.freeze({ ...report.summary, inputBytes: input.byteLength, ciphertextBytes: decrypted.ciphertextBytes }),
28
+ limitations: Object.freeze(['The complete encrypted container authenticated. Its package digest identifies the decrypted ZIP, not the encrypted file. Encryption does not establish source identity or factual accuracy.', ...report.limitations]),
29
+ });
30
+ }
31
+ finally {
32
+ decrypted.bytes.fill(0);
33
+ }
34
+ }
35
+ if (passphrase !== undefined)
36
+ throw new TypeError('A passphrase was supplied for an unencrypted evidence package. No encrypted-container assurance can be given.');
37
+ if (!(input instanceof Uint8Array) || input.byteLength > MAX_INVESTIGATION_PACKAGE_BYTES)
38
+ throw new TypeError('Investigation package exceeds its input limit.');
39
+ const bytes = new Uint8Array(input);
40
+ const inspected = await inspectInvestigationPackage(bytes);
41
+ const entries = [];
42
+ const caseFiles = [];
43
+ for (const reviewed of inspected.entries) {
44
+ let state = reviewed.state === 'rejected' ? 'rejected' : reviewed.interpretation === 'opaque' ? 'opaque' : 'unsupported';
45
+ let verification = null;
46
+ let issue = reviewed.issue ?? (reviewed.interpretation === 'unsupported_json_value'
47
+ ? 'JSON content identity is verified, but this value has no supported offline source-format reader.' : null);
48
+ if (reviewed.state === 'identity_verified' && reviewed.interpretation === 'not_checked') {
49
+ try {
50
+ const raw = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(inspected.contents.get(reviewed.entry.id));
51
+ const result = await verifyOfflineArtifact(raw);
52
+ verification = { artifact: result.artifact, state: result.state, checks: result.checks, summary: result.summary };
53
+ state = isCompleteOfflineArtifactVerification(result) ? 'admitted' : 'review_required';
54
+ if (state === 'review_required')
55
+ issue = 'The supported reader requires additional verification before complete assurance.';
56
+ if (result.artifact.kind === 'case_export') {
57
+ const candidates = inspected.entries.filter(item => item.entry.id !== reviewed.entry.id && item.state === 'identity_verified')
58
+ .map(item => ({ id: item.entry.id, digestSha256: item.entry.contentDigestSha256, byteLength: item.entry.byteLength }));
59
+ const cases = readEditableCaseExport(raw);
60
+ let references = 0, missing = 0;
61
+ for (const record of cases) {
62
+ const matched = matchCaseReviewFiles(record, candidates);
63
+ references += matched.length;
64
+ missing += matched.filter(item => !item.entries.length).length;
65
+ }
66
+ // Keep incident identifiers and filenames out of redacted reports.
67
+ caseFiles.push({ entryId: reviewed.entry.id, caseCount: cases.length, references, matched: references - missing, missing });
68
+ }
69
+ }
70
+ catch (cause) {
71
+ state = cause instanceof UnsupportedOfflineArtifactError ? 'unsupported' : 'rejected';
72
+ issue = state === 'unsupported' ? 'No supported offline reader accepts this declared source format.' : 'The source file failed its independent format or integrity checks.';
73
+ }
74
+ }
75
+ entries.push({ id: reviewed.entry.id, byteLength: reviewed.entry.byteLength,
76
+ mediaType: 'mediaType' in reviewed.entry ? reviewed.entry.mediaType : 'application/json',
77
+ state, identity: reviewed.state === 'identity_verified' ? 'verified' : 'failed', verification, issue });
78
+ }
79
+ const complete = entries.every((entry) => entry.state === 'admitted' || entry.state === 'opaque')
80
+ && inspected.links.every((link) => link.state === 'linked')
81
+ && inspected.captureManifests.every(capture => capture.state === 'matched')
82
+ && caseFiles.every(item => item.missing === 0);
83
+ return Object.freeze({
84
+ schema: OFFLINE_ARTIFACT_VERIFICATION_SCHEMA, version: OFFLINE_ARTIFACT_VERIFICATION_VERSION,
85
+ artifact: Object.freeze({ kind: 'investigation_package', schema: INVESTIGATION_MANIFEST_SCHEMA, version: inspected.manifest.version }),
86
+ state: complete ? 'verified' : 'partial',
87
+ checks: Object.freeze({ structure: 'verified', contentIntegrity: inspected.identityVerified ? 'verified' : 'failed',
88
+ contentIntegrityScope: 'manifest_and_files', authenticatedEncryption: 'not_applicable' }),
89
+ summary: Object.freeze({ inputBytes: bytes.byteLength, sectionCount: entries.length, recordCount: null, ciphertextBytes: null }),
90
+ manifestIdentity: null,
91
+ package: Object.freeze({ digestSha256: await sha256ArtifactBytes(bytes), audience: 'private', storageEffect: 'none',
92
+ signatureTrust: 'not_checked', timestampAssurance: 'not_checked', factualAccuracy: 'not_established',
93
+ entries: Object.freeze(entries), links: inspected.links, captureManifests: inspected.captureManifests, caseFiles: Object.freeze(caseFiles) }),
94
+ limitations: Object.freeze([
95
+ 'The manifest and selected file bytes are checked independently. Re-compressing the ZIP can change its archive digest without changing its verified file content.',
96
+ 'Opaque files are retained byte-for-byte, not rendered, executed or validated as images or documents. Unsupported JSON remains separate from admitted source formats.',
97
+ 'Capture attachment checks bind selected bytes to the capture manifest declaration, not to a trusted publisher or real website observation.',
98
+ 'Case-file checks match original references to other verified package bytes by length and digest, not by filename or claimed source. Missing originals make the package partial; no file is fetched or imported.',
99
+ 'Source declarations and packaging times are not authenticated. Signatures and timestamp tokens require their own verification and trust decisions.',
100
+ 'This command does not import, overwrite or collect evidence. Unchanged bytes and valid source structure do not establish factual accuracy, currentness or safe sharing.',
101
+ ]),
102
+ });
103
+ }
@@ -1,154 +1,36 @@
1
1
  import { domainToASCII } from 'node:url';
2
2
  import { normalizeExplicitIsoTimestamp } from "../packages/evidence/observation.mjs";
3
- import { INVESTIGATION_PLAN_RECIPES, RUNNABLE_INVESTIGATION_PLAN_RECIPES, cliInvocationNetworkEffect, } from "./command-reference.mjs";
3
+ import { cliInvocationNetworkEffect } from "./command-reference.mjs";
4
+ import { INVESTIGATION_RECIPE_DEFINITIONS, INVESTIGATION_PLAN_RECIPES, RUNNABLE_INVESTIGATION_PLAN_RECIPES, } from "./investigation-recipes.mjs";
4
5
  export const CLI_INVESTIGATION_PLAN_SCHEMA = 'whoisleuth.cli.investigation-plan';
5
6
  export const CLI_INVESTIGATION_PLAN_VERSION = 1;
6
7
  export const CLI_WORKFLOW_RECIPE_CATALOGUE_SCHEMA = 'whoisleuth.cli.workflow-recipe-catalogue';
7
8
  export const CLI_WORKFLOW_RECIPE_CATALOGUE_VERSION = 1;
8
9
  export { INVESTIGATION_PLAN_RECIPES, RUNNABLE_INVESTIGATION_PLAN_RECIPES };
9
- const RECIPES = Object.freeze({
10
- 'domain-triage': Object.freeze({
11
- id: 'domain-triage',
12
- label: 'New domain triage',
13
- subjectRequirement: 'domain',
14
- objective: 'Collect and preserve separately attributed registration, DNS, HTTP, TLS, page, and network-context evidence.',
15
- runnable: true,
16
- limitations: Object.freeze([
17
- 'Collection remains analyst-triggered and source limitations remain explicit.',
18
- 'Disposition, reviewed response actions, monitoring, and closure continue in the browser-local Case workspace; this CLI recipe does not submit reports.',
19
- ]),
20
- steps: (domain) => Object.freeze([
21
- step('collect', 'Collect a Deep lookup', 'lookup', [domain, '--deep', '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.lookup', 'Review source health and limitations before using missing fields.'),
22
- step('export', 'Create a portable evidence report', 'export', ['<saved-lookup.json>'], 'offline', 'analyst_selection', 'whoisleuth.lookup-evidence', 'Select the reviewed lookup file; the plan never guesses a path.'),
23
- step('verify', 'Verify the exported artefact', 'verify-artifact', ['<evidence.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.offline-artifact-verification', 'Keep verification distinct from a claim that the observations are correct or current.'),
24
- ]),
25
- }),
26
- 'lookalike-review': Object.freeze({
27
- id: 'lookalike-review',
28
- label: 'Lookalike candidate review',
29
- subjectRequirement: 'brand_or_domain',
30
- objective: 'Generate a bounded candidate queue, collect only the selected scope, and retain a reviewed candidate lookup.',
31
- runnable: true,
32
- limitations: Object.freeze([
33
- 'Candidate generation does not establish registration, control, intent, or maliciousness.',
34
- 'Official-reference collection and page comparison require analyst-selected saved evidence; use page-compare after retaining the reference and candidate observations.',
35
- ]),
36
- steps: (subject) => Object.freeze([
37
- step('generate', 'Generate candidates offline', 'discover', [subject, '--preset', 'all', '--json'], 'offline', 'none', 'whoisleuth.cli.discover', 'Review mutation families and suppressions before collection.'),
38
- step('scan', 'Collect a bounded candidate queue', 'discover-scan', [subject, '--fast', '--scan-limit', '50', '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.discovery-scan', 'Fast collection is a triage boundary; partial or inconclusive authority evidence remains explicit.'),
39
- step('inspect', 'Deep-review one selected candidate', 'lookup', ['<selected-domain>', '--deep', '--json'], 'network', 'analyst_selection', 'whoisleuth.cli.lookup', 'Select a candidate deliberately; generation does not prove registration, control, intent, or maliciousness.'),
40
- ]),
41
- }),
42
- 'owned-domain-review': Object.freeze({
43
- id: 'owned-domain-review',
44
- label: 'Owned domain posture review',
45
- subjectRequirement: 'domain',
46
- objective: 'Review current passive posture and compare supplied observations with an analyst-authored control manifest.',
47
- runnable: true,
48
- limitations: Object.freeze(['Use only for a domain the analyst owns or is authorised to review.']),
49
- steps: (domain) => Object.freeze([
50
- step('posture', 'Collect bounded DNS posture', 'posture', [domain, '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.posture', 'Review mail profile and delegation evidence before interpreting missing records.'),
51
- step('lookup', 'Collect supporting Deep evidence', 'lookup', [domain, '--deep', '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.lookup', 'Retain separately attributed registration, DNS, TLS, and page observations.'),
52
- step('manifest', 'Review the domain control manifest', 'domain-control', ['<review-input.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.domain-control-review', 'Only complete supplied observations may produce drift.'),
53
- ]),
54
- }),
55
- 'historical-comparison': Object.freeze({
56
- id: 'historical-comparison',
57
- label: 'Historical observation comparison',
58
- subjectRequirement: 'domain',
59
- objective: 'Collect a current observation and compare it with analyst-selected saved observations without merging source states.',
60
- runnable: true,
61
- limitations: Object.freeze(['A later observation does not retroactively refresh retained evidence.']),
62
- steps: (domain) => Object.freeze([
63
- step('current', 'Collect the current lookup', 'lookup', [domain, '--deep', '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.lookup', 'A current request does not refresh or validate older provider-reported history.'),
64
- step('diff', 'Compare two selected observations', 'diff', ['<previous.json>', '<current.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.cli.lookup-diff', 'Equal, different, conflicting, and unavailable evidence remain separate.'),
65
- step('timeline', 'Build a bounded local timeline', 'timeline', ['<oldest.json>', '<newer.json>', '<current.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.cli.lookup-timeline', 'Choose two to twenty same-domain files in chronological scope.'),
66
- ]),
67
- }),
68
- 'campaign-review': Object.freeze({
69
- id: 'campaign-review',
70
- label: 'Campaign candidate review',
71
- subjectRequirement: 'brand_or_domain',
72
- objective: 'Prepare a bounded candidate set, collect a deliberately selected queue, and review retained evidence without asserting campaign attribution.',
73
- runnable: false,
74
- limitations: Object.freeze(['Grouping candidates is analyst triage and does not prove common ownership, control, infrastructure, or intent.']),
75
- steps: (subject) => Object.freeze([
76
- step('prepare', 'Prepare candidates offline', 'discover', [subject, '--preset', 'all', '--json'], 'offline', 'none', 'whoisleuth.cli.discover', 'Review mutation families and bounded omissions before selecting a collection scope.'),
77
- step('collect', 'Collect the selected candidate queue', 'discover-scan', [subject, '--fast', '--scan-limit', '50', '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.discovery-scan', 'Treat partial and inconclusive authority results as explicit outcomes.'),
78
- step('review', 'Review selected retained evidence', 'review-evidence', ['<selected-evidence.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.cli.offline-evidence-review', 'Keep source observations separate and record any campaign grouping as analyst-authored.'),
79
- ]),
10
+ const RECIPES = Object.freeze(Object.fromEntries(INVESTIGATION_PLAN_RECIPES.map((id) => [
11
+ id,
12
+ Object.freeze({
13
+ ...INVESTIGATION_RECIPE_DEFINITIONS[id],
14
+ id,
15
+ steps: (subject) => validatedSteps(INVESTIGATION_RECIPE_DEFINITIONS[id].steps(subject)),
80
16
  }),
81
- 'certificate-anomaly': Object.freeze({
82
- id: 'certificate-anomaly',
83
- label: 'Certificate anomaly review',
84
- subjectRequirement: 'domain',
85
- objective: 'Review bounded certificate observations alongside current source-qualified domain evidence without treating issuance as proof of control or intent.',
86
- runnable: false,
87
- limitations: Object.freeze(['Certificate observations are separately attributed and do not establish current service control.']),
88
- steps: (domain) => Object.freeze([
89
- step('search', 'Collect bounded certificate observations', 'ct-search', [domain, '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.ct-search', 'Review source availability, truncation, and observation timing.'),
90
- step('intake', 'Normalise the selected observations', 'ct-intake', ['<certificate-events.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.ct-event-batch', 'Only selected saved observations enter the offline intake.'),
91
- step('corroborate', 'Collect supporting domain evidence', 'lookup', [domain, '--deep', '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.lookup', 'Compare evidence families without collapsing certificate and registration identities.'),
92
- ]),
93
- }),
94
- 'registry-disagreement': Object.freeze({
95
- id: 'registry-disagreement',
96
- label: 'Registry disagreement review',
97
- subjectRequirement: 'domain',
98
- objective: 'Collect separately attributed registration evidence and review conflicting publications without selecting an arbitrary source as truth.',
99
- runnable: false,
100
- limitations: Object.freeze(['Only authority-aware registration evidence may decide availability; disagreement remains explicit.']),
101
- steps: (domain) => Object.freeze([
102
- step('collect', 'Collect source-qualified registration evidence', 'lookup', [domain, '--deep', '--json'], 'network', 'network_disclosure', 'whoisleuth.cli.lookup', 'Retain RDAP, registrar RDAP, WHOIS, and authority states separately.'),
103
- step('compare', 'Compare registry publications offline', 'compare', ['<saved-lookup.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.cli.compare', 'Do not convert conflicting or unavailable publications into equivalence.'),
104
- step('report', 'Prepare a target-free source report', 'source-report', ['<saved-lookup.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.source-reliability-report', 'The report describes source behaviour, not ownership, safety, or legal status.'),
105
- ]),
106
- }),
107
- 'evidence-handoff': Object.freeze({
108
- id: 'evidence-handoff',
109
- label: 'Reviewed evidence handoff',
110
- subjectRequirement: 'review_label',
111
- objective: 'Verify, minimise, and package analyst-selected evidence for a deliberate handoff without transmitting or submitting it.',
112
- runnable: false,
113
- limitations: Object.freeze(['The recipe prepares local material only; sharing remains a separate deliberate action.']),
114
- steps: () => Object.freeze([
115
- step('verify', 'Verify the selected artefact', 'verify-artifact', ['<evidence.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.offline-artifact-verification', 'Verification checks structure and integrity, not the truth or currency of observations.'),
116
- step('package', 'Build a reviewed public Case-pack', 'case-pack', ['<cases.json>', '--audience', 'public', '--reviewed', '--json'], 'offline', 'analyst_selection', 'whoisleuth.cli.case-pack', 'Review minimisation and audience projection before retaining the separate package.'),
117
- step('lint', 'Review deliberate-sharing metadata', 'sharing-review', ['<package.json>', '--marking', 'clear', '--recipient-scope', 'public', '--purpose', 'reviewed evidence handoff', '--human-reviewed', '--personal-data-reviewed', '--redactions-confirmed', '--json'], 'offline', 'analyst_selection', 'whoisleuth.cli.sharing-review', 'A clear lint result does not send, upload, publish, or authorise the artefact.'),
118
- ]),
119
- }),
120
- 'planned-domain-change': Object.freeze({
121
- id: 'planned-domain-change',
122
- label: 'Planned domain change',
123
- subjectRequirement: 'domain',
124
- objective: 'Review an analyst-authored desired state and prepare bounded change material without changing DNS, registry, mail, or hosted configuration.',
125
- runnable: false,
126
- limitations: Object.freeze(['Planning and packaging never apply, submit, schedule, or enforce a change.']),
127
- steps: () => Object.freeze([
128
- step('control', 'Review the desired-state manifest', 'domain-control', ['<review-input.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.domain-control-review', 'Only supplied complete observations may produce drift.'),
129
- step('assure', 'Review change and recovery assumptions', 'assurance', ['<assurance-input.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.domain-assurance', 'Record uncertainty, rollback dependencies, and unavailable evidence explicitly.'),
130
- step('package', 'Build a reviewed change packet', 'change-packet', ['<change-packet-input.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.domain-change-packet', 'The packet is local reviewed material and performs no submission or enforcement.'),
131
- ]),
132
- }),
133
- 'post-change-verification': Object.freeze({
134
- id: 'post-change-verification',
135
- label: 'Post-change verification',
136
- subjectRequirement: 'domain',
137
- objective: 'Perform one explicit later observation and compare it with analyst-selected retained evidence after an authorised change.',
138
- runnable: false,
139
- limitations: Object.freeze(['This is a one-time recheck, not monitoring setup or proof that every resolver or service has converged.']),
140
- steps: () => Object.freeze([
141
- step('recheck', 'Run one bounded retained-manifest review', 'monitor-once', ['<manifest.json>', '--limit', '1', '--json'], 'network', 'network_disclosure', 'whoisleuth.domain-control-review', 'One later observation may remain partial, unavailable, stale, or conflicting.'),
142
- step('compare', 'Compare selected before and after evidence', 'diff', ['<before.json>', '<after.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.cli.lookup-diff', 'Materiality is derived from compatible retained evidence and does not infer intent.'),
143
- step('record', 'Record reviewed completion material', 'change-packet', ['<post-change-input.json>', '--json'], 'offline', 'analyst_selection', 'whoisleuth.domain-change-packet', 'Recording reviewed material does not submit it or start automatic monitoring.'),
144
- ]),
145
- }),
146
- });
17
+ ])));
147
18
  export const INVESTIGATION_RECIPE_REGISTRY = RECIPES;
19
+ export function workflowStandardInputs(recipe) {
20
+ return RECIPES[recipe].standardInputs ?? [];
21
+ }
148
22
  export const INVESTIGATION_PLAN_RECIPE_LABELS = Object.freeze(Object.fromEntries(INVESTIGATION_PLAN_RECIPES.map((recipe) => [recipe, RECIPES[recipe].label])));
149
23
  export function isRunnableInvestigationRecipe(value) {
150
24
  return RUNNABLE_INVESTIGATION_PLAN_RECIPES.includes(value);
151
25
  }
26
+ export function workflowReviewDeclarations(step) {
27
+ return step.arguments.filter((argument) => [
28
+ '--reviewed',
29
+ '--human-reviewed',
30
+ '--personal-data-reviewed',
31
+ '--redactions-confirmed',
32
+ ].includes(argument));
33
+ }
152
34
  function recipeCatalogueEntry(recipe) {
153
35
  const exampleSubject = recipe.subjectRequirement === 'domain' ? 'example.test' : 'Example Organisation';
154
36
  const steps = recipe.steps(exampleSubject).map((item) => Object.freeze({
@@ -166,7 +48,7 @@ function recipeCatalogueEntry(recipe) {
166
48
  label: recipe.label,
167
49
  objective: recipe.objective,
168
50
  subjectRequirement: recipe.subjectRequirement,
169
- runnableByWorkflowRun: recipe.runnable,
51
+ runnableByWorkflowRun: isRunnableInvestigationRecipe(recipe.id),
170
52
  networkModes: Object.freeze([...new Set(steps.map((item) => item.mode))]),
171
53
  approvals: Object.freeze([...new Set(steps.map((item) => item.approval))]),
172
54
  steps: Object.freeze(steps),
@@ -202,15 +84,20 @@ export function formatWorkflowRecipeCatalogue(catalogue) {
202
84
  '',
203
85
  ].join('\n');
204
86
  }
205
- function step(id, label, command, args, mode, approval, produces, completion) {
206
- const invocationEffect = cliInvocationNetworkEffect(command, args);
207
- if ((mode === 'network') !== (invocationEffect === 'network')) {
208
- throw new Error(`Investigation step ${id} does not match the registered network effect for ${command}.`);
87
+ function validatedSteps(steps) {
88
+ for (const step of steps) {
89
+ const invocationEffect = cliInvocationNetworkEffect(step.command, step.arguments);
90
+ if ((step.mode === 'network') !== (invocationEffect === 'network')) {
91
+ throw new Error(`Investigation step ${step.id} does not match the registered network effect for ${step.command}.`);
92
+ }
209
93
  }
210
- return Object.freeze({ id, label, command, arguments: Object.freeze([...args]), mode, approval, produces, completion });
94
+ return steps;
211
95
  }
212
96
  function boundedSubject(value) {
213
- if (typeof value !== 'string' || !value.trim() || value.length > 253 || /[\u0000-\u001f\u007f]/u.test(value)) {
97
+ if (typeof value !== 'string' ||
98
+ !value.trim() ||
99
+ value.length > 253 ||
100
+ /[\u0000-\u001f\u007f]/u.test(value)) {
214
101
  throw new TypeError('Investigation-plan subject must be bounded text without control characters.');
215
102
  }
216
103
  return value.replace(/\s+/gu, ' ').trim();
@@ -219,7 +106,9 @@ function normalizedDomain(value) {
219
106
  const candidate = domainToASCII(value.toLowerCase().replace(/\.$/u, ''));
220
107
  if (!candidate || candidate.length > 253 || !candidate.includes('.'))
221
108
  return null;
222
- return candidate.split('.').every((label) => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/u.test(label))
109
+ return candidate
110
+ .split('.')
111
+ .every((label) => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/u.test(label))
223
112
  ? candidate
224
113
  : null;
225
114
  }
@@ -228,7 +117,9 @@ export function buildInvestigationPlan(recipeId, subjectValue, generatedAtValue
228
117
  if (!recipe)
229
118
  throw new TypeError('Investigation-plan recipe is unsupported.');
230
119
  const suppliedSubject = boundedSubject(subjectValue);
231
- const subject = recipe.subjectRequirement === 'domain' ? normalizedDomain(suppliedSubject) : suppliedSubject.toLowerCase();
120
+ const subject = recipe.subjectRequirement === 'domain'
121
+ ? normalizedDomain(suppliedSubject)
122
+ : suppliedSubject.toLowerCase();
232
123
  if (!subject)
233
124
  throw new TypeError('This investigation-plan recipe requires one valid domain.');
234
125
  const generatedAt = normalizeExplicitIsoTimestamp(generatedAtValue);