@mailwoman/core 11.1.0 → 11.3.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 (477) hide show
  1. package/README.md +2 -2
  2. package/lib/api/arcgis.ts +194 -0
  3. package/lib/api/ckan.ts +1 -1
  4. package/lib/api/disk-storage.ts +2 -2
  5. package/lib/api/ogc.ts +1 -1
  6. package/lib/api/retry.ts +7 -2
  7. package/lib/api/test/transport.ts +1 -1
  8. package/lib/{binary-frame.ts → asset/binary-frame.ts} +1 -1
  9. package/lib/async/abort.ts +100 -0
  10. package/lib/{memoize.ts → async/memoize.ts} +2 -2
  11. package/lib/{promises.ts → async/promises.ts} +1 -1
  12. package/lib/cloudflare/tokens.ts +1 -1
  13. package/lib/cloudflare/wrangler.ts +3 -3
  14. package/lib/crypto/digest.ts +1 -1
  15. package/lib/crypto/ed25519.ts +8 -0
  16. package/lib/crypto/node.ts +1 -1
  17. package/lib/data-root.ts +16 -3
  18. package/lib/decoder/containment.ts +4 -1
  19. package/lib/decoder/serialize/outline.ts +50 -0
  20. package/lib/decoder/types.ts +9 -1
  21. package/lib/decoder.ts +1 -0
  22. package/lib/env/schema.ts +5 -0
  23. package/lib/fs/deflate64.ts +1 -1
  24. package/lib/fs/lock.ts +183 -25
  25. package/lib/fs/readers.ts +1 -1
  26. package/lib/fs/writers.ts +1 -1
  27. package/lib/geocode/result.ts +50 -6
  28. package/lib/html/text.ts +2 -2
  29. package/lib/index.ts +0 -1
  30. package/lib/layers/artifact.ts +2 -2
  31. package/lib/layers/coverage.ts +1 -1
  32. package/lib/layers/manifest.ts +94 -2
  33. package/lib/layers/provenance.ts +246 -0
  34. package/lib/layers/publication.ts +4 -3
  35. package/lib/layers/selection.ts +2 -2
  36. package/lib/license/branch.ts +66 -0
  37. package/lib/license/configured.ts +4 -2
  38. package/lib/license/declaration.ts +1 -1
  39. package/lib/license/key/file.ts +1 -1
  40. package/lib/license/key.ts +148 -201
  41. package/lib/license/provenance.ts +193 -0
  42. package/lib/license/register.ts +7 -78
  43. package/lib/license/stamp.ts +8 -2
  44. package/lib/license/text-url.ts +55 -0
  45. package/lib/license/training.ts +67 -0
  46. package/lib/license.ts +7 -6
  47. package/lib/locale/registry.ts +1 -1
  48. package/lib/locale/zh-cn-units.ts +1 -1
  49. package/lib/module/workspace.ts +1 -1
  50. package/lib/{routing.ts → network/routing.ts} +1 -1
  51. package/lib/pipeline/result.ts +7 -27
  52. package/lib/pipeline/runtime-pipeline.ts +131 -152
  53. package/lib/pipeline/stage.ts +290 -0
  54. package/lib/pipeline/types.ts +154 -20
  55. package/lib/pipeline.ts +14 -2
  56. package/lib/{git.ts → repo/git.ts} +21 -1
  57. package/lib/{release-config.ts → repo/release-config.ts} +8 -0
  58. package/lib/{scope-config.ts → repo/scope-config.ts} +8 -36
  59. package/lib/{spdx-header.ts → repo/spdx-header.ts} +8 -0
  60. package/lib/{workspaces.ts → repo/workspaces.ts} +1 -1
  61. package/lib/resolver/lookup-types.ts +1 -1
  62. package/lib/resolver/region-database-provider.ts +33 -0
  63. package/lib/resolver/synthetic-id-ranges.ts +76 -4
  64. package/lib/resolver/types.ts +231 -6
  65. package/lib/resolver.ts +14 -1
  66. package/lib/state-machine.ts +1 -1
  67. package/lib/strings/python-json.ts +15 -5
  68. package/lib/tokenization/Span.ts +12 -0
  69. package/lib/utils/chunk-process.ts +2 -2
  70. package/lib/utils/geodatabase-archive.ts +1 -1
  71. package/lib/utils/time.ts +190 -6
  72. package/lib/utils.ts +4 -4
  73. package/out/api/arcgis.d.ts +76 -0
  74. package/out/api/arcgis.d.ts.map +1 -1
  75. package/out/api/arcgis.js +123 -0
  76. package/out/api/arcgis.js.map +1 -1
  77. package/out/api/ckan.js +1 -1
  78. package/out/api/ckan.js.map +1 -1
  79. package/out/api/disk-storage.d.ts.map +1 -1
  80. package/out/api/disk-storage.js +2 -2
  81. package/out/api/disk-storage.js.map +1 -1
  82. package/out/api/ogc.js +1 -1
  83. package/out/api/ogc.js.map +1 -1
  84. package/out/api/retry.d.ts.map +1 -1
  85. package/out/api/retry.js +6 -2
  86. package/out/api/retry.js.map +1 -1
  87. package/out/api/test/transport.js +1 -1
  88. package/out/api/test/transport.js.map +1 -1
  89. package/out/asset/binary-frame.d.ts.map +1 -0
  90. package/out/{binary-frame.js → asset/binary-frame.js} +1 -1
  91. package/out/asset/binary-frame.js.map +1 -0
  92. package/out/asset/load-ledger.d.ts.map +1 -0
  93. package/out/asset/load-ledger.js.map +1 -0
  94. package/out/asset/overture-pins.d.ts.map +1 -0
  95. package/out/asset/overture-pins.js.map +1 -0
  96. package/out/asset/postcode-prefix-files.d.ts.map +1 -0
  97. package/out/asset/postcode-prefix-files.js.map +1 -0
  98. package/out/async/abort.d.ts +57 -0
  99. package/out/async/abort.d.ts.map +1 -0
  100. package/out/async/abort.js +89 -0
  101. package/out/async/abort.js.map +1 -0
  102. package/out/async/memoize.d.ts.map +1 -0
  103. package/out/{memoize.js → async/memoize.js} +2 -2
  104. package/out/async/memoize.js.map +1 -0
  105. package/out/{promises.d.ts → async/promises.d.ts} +1 -1
  106. package/out/async/promises.d.ts.map +1 -0
  107. package/out/{promises.js → async/promises.js} +1 -1
  108. package/out/async/promises.js.map +1 -0
  109. package/out/cloudflare/tokens.js +1 -1
  110. package/out/cloudflare/tokens.js.map +1 -1
  111. package/out/cloudflare/wrangler.js +3 -3
  112. package/out/cloudflare/wrangler.js.map +1 -1
  113. package/out/crypto/digest.d.ts +1 -1
  114. package/out/crypto/digest.js +1 -1
  115. package/out/crypto/ed25519.d.ts +7 -0
  116. package/out/crypto/ed25519.d.ts.map +1 -1
  117. package/out/crypto/ed25519.js +7 -0
  118. package/out/crypto/ed25519.js.map +1 -1
  119. package/out/crypto/hash.d.ts.map +1 -0
  120. package/out/crypto/hash.js.map +1 -0
  121. package/out/crypto/node.js +1 -1
  122. package/out/crypto/node.js.map +1 -1
  123. package/out/data-root.d.ts +11 -3
  124. package/out/data-root.d.ts.map +1 -1
  125. package/out/data-root.js +14 -3
  126. package/out/data-root.js.map +1 -1
  127. package/out/decoder/containment.d.ts.map +1 -1
  128. package/out/decoder/containment.js +1 -1
  129. package/out/decoder/containment.js.map +1 -1
  130. package/out/decoder/serialize/outline.d.ts +25 -0
  131. package/out/decoder/serialize/outline.d.ts.map +1 -0
  132. package/out/decoder/serialize/outline.js +37 -0
  133. package/out/decoder/serialize/outline.js.map +1 -0
  134. package/out/decoder/types.d.ts +8 -0
  135. package/out/decoder/types.d.ts.map +1 -1
  136. package/out/decoder/types.js +1 -1
  137. package/out/decoder/types.js.map +1 -1
  138. package/out/decoder.d.ts +1 -0
  139. package/out/decoder.d.ts.map +1 -1
  140. package/out/decoder.js +1 -0
  141. package/out/decoder.js.map +1 -1
  142. package/out/env/schema.d.ts +1 -0
  143. package/out/env/schema.d.ts.map +1 -1
  144. package/out/env/schema.js +4 -0
  145. package/out/env/schema.js.map +1 -1
  146. package/out/env.d.ts +1 -0
  147. package/out/env.d.ts.map +1 -1
  148. package/out/fs/deflate64.js +1 -1
  149. package/out/fs/deflate64.js.map +1 -1
  150. package/out/fs/lock.d.ts +73 -4
  151. package/out/fs/lock.d.ts.map +1 -1
  152. package/out/fs/lock.js +96 -19
  153. package/out/fs/lock.js.map +1 -1
  154. package/out/fs/readers.js +1 -1
  155. package/out/fs/readers.js.map +1 -1
  156. package/out/fs/writers.d.ts +1 -1
  157. package/out/fs/writers.d.ts.map +1 -1
  158. package/out/fs/writers.js +1 -1
  159. package/out/fs/writers.js.map +1 -1
  160. package/out/geocode/result.d.ts +25 -1
  161. package/out/geocode/result.d.ts.map +1 -1
  162. package/out/geocode/result.js +49 -6
  163. package/out/geocode/result.js.map +1 -1
  164. package/out/html/text.js +2 -2
  165. package/out/html/trust-policies.d.ts.map +1 -0
  166. package/out/html/trust-policies.js.map +1 -0
  167. package/out/index.d.ts +0 -1
  168. package/out/index.d.ts.map +1 -1
  169. package/out/index.js +0 -1
  170. package/out/index.js.map +1 -1
  171. package/out/layers/artifact.js +2 -2
  172. package/out/layers/artifact.js.map +1 -1
  173. package/out/layers/coverage.d.ts.map +1 -1
  174. package/out/layers/coverage.js +1 -1
  175. package/out/layers/coverage.js.map +1 -1
  176. package/out/layers/manifest.d.ts +53 -0
  177. package/out/layers/manifest.d.ts.map +1 -1
  178. package/out/layers/manifest.js +68 -2
  179. package/out/layers/manifest.js.map +1 -1
  180. package/out/layers/provenance.d.ts +127 -0
  181. package/out/layers/provenance.d.ts.map +1 -0
  182. package/out/layers/provenance.js +122 -0
  183. package/out/layers/provenance.js.map +1 -0
  184. package/out/layers/publication.d.ts.map +1 -1
  185. package/out/layers/publication.js +3 -3
  186. package/out/layers/publication.js.map +1 -1
  187. package/out/layers/selection.d.ts.map +1 -1
  188. package/out/layers/selection.js +2 -2
  189. package/out/layers/selection.js.map +1 -1
  190. package/out/license/branch.d.ts +33 -0
  191. package/out/license/branch.d.ts.map +1 -0
  192. package/out/license/branch.js +52 -0
  193. package/out/license/branch.js.map +1 -0
  194. package/out/license/configured.d.ts +1 -1
  195. package/out/license/configured.d.ts.map +1 -1
  196. package/out/license/configured.js +1 -9
  197. package/out/license/configured.js.map +1 -1
  198. package/out/license/declaration.d.ts +1 -1
  199. package/out/license/declaration.d.ts.map +1 -1
  200. package/out/license/key/file.js +1 -1
  201. package/out/license/key/file.js.map +1 -1
  202. package/out/license/key.d.ts +27 -115
  203. package/out/license/key.d.ts.map +1 -1
  204. package/out/license/key.js +98 -164
  205. package/out/license/key.js.map +1 -1
  206. package/out/license/provenance.d.ts +47 -0
  207. package/out/license/provenance.d.ts.map +1 -0
  208. package/out/license/provenance.js +134 -0
  209. package/out/license/provenance.js.map +1 -0
  210. package/out/license/register.d.ts +6 -47
  211. package/out/license/register.d.ts.map +1 -1
  212. package/out/license/register.js +7 -58
  213. package/out/license/register.js.map +1 -1
  214. package/out/license/stamp.d.ts +7 -1
  215. package/out/license/stamp.d.ts.map +1 -1
  216. package/out/license/stamp.js +2 -2
  217. package/out/license/stamp.js.map +1 -1
  218. package/out/license/text-url.d.ts +9 -0
  219. package/out/license/text-url.d.ts.map +1 -0
  220. package/out/license/text-url.js +49 -0
  221. package/out/license/text-url.js.map +1 -0
  222. package/out/license/training.d.ts +29 -0
  223. package/out/license/training.d.ts.map +1 -0
  224. package/out/license/training.js +52 -0
  225. package/out/license/training.js.map +1 -0
  226. package/out/license.d.ts +7 -6
  227. package/out/license.d.ts.map +1 -1
  228. package/out/license.js +7 -6
  229. package/out/license.js.map +1 -1
  230. package/out/locale/registry.d.ts.map +1 -1
  231. package/out/locale/registry.js +1 -1
  232. package/out/locale/registry.js.map +1 -1
  233. package/out/locale/zh-cn-units.js +1 -1
  234. package/out/locale/zh-cn-units.js.map +1 -1
  235. package/out/math/numeric.d.ts.map +1 -0
  236. package/out/math/numeric.js.map +1 -0
  237. package/out/math/random.d.ts.map +1 -0
  238. package/out/math/random.js.map +1 -0
  239. package/out/math/stats.d.ts.map +1 -0
  240. package/out/math/stats.js.map +1 -0
  241. package/out/module/workspace.js +1 -1
  242. package/out/module/workspace.js.map +1 -1
  243. package/out/network/routing.d.ts.map +1 -0
  244. package/out/{routing.js → network/routing.js} +1 -1
  245. package/out/network/routing.js.map +1 -0
  246. package/out/pipeline/result.d.ts +7 -25
  247. package/out/pipeline/result.d.ts.map +1 -1
  248. package/out/pipeline/runtime-pipeline.d.ts +8 -4
  249. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  250. package/out/pipeline/runtime-pipeline.js +56 -109
  251. package/out/pipeline/runtime-pipeline.js.map +1 -1
  252. package/out/pipeline/stage.d.ts +180 -0
  253. package/out/pipeline/stage.d.ts.map +1 -0
  254. package/out/pipeline/stage.js +130 -0
  255. package/out/pipeline/stage.js.map +1 -0
  256. package/out/pipeline/types.d.ts +146 -20
  257. package/out/pipeline/types.d.ts.map +1 -1
  258. package/out/pipeline/types.js +24 -8
  259. package/out/pipeline/types.js.map +1 -1
  260. package/out/pipeline.d.ts +5 -3
  261. package/out/pipeline.d.ts.map +1 -1
  262. package/out/pipeline.js +2 -1
  263. package/out/pipeline.js.map +1 -1
  264. package/out/{git.d.ts → repo/git.d.ts} +10 -1
  265. package/out/repo/git.d.ts.map +1 -0
  266. package/out/{git.js → repo/git.js} +14 -1
  267. package/out/repo/git.js.map +1 -0
  268. package/out/{release-config.d.ts → repo/release-config.d.ts} +8 -0
  269. package/out/repo/release-config.d.ts.map +1 -0
  270. package/out/repo/release-config.js.map +1 -0
  271. package/out/{scope-config.d.ts → repo/scope-config.d.ts} +8 -23
  272. package/out/repo/scope-config.d.ts.map +1 -0
  273. package/out/{scope-config.js → repo/scope-config.js} +0 -17
  274. package/out/repo/scope-config.js.map +1 -0
  275. package/out/repo/spdx-header.d.ts.map +1 -0
  276. package/out/{spdx-header.js → repo/spdx-header.js} +7 -0
  277. package/out/repo/spdx-header.js.map +1 -0
  278. package/out/repo/vale.d.ts.map +1 -0
  279. package/out/repo/vale.js.map +1 -0
  280. package/out/repo/workspaces.d.ts.map +1 -0
  281. package/out/{workspaces.js → repo/workspaces.js} +1 -1
  282. package/out/repo/workspaces.js.map +1 -0
  283. package/out/resolver/lookup-types.d.ts +1 -1
  284. package/out/resolver/region-database-provider.d.ts +30 -0
  285. package/out/resolver/region-database-provider.d.ts.map +1 -1
  286. package/out/resolver/synthetic-id-ranges.d.ts +46 -4
  287. package/out/resolver/synthetic-id-ranges.d.ts.map +1 -1
  288. package/out/resolver/synthetic-id-ranges.js +66 -4
  289. package/out/resolver/synthetic-id-ranges.js.map +1 -1
  290. package/out/resolver/types.d.ts +201 -7
  291. package/out/resolver/types.d.ts.map +1 -1
  292. package/out/resolver/types.js +57 -0
  293. package/out/resolver/types.js.map +1 -1
  294. package/out/resolver.d.ts +3 -3
  295. package/out/resolver.d.ts.map +1 -1
  296. package/out/resolver.js +1 -1
  297. package/out/resolver.js.map +1 -1
  298. package/out/scripting/process.d.ts.map +1 -0
  299. package/out/scripting/process.js.map +1 -0
  300. package/out/scripting/workers.d.ts.map +1 -0
  301. package/out/scripting/workers.js.map +1 -0
  302. package/out/state-machine.d.ts +1 -1
  303. package/out/strings/python-json.d.ts +12 -1
  304. package/out/strings/python-json.d.ts.map +1 -1
  305. package/out/strings/python-json.js +9 -4
  306. package/out/strings/python-json.js.map +1 -1
  307. package/out/tokenization/Span.d.ts +11 -0
  308. package/out/tokenization/Span.d.ts.map +1 -1
  309. package/out/tokenization/Span.js.map +1 -1
  310. package/out/tools/build-deflate64-wasm.run.js +2 -2
  311. package/out/tools/build-deflate64-wasm.run.js.map +1 -1
  312. package/out/tools/coarse-placer/build/dataset.js +1 -1
  313. package/out/tools/coarse-placer/build/dataset.js.map +1 -1
  314. package/out/tools/coarse-placer/build/outlier/exposure.js +1 -1
  315. package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -1
  316. package/out/tools/coarse-placer/build/outlier/latin.d.ts.map +1 -1
  317. package/out/tools/coarse-placer/build/outlier/latin.js +5 -1
  318. package/out/tools/coarse-placer/build/outlier/latin.js.map +1 -1
  319. package/out/tools/coarse-placer/country-sets.d.ts +2 -2
  320. package/out/tools/coarse-placer/country-sets.js +2 -2
  321. package/out/tools/coarse-placer/outlier-rows.js +2 -2
  322. package/out/tools/coarse-placer/outlier-rows.js.map +1 -1
  323. package/out/tools/coarse-placer/train.js +1 -1
  324. package/out/tools/coarse-placer/train.js.map +1 -1
  325. package/out/tools/generate-language-types.js +2 -2
  326. package/out/tools/generate-language-types.js.map +1 -1
  327. package/out/tools/license/product-fixtures.run.d.ts +2 -0
  328. package/out/tools/license/product-fixtures.run.d.ts.map +1 -0
  329. package/out/tools/license/product-fixtures.run.js +350 -0
  330. package/out/tools/license/product-fixtures.run.js.map +1 -0
  331. package/out/utils/chunk-process.js +2 -2
  332. package/out/utils/chunk-process.js.map +1 -1
  333. package/out/utils/geodatabase-archive.js +1 -1
  334. package/out/utils/geodatabase-archive.js.map +1 -1
  335. package/out/utils/time.d.ts +46 -3
  336. package/out/utils/time.d.ts.map +1 -1
  337. package/out/utils/time.js +139 -6
  338. package/out/utils/time.js.map +1 -1
  339. package/out/utils.d.ts +4 -4
  340. package/out/utils.d.ts.map +1 -1
  341. package/out/utils.js +4 -4
  342. package/out/utils.js.map +1 -1
  343. package/out/values/identical.d.ts.map +1 -0
  344. package/out/values/identical.js.map +1 -0
  345. package/out/values/json.d.ts.map +1 -0
  346. package/out/values/json.js.map +1 -0
  347. package/out/values/objects.d.ts.map +1 -0
  348. package/out/values/objects.js.map +1 -0
  349. package/package.json +278 -243
  350. package/tools/build-deflate64-wasm.run.ts +2 -2
  351. package/tools/coarse-placer/build/dataset.ts +1 -1
  352. package/tools/coarse-placer/build/outlier/exposure.ts +1 -1
  353. package/tools/coarse-placer/build/outlier/latin.ts +5 -1
  354. package/tools/coarse-placer/country-sets.ts +2 -2
  355. package/tools/coarse-placer/outlier-rows.ts +2 -2
  356. package/tools/coarse-placer/train.ts +1 -1
  357. package/tools/generate-language-types.ts +2 -2
  358. package/tools/license/product-fixtures.run.ts +449 -0
  359. package/lib/collections.ts +0 -5
  360. package/lib/license/decision.ts +0 -329
  361. package/lib/license/obligations.ts +0 -256
  362. package/lib/license/record.ts +0 -277
  363. package/lib/scripting/ingest-chunk-script.ts +0 -87
  364. package/out/binary-frame.d.ts.map +0 -1
  365. package/out/binary-frame.js.map +0 -1
  366. package/out/collections.d.ts +0 -2
  367. package/out/collections.d.ts.map +0 -1
  368. package/out/collections.js +0 -5
  369. package/out/collections.js.map +0 -1
  370. package/out/git.d.ts.map +0 -1
  371. package/out/git.js.map +0 -1
  372. package/out/hash.d.ts.map +0 -1
  373. package/out/hash.js.map +0 -1
  374. package/out/identical.d.ts.map +0 -1
  375. package/out/identical.js.map +0 -1
  376. package/out/json.d.ts.map +0 -1
  377. package/out/json.js.map +0 -1
  378. package/out/license/decision.d.ts +0 -179
  379. package/out/license/decision.d.ts.map +0 -1
  380. package/out/license/decision.js +0 -169
  381. package/out/license/decision.js.map +0 -1
  382. package/out/license/obligations.d.ts +0 -102
  383. package/out/license/obligations.d.ts.map +0 -1
  384. package/out/license/obligations.js +0 -188
  385. package/out/license/obligations.js.map +0 -1
  386. package/out/license/record.d.ts +0 -136
  387. package/out/license/record.d.ts.map +0 -1
  388. package/out/license/record.js +0 -222
  389. package/out/license/record.js.map +0 -1
  390. package/out/load-ledger.d.ts.map +0 -1
  391. package/out/load-ledger.js.map +0 -1
  392. package/out/memoize.d.ts.map +0 -1
  393. package/out/memoize.js.map +0 -1
  394. package/out/numeric.d.ts.map +0 -1
  395. package/out/numeric.js.map +0 -1
  396. package/out/objects.d.ts.map +0 -1
  397. package/out/objects.js.map +0 -1
  398. package/out/overture-pins.d.ts.map +0 -1
  399. package/out/overture-pins.js.map +0 -1
  400. package/out/postcode-prefix-files.d.ts.map +0 -1
  401. package/out/postcode-prefix-files.js.map +0 -1
  402. package/out/process.d.ts.map +0 -1
  403. package/out/process.js.map +0 -1
  404. package/out/promises.d.ts.map +0 -1
  405. package/out/promises.js.map +0 -1
  406. package/out/random.d.ts.map +0 -1
  407. package/out/random.js.map +0 -1
  408. package/out/release-config.d.ts.map +0 -1
  409. package/out/release-config.js.map +0 -1
  410. package/out/routing.d.ts.map +0 -1
  411. package/out/routing.js.map +0 -1
  412. package/out/scope-config.d.ts.map +0 -1
  413. package/out/scope-config.js.map +0 -1
  414. package/out/scripting/ingest-chunk-script.d.ts +0 -58
  415. package/out/scripting/ingest-chunk-script.d.ts.map +0 -1
  416. package/out/scripting/ingest-chunk-script.js +0 -47
  417. package/out/scripting/ingest-chunk-script.js.map +0 -1
  418. package/out/spdx-header.d.ts.map +0 -1
  419. package/out/spdx-header.js.map +0 -1
  420. package/out/stats.d.ts.map +0 -1
  421. package/out/stats.js.map +0 -1
  422. package/out/trust-policies.d.ts.map +0 -1
  423. package/out/trust-policies.js.map +0 -1
  424. package/out/vale.d.ts.map +0 -1
  425. package/out/vale.js.map +0 -1
  426. package/out/workers.d.ts.map +0 -1
  427. package/out/workers.js.map +0 -1
  428. package/out/workspaces.d.ts.map +0 -1
  429. package/out/workspaces.js.map +0 -1
  430. /package/lib/{load-ledger.ts → asset/load-ledger.ts} +0 -0
  431. /package/lib/{overture-pins.ts → asset/overture-pins.ts} +0 -0
  432. /package/lib/{postcode-prefix-files.ts → asset/postcode-prefix-files.ts} +0 -0
  433. /package/lib/{hash.ts → crypto/hash.ts} +0 -0
  434. /package/lib/{trust-policies.ts → html/trust-policies.ts} +0 -0
  435. /package/lib/{numeric.ts → math/numeric.ts} +0 -0
  436. /package/lib/{random.ts → math/random.ts} +0 -0
  437. /package/lib/{stats.ts → math/stats.ts} +0 -0
  438. /package/lib/{vale.ts → repo/vale.ts} +0 -0
  439. /package/lib/{process.ts → scripting/process.ts} +0 -0
  440. /package/lib/{workers.ts → scripting/workers.ts} +0 -0
  441. /package/lib/{identical.ts → values/identical.ts} +0 -0
  442. /package/lib/{json.ts → values/json.ts} +0 -0
  443. /package/lib/{objects.ts → values/objects.ts} +0 -0
  444. /package/out/{binary-frame.d.ts → asset/binary-frame.d.ts} +0 -0
  445. /package/out/{load-ledger.d.ts → asset/load-ledger.d.ts} +0 -0
  446. /package/out/{load-ledger.js → asset/load-ledger.js} +0 -0
  447. /package/out/{overture-pins.d.ts → asset/overture-pins.d.ts} +0 -0
  448. /package/out/{overture-pins.js → asset/overture-pins.js} +0 -0
  449. /package/out/{postcode-prefix-files.d.ts → asset/postcode-prefix-files.d.ts} +0 -0
  450. /package/out/{postcode-prefix-files.js → asset/postcode-prefix-files.js} +0 -0
  451. /package/out/{memoize.d.ts → async/memoize.d.ts} +0 -0
  452. /package/out/{hash.d.ts → crypto/hash.d.ts} +0 -0
  453. /package/out/{hash.js → crypto/hash.js} +0 -0
  454. /package/out/{trust-policies.d.ts → html/trust-policies.d.ts} +0 -0
  455. /package/out/{trust-policies.js → html/trust-policies.js} +0 -0
  456. /package/out/{numeric.d.ts → math/numeric.d.ts} +0 -0
  457. /package/out/{numeric.js → math/numeric.js} +0 -0
  458. /package/out/{random.d.ts → math/random.d.ts} +0 -0
  459. /package/out/{random.js → math/random.js} +0 -0
  460. /package/out/{stats.d.ts → math/stats.d.ts} +0 -0
  461. /package/out/{stats.js → math/stats.js} +0 -0
  462. /package/out/{routing.d.ts → network/routing.d.ts} +0 -0
  463. /package/out/{release-config.js → repo/release-config.js} +0 -0
  464. /package/out/{spdx-header.d.ts → repo/spdx-header.d.ts} +0 -0
  465. /package/out/{vale.d.ts → repo/vale.d.ts} +0 -0
  466. /package/out/{vale.js → repo/vale.js} +0 -0
  467. /package/out/{workspaces.d.ts → repo/workspaces.d.ts} +0 -0
  468. /package/out/{process.d.ts → scripting/process.d.ts} +0 -0
  469. /package/out/{process.js → scripting/process.js} +0 -0
  470. /package/out/{workers.d.ts → scripting/workers.d.ts} +0 -0
  471. /package/out/{workers.js → scripting/workers.js} +0 -0
  472. /package/out/{identical.d.ts → values/identical.d.ts} +0 -0
  473. /package/out/{identical.js → values/identical.js} +0 -0
  474. /package/out/{json.d.ts → values/json.d.ts} +0 -0
  475. /package/out/{json.js → values/json.js} +0 -0
  476. /package/out/{objects.d.ts → values/objects.d.ts} +0 -0
  477. /package/out/{objects.js → values/objects.js} +0 -0
@@ -1,169 +0,0 @@
1
- // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
- // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
- /**
4
- * A license decision records three things: whether a person read a publisher's terms,
5
- * the grant they elected, and what that grant permits for each act this
6
- * repository performs on the publisher's data.
7
- *
8
- * Every register of third-party data uses this shape: the address-source register in
9
- * `@mailwoman/corpus` and the building and landmark register in `@mailwoman/structures`.
10
- * Each register defines its own operation list, such as `train` for an address corpus
11
- * or `convert` for a building model, and passes it as the `Operation` parameter.
12
- *
13
- * {@linkcode LicenseResolution} in `#license/record` answers a different question.
14
- * It records whether a license string mapped to an expression with known obligations,
15
- * whereas a decision records a person's review of terms.
16
- */
17
- import { stringifyJSON } from "#json";
18
- /**
19
- * The review state of a source's terms.
20
- *
21
- * Only an `elected` decision can admit a source into any build.
22
- */
23
- export const LicenseReviewState = {
24
- /**
25
- * The publisher's terms have no review record.
26
- *
27
- * The research pass's license text is kept verbatim in
28
- * {@linkcode UncheckedLicense.publisherStatement} and grants no license.
29
- */
30
- Unchecked: "unchecked",
31
- /**
32
- * A reviewer read the terms, elected one grant, retrieved a copy and recorded the reason.
33
- */
34
- Elected: "elected",
35
- /**
36
- * A reviewer read the terms and rejected the source.
37
- * The row records the reason.
38
- */
39
- Refused: "refused",
40
- };
41
- /**
42
- * What a grant permits for one operation.
43
- *
44
- * `unreviewed` means the terms lack an operation-specific review.
45
- * Eligibility checks treat it as blocking.
46
- * The state stays distinct from `refused`.
47
- */
48
- export const OperationPermission = {
49
- Permitted: "permitted",
50
- Refused: "refused",
51
- Unreviewed: "unreviewed",
52
- };
53
- /**
54
- * The legal basis of a permission.
55
- *
56
- * Most permissions rest on a publisher grant.
57
- * The other values mark permissions with a different basis.
58
- */
59
- export const PermissionBasis = {
60
- PublisherGrant: "publisher-grant",
61
- StatutoryException: "statutory-exception",
62
- OtherDocumented: "other-documented",
63
- };
64
- /**
65
- * Returns the label a share-alike or exclusion filter matches by prefix: the SPDX identifier
66
- * when one is recorded, otherwise the publisher's name for the terms.
67
- *
68
- * The function returns `null` until someone has elected terms for the decision.
69
- */
70
- export function electedTermsLabel(decision) {
71
- if (decision.state !== LicenseReviewState.Elected)
72
- return null;
73
- return decision.spdx ?? decision.electedTerms;
74
- }
75
- /**
76
- * Returns the recorded permission for one operation under a license decision.
77
- *
78
- * The result is `unreviewed` when the decision isn't elected or doesn't mention the operation.
79
- * The selected terms establish which terms apply.
80
- * Each operation still needs its own review.
81
- */
82
- export function permissionFor(decision, operation) {
83
- if (decision.state !== LicenseReviewState.Elected) {
84
- return {
85
- permission: OperationPermission.Unreviewed,
86
- because: `the decision reads ${decision.state}, so no operation has been read against terms`,
87
- };
88
- }
89
- return (decision.operations?.[operation] ?? {
90
- permission: OperationPermission.Unreviewed,
91
- because: `the elected terms do not state whether ${operation} is permitted`,
92
- });
93
- }
94
- /**
95
- * Returns a reason for every operation the decision doesn't permit,
96
- * or an empty array when it permits them all.
97
- *
98
- * `licenseID` is the id the source row points at.
99
- * A decision that's absent, unchecked or refused yields one reason naming that state.
100
- */
101
- export function operationProblems(licenseID, decision, operations) {
102
- const named = stringifyJSON(licenseID);
103
- if (!decision)
104
- return [`license ${named} is not declared in the register`];
105
- if (decision.state !== LicenseReviewState.Elected) {
106
- return [`license ${named} is ${decision.state}, and only elected terms admit a source`];
107
- }
108
- const problems = [];
109
- for (const operation of operations) {
110
- const reading = permissionFor(decision, operation);
111
- if (reading.permission === OperationPermission.Permitted)
112
- continue;
113
- problems.push(`the elected terms read ${reading.permission} for ${operation}: ${reading.because}`);
114
- }
115
- return problems;
116
- }
117
- /**
118
- * Returns every problem with one decision's own record, given the operations its register performs.
119
- *
120
- * A register's audit adds the checks that span decisions, such as a duplicate id
121
- * or a decision no source points at.
122
- */
123
- export function auditLicenseDecision(decision, knownOperations) {
124
- const named = stringifyJSON(decision.licenseID);
125
- switch (decision.state) {
126
- case LicenseReviewState.Unchecked:
127
- return decision.publisherStatement ? [] : [`license ${named} is unchecked and records no publisher statement`];
128
- case LicenseReviewState.Refused:
129
- return decision.refusedBecause ? [] : [`license ${named} is refused and gives no reason`];
130
- case LicenseReviewState.Elected:
131
- return auditElected(decision, named, knownOperations);
132
- default:
133
- return [`license ${named} carries an unknown review state`];
134
- }
135
- }
136
- function auditElected(decision, named, knownOperations) {
137
- const problems = [];
138
- const known = new Set(knownOperations);
139
- const permissions = new Set(Object.values(OperationPermission));
140
- if (!decision.electedTerms) {
141
- problems.push(`license ${named} is elected and names no terms`);
142
- }
143
- if (!decision.retrievedCopy) {
144
- problems.push(`license ${named} is elected and names no retrieved copy`);
145
- }
146
- if (!decision.electedBecause) {
147
- problems.push(`license ${named} is elected and gives no reason`);
148
- }
149
- for (const [operation, reading] of Object.entries(decision.operations ?? {})) {
150
- if (!reading)
151
- continue;
152
- if (!reading.because) {
153
- problems.push(`license ${named} reads ${reading.permission} for ${operation} and gives no reason`);
154
- }
155
- // A permission must cite its basis in the terms so that a reviewer can check it.
156
- // A refusal needs no basis.
157
- if (reading.permission === OperationPermission.Permitted && !reading.basis) {
158
- problems.push(`license ${named} permits ${operation} and names no basis for the permission`);
159
- }
160
- if (!permissions.has(reading.permission)) {
161
- problems.push(`license ${named} reads an unknown permission ${stringifyJSON(reading.permission)} for ${operation}`);
162
- }
163
- if (!known.has(operation)) {
164
- problems.push(`license ${named} names ${stringifyJSON(operation)}, which is not an operation this repository performs`);
165
- }
166
- }
167
- return problems;
168
- }
169
- //# sourceMappingURL=decision.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decision.js","sourceRoot":"","sources":["../../lib/license/decision.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC;;;;;OAKG;IACH,SAAS,EAAE,WAAW;IACtB;;OAEG;IACH,OAAO,EAAE,SAAS;IAClB;;;OAGG;IACH,OAAO,EAAE,SAAS;CACT,CAAA;AAuBV;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;CACf,CAAA;AAOV;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,cAAc,EAAE,iBAAiB;IACjC,kBAAkB,EAAE,qBAAqB;IACzC,eAAe,EAAE,kBAAkB;CAC1B,CAAA;AAyFV;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAyB;IAC1D,IAAI,QAAQ,CAAC,KAAK,KAAK,kBAAkB,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAE9D,OAAO,QAAQ,CAA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Q,CAAC,IAAI,CAAC,WAAW,KAAK,iCAAiC,CAAC,CAAA;IACjE,CAAC;IAED,KAAK,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAgC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC;QAC7G,IAAI,CAAC,OAAO;YAAE,SAAQ;QAEtB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACtB,QAAQ,CAAC,IAAI,CAAC,WAAW,KAAK,UAAU,OAAO,CAAC,UAAU,QAAQ,SAAS,sBAAsB,CAAC,CAAA;QACnG,CAAC;QAED,iFAAiF;QACjF,4BAA4B;QAC5B,IAAI,OAAO,CAAC,UAAU,KAAK,mBAAmB,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YAC5E,QAAQ,CAAC,IAAI,CAAC,WAAW,KAAK,YAAY,SAAS,wCAAwC,CAAC,CAAA;QAC7F,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1C,QAAQ,CAAC,IAAI,CACZ,WAAW,KAAK,gCAAgC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,SAAS,EAAE,CACpG,CAAA;QACF,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CACZ,WAAW,KAAK,UAAU,aAAa,CAAC,SAAS,CAAC,sDAAsD,CACxG,CAAA;QACF,CAAC;IACF,CAAC;IAED,OAAO,QAAQ,CAAA;AAChB,CAAC"}
@@ -1,102 +0,0 @@
1
- import type { LicenseKeyVerification } from "#license/key";
2
- import type { LicenseKeyPublication } from "#license/publication";
3
- /**
4
- * Returns whether a verification grants the commercial branch: the token is valid
5
- * and its terms are commercial.
6
- *
7
- * A valid open-source token answers false, so the AGPL branch and its notice stay in place for it.
8
- * The function lives here rather than in `key.ts` because this module sits in the
9
- * docs site's plugin graph that jiti evaluates.
10
- *
11
- * A value import of `key.ts` would pull its zod schema into that graph.
12
- */
13
- export declare function grantsCommercialTerms(key: LicenseKeyVerification | null | undefined): boolean;
14
- /**
15
- * The obligation classes the summary reports.
16
- *
17
- * - `attribution` requires crediting the source where derived results are shown or redistributed.
18
- * - `share_alike` requires a derived work or database to use the same license, as in ODbL and AGPL.
19
- * - `source_offer` requires offering the source, including modifications,
20
- * to network users (AGPL-3.0 section 13).
21
- */
22
- export declare const LicenseObligation: {
23
- readonly Attribution: "attribution";
24
- readonly ShareAlike: "share_alike";
25
- readonly SourceOffer: "source_offer";
26
- };
27
- /**
28
- * An obligation class.
29
- */
30
- export type LicenseObligation = (typeof LicenseObligation)[keyof typeof LicenseObligation];
31
- /**
32
- * A summarized license expression.
33
- */
34
- export interface LicenseSummary {
35
- /**
36
- * The expression as recorded.
37
- */
38
- expression: string;
39
- /**
40
- * The expression's identifiers in order.
41
- * `AGPL-3.0-only OR LicenseRef-Commercial` has two.
42
- */
43
- identifiers: string[];
44
- /**
45
- * The union of the known obligations of every identifier.
46
- *
47
- * For `OR`, this union applies until a branch is chosen with {@link chooseLicenseBranch}.
48
- */
49
- obligations: LicenseObligation[];
50
- /**
51
- * Whether every identifier is in the known table.
52
- *
53
- * `NOASSERTION`, a vendor-suffixed identifier such as `pddl-1.0-USGov-nrcs`
54
- * and a misspelling are all unrecognized.
55
- */
56
- recognized: boolean;
57
- /**
58
- * The identifiers missing from the known table.
59
- */
60
- unrecognized: string[];
61
- }
62
- /**
63
- * Splits an SPDX expression into its identifiers.
64
- *
65
- * The function removes parentheses and splits on `AND` and `OR`.
66
- * A `WITH` exception stays attached to its license.
67
- */
68
- export declare function licenseIdentifiers(expression: string): string[];
69
- /**
70
- * Summarizes the known obligations of an SPDX expression.
71
- */
72
- export declare function summarizeLicense(expression: string): LicenseSummary;
73
- /**
74
- * Returns the branch of mailwoman's license expression that applies to this installation.
75
- *
76
- * The commercial branch applies only when the key is `valid` and the published
77
- * key register hasn't marked it retired or unlisted.
78
- * The doctor passes both the key and the register status.
79
- * The stamp runs offline and passes only the key.
80
- */
81
- export declare function appliedLicenseBranch(expression: string, key?: LicenseKeyVerification, publication?: LicenseKeyPublication): string;
82
- /**
83
- * Chooses the applicable branch of an `A OR B` expression.
84
- *
85
- * The first `LicenseRef-` branch applies when there's a commercial agreement.
86
- * Otherwise the first open-source branch applies.
87
- * An expression without `OR` is returned unchanged.
88
- */
89
- export declare function chooseLicenseBranch(expression: string, options: {
90
- commercialAgreement: boolean;
91
- }): string;
92
- /**
93
- * Throws unless every identifier in the expression may be recorded in a layer manifest.
94
- *
95
- * An admissible identifier is in the obligations table, matches `LicenseRef-…`, or is `NOASSERTION`.
96
- * A `WITH` exception is ignored, as it is in {@link summarizeLicense}.
97
- * The doctor reports `NOASSERTION` as degraded.
98
- *
99
- * A manifest is sealed, so an unknown identifier is rejected at build time.
100
- */
101
- export declare function assertAdmissibleLicenseExpression(expression: string, context?: string): void;
102
- //# sourceMappingURL=obligations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"obligations.d.ts","sourceRoot":"","sources":["../../lib/license/obligations.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAEjE;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE7F;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;aAC7B,WAAW,EAAE,aAAa;aAC1B,UAAU,EAAE,aAAa;aACzB,WAAW,EAAE,cAAc;CAClB,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;AAiE1F;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB;;;;OAIG;IACH,WAAW,EAAE,iBAAiB,EAAE,CAAA;IAChC;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAA;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAM/D;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CA0BnE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,sBAAsB,EAC5B,WAAW,CAAC,EAAE,qBAAqB,GACjC,MAAM,CAIR;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,mBAAmB,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAezG;AAID;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,SAAY,GAAG,IAAI,CAU/F"}
@@ -1,188 +0,0 @@
1
- // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
- // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
- /**
4
- * Summarizes the obligations of an SPDX license expression for `mailwoman doctor`.
5
- * The summary is a debugging aid and gives no legal advice.
6
- */
7
- import { stringifyJSON } from "#json";
8
- /**
9
- * Returns whether a verification grants the commercial branch: the token is valid
10
- * and its terms are commercial.
11
- *
12
- * A valid open-source token answers false, so the AGPL branch and its notice stay in place for it.
13
- * The function lives here rather than in `key.ts` because this module sits in the
14
- * docs site's plugin graph that jiti evaluates.
15
- *
16
- * A value import of `key.ts` would pull its zod schema into that graph.
17
- */
18
- export function grantsCommercialTerms(key) {
19
- return key?.status === "valid" && key.payload.terms === "LicenseRef-Commercial";
20
- }
21
- /**
22
- * The obligation classes the summary reports.
23
- *
24
- * - `attribution` requires crediting the source where derived results are shown or redistributed.
25
- * - `share_alike` requires a derived work or database to use the same license, as in ODbL and AGPL.
26
- * - `source_offer` requires offering the source, including modifications,
27
- * to network users (AGPL-3.0 section 13).
28
- */
29
- export const LicenseObligation = {
30
- Attribution: "attribution",
31
- ShareAlike: "share_alike",
32
- SourceOffer: "source_offer",
33
- };
34
- /**
35
- * The known obligations of each SPDX identifier.
36
- *
37
- * An empty list means the license has no obligations.
38
- * An identifier missing from the table is reported as unrecognized so that an
39
- * unknown license never reads as obligation-free.
40
- */
41
- const KNOWN_OBLIGATIONS = new Map([
42
- ["AGPL-3.0-only", [LicenseObligation.Attribution, LicenseObligation.ShareAlike, LicenseObligation.SourceOffer]],
43
- ["AGPL-3.0-or-later", [LicenseObligation.Attribution, LicenseObligation.ShareAlike, LicenseObligation.SourceOffer]],
44
- // Section 4 of commercial-LICENSE.md requires attribution.
45
- ["LicenseRef-Commercial", [LicenseObligation.Attribution]],
46
- ["ODbL-1.0", [LicenseObligation.Attribution, LicenseObligation.ShareAlike]],
47
- // Open Data Commons publishes an attribution-only license beside ODbL.
48
- // Readers confuse them because both are ODC.
49
- // This one has no share-alike term.
50
- ["ODC-By-1.0", [LicenseObligation.Attribution]],
51
- // Every identifier `readLicenseRecord` can resolve a share-alike mention to belongs here,
52
- // so a stated CC-BY-SA grant reads as carrying share-alike rather than as an unrecognized identifier.
53
- ["CC-BY-SA-4.0", [LicenseObligation.Attribution, LicenseObligation.ShareAlike]],
54
- ["CC-BY-SA-3.0", [LicenseObligation.Attribution, LicenseObligation.ShareAlike]],
55
- ["CC-BY-SA-2.0", [LicenseObligation.Attribution, LicenseObligation.ShareAlike]],
56
- ["OGL-UK-3.0", [LicenseObligation.Attribution]],
57
- ["CDLA-Permissive-2.0", [LicenseObligation.Attribution]],
58
- ["CC-BY-4.0", [LicenseObligation.Attribution]],
59
- ["CC0-1.0", []],
60
- ["PDDL-1.0", []],
61
- // The Datenlizenz Deutschland pair.
62
- // Zero permits any use without restrictions or conditions.
63
- // Namensnennung requires a source note naming the provider, the license and the dataset URI.
64
- // It also requires a mark on changed data.
65
- // Both texts are retained at internal/strategy/rights-receipts/address-skeletons-2026-10-17/.
66
- ["DL-DE-ZERO-2.0", []],
67
- ["DL-DE-BY-2.0", [LicenseObligation.Attribution]],
68
- // US Government works have no copyright under 17 U.S.C. § 105. SPDX has no identifier for them, so this
69
- // `LicenseRef` is defined in docs/engineering/reference/layer-interface.mdx.
70
- ["LicenseRef-USGov-Public-Domain", []],
71
- // BAN publishes under Licence Ouverte 2.0.
72
- ["etalab-2.0", [LicenseObligation.Attribution]],
73
- // The Taiwanese address registers behind Overture-TW use this license.
74
- // The grant is void without the attribution statement, so the per-agency
75
- // attribution list ships with the data.
76
- ["OGDL-Taiwan-1.0", [LicenseObligation.Attribution]],
77
- // Mexico's national statistics institute publishes under its own "Términos de Libre Uso de la
78
- // Información del INEGI", which identifies no Creative Commons license and includes no version.
79
- // The terms permit copying, publishing, adapting, extracting and commercial use.
80
- // They require the credit `Fuente: INEGI, <product name>`.
81
- // They state no share-alike term.
82
- // Retrieved 2026-09-27 and retained at internal/strategy/rights-receipts/mx-gb-2026-09-27/mx-inegi-terminos.html.
83
- ["LicenseRef-INEGI-Terms", [LicenseObligation.Attribution]],
84
- // The GEBCO undersea gazetteer, under the operator's own election of 2026-11-02 (#2896).
85
- // GEBCO and NOAA NCEI publish it with a citation request and no stated restriction.
86
- // The disclaimer excludes only navigation and safety-at-sea use.
87
- // The election rests on that publication without a written grant, and a request for one has gone to GEBCO.
88
- // The citation is the obligation it records.
89
- ["LicenseRef-GEBCO-Operator-Election", [LicenseObligation.Attribution]],
90
- ["MIT", [LicenseObligation.Attribution]],
91
- ["Apache-2.0", [LicenseObligation.Attribution]],
92
- ]);
93
- /**
94
- * Splits an SPDX expression into its identifiers.
95
- *
96
- * The function removes parentheses and splits on `AND` and `OR`.
97
- * A `WITH` exception stays attached to its license.
98
- */
99
- export function licenseIdentifiers(expression) {
100
- return expression
101
- .replaceAll(/[()]/g, " ")
102
- .split(/\s+(?:AND|OR)\s+/i)
103
- .map((part) => part.trim())
104
- .filter((part) => part.length);
105
- }
106
- /**
107
- * Returns the license part of an identifier, without any `WITH` exception.
108
- */
109
- function withoutException(identifier) {
110
- return identifier.split(/\s+WITH\s+/i)[0];
111
- }
112
- /**
113
- * Summarizes the known obligations of an SPDX expression.
114
- */
115
- export function summarizeLicense(expression) {
116
- const identifiers = licenseIdentifiers(expression);
117
- const obligations = new Set();
118
- const unrecognized = [];
119
- for (const identifier of identifiers) {
120
- const known = KNOWN_OBLIGATIONS.get(withoutException(identifier));
121
- if (!known) {
122
- unrecognized.push(identifier);
123
- continue;
124
- }
125
- for (const obligation of known) {
126
- obligations.add(obligation);
127
- }
128
- }
129
- return {
130
- expression,
131
- identifiers,
132
- obligations: [...obligations],
133
- recognized: identifiers.length > 0 && unrecognized.length === 0,
134
- unrecognized,
135
- };
136
- }
137
- /**
138
- * Returns the branch of mailwoman's license expression that applies to this installation.
139
- *
140
- * The commercial branch applies only when the key is `valid` and the published
141
- * key register hasn't marked it retired or unlisted.
142
- * The doctor passes both the key and the register status.
143
- * The stamp runs offline and passes only the key.
144
- */
145
- export function appliedLicenseBranch(expression, key, publication) {
146
- const retired = publication === "retired" || publication === "unlisted";
147
- return chooseLicenseBranch(expression, { commercialAgreement: grantsCommercialTerms(key) && !retired });
148
- }
149
- /**
150
- * Chooses the applicable branch of an `A OR B` expression.
151
- *
152
- * The first `LicenseRef-` branch applies when there's a commercial agreement.
153
- * Otherwise the first open-source branch applies.
154
- * An expression without `OR` is returned unchanged.
155
- */
156
- export function chooseLicenseBranch(expression, options) {
157
- const branches = expression
158
- .replaceAll(/[()]/g, " ")
159
- .split(/\s+OR\s+/i)
160
- .map((part) => part.trim())
161
- .filter((part) => part.length);
162
- if (branches.length < 2)
163
- return expression;
164
- const commercial = branches.find((branch) => branch.startsWith("LicenseRef-"));
165
- const open = branches.find((branch) => !branch.startsWith("LicenseRef-"));
166
- if (options.commercialAgreement && commercial)
167
- return commercial;
168
- return open ?? branches[0];
169
- }
170
- const LICENSE_REF = /^LicenseRef-[A-Za-z0-9.-]+$/u;
171
- /**
172
- * Throws unless every identifier in the expression may be recorded in a layer manifest.
173
- *
174
- * An admissible identifier is in the obligations table, matches `LicenseRef-…`, or is `NOASSERTION`.
175
- * A `WITH` exception is ignored, as it is in {@link summarizeLicense}.
176
- * The doctor reports `NOASSERTION` as degraded.
177
- *
178
- * A manifest is sealed, so an unknown identifier is rejected at build time.
179
- */
180
- export function assertAdmissibleLicenseExpression(expression, context = "license") {
181
- for (const identifier of licenseIdentifiers(expression)) {
182
- const license = withoutException(identifier);
183
- if (license === "NOASSERTION" || KNOWN_OBLIGATIONS.has(license) || LICENSE_REF.test(license))
184
- continue;
185
- throw new Error(`${context}: ${stringifyJSON(identifier)} is not an admissible license identifier. Use the SPDX identifier the obligations table knows (packages/core/lib/license/obligations.ts), a LicenseRef- this repository defines, or NOASSERTION.`);
186
- }
187
- }
188
- //# sourceMappingURL=obligations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"obligations.js","sourceRoot":"","sources":["../../lib/license/obligations.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAIrC;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAA8C;IACnF,OAAO,GAAG,EAAE,MAAM,KAAK,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,uBAAuB,CAAA;AAChF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,WAAW,EAAE,aAAa;IAC1B,U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* A corpus row's `license` column holds whichever of these the writer had to hand. Measured over
5
- * `v0.7.0-de-holdout` on 2026-09-26: 71 distinct values across 703,835,753 rows, of which 4 are SPDX
6
- * identifiers covering 75,582,634 rows and 66 are prose covering 628,203,119, plus 50,000 rows at
7
- * `null`. `Public Domain` labels 478,632,849 rows. `Licence Ouverte 2.0` labels 145,193,536 rows.
8
- * Neither label is an SPDX identifier. This repository uses `LicenseRef-USGov-Public-Domain` and
9
- * `etalab-2.0` for those values.
10
- *
11
- * The recurring failures all came from reading one of these facts out of a field holding another. A
12
- * share-alike filter written as `/^ODbL/` cannot see 120,000 rows whose text reads "Synthetic —
13
- * OpenStreetMap venue + sub-venue names (ODbL, © OpenStreetMap contributors) …". A rights audit over
14
- * the column reads sentences where it expects identifiers. An obligations lookup keyed on
15
- * `etalab-2.0` finds no entry for `Licence Ouverte 2.0` and would report no obligation if its caller
16
- * ignored `unrecognized`.
17
- *
18
- * Store each fact in its own field: the grant is an expression, credit owed is attribution text,
19
- * source material is provenance and user duties are obligations. The raw value remains available
20
- * for later review against what the writer recorded.
21
- *
22
- * **A value this cannot resolve reads `unresolved`, and that's a finding rather than a default.**
23
- * `unresolved` means the obligations are unknown. That differs from knowing there are none.
24
- * A caller deciding whether to publish or train must distinguish those cases. This type exists
25
- * because a bare string made them easy to confuse.
26
- */
27
- import { LicenseObligation } from "#license/obligations";
28
- /**
29
- * Whether a license value has been mapped to an expression whose obligations are recorded.
30
- *
31
- * This states what reading the string achieved.
32
- * `#license/decision` exports a separate `LicenseReviewState`.
33
- *
34
- * It records whether a person read and accepted a source's terms.
35
- * That state answers a different question about a different subject.
36
- */
37
- export declare const LicenseResolution: {
38
- /**
39
- * The expression is an SPDX identifier or a `LicenseRef` this repository defines.
40
- * `KNOWN_OBLIGATIONS` records the expression's obligations.
41
- */
42
- readonly Resolved: "resolved";
43
- /**
44
- * No expression was determinable from the value.
45
- * The obligations are unknown.
46
- */
47
- readonly Unresolved: "unresolved";
48
- };
49
- /**
50
- * One of the {@link LicenseResolution} values.
51
- */
52
- export type LicenseResolution = (typeof LicenseResolution)[keyof typeof LicenseResolution];
53
- /**
54
- * A license as the four facts a caller asks about separately.
55
- */
56
- export interface LicenseRecord {
57
- /**
58
- * The value as written, preserved so a reading can be checked against its source.
59
- */
60
- raw: string;
61
- /**
62
- * The SPDX expression the grant resolves to, or `null` where the value states none.
63
- */
64
- expression: string | null;
65
- /**
66
- * The credit the grant requires, recorded as a value.
67
- */
68
- attribution: string | null;
69
- /**
70
- * License identifiers the raw text mentions, whether or not each is the grant on the row.
71
- *
72
- * A row rendered from an attested record can mention the upstream register's license
73
- * in its provenance prose while the row records a different grant.
74
- * This field records those mentions separately so callers do not treat them as the grant.
75
- */
76
- mentions: string[];
77
- /**
78
- * The obligations of {@link LicenseRecord.expression}, empty where the resolution is `unresolved`.
79
- */
80
- obligations: LicenseObligation[];
81
- resolution: LicenseResolution;
82
- }
83
- /**
84
- * Reads a license column value as four separate facts.
85
- *
86
- * A value that resolves to an expression whose obligations are recorded reads `resolved`.
87
- * Everything else reads `unresolved` with empty obligations, including a value
88
- * whose prose mentions a license.
89
- *
90
- * A sentence mentioning ODbL doesn't establish that ODbL is the grant on the row.
91
- */
92
- export declare function readLicenseRecord(raw: string | null | undefined): LicenseRecord;
93
- /**
94
- * Whether a record establishes a share-alike obligation on the rows it labels.
95
- *
96
- * True only for a resolved expression whose obligations include it.
97
- * A record mentioning ODbL in prose is reported by {@link mentionsShareAlike} instead,
98
- * because those are different claims and a release decision needs to tell them apart.
99
- */
100
- export declare function carriesShareAlike(record: LicenseRecord): boolean;
101
- /**
102
- * Whether a record's text mentions a share-alike license without establishing it as the grant.
103
- *
104
- * This is the case `/^ODbL/` over the raw column could never see: a row whose license reads
105
- * "Synthetic — OpenStreetMap venue + sub-venue names (ODbL, © OpenStreetMap contributors) …"
106
- * mentions a share-alike license in its provenance while its own expression is unresolved.
107
- */
108
- export declare function mentionsShareAlike(record: LicenseRecord): boolean;
109
- /**
110
- * Returns the attribution entries a model card records, from whichever field holds them.
111
- *
112
- * Published cards include the list under `training.data_attribution` or under a top-level
113
- * `attribution`, and a published card cannot change, so both spellings have to be read.
114
- * The first candidate holding at least one string wins.
115
- * Candidates that are not arrays of strings are skipped.
116
- *
117
- * The caller passes the field values rather than a card, because the card's own
118
- * shape belongs to the package that reads the file.
119
- *
120
- * @param candidates The card fields to try, in preference order.
121
- */
122
- export declare function attributionEntries(...candidates: readonly unknown[]): string[];
123
- /**
124
- * Returns the license an attribution entry states in a parenthetical, verbatim.
125
- *
126
- * `LINZ-derived OpenAddresses NZ (CC-BY 4.0): …` yields `CC-BY 4.0`.
127
- * The text is returned as written rather than resolved to an identifier, because a
128
- * caller reporting on a published card has to quote the card's recorded value.
129
- *
130
- * Returns `null` when no parenthetical holds a license.
131
- * Some entries state their terms outside a parenthetical, so `null` describes what this
132
- * reader found rather than establishing that the entry states no license.
133
- * The caller keeps the verbatim entry beside the result.
134
- */
135
- export declare function licenseNamedIn(entry: string): string | null;
136
- //# sourceMappingURL=record.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../lib/license/record.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,iBAAiB,EAAoB,MAAM,sBAAsB,CAAA;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;IAC7B;;;OAGG;aACH,QAAQ,EAAE,UAAU;IACpB;;;OAGG;aACH,UAAU,EAAE,YAAY;CACf,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;AAE1F;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB;;OAEG;IACH,WAAW,E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