@prestack/thread 0.1.2 → 0.1.4
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 +193 -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 +67 -58
- package/dist/core/attach.ts +61 -68
- 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 +89 -21
- package/dist/core/descend.ts +86 -17
- 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 +0 -2
- package/dist/core/init.js +51 -15
- package/dist/core/init.ts +58 -15
- 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/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 +1 -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 +33 -54
- package/dist/integrations/attach.ts +50 -57
- 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 -20
- 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 +3 -73
- package/dist/integrity/attach.ts +1 -71
- 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 -161
- package/dist/integrity/generators/trial.ts +145 -165
- 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 +58 -37
- package/dist/integrity/slopnator.ts +53 -37
- 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 +1 -1
- 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 +28 -109
- package/dist/operations/attach.ts +46 -113
- 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 -57
- package/dist/core/client.js +0 -247
- package/dist/core/client.ts +0 -286
- package/dist/core/files.js +0 -145
- package/dist/core/files.ts +0 -193
- 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,7 +1,6 @@
|
|
|
1
1
|
import { createCipheriv, createDecipheriv, randomBytes } from 'node:crypto';
|
|
2
|
-
import * as disk from 'node:fs';
|
|
3
2
|
import { join } from 'node:path';
|
|
4
|
-
import { existsSync, readFileSync, writeFileSync } from
|
|
3
|
+
import { existsSync, readFileSync, writeFileSync } from './disk.js';
|
|
5
4
|
export const VAULT_DIR = '.thread';
|
|
6
5
|
export const SEALED_NAME = 'vault.sealed.json';
|
|
7
6
|
export const KEY_NAME = 'vault.key';
|
|
@@ -18,7 +17,7 @@ const unsealable = (named, why) => new Error(`"${named}" is in the sealed store
|
|
|
18
17
|
const undeclared = (named, known) => new Error(`nothing may ask for a secret this app does not declare, and "${named}" is not one of ` +
|
|
19
18
|
`${known.length === 0 ? '(this app declares none)' : known.join(', ')}. A value is asked for by something that ` +
|
|
20
19
|
'declared it needed it, or not at all.');
|
|
21
|
-
const unset = (named, env) => new Error(`"${named}" is declared and has no value sealed for \`${env}\`. Run \`thread create secret\` and give it one — a ` +
|
|
20
|
+
const unset = (named, env) => new Error(`"${named}" is declared and has no value sealed for \`${env}\`. Run \`thread create secret set ${named}\` and give it one — a ` +
|
|
22
21
|
'declared secret nothing was ever given is refused here rather than resolved to an empty string.');
|
|
23
22
|
const store = (root) => {
|
|
24
23
|
const at = join(root, SEALED_AT);
|
|
@@ -49,8 +48,7 @@ export function keyed(root) {
|
|
|
49
48
|
if (held !== undefined)
|
|
50
49
|
return held;
|
|
51
50
|
const made = randomBytes(KEY_BYTES);
|
|
52
|
-
|
|
53
|
-
disk.writeFileSync(join(root, KEY_AT), `${made.toString('base64')}\n`, { mode: 0o600 });
|
|
51
|
+
writeFileSync(join(root, KEY_AT), `${made.toString('base64')}\n`, { mode: 0o600 });
|
|
54
52
|
return made;
|
|
55
53
|
}
|
|
56
54
|
export function seal(root, named, env, value) {
|
|
@@ -103,4 +101,21 @@ export function opened(root, declared, env) {
|
|
|
103
101
|
return out;
|
|
104
102
|
};
|
|
105
103
|
}
|
|
104
|
+
export function unseal(root, named, envs) {
|
|
105
|
+
const held = store(root);
|
|
106
|
+
const kept = held[named];
|
|
107
|
+
if (kept === undefined)
|
|
108
|
+
return [];
|
|
109
|
+
const taken = envs.filter((env) => kept[env] !== undefined);
|
|
110
|
+
if (taken.length === 0)
|
|
111
|
+
return [];
|
|
112
|
+
const left = Object.fromEntries(Object.entries(kept).filter(([env]) => !envs.includes(env)));
|
|
113
|
+
if (Object.keys(left).length === 0)
|
|
114
|
+
delete held[named];
|
|
115
|
+
else
|
|
116
|
+
held[named] = left;
|
|
117
|
+
const sorted = Object.fromEntries(Object.keys(held).sort().map((each) => [each, held[each]]));
|
|
118
|
+
writeFileSync(join(root, SEALED_AT), `${JSON.stringify(sorted, null, 2)}\n`);
|
|
119
|
+
return taken;
|
|
120
|
+
}
|
|
106
121
|
export const IGNORES = [KEY_AT];
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createCipheriv, createDecipheriv, randomBytes } from 'node:crypto'
|
|
2
|
-
import * as disk from 'node:fs'
|
|
3
2
|
import { join } from 'node:path'
|
|
4
3
|
|
|
5
4
|
import type { Env } from '../core/actor.ts'
|
|
6
|
-
import { existsSync, readFileSync, writeFileSync } from '
|
|
5
|
+
import { existsSync, readFileSync, writeFileSync } from './disk.ts'
|
|
7
6
|
|
|
8
7
|
export const VAULT_DIR = '.thread'
|
|
9
8
|
|
|
@@ -43,7 +42,7 @@ const undeclared = (named: string, known: readonly string[]): Error =>
|
|
|
43
42
|
|
|
44
43
|
const unset = (named: string, env: Env): Error =>
|
|
45
44
|
new Error(
|
|
46
|
-
`"${named}" is declared and has no value sealed for \`${env}\`. Run \`thread create secret\` and give it one — a ` +
|
|
45
|
+
`"${named}" is declared and has no value sealed for \`${env}\`. Run \`thread create secret set ${named}\` and give it one — a ` +
|
|
47
46
|
'declared secret nothing was ever given is refused here rather than resolved to an empty string.',
|
|
48
47
|
)
|
|
49
48
|
|
|
@@ -75,8 +74,7 @@ export function keyed(root: string): Buffer {
|
|
|
75
74
|
const held = keyOf(root)
|
|
76
75
|
if (held !== undefined) return held
|
|
77
76
|
const made = randomBytes(KEY_BYTES)
|
|
78
|
-
|
|
79
|
-
disk.writeFileSync(join(root, KEY_AT), `${made.toString('base64')}\n`, { mode: 0o600 })
|
|
77
|
+
writeFileSync(join(root, KEY_AT), `${made.toString('base64')}\n`, { mode: 0o600 })
|
|
80
78
|
return made
|
|
81
79
|
}
|
|
82
80
|
|
|
@@ -133,4 +131,18 @@ export function opened(
|
|
|
133
131
|
}
|
|
134
132
|
}
|
|
135
133
|
|
|
134
|
+
export function unseal(root: string, named: string, envs: readonly Env[]): readonly Env[] {
|
|
135
|
+
const held = store(root)
|
|
136
|
+
const kept = held[named]
|
|
137
|
+
if (kept === undefined) return []
|
|
138
|
+
const taken = envs.filter((env) => kept[env] !== undefined)
|
|
139
|
+
if (taken.length === 0) return []
|
|
140
|
+
const left = Object.fromEntries(Object.entries(kept).filter(([env]) => !envs.includes(env as Env)))
|
|
141
|
+
if (Object.keys(left).length === 0) delete held[named]
|
|
142
|
+
else held[named] = left as Partial<Record<Env, string>>
|
|
143
|
+
const sorted = Object.fromEntries(Object.keys(held).sort().map((each) => [each, held[each]]))
|
|
144
|
+
writeFileSync(join(root, SEALED_AT), `${JSON.stringify(sorted, null, 2)}\n`)
|
|
145
|
+
return taken
|
|
146
|
+
}
|
|
147
|
+
|
|
136
148
|
export const IGNORES: readonly string[] = [KEY_AT]
|
package/dist/integrity/attach.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { named } from
|
|
2
|
-
import { quoted } from
|
|
1
|
+
import { named } from '../core/scope.js';
|
|
2
|
+
import { quoted } from '../core/rows.js';
|
|
3
3
|
const DESCRIBES = 'What this app refuses, and the checks that make each refusal actually happen. Every check has one owner, so none of them can be switched off somewhere nobody is looking.';
|
|
4
4
|
const CONSTRAINT = 'The rules the framework enforces on every app that installs it. They are read from the installed package rather than from this tree, so there is nothing here to weaken.';
|
|
5
5
|
const RULES = 'What this app refuses on top of what the framework already does. `thread create rule` asks what to ban, where it applies and what to do instead, then writes the row and the check beside it.';
|
|
@@ -103,7 +103,7 @@ const SHIPPED = [
|
|
|
103
103
|
into: 'derivation.ts',
|
|
104
104
|
list: 'GENERATORS',
|
|
105
105
|
id: 'publish-runner',
|
|
106
|
-
source: " {\n id: 'publish-runner',\n at: 'node_modules/@prestack/thread/dist/integrity/generators/publish.js',\n describes: 'Sends this repository\\'s packages to a registry. It derives what each package says about itself first, then builds, then refuses to send anything until the gate, the typecheck
|
|
106
|
+
source: " {\n id: 'publish-runner',\n at: 'node_modules/@prestack/thread/dist/integrity/generators/publish.js',\n describes: 'Sends this repository\\'s packages to a registry. It derives what each package says about itself first, then builds, then refuses to send anything until the gate, the typecheck and the seal have each passed, and commits what it derived once the packages are out. The seal is checked rather than regenerated, because a release that rewrites its own seal can never fail it.',\n version: 1,\n by: 'thread publish',\n },",
|
|
107
107
|
},
|
|
108
108
|
];
|
|
109
109
|
export const ATTACH = {
|
|
@@ -115,79 +115,9 @@ export const ATTACH = {
|
|
|
115
115
|
{ file: 'rules.ts', source: RULES_SOURCE },
|
|
116
116
|
{ file: 'gate.ts', source: GATE_SOURCE },
|
|
117
117
|
],
|
|
118
|
-
retires: [
|
|
119
|
-
{
|
|
120
|
-
into: 'gate.ts',
|
|
121
|
-
list: 'declares',
|
|
122
|
-
id: 'compiler',
|
|
123
|
-
why: 'moved into `GENERATORS` beside the generator that writes it, which is what makes `tsconfig.json` settle when declarations move. Left here it would be a second gate step running the same command, which the gate refuses.',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
into: 'gate.ts',
|
|
127
|
-
list: 'declares',
|
|
128
|
-
id: 'descent',
|
|
129
|
-
why: 'its step now comes from the `descent-runner` row this package ships into `GENERATORS`, which states `runs` beside `by`. Left here it would be a second gate step running the same command, which the gate refuses.',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
into: 'gate.ts',
|
|
133
|
-
list: 'declares',
|
|
134
|
-
id: 'sweep',
|
|
135
|
-
why: 'its step now comes from the `sweep-runner` row this package ships into `GENERATORS`, which states `runs` beside `by`. Left here it would be a second gate step running the same command, which the gate refuses.',
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
into: 'constraint.ts',
|
|
139
|
-
list: 'GENERATORS',
|
|
140
|
-
id: 'sql-duplicate-id',
|
|
141
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
into: 'constraint.ts',
|
|
145
|
-
list: 'GENERATORS',
|
|
146
|
-
id: 'sql-name-collision',
|
|
147
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
into: 'constraint.ts',
|
|
151
|
-
list: 'GENERATORS',
|
|
152
|
-
id: 'sql-duplicate-parameter',
|
|
153
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
into: 'constraint.ts',
|
|
157
|
-
list: 'GENERATORS',
|
|
158
|
-
id: 'sql-unwritable-parameter-type',
|
|
159
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
into: 'constraint.ts',
|
|
163
|
-
list: 'GENERATORS',
|
|
164
|
-
id: 'sql-duplicate-returned-column',
|
|
165
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
into: 'constraint.ts',
|
|
169
|
-
list: 'GENERATORS',
|
|
170
|
-
id: 'sql-unwritable-return-type',
|
|
171
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
into: 'constraint.ts',
|
|
175
|
-
list: 'GENERATORS',
|
|
176
|
-
id: 'sql-unknown-write-target',
|
|
177
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
into: 'constraint.ts',
|
|
181
|
-
list: 'GENERATORS',
|
|
182
|
-
id: 'sql-multi-statement',
|
|
183
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
184
|
-
},
|
|
185
|
-
],
|
|
186
118
|
ignores: ['.thread/', '.next/', 'node_modules/', 'tsconfig.tsbuildinfo'],
|
|
187
119
|
scripts: {
|
|
188
120
|
gate: 'thread gate',
|
|
189
|
-
predev: 'thread gate',
|
|
190
|
-
dev: 'next dev',
|
|
191
121
|
prebuild: 'thread gate',
|
|
192
122
|
build: 'next build',
|
|
193
123
|
prestart: 'thread gate',
|
package/dist/integrity/attach.ts
CHANGED
|
@@ -121,7 +121,7 @@ const SHIPPED: readonly { readonly into: string; readonly list: string; readonly
|
|
|
121
121
|
into: 'derivation.ts',
|
|
122
122
|
list: 'GENERATORS',
|
|
123
123
|
id: 'publish-runner',
|
|
124
|
-
source: " {\n id: 'publish-runner',\n at: 'node_modules/@prestack/thread/dist/integrity/generators/publish.js',\n describes: 'Sends this repository\\'s packages to a registry. It derives what each package says about itself first, then builds, then refuses to send anything until the gate, the typecheck
|
|
124
|
+
source: " {\n id: 'publish-runner',\n at: 'node_modules/@prestack/thread/dist/integrity/generators/publish.js',\n describes: 'Sends this repository\\'s packages to a registry. It derives what each package says about itself first, then builds, then refuses to send anything until the gate, the typecheck and the seal have each passed, and commits what it derived once the packages are out. The seal is checked rather than regenerated, because a release that rewrites its own seal can never fail it.',\n version: 1,\n by: 'thread publish',\n },",
|
|
125
125
|
},
|
|
126
126
|
]
|
|
127
127
|
export const ATTACH: Attaching = {
|
|
@@ -134,80 +134,10 @@ export const ATTACH: Attaching = {
|
|
|
134
134
|
{ file: 'gate.ts', source: GATE_SOURCE },
|
|
135
135
|
],
|
|
136
136
|
|
|
137
|
-
retires: [
|
|
138
|
-
{
|
|
139
|
-
into: 'gate.ts',
|
|
140
|
-
list: 'declares',
|
|
141
|
-
id: 'compiler',
|
|
142
|
-
why: 'moved into `GENERATORS` beside the generator that writes it, which is what makes `tsconfig.json` settle when declarations move. Left here it would be a second gate step running the same command, which the gate refuses.',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
into: 'gate.ts',
|
|
146
|
-
list: 'declares',
|
|
147
|
-
id: 'descent',
|
|
148
|
-
why: 'its step now comes from the `descent-runner` row this package ships into `GENERATORS`, which states `runs` beside `by`. Left here it would be a second gate step running the same command, which the gate refuses.',
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
into: 'gate.ts',
|
|
152
|
-
list: 'declares',
|
|
153
|
-
id: 'sweep',
|
|
154
|
-
why: 'its step now comes from the `sweep-runner` row this package ships into `GENERATORS`, which states `runs` beside `by`. Left here it would be a second gate step running the same command, which the gate refuses.',
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
into: 'constraint.ts',
|
|
158
|
-
list: 'GENERATORS',
|
|
159
|
-
id: 'sql-duplicate-id',
|
|
160
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
into: 'constraint.ts',
|
|
164
|
-
list: 'GENERATORS',
|
|
165
|
-
id: 'sql-name-collision',
|
|
166
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
into: 'constraint.ts',
|
|
170
|
-
list: 'GENERATORS',
|
|
171
|
-
id: 'sql-duplicate-parameter',
|
|
172
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
into: 'constraint.ts',
|
|
176
|
-
list: 'GENERATORS',
|
|
177
|
-
id: 'sql-unwritable-parameter-type',
|
|
178
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
into: 'constraint.ts',
|
|
182
|
-
list: 'GENERATORS',
|
|
183
|
-
id: 'sql-duplicate-returned-column',
|
|
184
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
into: 'constraint.ts',
|
|
188
|
-
list: 'GENERATORS',
|
|
189
|
-
id: 'sql-unwritable-return-type',
|
|
190
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
into: 'constraint.ts',
|
|
194
|
-
list: 'GENERATORS',
|
|
195
|
-
id: 'sql-unknown-write-target',
|
|
196
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
into: 'constraint.ts',
|
|
200
|
-
list: 'GENERATORS',
|
|
201
|
-
id: 'sql-multi-statement',
|
|
202
|
-
why: 'its check imported a package this framework no longer ships and read a folder no app has, so it could never refuse anything. A rule that cannot fire reads as coverage while enforcing nothing.',
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
137
|
|
|
206
138
|
ignores: ['.thread/', '.next/', 'node_modules/', 'tsconfig.tsbuildinfo'],
|
|
207
139
|
scripts: {
|
|
208
140
|
gate: 'thread gate',
|
|
209
|
-
predev: 'thread gate',
|
|
210
|
-
dev: 'next dev',
|
|
211
141
|
prebuild: 'thread gate',
|
|
212
142
|
build: 'next build',
|
|
213
143
|
prestart: 'thread gate',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { readdirSync } from
|
|
1
|
+
import { readdirSync } from '../integrations/disk.js';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { argv, stdout } from 'node:process';
|
|
4
|
-
import { exit, invoked } from
|
|
5
|
-
import { ROOT, THREAD_AT, TREE, configured, descend, unkept } from
|
|
6
|
-
import { runChecker } from
|
|
4
|
+
import { exit, invoked } from '../core/invoked.js';
|
|
5
|
+
import { ROOT, THREAD_AT, TREE, configured, descend, unkept } from '../core/descend.js';
|
|
6
|
+
import { runChecker } from '../core/finding.js';
|
|
7
7
|
export { ROOT, THREAD_AT, TREE, descend };
|
|
8
8
|
const ELSEWHERE = new Set(['node_modules', '.git']);
|
|
9
9
|
export function trackedFiles() {
|
|
@@ -121,7 +121,7 @@ if (invoked(import.meta.url)) {
|
|
|
121
121
|
stdout.write(`threads: ${String(warned.length)} of these is a derivation nothing has produced yet — the row states what a ` +
|
|
122
122
|
'generator would write and no file is there. A generator that refuses to write an empty file is doing its ' +
|
|
123
123
|
'job, so this is said rather than refused. A derived file that is there and differs from what its generator ' +
|
|
124
|
-
'writes is the other case, and
|
|
124
|
+
'writes is the other case, and the command its row names in `runs` refuses it at the gate.\n');
|
|
125
125
|
}
|
|
126
126
|
if (refused.length > 0)
|
|
127
127
|
exit(1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readdirSync } from '../
|
|
1
|
+
import { readdirSync } from '../integrations/disk.ts'
|
|
2
2
|
import { dirname, join } from 'node:path'
|
|
3
3
|
import { argv, stdout } from 'node:process'
|
|
4
4
|
|
|
@@ -157,7 +157,7 @@ if (invoked(import.meta.url)) {
|
|
|
157
157
|
`threads: ${String(warned.length)} of these is a derivation nothing has produced yet — the row states what a ` +
|
|
158
158
|
'generator would write and no file is there. A generator that refuses to write an empty file is doing its ' +
|
|
159
159
|
'job, so this is said rather than refused. A derived file that is there and differs from what its generator ' +
|
|
160
|
-
'writes is the other case, and
|
|
160
|
+
'writes is the other case, and the command its row names in `runs` refuses it at the gate.\n',
|
|
161
161
|
)
|
|
162
162
|
}
|
|
163
163
|
|