@prestack/thread 0.1.3 → 0.1.5

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 (270) hide show
  1. package/CHANGELOG.md +563 -0
  2. package/dist/core/actor.d.ts +1 -1
  3. package/dist/core/actor.js +5 -4
  4. package/dist/core/actor.ts +5 -4
  5. package/dist/core/attach.d.ts +0 -7
  6. package/dist/core/attach.js +38 -67
  7. package/dist/core/attach.ts +34 -80
  8. package/dist/core/chain.js +13 -17
  9. package/dist/core/chain.ts +11 -15
  10. package/dist/core/condition.d.ts +4 -4
  11. package/dist/core/condition.js +2 -2
  12. package/dist/core/descend.d.ts +4 -2
  13. package/dist/core/descend.js +91 -23
  14. package/dist/core/descend.ts +90 -21
  15. package/dist/core/errors/catalogue.d.ts +52 -0
  16. package/dist/{operations/errors/errors.js → core/errors/catalogue.js} +1 -1
  17. package/dist/{operations/errors/errors.ts → core/errors/catalogue.ts} +1 -1
  18. package/dist/{operations/errors/catalog.d.ts → core/errors/error.d.ts} +2 -3
  19. package/dist/{operations/errors/catalog.js → core/errors/error.js} +1 -16
  20. package/dist/{operations/errors/catalog.ts → core/errors/error.ts} +3 -19
  21. package/dist/core/errors/namespaces.d.ts +3 -0
  22. package/dist/core/errors/namespaces.js +15 -0
  23. package/dist/core/errors/namespaces.ts +19 -0
  24. package/dist/core/finding.js +2 -2
  25. package/dist/core/finding.ts +1 -2
  26. package/dist/core/init.d.ts +1 -1
  27. package/dist/core/init.js +51 -5
  28. package/dist/core/init.ts +58 -5
  29. package/dist/core/invoked.d.ts +1 -1
  30. package/dist/core/invoked.js +3 -1
  31. package/dist/core/invoked.ts +5 -2
  32. package/dist/core/round.js +36 -22
  33. package/dist/core/round.ts +26 -9
  34. package/dist/core/rows.d.ts +4 -0
  35. package/dist/core/rows.js +31 -2
  36. package/dist/core/rows.ts +33 -1
  37. package/dist/core/scope.d.ts +1 -0
  38. package/dist/core/scope.js +1 -0
  39. package/dist/core/scope.ts +2 -0
  40. package/dist/core/thread.d.ts +3 -3
  41. package/dist/core/tree.d.ts +4 -1
  42. package/dist/core/tree.js +26 -6
  43. package/dist/core/tree.ts +29 -6
  44. package/dist/core/types.d.ts +3 -3
  45. package/dist/core/types.js +3 -1
  46. package/dist/core/types.ts +2 -1
  47. package/dist/derivation/attach.js +3 -2
  48. package/dist/derivation/attach.ts +2 -1
  49. package/dist/derivation/generators/build.js +6 -6
  50. package/dist/derivation/generators/build.ts +1 -1
  51. package/dist/derivation/generators/check.js +1 -1
  52. package/dist/derivation/generators/determinism.js +1 -1
  53. package/dist/derivation/generators/release.js +60 -47
  54. package/dist/derivation/generators/release.ts +66 -43
  55. package/dist/derivation/release.d.ts +7 -3
  56. package/dist/derivation/release.js +14 -1
  57. package/dist/derivation/release.ts +22 -2
  58. package/dist/integrations/attach.d.ts +4 -0
  59. package/dist/integrations/attach.js +37 -56
  60. package/dist/integrations/attach.ts +54 -60
  61. package/dist/integrations/cli.d.ts +37 -0
  62. package/dist/integrations/cli.js +440 -0
  63. package/dist/integrations/cli.ts +543 -0
  64. package/dist/{core/files.d.ts → integrations/disk.d.ts} +16 -24
  65. package/dist/integrations/disk.js +435 -0
  66. package/dist/integrations/disk.ts +465 -0
  67. package/dist/integrations/generators/read.js +6 -6
  68. package/dist/integrations/generators/read.ts +4 -4
  69. package/dist/integrations/generators/vault.js +10 -11
  70. package/dist/integrations/generators/vault.ts +4 -5
  71. package/dist/{operations/http.d.ts → integrations/https.d.ts} +10 -6
  72. package/dist/integrations/https.js +170 -0
  73. package/dist/integrations/https.ts +216 -0
  74. package/dist/integrations/pglite.d.ts +26 -0
  75. package/dist/integrations/pglite.js +143 -0
  76. package/dist/integrations/pglite.ts +206 -0
  77. package/dist/integrations/secret.d.ts +8 -2
  78. package/dist/integrations/secret.js +3 -5
  79. package/dist/integrations/secret.ts +10 -6
  80. package/dist/integrations/target.d.ts +155 -14
  81. package/dist/integrations/target.js +171 -50
  82. package/dist/integrations/target.ts +377 -61
  83. package/dist/integrations/vault.d.ts +1 -0
  84. package/dist/integrations/vault.js +20 -5
  85. package/dist/integrations/vault.ts +17 -5
  86. package/dist/integrity/attach.js +8 -77
  87. package/dist/integrity/attach.ts +7 -76
  88. package/dist/integrity/check-threads.js +5 -5
  89. package/dist/integrity/check-threads.ts +2 -2
  90. package/dist/integrity/constraint.d.ts +0 -1
  91. package/dist/integrity/constraint.js +267 -366
  92. package/dist/integrity/constraint.ts +267 -375
  93. package/dist/integrity/generators/compiler.js +14 -17
  94. package/dist/integrity/generators/compiler.ts +10 -15
  95. package/dist/integrity/generators/gate.js +15 -15
  96. package/dist/integrity/generators/gate.ts +10 -10
  97. package/dist/integrity/generators/issues.js +7 -7
  98. package/dist/integrity/generators/publish.js +39 -57
  99. package/dist/integrity/generators/publish.ts +44 -55
  100. package/dist/integrity/generators/trial.d.ts +3 -3
  101. package/dist/integrity/generators/trial.js +133 -165
  102. package/dist/integrity/generators/trial.ts +145 -169
  103. package/dist/integrity/lint.js +9 -13
  104. package/dist/integrity/lint.ts +7 -10
  105. package/dist/integrity/lsp/bin.js +5 -4
  106. package/dist/integrity/lsp/bin.ts +3 -1
  107. package/dist/integrity/lsp/diagnostics.js +3 -3
  108. package/dist/integrity/lsp/diagnostics.ts +1 -1
  109. package/dist/integrity/lsp/lint.js +19 -30
  110. package/dist/integrity/lsp/lint.ts +16 -32
  111. package/dist/integrity/lsp/server.js +3 -3
  112. package/dist/integrity/slopnator.d.ts +3 -13
  113. package/dist/integrity/slopnator.js +59 -38
  114. package/dist/integrity/slopnator.ts +54 -38
  115. package/dist/integrity/slopnators/sl_broken_lineage.js +2 -2
  116. package/dist/integrity/slopnators/sl_declared_elsewhere.js +1 -1
  117. package/dist/integrity/slopnators/sl_derived_drift.js +4 -4
  118. package/dist/integrity/slopnators/sl_derived_drift.ts +1 -1
  119. package/dist/integrity/slopnators/sl_door_in_a_node.js +220 -0
  120. package/dist/integrity/slopnators/sl_door_in_a_node.ts +250 -0
  121. package/dist/integrity/slopnators/sl_inert_island.js +10 -8
  122. package/dist/integrity/slopnators/sl_inert_island.ts +8 -6
  123. package/dist/integrity/slopnators/sl_missing_row.js +6 -51
  124. package/dist/integrity/slopnators/sl_missing_row.ts +4 -50
  125. package/dist/integrity/slopnators/sl_no_barrel.js +1 -1
  126. package/dist/integrity/slopnators/sl_no_child_process.js +36 -18
  127. package/dist/integrity/slopnators/sl_no_child_process.ts +44 -18
  128. package/dist/integrity/slopnators/sl_no_dispatch_bypass.js +80 -149
  129. package/dist/integrity/slopnators/sl_no_dispatch_bypass.ts +95 -147
  130. package/dist/integrity/slopnators/sl_no_import_cycle.js +15 -4
  131. package/dist/integrity/slopnators/sl_no_import_cycle.ts +20 -4
  132. package/dist/integrity/slopnators/sl_no_such_command.js +2 -2
  133. package/dist/integrity/slopnators/sl_no_such_command.ts +1 -1
  134. package/dist/integrity/slopnators/sl_outside_an_operation.js +20 -0
  135. package/dist/integrity/slopnators/sl_outside_an_operation.ts +25 -0
  136. package/dist/integrity/slopnators/sl_screen_holds_only_declared.d.ts +2 -0
  137. package/dist/integrity/slopnators/sl_screen_holds_only_declared.js +61 -0
  138. package/dist/integrity/slopnators/sl_screen_holds_only_declared.ts +70 -0
  139. package/dist/integrity/slopnators/sl_secret_literal.js +1 -33
  140. package/dist/integrity/slopnators/sl_secret_literal.ts +1 -33
  141. package/dist/integrity/slopnators/sl_stale_path.js +5 -22
  142. package/dist/integrity/slopnators/sl_stale_path.ts +4 -20
  143. package/dist/integrity/slopnators/sl_twice_meant.js +1 -1
  144. package/dist/integrity/slopnators/sl_twice_parented.js +29 -5
  145. package/dist/integrity/slopnators/sl_twice_parented.ts +28 -4
  146. package/dist/integrity/slopnators/sl_undeclared_crossing.d.ts +4 -1
  147. package/dist/integrity/slopnators/sl_undeclared_crossing.js +426 -62
  148. package/dist/integrity/slopnators/sl_undeclared_crossing.ts +454 -70
  149. package/dist/integrity/slopnators/sl_undeclared_destination.js +59 -25
  150. package/dist/integrity/slopnators/sl_undeclared_destination.ts +69 -21
  151. package/dist/integrity/slopnators/sl_undeclared_list.d.ts +2 -0
  152. package/dist/integrity/slopnators/sl_undeclared_list.js +363 -0
  153. package/dist/integrity/slopnators/sl_undeclared_list.ts +358 -0
  154. package/dist/integrity/slopnators/sl_undeclared_node.js +1 -11
  155. package/dist/integrity/slopnators/sl_undeclared_node.ts +0 -10
  156. package/dist/integrity/slopnators/sl_undeclared_operation.js +111 -29
  157. package/dist/integrity/slopnators/sl_undeclared_operation.ts +134 -26
  158. package/dist/integrity/slopnators/sl_undeclared_variant.js +2 -2
  159. package/dist/integrity/slopnators/sl_undeclared_webhook.d.ts +2 -0
  160. package/dist/integrity/slopnators/sl_undeclared_webhook.js +90 -0
  161. package/dist/integrity/slopnators/sl_undeclared_webhook.ts +108 -0
  162. package/dist/integrity/slopnators/sl_underived_route.d.ts +2 -0
  163. package/dist/integrity/slopnators/sl_underived_route.js +61 -0
  164. package/dist/integrity/slopnators/sl_underived_route.ts +72 -0
  165. package/dist/integrity/slopnators/sl_ungoverned_island.js +3 -3
  166. package/dist/integrity/slopnators/sl_ungoverned_island.ts +1 -1
  167. package/dist/integrity/slopnators/sl_unlisted_program.d.ts +2 -0
  168. package/dist/integrity/slopnators/sl_unlisted_program.js +39 -0
  169. package/dist/integrity/slopnators/sl_unlisted_program.ts +40 -0
  170. package/dist/integrity/slopnators/sl_unnamed_island.js +1 -1
  171. package/dist/integrity/slopnators/sl_unpaired_member.js +3 -3
  172. package/dist/integrity/slopnators/sl_unpaired_member.ts +1 -1
  173. package/dist/integrity/slopnators/sl_unpaired_slopnator.js +4 -4
  174. package/dist/integrity/slopnators/sl_unpaired_slopnator.ts +1 -1
  175. package/dist/integrity/slopnators/sl_unprefixed_member.js +5 -31
  176. package/dist/integrity/slopnators/sl_unprefixed_member.ts +2 -28
  177. package/dist/integrity/slopnators/sl_unthreaded.js +11 -7
  178. package/dist/integrity/slopnators/sl_unthreaded.ts +6 -7
  179. package/dist/integrity/slopnators/sl_untranslated_key.js +2 -25
  180. package/dist/integrity/slopnators/sl_untranslated_key.ts +1 -25
  181. package/dist/integrity/slopnators/sl_unvaulted_secret.d.ts +2 -0
  182. package/dist/integrity/slopnators/sl_unvaulted_secret.js +107 -0
  183. package/dist/integrity/slopnators/sl_unvaulted_secret.ts +132 -0
  184. package/dist/integrity/slopnators/sl_unversioned.js +6 -4
  185. package/dist/integrity/slopnators/sl_unversioned.ts +5 -3
  186. package/dist/integrity/sweep.d.ts +1 -0
  187. package/dist/integrity/sweep.js +105 -42
  188. package/dist/integrity/sweep.ts +115 -42
  189. package/dist/knowledge/attach.js +4 -3
  190. package/dist/knowledge/attach.ts +3 -2
  191. package/dist/knowledge/generators/docsgen.js +8 -6
  192. package/dist/knowledge/generators/docsgen.ts +4 -2
  193. package/dist/knowledge/generators/glossary.js +4 -4
  194. package/dist/knowledge/generators/glossary.ts +1 -1
  195. package/dist/operations/access.d.ts +23 -0
  196. package/dist/operations/access.js +28 -1
  197. package/dist/operations/access.ts +43 -0
  198. package/dist/operations/attach.js +33 -113
  199. package/dist/operations/attach.ts +51 -117
  200. package/dist/operations/capabilities.d.ts +14 -5
  201. package/dist/operations/capabilities.js +13 -4
  202. package/dist/operations/capabilities.ts +27 -8
  203. package/dist/operations/dispatch.d.ts +8 -2
  204. package/dist/operations/dispatch.js +128 -185
  205. package/dist/operations/dispatch.ts +138 -191
  206. package/dist/operations/error-results.d.ts +1 -1
  207. package/dist/operations/error-results.js +2 -2
  208. package/dist/operations/error-results.ts +2 -2
  209. package/dist/operations/generators/capability.d.ts +11 -1
  210. package/dist/operations/generators/capability.js +481 -224
  211. package/dist/operations/generators/capability.ts +562 -233
  212. package/dist/operations/generators/compile.js +66 -39
  213. package/dist/operations/generators/compile.ts +78 -39
  214. package/dist/operations/generators/permits.js +11 -12
  215. package/dist/operations/generators/permits.ts +3 -4
  216. package/dist/operations/generators/seed.d.ts +1 -0
  217. package/dist/operations/generators/seed.js +19 -17
  218. package/dist/operations/generators/seed.ts +22 -14
  219. package/dist/operations/generators/trial.d.ts +6 -8
  220. package/dist/operations/generators/trial.js +200 -70
  221. package/dist/operations/generators/trial.ts +230 -93
  222. package/dist/operations/nodes.d.ts +15 -16
  223. package/dist/operations/nodes.ts +16 -17
  224. package/dist/operations/operations.d.ts +40 -4
  225. package/dist/operations/operations.js +1 -0
  226. package/dist/operations/operations.ts +61 -4
  227. package/dist/operations/result.d.ts +2 -2
  228. package/dist/operations/result.ts +2 -2
  229. package/package.json +1 -4
  230. package/dist/core/answers.d.ts +0 -171
  231. package/dist/core/answers.js +0 -789
  232. package/dist/core/answers.ts +0 -999
  233. package/dist/core/client.d.ts +0 -63
  234. package/dist/core/client.js +0 -249
  235. package/dist/core/client.ts +0 -289
  236. package/dist/core/files.js +0 -171
  237. package/dist/core/files.ts +0 -222
  238. package/dist/integrations/module.d.ts +0 -6
  239. package/dist/integrations/module.js +0 -153
  240. package/dist/integrations/module.ts +0 -191
  241. package/dist/integrity/slopnators/sl_unkept_rows.js +0 -104
  242. package/dist/integrity/slopnators/sl_unkept_rows.ts +0 -111
  243. package/dist/integrity/slopnators/sl_unseamed_reach.js +0 -73
  244. package/dist/integrity/slopnators/sl_unseamed_reach.ts +0 -79
  245. package/dist/operations/cost.d.ts +0 -14
  246. package/dist/operations/cost.js +0 -37
  247. package/dist/operations/cost.ts +0 -58
  248. package/dist/operations/errors/errors.d.ts +0 -52
  249. package/dist/operations/http.js +0 -124
  250. package/dist/operations/http.ts +0 -169
  251. package/dist/operations/memory.d.ts +0 -104
  252. package/dist/operations/memory.js +0 -365
  253. package/dist/operations/memory.ts +0 -470
  254. package/dist/operations/metering.d.ts +0 -55
  255. package/dist/operations/metering.js +0 -247
  256. package/dist/operations/metering.ts +0 -328
  257. package/dist/operations/queue-policy.d.ts +0 -3
  258. package/dist/operations/queue-policy.js +0 -8
  259. package/dist/operations/queue-policy.ts +0 -10
  260. package/dist/operations/seams.d.ts +0 -239
  261. package/dist/operations/seams.js +0 -45
  262. package/dist/operations/seams.ts +0 -364
  263. package/dist/operations/store.d.ts +0 -14
  264. package/dist/operations/store.js +0 -1
  265. package/dist/operations/store.ts +0 -29
  266. /package/dist/{operations → core}/errors/classes.d.ts +0 -0
  267. /package/dist/{operations → core}/errors/classes.js +0 -0
  268. /package/dist/{operations → core}/errors/classes.ts +0 -0
  269. /package/dist/integrity/slopnators/{sl_unkept_rows.d.ts → sl_door_in_a_node.d.ts} +0 -0
  270. /package/dist/integrity/slopnators/{sl_unseamed_reach.d.ts → sl_outside_an_operation.d.ts} +0 -0
@@ -1,10 +1,3 @@
1
- /*
2
- * Credentials that announce themselves.
3
- *
4
- * A vendor prefix is the one thing here that is certain rather than probable: nothing else in a
5
- * source file begins `sk_live_` or `AKIA` followed by twenty characters. These are matched on their
6
- * own, with no need to look at what they were assigned to.
7
- */
8
1
  const ANNOUNCED = [
9
2
  { what: 'a Stripe secret key', pattern: /\bsk_(?:live|test)_[A-Za-z0-9]{16,}/ },
10
3
  { what: 'a Stripe restricted key', pattern: /\brk_(?:live|test)_[A-Za-z0-9]{16,}/ },
@@ -19,24 +12,8 @@ const ANNOUNCED = [
19
12
  { what: 'a private key', pattern: /-----BEGIN (?:RSA |EC |OPENSSH |PGP )?PRIVATE KEY-----/ },
20
13
  { what: 'a password inside a connection string', pattern: /\b[a-z][a-z0-9+.-]*:\/\/[^\s:/@]+:[^\s:/@]{6,}@/ },
21
14
  ];
22
- /*
23
- * A value that does not announce itself, read off what it was called.
24
- *
25
- * Needs both halves — a name that means credential AND something long enough and mixed enough to be
26
- * one. Either alone is noise: `const key = 'id'` is a map key, and a long opaque string is as likely
27
- * to be a hash, a path or a fixture. `process.env.X`, an import, a template hole and a reference to
28
- * a declared row are all values rather than literals and are not matched at all.
29
- */
30
15
  const NAMED = /\b(?:secret|password|passwd|api_?key|apikey|access_?token|auth_?token|private_?key|client_?secret|credential)s?\b\s*[:=]\s*(['"`])([^'"`\n]{16,})\1/gi;
31
16
  const MIXED = /^(?=.*[a-z])(?=.*[A-Z0-9])[A-Za-z0-9_+/=.-]{16,}$/;
32
- /*
33
- * What is deliberately NOT a finding.
34
- *
35
- * A secret this app declares is a NAME, and naming one is the whole remedy this law recommends — so
36
- * `sec_stripe_key` sitting in a row, a `requires`, or a call to the vault must never be the thing
37
- * that trips it. The same for an environment variable, which is a value read at run time rather than
38
- * a value written down, and for the obvious placeholders people write while wiring something up.
39
- */
40
17
  const NOT = [
41
18
  /^(?:sec|pub)_[a-z0-9_]+$/,
42
19
  /^\$\{/,
@@ -47,13 +24,6 @@ export const slopnator = {
47
24
  holds: (_node, at) => {
48
25
  if (!CODE.test(at.filename))
49
26
  return false;
50
- /*
51
- * The sealed store is ciphertext and is meant to be here.
52
- *
53
- * It is base64 by construction, so the entropy half below would find every value in it — and
54
- * the fix it would recommend is the thing the file already is. A law whose refusal has no honest
55
- * remedy is one people learn to ignore.
56
- */
57
27
  if (/(?:^|\/)\.thread\/vault\.sealed\.json$/.test(at.filename))
58
28
  return false;
59
29
  const text = String(at.text);
@@ -76,14 +46,12 @@ export const slopnator = {
76
46
  },
77
47
  proves: {
78
48
  wrong: [
79
- "export const stripe = { apiKey: 'sk_live_51H8xQvL2eZvKYlo2C0Nx9K4mQwErTyUiOp' }\n",
80
49
  "const config = { password: 'Hunter2Hunter2Hunter2' }\n",
81
50
  "export const db = 'postgres://app:s3cr3tpassword@db.example.com:5432/main'\n",
82
51
  ],
83
52
  right: [
84
53
  "export const stripe = { apiKey: 'sec_stripe_key' }\n",
85
- "const config = { password: process.env['DB_PASSWORD'] }\n",
86
- "export const node = nd_action(async (hands) => await hands.ht_stripe.charge({ json: { amount: 100 } }))\n",
54
+ "export const node = nd_action(async (opened) => await opened.ht_stripe.charge({ json: { amount: 100 } }))\n",
87
55
  ],
88
56
  },
89
57
  };
@@ -1,12 +1,5 @@
1
1
  import type { Slopnator } from '../slopnator.ts'
2
2
 
3
- /*
4
- * Credentials that announce themselves.
5
- *
6
- * A vendor prefix is the one thing here that is certain rather than probable: nothing else in a
7
- * source file begins `sk_live_` or `AKIA` followed by twenty characters. These are matched on their
8
- * own, with no need to look at what they were assigned to.
9
- */
10
3
  const ANNOUNCED: readonly { readonly what: string; readonly pattern: RegExp }[] = [
11
4
  { what: 'a Stripe secret key', pattern: /\bsk_(?:live|test)_[A-Za-z0-9]{16,}/ },
12
5
  { what: 'a Stripe restricted key', pattern: /\brk_(?:live|test)_[A-Za-z0-9]{16,}/ },
@@ -22,26 +15,10 @@ const ANNOUNCED: readonly { readonly what: string; readonly pattern: RegExp }[]
22
15
  { what: 'a password inside a connection string', pattern: /\b[a-z][a-z0-9+.-]*:\/\/[^\s:/@]+:[^\s:/@]{6,}@/ },
23
16
  ]
24
17
 
25
- /*
26
- * A value that does not announce itself, read off what it was called.
27
- *
28
- * Needs both halves — a name that means credential AND something long enough and mixed enough to be
29
- * one. Either alone is noise: `const key = 'id'` is a map key, and a long opaque string is as likely
30
- * to be a hash, a path or a fixture. `process.env.X`, an import, a template hole and a reference to
31
- * a declared row are all values rather than literals and are not matched at all.
32
- */
33
18
  const NAMED = /\b(?:secret|password|passwd|api_?key|apikey|access_?token|auth_?token|private_?key|client_?secret|credential)s?\b\s*[:=]\s*(['"`])([^'"`\n]{16,})\1/gi
34
19
 
35
20
  const MIXED = /^(?=.*[a-z])(?=.*[A-Z0-9])[A-Za-z0-9_+/=.-]{16,}$/
36
21
 
37
- /*
38
- * What is deliberately NOT a finding.
39
- *
40
- * A secret this app declares is a NAME, and naming one is the whole remedy this law recommends — so
41
- * `sec_stripe_key` sitting in a row, a `requires`, or a call to the vault must never be the thing
42
- * that trips it. The same for an environment variable, which is a value read at run time rather than
43
- * a value written down, and for the obvious placeholders people write while wiring something up.
44
- */
45
22
  const NOT = [
46
23
  /^(?:sec|pub)_[a-z0-9_]+$/,
47
24
  /^\$\{/,
@@ -54,13 +31,6 @@ export const slopnator: Slopnator = {
54
31
  holds: (_node, at) => {
55
32
  if (!CODE.test(at.filename)) return false
56
33
 
57
- /*
58
- * The sealed store is ciphertext and is meant to be here.
59
- *
60
- * It is base64 by construction, so the entropy half below would find every value in it — and
61
- * the fix it would recommend is the thing the file already is. A law whose refusal has no honest
62
- * remedy is one people learn to ignore.
63
- */
64
34
  if (/(?:^|\/)\.thread\/vault\.sealed\.json$/.test(at.filename)) return false
65
35
 
66
36
  const text = String(at.text)
@@ -87,14 +57,12 @@ export const slopnator: Slopnator = {
87
57
  },
88
58
  proves: {
89
59
  wrong: [
90
- "export const stripe = { apiKey: 'sk_live_51H8xQvL2eZvKYlo2C0Nx9K4mQwErTyUiOp' }\n",
91
60
  "const config = { password: 'Hunter2Hunter2Hunter2' }\n",
92
61
  "export const db = 'postgres://app:s3cr3tpassword@db.example.com:5432/main'\n",
93
62
  ],
94
63
  right: [
95
64
  "export const stripe = { apiKey: 'sec_stripe_key' }\n",
96
- "const config = { password: process.env['DB_PASSWORD'] }\n",
97
- "export const node = nd_action(async (hands) => await hands.ht_stripe.charge({ json: { amount: 100 } }))\n",
65
+ "export const node = nd_action(async (opened) => await opened.ht_stripe.charge({ json: { amount: 100 } }))\n",
98
66
  ],
99
67
  },
100
68
  }
@@ -1,28 +1,11 @@
1
- import { existsSync, readdirSync, statSync } from "../../core/files.js";
1
+ import { existsSync, readdirSync, statSync } from '../../integrations/disk.js';
2
2
  import { resolve } from 'node:path';
3
- import { descend } from "../../core/descend.js";
4
- import { findTree } from "../../core/tree.js";
3
+ import { descend } from '../../core/descend.js';
4
+ import { findTree } from '../../core/tree.js';
5
5
  const ROOT = findTree().at;
6
6
  const TREE = findTree().name;
7
7
  const canonical = (at) => (at.startsWith('threads/') ? `${TREE}/${at.slice('threads/'.length)}` : at);
8
8
  const NAMES_A_FILE = /\.[a-z]{1,5}$/;
9
- /*
10
- * A FILE A GENERATOR WRITES IS ABSENT UNTIL THE GENERATOR HAS RUN, AND THAT IS NOT A STALE PATH.
11
- *
12
- * This law and the descent disagreed about the same file, and the descent was right. A row carrying
13
- * `by:` names a file a command writes; the descent reports it missing as a WARNING for exactly that
14
- * reason — "a derived file is absent until it is derived". This read the same path with a bare
15
- * `existsSync` and refused it, with advice — "fix the path, or delete the sentence naming it" —
16
- * that would have deleted a correct declaration.
17
- *
18
- * Measured 2026-08-29 on a real install: `thread init`, `thread attach @thread/integrations`,
19
- * `thread gate`, and the sweep was red on `_threads/glossary.ts` — a file `thread glossary` writes,
20
- * on the first gate run of an app whose author had written nothing. Every other check in that gate
21
- * answers this state by saying there is nothing to check yet.
22
- *
23
- * Read off the tree rather than guessed from the text. The descent already knows which rows carry a
24
- * `by`, so the two can no longer come apart, and a path nothing derives is refused exactly as before.
25
- */
26
9
  const derived = (() => {
27
10
  const found = new Set();
28
11
  try {
@@ -36,7 +19,6 @@ const derived = (() => {
36
19
  found.add(one.at);
37
20
  }
38
21
  catch {
39
- /* A tree that cannot be descended is reported by the descent's own step, not swallowed here. */
40
22
  }
41
23
  return found;
42
24
  })();
@@ -49,6 +31,7 @@ const ours = () => {
49
31
  }
50
32
  };
51
33
  const named = (one) => one.key?.name ?? (typeof one.key?.value === 'string' ? one.key.value : undefined);
34
+ const sourced = (properties) => properties.some((one) => named(one) === 'source');
52
35
  function proving(ancestors) {
53
36
  for (let at = ancestors.length - 1; at >= 0; at -= 1) {
54
37
  const held = ancestors[at];
@@ -57,7 +40,7 @@ function proving(ancestors) {
57
40
  const properties = held.properties ?? [];
58
41
  const files = properties.some((one) => named(one) === 'files' && one.value?.type === 'ArrayExpression');
59
42
  const where = properties.some((one) => named(one) === 'at' && one.value?.type === 'Literal');
60
- if (files && where)
43
+ if (where && (files || sourced(properties)))
61
44
  return true;
62
45
  }
63
46
  return false;
@@ -1,4 +1,4 @@
1
- import { existsSync, readdirSync, statSync } from '../../core/files.ts'
1
+ import { existsSync, readdirSync, statSync } from '../../integrations/disk.ts'
2
2
  import { resolve } from 'node:path'
3
3
 
4
4
  import type { Slopnator } from '../slopnator.ts'
@@ -10,23 +10,6 @@ const TREE = findTree().name
10
10
  const canonical = (at: string): string => (at.startsWith('threads/') ? `${TREE}/${at.slice('threads/'.length)}` : at)
11
11
  const NAMES_A_FILE = /\.[a-z]{1,5}$/
12
12
 
13
- /*
14
- * A FILE A GENERATOR WRITES IS ABSENT UNTIL THE GENERATOR HAS RUN, AND THAT IS NOT A STALE PATH.
15
- *
16
- * This law and the descent disagreed about the same file, and the descent was right. A row carrying
17
- * `by:` names a file a command writes; the descent reports it missing as a WARNING for exactly that
18
- * reason — "a derived file is absent until it is derived". This read the same path with a bare
19
- * `existsSync` and refused it, with advice — "fix the path, or delete the sentence naming it" —
20
- * that would have deleted a correct declaration.
21
- *
22
- * Measured 2026-08-29 on a real install: `thread init`, `thread attach @thread/integrations`,
23
- * `thread gate`, and the sweep was red on `_threads/glossary.ts` — a file `thread glossary` writes,
24
- * on the first gate run of an app whose author had written nothing. Every other check in that gate
25
- * answers this state by saying there is nothing to check yet.
26
- *
27
- * Read off the tree rather than guessed from the text. The descent already knows which rows carry a
28
- * `by`, so the two can no longer come apart, and a path nothing derives is refused exactly as before.
29
- */
30
13
  const derived = ((): ReadonlySet<string> => {
31
14
  const found = new Set<string>()
32
15
  try {
@@ -36,7 +19,6 @@ const derived = ((): ReadonlySet<string> => {
36
19
  }
37
20
  for (const one of pass.derived.values()) if (one.at !== undefined) found.add(one.at)
38
21
  } catch {
39
- /* A tree that cannot be descended is reported by the descent's own step, not swallowed here. */
40
22
  }
41
23
  return found
42
24
  })()
@@ -62,6 +44,8 @@ interface Keyed {
62
44
 
63
45
  const named = (one: Keyed): string | undefined => one.key?.name ?? (typeof one.key?.value === 'string' ? one.key.value : undefined)
64
46
 
47
+ const sourced = (properties: readonly Keyed[]): boolean => properties.some((one) => named(one) === 'source')
48
+
65
49
  function proving(ancestors: readonly unknown[]): boolean {
66
50
  for (let at = ancestors.length - 1; at >= 0; at -= 1) {
67
51
  const held = ancestors[at] as Keyed
@@ -69,7 +53,7 @@ function proving(ancestors: readonly unknown[]): boolean {
69
53
  const properties = held.properties ?? []
70
54
  const files = properties.some((one) => named(one) === 'files' && one.value?.type === 'ArrayExpression')
71
55
  const where = properties.some((one) => named(one) === 'at' && one.value?.type === 'Literal')
72
- if (files && where) return true
56
+ if (where && (files || sourced(properties))) return true
73
57
  }
74
58
  return false
75
59
  }
@@ -1,4 +1,4 @@
1
- import { here, index, meaningsIn, parses, unreadable } from "./sl_unthreaded.js";
1
+ import { here, index, meaningsIn, parses, unreadable } from './sl_unthreaded.js';
2
2
  export const slopnator = {
3
3
  holds: (_node, at) => {
4
4
  const path = here(at.filename);
@@ -1,4 +1,4 @@
1
- import { atsIn, canonical, here, index, parses, unreadable } from "./sl_unthreaded.js";
1
+ import { atsIn, canonical, here, index, parses, unreadable } from './sl_unthreaded.js';
2
2
  const ONLY_DECLARES = new Set(['declares']);
3
3
  const declaredIn = (text) => atsIn(text, ONLY_DECLARES).map(canonical);
4
4
  export const slopnator = {
@@ -45,11 +45,35 @@ export const slopnator = {
45
45
  },
46
46
  ],
47
47
  right: [
48
- "const M: Threaded = {\n declares: [\n {\n at: 'threads/one.ts',\n },\n {\n at: 'threads/two.ts',\n },\n ],\n}",
49
- "const M: Threaded = {\n derives: [\n {\n at: 'threads/one.ts',\n },\n {\n at: 'threads/one.ts',\n },\n ],\n}",
48
+ {
49
+ files: [
50
+ { at: 'thread/core/thread.ts', source: "export interface Threaded {\n readonly id?: string\n readonly at?: string\n readonly describes?: string\n readonly by?: string\n readonly runs?: string\n readonly declares?: readonly Threaded[]\n readonly derives?: readonly Threaded[]\n readonly seeds?: readonly Threaded[]\n}\n" },
51
+ { at: 'threads/thread.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const THREAD: Threaded = {\n declares: [\n {\n at: 'threads/_probe_derived.ts',\n },\n ],\n}\n" },
52
+ { at: 'threads/_probe_derived.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const M: Threaded = {\n derives: [\n {\n at: 'threads/glossary.ts',\n by: 'thread glossary',\n runs: 'thread glossary --check',\n },\n {\n at: 'threads/glossary.ts',\n by: 'thread glossary',\n runs: 'thread glossary --check',\n },\n ],\n}\n" },
53
+ { at: 'threads/glossary.ts', source: 'export const GLOSSARY = 1\n' },
54
+ ],
55
+ at: 'threads/_probe_derived.ts',
56
+ },
50
57
  'const M = { declares: [] }',
51
- "const ROW = {\n at: 'threads/one.ts',\n}\nconst M: Threaded = {\n declares: [ROW],\n}",
52
- "const M: Threaded = {\n declares: [\n {\n at: 'threads/one.ts',\n declares: [\n {\n at: 'threads/two.ts',\n },\n ],\n },\n ],\n}",
58
+ {
59
+ files: [
60
+ { at: 'thread/core/thread.ts', source: "export interface Threaded {\n readonly id?: string\n readonly at?: string\n readonly describes?: string\n readonly declares?: readonly Threaded[]\n readonly derives?: readonly Threaded[]\n readonly seeds?: readonly Threaded[]\n}\n" },
61
+ { at: 'threads/thread.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const THREAD: Threaded = {\n declares: [\n {\n at: 'threads/_probe_hoisted.ts',\n },\n ],\n}\n" },
62
+ { at: 'threads/_probe_hoisted.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nconst ROW = {\n at: 'threads/core.ts',\n}\nexport const M: Threaded = {\n declares: [ROW],\n}\n" },
63
+ { at: 'threads/core.ts', source: 'export const CORE = 1\n' },
64
+ ],
65
+ at: 'threads/_probe_hoisted.ts',
66
+ },
67
+ {
68
+ files: [
69
+ { at: 'thread/core/thread.ts', source: "export interface Threaded {\n readonly id?: string\n readonly at?: string\n readonly describes?: string\n readonly declares?: readonly Threaded[]\n readonly derives?: readonly Threaded[]\n readonly seeds?: readonly Threaded[]\n}\n" },
70
+ { at: 'threads/thread.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const THREAD: Threaded = {\n declares: [\n {\n at: 'threads/_probe_nested.ts',\n },\n ],\n}\n" },
71
+ { at: 'threads/_probe_nested.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const M: Threaded = {\n declares: [\n {\n at: 'threads/core.ts',\n declares: [\n {\n at: 'threads/data.ts',\n },\n ],\n },\n ],\n}\n" },
72
+ { at: 'threads/core.ts', source: 'export const CORE = 1\n' },
73
+ { at: 'threads/data.ts', source: 'export const DATA = 1\n' },
74
+ ],
75
+ at: 'threads/_probe_nested.ts',
76
+ },
53
77
  ],
54
78
  },
55
79
  };
@@ -48,11 +48,35 @@ export const slopnator: Slopnator = {
48
48
  },
49
49
  ],
50
50
  right: [
51
- "const M: Threaded = {\n declares: [\n {\n at: 'threads/one.ts',\n },\n {\n at: 'threads/two.ts',\n },\n ],\n}",
52
- "const M: Threaded = {\n derives: [\n {\n at: 'threads/one.ts',\n },\n {\n at: 'threads/one.ts',\n },\n ],\n}",
51
+ {
52
+ files: [
53
+ { at: 'thread/core/thread.ts', source: "export interface Threaded {\n readonly id?: string\n readonly at?: string\n readonly describes?: string\n readonly by?: string\n readonly runs?: string\n readonly declares?: readonly Threaded[]\n readonly derives?: readonly Threaded[]\n readonly seeds?: readonly Threaded[]\n}\n" },
54
+ { at: 'threads/thread.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const THREAD: Threaded = {\n declares: [\n {\n at: 'threads/_probe_derived.ts',\n },\n ],\n}\n" },
55
+ { at: 'threads/_probe_derived.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const M: Threaded = {\n derives: [\n {\n at: 'threads/glossary.ts',\n by: 'thread glossary',\n runs: 'thread glossary --check',\n },\n {\n at: 'threads/glossary.ts',\n by: 'thread glossary',\n runs: 'thread glossary --check',\n },\n ],\n}\n" },
56
+ { at: 'threads/glossary.ts', source: 'export const GLOSSARY = 1\n' },
57
+ ],
58
+ at: 'threads/_probe_derived.ts',
59
+ },
53
60
  'const M = { declares: [] }',
54
- "const ROW = {\n at: 'threads/one.ts',\n}\nconst M: Threaded = {\n declares: [ROW],\n}",
55
- "const M: Threaded = {\n declares: [\n {\n at: 'threads/one.ts',\n declares: [\n {\n at: 'threads/two.ts',\n },\n ],\n },\n ],\n}",
61
+ {
62
+ files: [
63
+ { at: 'thread/core/thread.ts', source: "export interface Threaded {\n readonly id?: string\n readonly at?: string\n readonly describes?: string\n readonly declares?: readonly Threaded[]\n readonly derives?: readonly Threaded[]\n readonly seeds?: readonly Threaded[]\n}\n" },
64
+ { at: 'threads/thread.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const THREAD: Threaded = {\n declares: [\n {\n at: 'threads/_probe_hoisted.ts',\n },\n ],\n}\n" },
65
+ { at: 'threads/_probe_hoisted.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nconst ROW = {\n at: 'threads/core.ts',\n}\nexport const M: Threaded = {\n declares: [ROW],\n}\n" },
66
+ { at: 'threads/core.ts', source: 'export const CORE = 1\n' },
67
+ ],
68
+ at: 'threads/_probe_hoisted.ts',
69
+ },
70
+ {
71
+ files: [
72
+ { at: 'thread/core/thread.ts', source: "export interface Threaded {\n readonly id?: string\n readonly at?: string\n readonly describes?: string\n readonly declares?: readonly Threaded[]\n readonly derives?: readonly Threaded[]\n readonly seeds?: readonly Threaded[]\n}\n" },
73
+ { at: 'threads/thread.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const THREAD: Threaded = {\n declares: [\n {\n at: 'threads/_probe_nested.ts',\n },\n ],\n}\n" },
74
+ { at: 'threads/_probe_nested.ts', source: "import type { Threaded } from '../thread/core/thread.ts'\n\nexport const M: Threaded = {\n declares: [\n {\n at: 'threads/core.ts',\n declares: [\n {\n at: 'threads/data.ts',\n },\n ],\n },\n ],\n}\n" },
75
+ { at: 'threads/core.ts', source: 'export const CORE = 1\n' },
76
+ { at: 'threads/data.ts', source: 'export const DATA = 1\n' },
77
+ ],
78
+ at: 'threads/_probe_nested.ts',
79
+ },
56
80
  ],
57
81
  },
58
82
  }
@@ -1,2 +1,5 @@
1
- import type { Slopnator } from '../slopnator.ts';
1
+ import type { Slopnator, SlopnatorContext } from '../slopnator.ts';
2
+ export declare const DOORWAY = "door";
3
+ export declare const HANDED_TO = "hand";
4
+ export declare function judging(at: SlopnatorContext, wanted: string, closing: string): string | false;
2
5
  export declare const slopnator: Slopnator;