@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.
- package/CHANGELOG.md +563 -0
- package/dist/core/actor.d.ts +1 -1
- package/dist/core/actor.js +5 -4
- package/dist/core/actor.ts +5 -4
- package/dist/core/attach.d.ts +0 -7
- package/dist/core/attach.js +38 -67
- package/dist/core/attach.ts +34 -80
- package/dist/core/chain.js +13 -17
- package/dist/core/chain.ts +11 -15
- package/dist/core/condition.d.ts +4 -4
- package/dist/core/condition.js +2 -2
- package/dist/core/descend.d.ts +4 -2
- package/dist/core/descend.js +91 -23
- package/dist/core/descend.ts +90 -21
- package/dist/core/errors/catalogue.d.ts +52 -0
- package/dist/{operations/errors/errors.js → core/errors/catalogue.js} +1 -1
- package/dist/{operations/errors/errors.ts → core/errors/catalogue.ts} +1 -1
- package/dist/{operations/errors/catalog.d.ts → core/errors/error.d.ts} +2 -3
- package/dist/{operations/errors/catalog.js → core/errors/error.js} +1 -16
- package/dist/{operations/errors/catalog.ts → core/errors/error.ts} +3 -19
- package/dist/core/errors/namespaces.d.ts +3 -0
- package/dist/core/errors/namespaces.js +15 -0
- package/dist/core/errors/namespaces.ts +19 -0
- package/dist/core/finding.js +2 -2
- package/dist/core/finding.ts +1 -2
- package/dist/core/init.d.ts +1 -1
- package/dist/core/init.js +51 -5
- package/dist/core/init.ts +58 -5
- package/dist/core/invoked.d.ts +1 -1
- package/dist/core/invoked.js +3 -1
- package/dist/core/invoked.ts +5 -2
- package/dist/core/round.js +36 -22
- package/dist/core/round.ts +26 -9
- package/dist/core/rows.d.ts +4 -0
- package/dist/core/rows.js +31 -2
- package/dist/core/rows.ts +33 -1
- package/dist/core/scope.d.ts +1 -0
- package/dist/core/scope.js +1 -0
- package/dist/core/scope.ts +2 -0
- package/dist/core/thread.d.ts +3 -3
- package/dist/core/tree.d.ts +4 -1
- package/dist/core/tree.js +26 -6
- package/dist/core/tree.ts +29 -6
- package/dist/core/types.d.ts +3 -3
- package/dist/core/types.js +3 -1
- package/dist/core/types.ts +2 -1
- package/dist/derivation/attach.js +3 -2
- package/dist/derivation/attach.ts +2 -1
- package/dist/derivation/generators/build.js +6 -6
- package/dist/derivation/generators/build.ts +1 -1
- package/dist/derivation/generators/check.js +1 -1
- package/dist/derivation/generators/determinism.js +1 -1
- package/dist/derivation/generators/release.js +60 -47
- package/dist/derivation/generators/release.ts +66 -43
- package/dist/derivation/release.d.ts +7 -3
- package/dist/derivation/release.js +14 -1
- package/dist/derivation/release.ts +22 -2
- package/dist/integrations/attach.d.ts +4 -0
- package/dist/integrations/attach.js +37 -56
- package/dist/integrations/attach.ts +54 -60
- package/dist/integrations/cli.d.ts +37 -0
- package/dist/integrations/cli.js +440 -0
- package/dist/integrations/cli.ts +543 -0
- package/dist/{core/files.d.ts → integrations/disk.d.ts} +16 -24
- package/dist/integrations/disk.js +435 -0
- package/dist/integrations/disk.ts +465 -0
- package/dist/integrations/generators/read.js +6 -6
- package/dist/integrations/generators/read.ts +4 -4
- package/dist/integrations/generators/vault.js +10 -11
- package/dist/integrations/generators/vault.ts +4 -5
- package/dist/{operations/http.d.ts → integrations/https.d.ts} +10 -6
- package/dist/integrations/https.js +170 -0
- package/dist/integrations/https.ts +216 -0
- package/dist/integrations/pglite.d.ts +26 -0
- package/dist/integrations/pglite.js +143 -0
- package/dist/integrations/pglite.ts +206 -0
- package/dist/integrations/secret.d.ts +8 -2
- package/dist/integrations/secret.js +3 -5
- package/dist/integrations/secret.ts +10 -6
- package/dist/integrations/target.d.ts +155 -14
- package/dist/integrations/target.js +171 -50
- package/dist/integrations/target.ts +377 -61
- package/dist/integrations/vault.d.ts +1 -0
- package/dist/integrations/vault.js +20 -5
- package/dist/integrations/vault.ts +17 -5
- package/dist/integrity/attach.js +8 -77
- package/dist/integrity/attach.ts +7 -76
- package/dist/integrity/check-threads.js +5 -5
- package/dist/integrity/check-threads.ts +2 -2
- package/dist/integrity/constraint.d.ts +0 -1
- package/dist/integrity/constraint.js +267 -366
- package/dist/integrity/constraint.ts +267 -375
- package/dist/integrity/generators/compiler.js +14 -17
- package/dist/integrity/generators/compiler.ts +10 -15
- package/dist/integrity/generators/gate.js +15 -15
- package/dist/integrity/generators/gate.ts +10 -10
- package/dist/integrity/generators/issues.js +7 -7
- package/dist/integrity/generators/publish.js +39 -57
- package/dist/integrity/generators/publish.ts +44 -55
- package/dist/integrity/generators/trial.d.ts +3 -3
- package/dist/integrity/generators/trial.js +133 -165
- package/dist/integrity/generators/trial.ts +145 -169
- package/dist/integrity/lint.js +9 -13
- package/dist/integrity/lint.ts +7 -10
- package/dist/integrity/lsp/bin.js +5 -4
- package/dist/integrity/lsp/bin.ts +3 -1
- package/dist/integrity/lsp/diagnostics.js +3 -3
- package/dist/integrity/lsp/diagnostics.ts +1 -1
- package/dist/integrity/lsp/lint.js +19 -30
- package/dist/integrity/lsp/lint.ts +16 -32
- package/dist/integrity/lsp/server.js +3 -3
- package/dist/integrity/slopnator.d.ts +3 -13
- package/dist/integrity/slopnator.js +59 -38
- package/dist/integrity/slopnator.ts +54 -38
- package/dist/integrity/slopnators/sl_broken_lineage.js +2 -2
- package/dist/integrity/slopnators/sl_declared_elsewhere.js +1 -1
- package/dist/integrity/slopnators/sl_derived_drift.js +4 -4
- package/dist/integrity/slopnators/sl_derived_drift.ts +1 -1
- package/dist/integrity/slopnators/sl_door_in_a_node.js +220 -0
- package/dist/integrity/slopnators/sl_door_in_a_node.ts +250 -0
- package/dist/integrity/slopnators/sl_inert_island.js +10 -8
- package/dist/integrity/slopnators/sl_inert_island.ts +8 -6
- package/dist/integrity/slopnators/sl_missing_row.js +6 -51
- package/dist/integrity/slopnators/sl_missing_row.ts +4 -50
- package/dist/integrity/slopnators/sl_no_barrel.js +1 -1
- package/dist/integrity/slopnators/sl_no_child_process.js +36 -18
- package/dist/integrity/slopnators/sl_no_child_process.ts +44 -18
- package/dist/integrity/slopnators/sl_no_dispatch_bypass.js +80 -149
- package/dist/integrity/slopnators/sl_no_dispatch_bypass.ts +95 -147
- package/dist/integrity/slopnators/sl_no_import_cycle.js +15 -4
- package/dist/integrity/slopnators/sl_no_import_cycle.ts +20 -4
- package/dist/integrity/slopnators/sl_no_such_command.js +2 -2
- package/dist/integrity/slopnators/sl_no_such_command.ts +1 -1
- package/dist/integrity/slopnators/sl_outside_an_operation.js +20 -0
- package/dist/integrity/slopnators/sl_outside_an_operation.ts +25 -0
- package/dist/integrity/slopnators/sl_screen_holds_only_declared.d.ts +2 -0
- package/dist/integrity/slopnators/sl_screen_holds_only_declared.js +61 -0
- package/dist/integrity/slopnators/sl_screen_holds_only_declared.ts +70 -0
- package/dist/integrity/slopnators/sl_secret_literal.js +1 -33
- package/dist/integrity/slopnators/sl_secret_literal.ts +1 -33
- package/dist/integrity/slopnators/sl_stale_path.js +5 -22
- package/dist/integrity/slopnators/sl_stale_path.ts +4 -20
- package/dist/integrity/slopnators/sl_twice_meant.js +1 -1
- package/dist/integrity/slopnators/sl_twice_parented.js +29 -5
- package/dist/integrity/slopnators/sl_twice_parented.ts +28 -4
- package/dist/integrity/slopnators/sl_undeclared_crossing.d.ts +4 -1
- package/dist/integrity/slopnators/sl_undeclared_crossing.js +426 -62
- package/dist/integrity/slopnators/sl_undeclared_crossing.ts +454 -70
- package/dist/integrity/slopnators/sl_undeclared_destination.js +59 -25
- package/dist/integrity/slopnators/sl_undeclared_destination.ts +69 -21
- package/dist/integrity/slopnators/sl_undeclared_list.d.ts +2 -0
- package/dist/integrity/slopnators/sl_undeclared_list.js +363 -0
- package/dist/integrity/slopnators/sl_undeclared_list.ts +358 -0
- package/dist/integrity/slopnators/sl_undeclared_node.js +1 -11
- package/dist/integrity/slopnators/sl_undeclared_node.ts +0 -10
- package/dist/integrity/slopnators/sl_undeclared_operation.js +111 -29
- package/dist/integrity/slopnators/sl_undeclared_operation.ts +134 -26
- package/dist/integrity/slopnators/sl_undeclared_variant.js +2 -2
- package/dist/integrity/slopnators/sl_undeclared_webhook.d.ts +2 -0
- package/dist/integrity/slopnators/sl_undeclared_webhook.js +90 -0
- package/dist/integrity/slopnators/sl_undeclared_webhook.ts +108 -0
- package/dist/integrity/slopnators/sl_underived_route.d.ts +2 -0
- package/dist/integrity/slopnators/sl_underived_route.js +61 -0
- package/dist/integrity/slopnators/sl_underived_route.ts +72 -0
- package/dist/integrity/slopnators/sl_ungoverned_island.js +3 -3
- package/dist/integrity/slopnators/sl_ungoverned_island.ts +1 -1
- package/dist/integrity/slopnators/sl_unlisted_program.d.ts +2 -0
- package/dist/integrity/slopnators/sl_unlisted_program.js +39 -0
- package/dist/integrity/slopnators/sl_unlisted_program.ts +40 -0
- package/dist/integrity/slopnators/sl_unnamed_island.js +1 -1
- package/dist/integrity/slopnators/sl_unpaired_member.js +3 -3
- package/dist/integrity/slopnators/sl_unpaired_member.ts +1 -1
- package/dist/integrity/slopnators/sl_unpaired_slopnator.js +4 -4
- package/dist/integrity/slopnators/sl_unpaired_slopnator.ts +1 -1
- package/dist/integrity/slopnators/sl_unprefixed_member.js +5 -31
- package/dist/integrity/slopnators/sl_unprefixed_member.ts +2 -28
- package/dist/integrity/slopnators/sl_unthreaded.js +11 -7
- package/dist/integrity/slopnators/sl_unthreaded.ts +6 -7
- package/dist/integrity/slopnators/sl_untranslated_key.js +2 -25
- package/dist/integrity/slopnators/sl_untranslated_key.ts +1 -25
- package/dist/integrity/slopnators/sl_unvaulted_secret.d.ts +2 -0
- package/dist/integrity/slopnators/sl_unvaulted_secret.js +107 -0
- package/dist/integrity/slopnators/sl_unvaulted_secret.ts +132 -0
- package/dist/integrity/slopnators/sl_unversioned.js +6 -4
- package/dist/integrity/slopnators/sl_unversioned.ts +5 -3
- package/dist/integrity/sweep.d.ts +1 -0
- package/dist/integrity/sweep.js +105 -42
- package/dist/integrity/sweep.ts +115 -42
- package/dist/knowledge/attach.js +4 -3
- package/dist/knowledge/attach.ts +3 -2
- package/dist/knowledge/generators/docsgen.js +8 -6
- package/dist/knowledge/generators/docsgen.ts +4 -2
- package/dist/knowledge/generators/glossary.js +4 -4
- package/dist/knowledge/generators/glossary.ts +1 -1
- package/dist/operations/access.d.ts +23 -0
- package/dist/operations/access.js +28 -1
- package/dist/operations/access.ts +43 -0
- package/dist/operations/attach.js +33 -113
- package/dist/operations/attach.ts +51 -117
- package/dist/operations/capabilities.d.ts +14 -5
- package/dist/operations/capabilities.js +13 -4
- package/dist/operations/capabilities.ts +27 -8
- package/dist/operations/dispatch.d.ts +8 -2
- package/dist/operations/dispatch.js +128 -185
- package/dist/operations/dispatch.ts +138 -191
- package/dist/operations/error-results.d.ts +1 -1
- package/dist/operations/error-results.js +2 -2
- package/dist/operations/error-results.ts +2 -2
- package/dist/operations/generators/capability.d.ts +11 -1
- package/dist/operations/generators/capability.js +481 -224
- package/dist/operations/generators/capability.ts +562 -233
- package/dist/operations/generators/compile.js +66 -39
- package/dist/operations/generators/compile.ts +78 -39
- package/dist/operations/generators/permits.js +11 -12
- package/dist/operations/generators/permits.ts +3 -4
- package/dist/operations/generators/seed.d.ts +1 -0
- package/dist/operations/generators/seed.js +19 -17
- package/dist/operations/generators/seed.ts +22 -14
- package/dist/operations/generators/trial.d.ts +6 -8
- package/dist/operations/generators/trial.js +200 -70
- package/dist/operations/generators/trial.ts +230 -93
- package/dist/operations/nodes.d.ts +15 -16
- package/dist/operations/nodes.ts +16 -17
- package/dist/operations/operations.d.ts +40 -4
- package/dist/operations/operations.js +1 -0
- package/dist/operations/operations.ts +61 -4
- package/dist/operations/result.d.ts +2 -2
- package/dist/operations/result.ts +2 -2
- package/package.json +1 -4
- package/dist/core/answers.d.ts +0 -171
- package/dist/core/answers.js +0 -789
- package/dist/core/answers.ts +0 -999
- package/dist/core/client.d.ts +0 -63
- package/dist/core/client.js +0 -249
- package/dist/core/client.ts +0 -289
- package/dist/core/files.js +0 -171
- package/dist/core/files.ts +0 -222
- package/dist/integrations/module.d.ts +0 -6
- package/dist/integrations/module.js +0 -153
- package/dist/integrations/module.ts +0 -191
- package/dist/integrity/slopnators/sl_unkept_rows.js +0 -104
- package/dist/integrity/slopnators/sl_unkept_rows.ts +0 -111
- package/dist/integrity/slopnators/sl_unseamed_reach.js +0 -73
- package/dist/integrity/slopnators/sl_unseamed_reach.ts +0 -79
- package/dist/operations/cost.d.ts +0 -14
- package/dist/operations/cost.js +0 -37
- package/dist/operations/cost.ts +0 -58
- package/dist/operations/errors/errors.d.ts +0 -52
- package/dist/operations/http.js +0 -124
- package/dist/operations/http.ts +0 -169
- package/dist/operations/memory.d.ts +0 -104
- package/dist/operations/memory.js +0 -365
- package/dist/operations/memory.ts +0 -470
- package/dist/operations/metering.d.ts +0 -55
- package/dist/operations/metering.js +0 -247
- package/dist/operations/metering.ts +0 -328
- package/dist/operations/queue-policy.d.ts +0 -3
- package/dist/operations/queue-policy.js +0 -8
- package/dist/operations/queue-policy.ts +0 -10
- package/dist/operations/seams.d.ts +0 -239
- package/dist/operations/seams.js +0 -45
- package/dist/operations/seams.ts +0 -364
- package/dist/operations/store.d.ts +0 -14
- package/dist/operations/store.js +0 -1
- package/dist/operations/store.ts +0 -29
- /package/dist/{operations → core}/errors/classes.d.ts +0 -0
- /package/dist/{operations → core}/errors/classes.js +0 -0
- /package/dist/{operations → core}/errors/classes.ts +0 -0
- /package/dist/integrity/slopnators/{sl_unkept_rows.d.ts → sl_door_in_a_node.d.ts} +0 -0
- /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
|
|
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
|
|
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
|
|
1
|
+
import { existsSync, readdirSync, statSync } from '../../integrations/disk.js';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import { descend } from
|
|
4
|
-
import { findTree } from
|
|
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 (
|
|
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 '../../
|
|
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 (
|
|
56
|
+
if (where && (files || sourced(properties))) return true
|
|
73
57
|
}
|
|
74
58
|
return false
|
|
75
59
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { atsIn, canonical, here, index, parses, unreadable } from
|
|
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
|
-
|
|
49
|
-
|
|
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
|
-
|
|
52
|
-
|
|
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
|
-
|
|
52
|
-
|
|
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
|
-
|
|
55
|
-
|
|
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;
|