@slicedearth/whoisleuth-cli 1.45.0 → 2.0.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 (268) hide show
  1. package/DISCLOSURE +7 -3
  2. package/NOTICE +5 -4
  3. package/README.md +74 -124
  4. package/SECURITY.md +6 -3
  5. package/bin/whoisleuth.mjs +7 -4
  6. package/cli/archive-inspect.mjs +28 -10
  7. package/cli/arguments.mjs +450 -173
  8. package/cli/artifact-structure.mjs +2507 -0
  9. package/cli/artifact-verify.mjs +286 -64
  10. package/cli/bounded-json.mjs +1 -0
  11. package/cli/bulk-checkpoint.mjs +35 -23
  12. package/cli/bulk-command-runner.mjs +2 -5
  13. package/cli/bulk.mjs +9 -2
  14. package/cli/case-pack.mjs +435 -46
  15. package/cli/ci-report.mjs +6 -1
  16. package/cli/collection-preflight.mjs +2 -2
  17. package/cli/command-catalogue.mjs +12 -3
  18. package/cli/command-reference.mjs +948 -106
  19. package/cli/completion.mjs +504 -218
  20. package/cli/config-profile.mjs +13 -3
  21. package/cli/ct-event-intake.mjs +32 -2
  22. package/cli/discover.mjs +7 -1
  23. package/cli/discovery-observation-snapshot.mjs +24 -28
  24. package/cli/discovery-scan-command-runner.mjs +13 -14
  25. package/cli/discovery-scan.mjs +17 -3
  26. package/cli/discovery-snapshot.mjs +15 -7
  27. package/cli/discovery-workflow.mjs +2 -3
  28. package/cli/doctor.mjs +2 -2
  29. package/cli/domain-control-monitor.mjs +215 -36
  30. package/cli/domain-control-observations.mjs +34 -17
  31. package/cli/errors.mjs +8 -3
  32. package/cli/evidence-command-runner.mjs +17 -11
  33. package/cli/evidence-signing.mjs +68 -50
  34. package/cli/export-evidence.mjs +11 -4
  35. package/cli/external-observation-mapping.mjs +3 -3
  36. package/cli/formatters/html.mjs +3 -3
  37. package/cli/formatters/json.mjs +20 -32
  38. package/cli/formatters/terminal.mjs +586 -22
  39. package/cli/input.mjs +62 -0
  40. package/cli/interactive-launcher.mjs +226 -0
  41. package/cli/interchange-report.mjs +226 -0
  42. package/cli/investigation-manifest.mjs +16 -17
  43. package/cli/investigation-plan.mjs +167 -16
  44. package/cli/investigation-run.mjs +80 -24
  45. package/cli/local-mmdb-review.mjs +45 -14
  46. package/cli/lookalike-calibration.mjs +3 -1
  47. package/cli/lookup-brief.mjs +13 -8
  48. package/cli/lookup-browser.mjs +844 -0
  49. package/cli/lookup-command-runner.mjs +96 -33
  50. package/cli/lookup-diff.mjs +11 -2
  51. package/cli/lookup-plan.mjs +1 -0
  52. package/cli/mail-review.mjs +206 -94
  53. package/cli/manual.mjs +5 -5
  54. package/cli/network-command-runner.mjs +78 -0
  55. package/cli/offline-evidence-review.mjs +45 -14
  56. package/cli/open-asset-model-bridge.mjs +1 -1
  57. package/cli/output-file.mjs +70 -14
  58. package/cli/page-compare.mjs +18 -10
  59. package/cli/progress-events.mjs +2 -1
  60. package/cli/progress.mjs +3 -3
  61. package/cli/registry-cohort.mjs +343 -61
  62. package/cli/registry-doctor.mjs +67 -28
  63. package/cli/registry-support.mjs +2 -1
  64. package/cli/retained-artifact-diff.mjs +375 -0
  65. package/cli/risk-calibration.mjs +89 -40
  66. package/cli/runner.mjs +322 -246
  67. package/cli/saved-lookup.mjs +439 -49
  68. package/cli/sharing-review.mjs +18 -7
  69. package/cli/source-reliability.mjs +75 -36
  70. package/cli/terminal-presentation.mjs +43 -18
  71. package/docs/cli-reference.md +125 -1334
  72. package/docs/cli.md +87 -236
  73. package/frontend/src/lib/analysis/domain-control-manifest-core.js +3 -0
  74. package/frontend/src/lib/analysis/domain-control-records.js +3 -0
  75. package/lib/application-version.mjs +3 -0
  76. package/lib/availability.mjs +72 -52
  77. package/lib/bounded-contract-normalizers.mjs +2 -4
  78. package/lib/bounded-file.mjs +91 -4
  79. package/lib/bounded-json.mjs +287 -0
  80. package/lib/browser-library-profile.mjs +1 -1
  81. package/lib/certificate-extension-profile.mjs +2 -1
  82. package/lib/classify.mjs +56 -5
  83. package/lib/client-behavior-profile.mjs +1 -1
  84. package/lib/credential-surface-profile.mjs +1 -1
  85. package/lib/cryptographic-assurance.mjs +173 -0
  86. package/lib/ct-query.mjs +3 -3
  87. package/lib/ct-search.mjs +120 -64
  88. package/lib/distributed-operation-budget.mjs +4 -2
  89. package/lib/dns-delegation-health.mjs +9 -6
  90. package/lib/dns-intelligence.mjs +4 -3
  91. package/lib/dns-resolver-selection.mjs +6 -4
  92. package/lib/dnssec-chain-validation.mjs +1052 -0
  93. package/lib/dnssec-evidence-validation.mjs +23 -10
  94. package/lib/domain-assurance.mjs +12 -12
  95. package/lib/domain-change-packet.mjs +7 -5
  96. package/lib/domain-control-flight-recorder.mjs +442 -78
  97. package/lib/domain-control-manifest.mjs +314 -171
  98. package/lib/domain-posture-analysis.mjs +5 -2
  99. package/lib/domain-posture.mjs +7 -4
  100. package/lib/encrypted-dns-contract.mjs +2 -3
  101. package/lib/evidence-export.mjs +1243 -88
  102. package/lib/evidence-report-markdown.mjs +3 -0
  103. package/lib/evidence-report.mjs +5 -0
  104. package/lib/external-intelligence-risk.mjs +26 -10
  105. package/lib/favicon.mjs +8 -5
  106. package/lib/feature-policy.mjs +1 -1
  107. package/lib/homepage-metadata-contract.mjs +290 -0
  108. package/lib/hostname.mjs +1 -1
  109. package/lib/html-signals.mjs +89 -5
  110. package/lib/http-evidence-bounds.mjs +3 -0
  111. package/lib/http-intelligence.mjs +332 -6
  112. package/lib/interchange-fidelity-registry.mjs +124 -0
  113. package/lib/local-geoip-evidence.mjs +2 -1
  114. package/lib/lookup-cache.mjs +6 -4
  115. package/lib/lookup-network-evidence-bounds.mjs +9 -0
  116. package/lib/lookup.mjs +27 -4
  117. package/lib/observed-network-context.mjs +1 -1
  118. package/lib/outbound-identity.mjs +2 -3
  119. package/lib/page-fingerprints.mjs +2 -2
  120. package/lib/page-role-profile.mjs +1 -1
  121. package/lib/perceptual-hash.mjs +12 -4
  122. package/lib/portable-generator.mjs +29 -0
  123. package/lib/provider-policy-admission.mjs +11 -4
  124. package/lib/rdap-bootstrap.mjs +76 -16
  125. package/lib/rdap-client.mjs +20 -12
  126. package/lib/rdap-normalization.mjs +324 -80
  127. package/lib/rdap-registrar.mjs +5 -1
  128. package/lib/rdap-transport.mjs +2 -2
  129. package/lib/rdap-validation.mjs +65 -14
  130. package/lib/rdap.mjs +2 -2
  131. package/lib/registrable-domain.mjs +36 -0
  132. package/lib/registry-capabilities.mjs +3 -0
  133. package/lib/registry-capability-catalogue.mjs +12 -2
  134. package/lib/registry-comparison.mjs +28 -11
  135. package/lib/registry-insights.mjs +7 -0
  136. package/lib/response-policy.mjs +27 -4
  137. package/lib/risk-calibration-summary.mjs +340 -0
  138. package/lib/risk-scoring.mjs +4 -3
  139. package/lib/rpki-evidence.mjs +9 -8
  140. package/lib/safe-fetch.mjs +121 -50
  141. package/lib/security-txt.mjs +27 -4
  142. package/lib/service-binding-dns.mjs +6 -1
  143. package/lib/smtp-transport-review.mjs +787 -0
  144. package/lib/sslbl-certificates.generated.mjs +136 -134
  145. package/lib/sslbl-intelligence.mjs +6 -8
  146. package/lib/static-html-analysis.mjs +301 -4
  147. package/lib/structured-data-identity.mjs +51 -19
  148. package/lib/threat-intelligence-fixtures.mjs +2 -4
  149. package/lib/threat-intelligence-manifests.mjs +2 -7
  150. package/lib/threat-intelligence-runtime.mjs +5 -15
  151. package/lib/threat-intelligence-types.mjs +21 -1
  152. package/lib/threatfox-intelligence.mjs +7 -3
  153. package/lib/tls-intelligence.mjs +15 -9
  154. package/lib/tlsa-evidence.mjs +37 -7
  155. package/lib/urlhaus-intelligence.mjs +4 -2
  156. package/lib/urlscan-intelligence.mjs +6 -5
  157. package/lib/website-security-posture.mjs +1 -1
  158. package/lib/website-technology.mjs +1 -1
  159. package/lib/whois-authority.mjs +43 -8
  160. package/lib/whois-chain.mjs +25 -3
  161. package/lib/whois-normalization.mjs +3 -1
  162. package/lib/whois-transport.mjs +12 -3
  163. package/lib/zone-intent-review.mjs +1 -1
  164. package/package.json +12 -4
  165. package/packages/cases/case-brand-profile-references.mjs +85 -0
  166. package/{frontend/src/lib/analysis/case-evidence-model.js → packages/cases/case-evidence-model.mjs} +43 -14
  167. package/packages/cases/case-investigation-branch-model.mjs +132 -0
  168. package/packages/cases/case-migration-model.mjs +476 -0
  169. package/{frontend/src/lib/analysis/case-model.js → packages/cases/case-model.mjs} +3 -3
  170. package/{frontend/src/lib/analysis/case-record-contracts.js → packages/cases/case-record-contracts.mjs} +3 -19
  171. package/{frontend/src/lib/analysis/case-record-core.js → packages/cases/case-record-core.mjs} +58 -31
  172. package/packages/cases/case-record-model.mjs +9 -0
  173. package/{frontend/src/lib/analysis/case-record-operations.js → packages/cases/case-record-operations.mjs} +106 -33
  174. package/{frontend/src/lib/analysis/case-report.js → packages/cases/case-report.mjs} +143 -16
  175. package/packages/cases/case-response-model.mjs +1604 -0
  176. package/packages/cases/case-response-packet.mjs +1312 -0
  177. package/{frontend/src/lib/analysis/case-storage-model.js → packages/cases/case-storage-model.mjs} +2 -2
  178. package/{frontend/src/lib/analysis/http-summary.js → packages/cases/http-summary.mjs} +1 -1
  179. package/packages/cases/opaque-reference-id.mjs +9 -0
  180. package/packages/comparison/comparison-ledger-bulk.mjs +366 -0
  181. package/packages/comparison/comparison-ledger-contract.mjs +241 -0
  182. package/packages/comparison/comparison-ledger-json.mjs +80 -0
  183. package/packages/comparison/comparison-ledger-serialization.mjs +52 -0
  184. package/packages/comparison/favicon-similarity.mjs +78 -0
  185. package/{frontend/src/lib/analysis/page-similarity.js → packages/comparison/page-similarity.mjs} +4 -3
  186. package/{frontend/src/lib/analysis/relationship-evidence.js → packages/comparison/relationship-evidence.mjs} +6 -7
  187. package/packages/contracts/analyst-review-state-contract.mjs +61 -0
  188. package/packages/contracts/analyst-review-state.mjs +50 -0
  189. package/packages/contracts/case-portability.mjs +1310 -0
  190. package/packages/contracts/cli-command-catalogue.mjs +2 -0
  191. package/packages/contracts/cli-lookup.mjs +394 -0
  192. package/packages/contracts/domain-control-flight-recorder.mjs +461 -0
  193. package/packages/contracts/domain-control-manifest.mjs +1027 -0
  194. package/packages/contracts/domain-control-monitor.mjs +310 -0
  195. package/packages/contracts/domain-control-review.mjs +828 -0
  196. package/packages/contracts/domain-name.mjs +4 -0
  197. package/packages/contracts/external-observation-interchange.mjs +224 -0
  198. package/packages/contracts/extracted-domain-lifecycle.mjs +218 -0
  199. package/packages/contracts/investigation-portability.mjs +331 -0
  200. package/packages/contracts/offline-comparison.mjs +160 -0
  201. package/packages/contracts/risk-calibration.mjs +1288 -0
  202. package/packages/contracts/schema-compatibility.mjs +71 -0
  203. package/packages/contracts/schema-lifecycle.mjs +1702 -0
  204. package/packages/contracts/sslbl-snapshot.mjs +17 -0
  205. package/packages/contracts/workspace-portability.mjs +1347 -0
  206. package/packages/evidence/artifact-integrity.mjs +65 -0
  207. package/packages/evidence/decision-fact.mjs +735 -0
  208. package/packages/evidence/domain-control-runtime.mjs +547 -0
  209. package/packages/evidence/domain-name.mjs +41 -0
  210. package/packages/evidence/observation.mjs +384 -0
  211. package/{frontend/src/lib/analysis/external-findings-import.js → packages/interchange/external-findings-import.mjs} +86 -20
  212. package/packages/interchange/retained-text.mjs +8 -0
  213. package/{frontend/src/lib/analysis/acquisition-decision-packet.js → packages/investigation/acquisition-decision-packet.mjs} +11 -8
  214. package/{frontend/src/lib/analysis/bulk-domain-comparison.js → packages/investigation/bulk-domain-comparison.mjs} +28 -9
  215. package/{frontend/src/lib/analysis/bulk-mail-exposure.js → packages/investigation/bulk-mail-exposure.mjs} +67 -18
  216. package/{frontend/src/lib/analysis/bulk-review-export.js → packages/investigation/bulk-review-export.mjs} +10 -9
  217. package/packages/investigation/bulk-review-policy.mjs +1 -0
  218. package/{frontend/src/lib/analysis/investigation-capsule.js → packages/investigation/investigation-capsule.mjs} +50 -18
  219. package/packages/investigation/lookup-artefact-inputs.mjs +1 -0
  220. package/{frontend/src/lib/analysis/lookup-asset-graph.js → packages/investigation/lookup-asset-graph.mjs} +4 -2
  221. package/packages/investigation/lookup-claim-passport.mjs +232 -0
  222. package/packages/investigation/lookup-claim-readiness.mjs +287 -0
  223. package/packages/investigation/lookup-investigation-brief.mjs +172 -0
  224. package/packages/monitoring/analyst-review-state.mjs +680 -0
  225. package/{frontend/src/lib/analysis/brand-profile-model.js → packages/workspace/brand-profile-model.mjs} +97 -50
  226. package/{frontend/src/lib/analysis/bulk-review-model.js → packages/workspace/bulk-review-model.mjs} +15 -15
  227. package/{frontend/src/lib/analysis/bulk-session-model.js → packages/workspace/bulk-session-model.mjs} +179 -39
  228. package/{frontend/src/lib/analysis/bulk-sort.js → packages/workspace/bulk-sort.mjs} +12 -5
  229. package/{frontend/src/lib/analysis/campaign-model.js → packages/workspace/campaign-model.mjs} +20 -22
  230. package/{frontend/src/lib/analysis/detection-rule-model.js → packages/workspace/detection-rule-model.mjs} +15 -17
  231. package/packages/workspace/hostile-input.mjs +172 -0
  232. package/{frontend/src/lib/analysis/investigation-guide.js → packages/workspace/investigation-guide.mjs} +51 -46
  233. package/{frontend/src/lib/analysis/investigation-template-model.js → packages/workspace/investigation-template-model.mjs} +15 -15
  234. package/{frontend/src/lib/analysis/page-baseline.js → packages/workspace/page-baseline.mjs} +6 -13
  235. package/{frontend/src/lib/analysis/relationship-observation-model.js → packages/workspace/relationship-observation-model.mjs} +13 -17
  236. package/{frontend/src/lib/analysis/shortlist-model.js → packages/workspace/shortlist-model.mjs} +20 -18
  237. package/{frontend/src/lib/analysis/watchlist-history.js → packages/workspace/watchlist-history.mjs} +9 -16
  238. package/{frontend/src/lib/analysis/watchlist-store.js → packages/workspace/watchlist-store.mjs} +24 -17
  239. package/{frontend/src/lib/analysis/website-snapshot-model.js → packages/workspace/website-snapshot-model.mjs} +18 -12
  240. package/{frontend/src/lib/analysis/workspace-archive-crypto.js → packages/workspace/workspace-archive-crypto.mjs} +49 -19
  241. package/{frontend/src/lib/analysis/workspace-archive.js → packages/workspace/workspace-archive.mjs} +195 -84
  242. package/third-party-notices.txt +112 -5834
  243. package/frontend/src/lib/analysis/artifact-integrity.js +0 -21
  244. package/frontend/src/lib/analysis/bulk-retry-plan.js +0 -79
  245. package/frontend/src/lib/analysis/bulk-source-coverage.js +0 -76
  246. package/frontend/src/lib/analysis/case-migration-model.js +0 -253
  247. package/frontend/src/lib/analysis/case-record-model.js +0 -7
  248. package/frontend/src/lib/analysis/case-response-model.js +0 -669
  249. package/frontend/src/lib/analysis/case-response-packet.js +0 -573
  250. package/frontend/src/lib/analysis/lookup-decision-support.js +0 -487
  251. package/frontend/src/lib/analysis/lookup-investigation-brief.js +0 -153
  252. package/frontend/src/lib/analysis/lookup-presentation.js +0 -58
  253. package/frontend/src/lib/analysis/lookup-response.js +0 -2
  254. package/frontend/src/lib/analysis/lookup-source-refresh.js +0 -277
  255. package/frontend/src/lib/analysis/lookup-summary-model.js +0 -398
  256. package/frontend/src/lib/analysis/scoring.js +0 -55
  257. package/frontend/src/lib/analysis/utils.js +0 -232
  258. package/frontend/src/lib/analysis/visualization-bounds.js +0 -26
  259. package/frontend/src/lib/analysis/visualization-force-graph.js +0 -352
  260. package/frontend/src/lib/analysis/visualization-matrix.js +0 -88
  261. package/frontend/src/lib/analysis/visualization-models.js +0 -369
  262. package/frontend/src/lib/analysis/visualization-time-series.js +0 -144
  263. package/lib/bounded-json-response.mjs +0 -157
  264. package/lib/lookup-response-contract.mjs +0 -346
  265. package/lib/observation.mjs +0 -114
  266. /package/{frontend/src/lib/analysis/acquisition-due-diligence.js → packages/investigation/acquisition-due-diligence.mjs} +0 -0
  267. /package/{frontend/src/lib/analysis/evidence-coverage-ledger.js → packages/investigation/evidence-coverage-ledger.mjs} +0 -0
  268. /package/{frontend/src/lib/analysis/dns-record-normalization.js → packages/workspace/dns-record-normalization.mjs} +0 -0
@@ -0,0 +1,2 @@
1
+ export const CLI_COMMAND_CATALOGUE_SCHEMA = 'whoisleuth.cli.command-catalogue';
2
+ export const CLI_COMMAND_CATALOGUE_VERSION = 1;
@@ -0,0 +1,394 @@
1
+ import { defineSchemaCompatibility } from "./schema-compatibility.mjs";
2
+ import { defineSchemaLifecycleFamily } from "./schema-lifecycle.mjs";
3
+ export const CLI_LOOKUP_SCHEMA = 'whoisleuth.cli.lookup';
4
+ export const PUBLIC_CLI_LOOKUP_VERSION = 1;
5
+ export const CLI_LOOKUP_VERSION = 2;
6
+ export const SUPPORTED_CLI_LOOKUP_VERSIONS = Object.freeze([
7
+ PUBLIC_CLI_LOOKUP_VERSION,
8
+ CLI_LOOKUP_VERSION,
9
+ ]);
10
+ export const MAX_CLI_LOOKUP_BYTES = 8 * 1024 * 1024;
11
+ export const MAX_CLI_LOOKUP_STRING_LENGTH = 1_024;
12
+ export const MAX_CLI_LOOKUP_JSON_DEPTH = 48;
13
+ export const MAX_CLI_LOOKUP_JSON_KEYS = 50_000;
14
+ export const MAX_CLI_LOOKUP_JSON_VALUES = 100_000;
15
+ export const MAX_CLI_LOOKUP_JSON_CONTAINER_ITEMS = 10_000;
16
+ export const CLI_LOOKUP_QUERY_TYPES = Object.freeze([
17
+ 'domain',
18
+ 'ipv4',
19
+ 'ipv6',
20
+ 'asn',
21
+ ]);
22
+ export const CLI_LOOKUP_REQUIRED_ROOT_KEYS = Object.freeze([
23
+ 'schema',
24
+ 'version',
25
+ 'generatedAt',
26
+ 'mode',
27
+ 'query',
28
+ 'type',
29
+ 'diagnostics',
30
+ ]);
31
+ export const CLI_LOOKUP_OPTIONAL_ROOT_KEYS = Object.freeze([
32
+ 'inputHostname',
33
+ 'registrableDomain',
34
+ 'isSubdomain',
35
+ 'rdap',
36
+ 'whois',
37
+ 'availability',
38
+ 'registryInsights',
39
+ 'reverseDns',
40
+ 'networkContext',
41
+ 'securityTxt',
42
+ 'sslbl',
43
+ 'threatIntelligence',
44
+ 'collectionContext',
45
+ ]);
46
+ export const CLI_LOOKUP_DIAGNOSTIC_REQUIRED_KEYS = Object.freeze([
47
+ 'rdap',
48
+ 'whois',
49
+ ]);
50
+ export const CLI_LOOKUP_COMPATIBILITY = defineSchemaCompatibility({
51
+ id: 'cli.lookup',
52
+ kind: 'cli_document',
53
+ schema: CLI_LOOKUP_SCHEMA,
54
+ currentVersion: CLI_LOOKUP_VERSION,
55
+ supportedVersions: SUPPORTED_CLI_LOOKUP_VERSIONS,
56
+ acceptsUnversionedLegacy: false,
57
+ futureVersionBehavior: 'reject',
58
+ migration: 'read_only',
59
+ writeSemantics: 'normalized_rewrite',
60
+ byteBudget: MAX_CLI_LOOKUP_BYTES,
61
+ owner: 'packages/contracts/cli-lookup.mts',
62
+ note: 'Saved Lookup documents preserve version 1 domain, IP and ASN compatibility while version 2 can additionally retain bounded Deep homepage metadata.',
63
+ });
64
+ export const CLI_LOOKUP_SCHEMA_LIFECYCLE = defineSchemaLifecycleFamily({
65
+ id: 'cli-lookup',
66
+ owner: 'packages/contracts/cli-lookup.mts',
67
+ privacy: 'analyst_authored_sensitive',
68
+ compatibility: [CLI_LOOKUP_COMPATIBILITY],
69
+ contracts: [
70
+ {
71
+ compatibilityId: CLI_LOOKUP_COMPATIBILITY.id,
72
+ schema: CLI_LOOKUP_SCHEMA,
73
+ version: PUBLIC_CLI_LOOKUP_VERSION,
74
+ role: 'document',
75
+ lifecycle: 'legacy',
76
+ readable: true,
77
+ emitted: false,
78
+ exactKeys: false,
79
+ extensionPolicy: 'preserve_bounded',
80
+ futureVersionBehaviour: 'reject',
81
+ migrationTarget: null,
82
+ canonicalisation: null,
83
+ byteBudget: MAX_CLI_LOOKUP_BYTES,
84
+ fixtureIds: ['cli-lookup-v1', 'cli-lookup-asn-v1'],
85
+ },
86
+ {
87
+ compatibilityId: CLI_LOOKUP_COMPATIBILITY.id,
88
+ schema: CLI_LOOKUP_SCHEMA,
89
+ version: CLI_LOOKUP_VERSION,
90
+ role: 'document',
91
+ lifecycle: 'current',
92
+ readable: true,
93
+ emitted: true,
94
+ exactKeys: false,
95
+ extensionPolicy: 'preserve_bounded',
96
+ futureVersionBehaviour: 'reject',
97
+ migrationTarget: null,
98
+ canonicalisation: null,
99
+ byteBudget: MAX_CLI_LOOKUP_BYTES,
100
+ fixtureIds: ['cli-lookup-v2', 'cli-lookup-asn-v2'],
101
+ },
102
+ ],
103
+ fixtures: [
104
+ {
105
+ id: 'cli-lookup-v1',
106
+ path: 'test/fixtures/cli-lookup-v1.json',
107
+ bytes: 952,
108
+ sha256: '0e6601693e384b29285ead97b20947c3a464baf2521277901ff86ad5a6e3a59e',
109
+ contentDigestSha256: null,
110
+ schema: CLI_LOOKUP_SCHEMA,
111
+ version: PUBLIC_CLI_LOOKUP_VERSION,
112
+ role: 'historical',
113
+ expectation: 'accepted_exact',
114
+ expectedOutputFixtureId: null,
115
+ scope: 'repository',
116
+ },
117
+ {
118
+ id: 'cli-lookup-v2',
119
+ path: 'test/fixtures/cli-lookup-v2.json',
120
+ bytes: 4_410,
121
+ sha256: 'd98356ede18ddd12fde8cf10b0cfa43c42f6c9a09f1951e0605e1ec912892778',
122
+ contentDigestSha256: null,
123
+ schema: CLI_LOOKUP_SCHEMA,
124
+ version: CLI_LOOKUP_VERSION,
125
+ role: 'current',
126
+ expectation: 'accepted_exact',
127
+ expectedOutputFixtureId: null,
128
+ scope: 'repository',
129
+ },
130
+ {
131
+ id: 'cli-lookup-asn-v1',
132
+ path: 'test/fixtures/cli-lookup-asn-v1.json',
133
+ bytes: 714,
134
+ sha256: 'bb06e18c67527e559a039f7f826d4d605d7581a556e2e6e511c461ba97dcfdef',
135
+ contentDigestSha256: null,
136
+ schema: CLI_LOOKUP_SCHEMA,
137
+ version: PUBLIC_CLI_LOOKUP_VERSION,
138
+ role: 'historical',
139
+ expectation: 'accepted_exact',
140
+ expectedOutputFixtureId: null,
141
+ scope: 'repository',
142
+ },
143
+ {
144
+ id: 'cli-lookup-asn-v2',
145
+ path: 'test/fixtures/cli-lookup-asn-v2.json',
146
+ bytes: 714,
147
+ sha256: 'a3ee74df02050d6efd935784734c8c4cfd5fcb9833393de68935f5040faf2856',
148
+ contentDigestSha256: null,
149
+ schema: CLI_LOOKUP_SCHEMA,
150
+ version: CLI_LOOKUP_VERSION,
151
+ role: 'current',
152
+ expectation: 'accepted_exact',
153
+ expectedOutputFixtureId: null,
154
+ scope: 'repository',
155
+ },
156
+ ],
157
+ metadata: {
158
+ metadataVersion: 3,
159
+ enforcement: 'declarative_only',
160
+ shapes: [
161
+ {
162
+ id: 'cli-lookup.document.v1',
163
+ schema: CLI_LOOKUP_SCHEMA,
164
+ versions: [PUBLIC_CLI_LOOKUP_VERSION],
165
+ objects: [
166
+ { path: '$', requiredKeys: CLI_LOOKUP_REQUIRED_ROOT_KEYS, optionalKeys: CLI_LOOKUP_OPTIONAL_ROOT_KEYS, unknownKeys: 'preserve_bounded' },
167
+ { path: '$.diagnostics', requiredKeys: CLI_LOOKUP_DIAGNOSTIC_REQUIRED_KEYS, optionalKeys: [], unknownKeys: 'preserve_bounded' },
168
+ { path: '$.diagnostics.rdap', requiredKeys: ['status'], optionalKeys: [], unknownKeys: 'preserve_bounded' },
169
+ { path: '$.diagnostics.whois', requiredKeys: ['status'], optionalKeys: [], unknownKeys: 'preserve_bounded' },
170
+ ],
171
+ fixedArrays: [],
172
+ normalisation: 'preserve_bounded_document',
173
+ target: null,
174
+ },
175
+ {
176
+ id: 'cli-lookup.document.v2',
177
+ schema: CLI_LOOKUP_SCHEMA,
178
+ versions: [CLI_LOOKUP_VERSION],
179
+ objects: [
180
+ { path: '$', requiredKeys: CLI_LOOKUP_REQUIRED_ROOT_KEYS, optionalKeys: CLI_LOOKUP_OPTIONAL_ROOT_KEYS, unknownKeys: 'preserve_bounded' },
181
+ { path: '$.diagnostics', requiredKeys: CLI_LOOKUP_DIAGNOSTIC_REQUIRED_KEYS, optionalKeys: [], unknownKeys: 'preserve_bounded' },
182
+ { path: '$.diagnostics.rdap', requiredKeys: ['status'], optionalKeys: [], unknownKeys: 'preserve_bounded' },
183
+ { path: '$.diagnostics.whois', requiredKeys: ['status'], optionalKeys: [], unknownKeys: 'preserve_bounded' },
184
+ ],
185
+ fixedArrays: [],
186
+ normalisation: 'preserve_bounded_document',
187
+ target: null,
188
+ },
189
+ ],
190
+ boundProfiles: [
191
+ {
192
+ id: 'cli-lookup.document-bounds.v1',
193
+ bounds: [
194
+ { id: 'raw-bytes', path: '$', phase: 'raw_intake', unit: 'bytes', minimum: 1, maximum: MAX_CLI_LOOKUP_BYTES, handling: 'reject' },
195
+ { id: 'serialised-bytes', path: '$', phase: 'serialised', unit: 'bytes', minimum: 1, maximum: MAX_CLI_LOOKUP_BYTES, handling: 'reject' },
196
+ { id: 'json-depth', path: '$', phase: 'pre_accumulation', unit: 'depth', minimum: 0, maximum: MAX_CLI_LOOKUP_JSON_DEPTH, handling: 'reject' },
197
+ { id: 'json-keys', path: '$', phase: 'pre_accumulation', unit: 'keys', minimum: 1, maximum: MAX_CLI_LOOKUP_JSON_KEYS, handling: 'reject' },
198
+ { id: 'json-values', path: '$', phase: 'pre_accumulation', unit: 'values', minimum: 1, maximum: MAX_CLI_LOOKUP_JSON_VALUES, handling: 'reject' },
199
+ { id: 'json-container-items', path: '$', phase: 'pre_accumulation', unit: 'items', minimum: 1, maximum: MAX_CLI_LOOKUP_JSON_CONTAINER_ITEMS, handling: 'reject' },
200
+ { id: 'query-characters', path: '$.query', phase: 'normalised', unit: 'characters', minimum: 1, maximum: MAX_CLI_LOOKUP_STRING_LENGTH, handling: 'reject' },
201
+ { id: 'generated-at-characters', path: '$.generatedAt', phase: 'normalised', unit: 'characters', minimum: 1, maximum: MAX_CLI_LOOKUP_STRING_LENGTH, handling: 'reject' },
202
+ ],
203
+ },
204
+ ],
205
+ hooks: [
206
+ { id: 'cli-lookup.cli.build', role: 'builder', runtime: 'cli', module: 'cli/saved-lookup.mts', exportName: 'buildCliLookupDocument' },
207
+ { id: 'cli-lookup.cli.normalise', role: 'normaliser', runtime: 'cli', module: 'cli/saved-lookup.mts', exportName: 'normalizeCliLookupDocument' },
208
+ { id: 'cli-lookup.cli.parse-all', role: 'normaliser', runtime: 'cli', module: 'cli/saved-lookup.mts', exportName: 'parseCliLookupDocument' },
209
+ { id: 'cli-lookup.cli.parse-domain', role: 'normaliser', runtime: 'cli', module: 'cli/saved-lookup.mts', exportName: 'parseSavedLookupDocument' },
210
+ { id: 'cli-lookup.cli.serialise', role: 'serialiser', runtime: 'cli', module: 'cli/saved-lookup.mts', exportName: 'serializeCliLookupDocument' },
211
+ { id: 'cli-lookup.cli.source-report', role: 'reviewer', runtime: 'cli', module: 'cli/source-reliability.mts', exportName: 'buildSourceReliabilityReport' },
212
+ { id: 'cli-lookup.cli.offline-verify', role: 'structure_validator', runtime: 'cli', module: 'cli/artifact-verify.mts', exportName: 'verifyOfflineArtifact' },
213
+ { id: 'cli-lookup.cli.sharing-review', role: 'sharing_reviewer', runtime: 'cli', module: 'cli/sharing-review.mts', exportName: 'buildSharingReview' },
214
+ ],
215
+ serialisationProfiles: [
216
+ {
217
+ id: 'cli-lookup.json.v1-v2',
218
+ schema: CLI_LOOKUP_SCHEMA,
219
+ versions: [PUBLIC_CLI_LOOKUP_VERSION, CLI_LOOKUP_VERSION],
220
+ mediaType: 'application/json',
221
+ encoding: 'utf-8',
222
+ bom: false,
223
+ indentSpaces: 2,
224
+ terminalLf: true,
225
+ propertyOrder: 'source_insertion',
226
+ canonicalisation: null,
227
+ integrity: 'none',
228
+ serializerHookId: 'cli-lookup.cli.serialise',
229
+ verifierHookIds: [],
230
+ },
231
+ ],
232
+ privacyProfiles: [
233
+ {
234
+ id: 'cli-lookup.sensitive-collection.v1',
235
+ classification: 'analyst_authored_sensitive',
236
+ projection: 'full_manifest',
237
+ includedCategories: ['target-identifiers', 'query-and-mode', 'raw-rdap-publications', 'raw-whois-responses', 'published-contacts', 'source-endpoints', 'source-timings', 'normalised-evidence', 'collection-context'],
238
+ excludedCategories: ['credentials', 'cookies', 'sessions', 'authorisation-material'],
239
+ notePolicy: 'not_applicable',
240
+ retention: 'operator_controlled_output',
241
+ network: 'explicit_bounded_passive_fast_or_deep',
242
+ sharingReview: 'required',
243
+ },
244
+ {
245
+ id: 'cli-lookup.sensitive-file.v1',
246
+ classification: 'analyst_authored_sensitive',
247
+ projection: 'full_manifest',
248
+ includedCategories: ['target-identifiers', 'query-and-mode', 'raw-rdap-publications', 'raw-whois-responses', 'published-contacts', 'source-endpoints', 'source-timings', 'normalised-evidence', 'collection-context'],
249
+ excludedCategories: ['credentials', 'cookies', 'sessions', 'authorisation-material'],
250
+ notePolicy: 'not_applicable',
251
+ retention: 'deliberate_local_file',
252
+ network: 'none',
253
+ sharingReview: 'required',
254
+ },
255
+ {
256
+ id: 'cli-lookup.metadata-report.v1',
257
+ classification: 'metadata_only',
258
+ projection: 'metadata_only',
259
+ includedCategories: ['schema-and-version', 'source-state-counts', 'bounded-timings', 'integrity-state'],
260
+ excludedCategories: ['target-identifiers', 'query-and-mode', 'raw-rdap-publications', 'raw-whois-responses', 'published-contacts', 'source-endpoints', 'normalised-evidence', 'collection-context'],
261
+ notePolicy: 'not_applicable',
262
+ retention: 'transient_report',
263
+ network: 'none',
264
+ sharingReview: 'not_applicable',
265
+ },
266
+ {
267
+ id: 'cli-lookup.source-report.v1',
268
+ classification: 'metadata_only',
269
+ projection: 'metadata_only',
270
+ includedCategories: ['schema-and-version', 'source-state-counts', 'bounded-timings', 'truncation-and-rate-limit-counts', 'aggregate-lookup-mode-counts'],
271
+ excludedCategories: ['target-identifiers', 'query-values', 'per-document-linkage', 'raw-rdap-publications', 'raw-whois-responses', 'published-contacts', 'source-endpoints', 'normalised-evidence', 'collection-context'],
272
+ notePolicy: 'not_applicable',
273
+ retention: 'transient_report',
274
+ network: 'none',
275
+ sharingReview: 'not_applicable',
276
+ },
277
+ ],
278
+ expiryProfiles: [
279
+ {
280
+ id: 'cli-lookup.expiry.not-applicable.v1',
281
+ field: null,
282
+ anchor: null,
283
+ handling: 'not_applicable',
284
+ phase: 'not_applicable',
285
+ maximumLifetimeDays: null,
286
+ },
287
+ ],
288
+ consumerEdges: [
289
+ {
290
+ id: 'cli-lookup.cli-build',
291
+ plane: 'cli',
292
+ operation: 'collect-and-serialise-fast-or-deep',
293
+ acceptedContracts: [],
294
+ emittedContract: { schema: CLI_LOOKUP_SCHEMA, version: CLI_LOOKUP_VERSION },
295
+ shapeIds: ['cli-lookup.document.v2'],
296
+ boundProfileIds: ['cli-lookup.document-bounds.v1'],
297
+ hookIds: ['cli-lookup.cli.build', 'cli-lookup.cli.serialise'],
298
+ serialisationProfileId: 'cli-lookup.json.v1-v2',
299
+ privacyProfileId: 'cli-lookup.sensitive-collection.v1',
300
+ expiryPolicyId: 'cli-lookup.expiry.not-applicable.v1',
301
+ requestMode: 'explicit_bounded_passive_fast_or_deep',
302
+ retentionEffect: 'operator_controlled_output',
303
+ bindingState: 'declared_unenforced',
304
+ policyState: 'current',
305
+ },
306
+ {
307
+ id: 'cli-lookup.cli-read-all',
308
+ plane: 'cli',
309
+ operation: 'read-all-query-types',
310
+ acceptedContracts: [{ schema: CLI_LOOKUP_SCHEMA, versions: [PUBLIC_CLI_LOOKUP_VERSION, CLI_LOOKUP_VERSION], mode: 'direct' }],
311
+ emittedContract: null,
312
+ shapeIds: ['cli-lookup.document.v1', 'cli-lookup.document.v2'],
313
+ boundProfileIds: ['cli-lookup.document-bounds.v1'],
314
+ hookIds: ['cli-lookup.cli.parse-all'],
315
+ serialisationProfileId: null,
316
+ privacyProfileId: 'cli-lookup.sensitive-file.v1',
317
+ expiryPolicyId: 'cli-lookup.expiry.not-applicable.v1',
318
+ requestMode: 'none',
319
+ retentionEffect: 'deliberate_local_file',
320
+ bindingState: 'declared_unenforced',
321
+ policyState: 'current',
322
+ },
323
+ {
324
+ id: 'cli-lookup.cli-read-domain',
325
+ plane: 'cli',
326
+ operation: 'read-domain-only',
327
+ acceptedContracts: [{ schema: CLI_LOOKUP_SCHEMA, versions: [PUBLIC_CLI_LOOKUP_VERSION, CLI_LOOKUP_VERSION], mode: 'direct', discriminator: { path: '$.type', values: ['domain'] } }],
328
+ emittedContract: null,
329
+ shapeIds: ['cli-lookup.document.v1', 'cli-lookup.document.v2'],
330
+ boundProfileIds: ['cli-lookup.document-bounds.v1'],
331
+ hookIds: ['cli-lookup.cli.parse-domain'],
332
+ serialisationProfileId: null,
333
+ privacyProfileId: 'cli-lookup.sensitive-file.v1',
334
+ expiryPolicyId: 'cli-lookup.expiry.not-applicable.v1',
335
+ requestMode: 'none',
336
+ retentionEffect: 'deliberate_local_file',
337
+ bindingState: 'declared_unenforced',
338
+ policyState: 'current',
339
+ },
340
+ {
341
+ id: 'cli-lookup.cli-source-report',
342
+ plane: 'cli',
343
+ operation: 'build-source-reliability-report',
344
+ acceptedContracts: [{ schema: CLI_LOOKUP_SCHEMA, versions: [PUBLIC_CLI_LOOKUP_VERSION, CLI_LOOKUP_VERSION], mode: 'direct' }],
345
+ emittedContract: null,
346
+ shapeIds: ['cli-lookup.document.v1', 'cli-lookup.document.v2'],
347
+ boundProfileIds: ['cli-lookup.document-bounds.v1'],
348
+ hookIds: ['cli-lookup.cli.normalise', 'cli-lookup.cli.source-report'],
349
+ serialisationProfileId: null,
350
+ privacyProfileId: 'cli-lookup.source-report.v1',
351
+ expiryPolicyId: 'cli-lookup.expiry.not-applicable.v1',
352
+ requestMode: 'none',
353
+ retentionEffect: 'transient_report',
354
+ bindingState: 'declared_unenforced',
355
+ policyState: 'current',
356
+ },
357
+ {
358
+ id: 'cli-lookup.cli-offline-verify',
359
+ plane: 'cli',
360
+ operation: 'verify-structure',
361
+ acceptedContracts: [{ schema: CLI_LOOKUP_SCHEMA, versions: [PUBLIC_CLI_LOOKUP_VERSION, CLI_LOOKUP_VERSION], mode: 'direct' }],
362
+ emittedContract: null,
363
+ shapeIds: ['cli-lookup.document.v1', 'cli-lookup.document.v2'],
364
+ boundProfileIds: ['cli-lookup.document-bounds.v1'],
365
+ hookIds: ['cli-lookup.cli.parse-all', 'cli-lookup.cli.offline-verify'],
366
+ serialisationProfileId: null,
367
+ privacyProfileId: 'cli-lookup.metadata-report.v1',
368
+ expiryPolicyId: 'cli-lookup.expiry.not-applicable.v1',
369
+ requestMode: 'none',
370
+ retentionEffect: 'transient_report',
371
+ bindingState: 'declared_unenforced',
372
+ policyState: 'current',
373
+ },
374
+ {
375
+ id: 'cli-lookup.cli-sharing-review',
376
+ plane: 'cli',
377
+ operation: 'build-redacted-sharing-review',
378
+ acceptedContracts: [{ schema: CLI_LOOKUP_SCHEMA, versions: [PUBLIC_CLI_LOOKUP_VERSION, CLI_LOOKUP_VERSION], mode: 'direct' }],
379
+ emittedContract: null,
380
+ shapeIds: ['cli-lookup.document.v1', 'cli-lookup.document.v2'],
381
+ boundProfileIds: ['cli-lookup.document-bounds.v1'],
382
+ hookIds: ['cli-lookup.cli.parse-all', 'cli-lookup.cli.sharing-review'],
383
+ serialisationProfileId: null,
384
+ privacyProfileId: 'cli-lookup.metadata-report.v1',
385
+ expiryPolicyId: 'cli-lookup.expiry.not-applicable.v1',
386
+ requestMode: 'none',
387
+ retentionEffect: 'transient_report',
388
+ bindingState: 'declared_unenforced',
389
+ policyState: 'current',
390
+ },
391
+ ],
392
+ consumerRelationships: [],
393
+ },
394
+ });