bareloop 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,34 @@ export function scopeContained(s: string): boolean;
25
25
  export function isObj(v: unknown): boolean;
26
26
  /** @param {unknown} v @returns {v is string} */
27
27
  export function isNonEmptyString(v: unknown): v is string;
28
+ /**
29
+ * The candidate script path TOKEN a close stage's `cmd` names, by SHAPE
30
+ * alone — no fs, no cwd resolution, so this is safe for `validateJob` (pure)
31
+ * to call directly. Two recognized forms, first match wins:
32
+ * - an INTERPRETER cmd: the token is the first argv[1..] element that is
33
+ * PATH-SHAPED (not a `-`-prefixed flag, and either contains `/` or ends
34
+ * in one of `.mjs .cjs .js .ts .sh .py`) — never just argv[1] outright.
35
+ * `node --enable-source-maps ./close/x.mjs stage` names `./close/x.mjs`,
36
+ * not `--enable-source-maps`; `python -m pytest` and `npx tsc --noEmit`
37
+ * name NOTHING (`-m`/`--noEmit` are flags, `pytest`/`tsc` are bare
38
+ * command names with no path shape) — fixed 2026-09-06 (orchestrator
39
+ * audit) after the earlier bare-argv[1] version demanded a sha256 for a
40
+ * token that named no file, making such a spec unsignable forever (the
41
+ * sign helper reads nothing, the validator reds permanently);
42
+ * - a bare cmd whose argv[0] ITSELF is an absolute path (no interpreter
43
+ * prefix — a `.sh`/other directly-executable close script) → the token
44
+ * is argv[0].
45
+ * Anything else — a relative bare executable (`true`, `pytest`), an
46
+ * interpreter with no path-shaped argument (`python -m pytest`, `npx tsc
47
+ * --noEmit`), a non-string/empty cmd — names no addressable file under this
48
+ * scheme and returns null; those stages carry no sha256 demand and are
49
+ * invisible to the byte/path detectors, exactly as they always were (most
50
+ * test-fixture closes use exactly this shape on purpose, to exercise
51
+ * runtime behaviour with no real script file at all).
52
+ * @param {unknown} cmd
53
+ * @returns {string|null}
54
+ */
55
+ export function closeScriptCandidateToken(cmd: unknown): string | null;
28
56
  /**
29
57
  * Scan a RAW text stream (a spine file, a close's output, a transcript) for
30
58
  * known secret shapes and return the literal matches. The ONE spelling of the
@@ -177,4 +205,24 @@ export function hasNestedQuantifier(src: string): boolean;
177
205
  * @param {(code: string, path: string, detail?: string) => void} red
178
206
  */
179
207
  export function sweepNestedQuantifiers(root: any, red: (code: string, path: string, detail?: string) => void): void;
208
+ /**
209
+ * PRD item 27/M2 close-bytes signature, orchestrator-flagged gap
210
+ * (2026-09-06): a close stage's `cmd` can name an addressable script TWO
211
+ * ways — `node <path> …` (M1's original scope) or a BARE directly-executable
212
+ * absolute path (a `.sh` wrapper, e.g. `jobs/aurora-testgen-cold.json`'s
213
+ * close, which `readCloseScripts` used to skip entirely, leaving both
214
+ * `close-absolute-path` and the sha256 signature blind to it — a "blind
215
+ * instrument" the audit named directly). This list is the shared, STATIC
216
+ * (no fs) shape test both `src/job.js` (which only needs to know WHETHER a
217
+ * stage names an addressable script, to decide whether `sha256` is
218
+ * demanded) and `src/close-integrity.js` (which resolves the token against
219
+ * a real cwd and reads it off disk) key off — one spelling, so the demand
220
+ * and the detector can never drift apart about which stages are in scope.
221
+ * A leading-interpreter cmd (`sh`/`bash`/`python`/`python3`/`npx` besides
222
+ * `node`) is included for the same reason `node` is: a close author may use
223
+ * any of them, and a scope that only recognized `node` would just move the
224
+ * blind spot rather than close it.
225
+ * @type {readonly string[]}
226
+ */
227
+ export const CLOSE_SCRIPT_INTERPRETERS: readonly string[];
180
228
  export const SECRET_PATTERNS: RegExp[];