@vaultcompass/conductor 0.9.0 → 0.11.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.
- package/README.md +157 -31
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +19 -4
- package/dist/gate-runner.d.ts +102 -10
- package/dist/gate-runner.js +282 -37
- package/dist/init-hook-detect.d.ts +1 -0
- package/dist/init-hook-detect.js +45 -0
- package/dist/init-policy.js +13 -0
- package/dist/init.d.ts +8 -0
- package/dist/init.js +166 -20
- package/dist/intent-prepare.d.ts +51 -2
- package/dist/intent-prepare.js +160 -35
- package/dist/intent-spec.d.ts +108 -22
- package/dist/intent-spec.js +226 -55
- package/dist/normalize.d.ts +32 -2
- package/dist/normalize.js +117 -11
- package/dist/output-sarif.js +72 -1
- package/dist/output-text.d.ts +37 -1
- package/dist/output-text.js +324 -21
- package/dist/policy.d.ts +8 -0
- package/dist/policy.js +33 -6
- package/dist/products.d.ts +8 -1
- package/dist/products.js +14 -0
- package/dist/run.d.ts +13 -1
- package/dist/run.js +19 -2
- package/package.json +1 -1
- package/schema/guardrails.schema.json +6 -0
package/dist/run.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Finding } from './envelope.js';
|
|
2
2
|
import { type GateOutcome } from './gate-runner.js';
|
|
3
|
+
import type { SelectionMiss } from './intent-spec.js';
|
|
3
4
|
import type { GateRole, GateStage, Policy, Product } from './policy.js';
|
|
4
5
|
/**
|
|
5
6
|
* An enabled gate the stage filter held back.
|
|
@@ -69,8 +70,15 @@ export interface TreeUnchangedGate {
|
|
|
69
70
|
export interface SkippedGate {
|
|
70
71
|
role: GateRole;
|
|
71
72
|
product: Product;
|
|
72
|
-
|
|
73
|
+
/**
|
|
74
|
+
* `spec-ambiguous` is the third: two or more specs matched the branch name
|
|
75
|
+
* equally, so the convention chose none. Advisory exactly like the other
|
|
76
|
+
* two, and for the same reason.
|
|
77
|
+
*/
|
|
78
|
+
reason: 'no-contract' | 'contract-waived' | 'spec-ambiguous';
|
|
73
79
|
detail: string;
|
|
80
|
+
/** What the branch-name convention said, for the SARIF details bag. */
|
|
81
|
+
selection?: SelectionMiss;
|
|
74
82
|
}
|
|
75
83
|
/**
|
|
76
84
|
* One control input this pull request proposes to change.
|
|
@@ -198,6 +206,10 @@ export interface RunOptions {
|
|
|
198
206
|
repoRoot: string;
|
|
199
207
|
staged: boolean;
|
|
200
208
|
pathValue: string;
|
|
209
|
+
/**
|
|
210
|
+
* A test hook: every gate's time limit, outranking the policy. No CLI path
|
|
211
|
+
* sets it; `resolveTimeLimit` (src/gate-runner.ts) decides the limit.
|
|
212
|
+
*/
|
|
201
213
|
timeoutMs?: number;
|
|
202
214
|
/**
|
|
203
215
|
* Which stopping point this run is. Absent means every enabled gate runs,
|
package/dist/run.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// One run across every enabled gate.
|
|
2
2
|
import { compareFindings } from './envelope.js';
|
|
3
3
|
import { EXIT_COULD_NOT_RUN, composeExitCode, gateExitBlocks } from './exit-codes.js';
|
|
4
|
-
import { gateProgramRefused, preparationFailed, refuseHeadControlledBinary, runGate, } from './gate-runner.js';
|
|
4
|
+
import { gateProgramRefused, preparationFailed, preparationTimedOut, refuseHeadControlledBinary, resolveTimeLimit, runGate, } from './gate-runner.js';
|
|
5
5
|
import { resolveBaseRef } from './intent-base.js';
|
|
6
6
|
import { frozenNativeContractPath, prepareIntent, } from './intent-prepare.js';
|
|
7
7
|
import { GATE_ROLES, enabledGates, runsAtStage } from './policy.js';
|
|
@@ -281,13 +281,17 @@ export function runAll(policy, options) {
|
|
|
281
281
|
continue;
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
+
const intentLimit = resolveTimeLimit(gate, options.timeoutMs);
|
|
284
285
|
const prepared = prepareIntent({
|
|
285
286
|
repoRoot: options.repoRoot,
|
|
286
287
|
binary,
|
|
287
288
|
env,
|
|
288
289
|
...(options.base === undefined ? {} : { base: options.base }),
|
|
289
290
|
...(options.spec === undefined ? {} : { spec: options.spec }),
|
|
290
|
-
|
|
291
|
+
// The same resolver runGate uses, so the preparation spawns and
|
|
292
|
+
// the gate's own spawns cannot disagree about its limit; each
|
|
293
|
+
// preparation spawn gets the full limit.
|
|
294
|
+
timeoutMs: intentLimit.ms,
|
|
291
295
|
...(options.tempRoot === undefined ? {} : { tempRoot: options.tempRoot }),
|
|
292
296
|
...(trustBaseRef === undefined ? {} : { trustBase: trustBaseRef }),
|
|
293
297
|
});
|
|
@@ -305,9 +309,22 @@ export function runAll(policy, options) {
|
|
|
305
309
|
product: gate.product,
|
|
306
310
|
reason: prepared.reason,
|
|
307
311
|
detail: prepared.detail,
|
|
312
|
+
...(prepared.selection === undefined ? {} : { selection: prepared.selection }),
|
|
308
313
|
});
|
|
309
314
|
continue;
|
|
310
315
|
}
|
|
316
|
+
if (prepared.kind === 'timed-out') {
|
|
317
|
+
outcomes.push(preparationTimedOut(
|
|
318
|
+
// The same enforce rule as a failed preparation, below.
|
|
319
|
+
trustBaseRef === undefined ? gate : { ...gate, enforce: true }, {
|
|
320
|
+
step: prepared.step,
|
|
321
|
+
elapsedMs: prepared.elapsedMs,
|
|
322
|
+
signal: prepared.signal,
|
|
323
|
+
limit: intentLimit,
|
|
324
|
+
...(trustBaseRef === undefined ? {} : { trustBase: trustBaseRef }),
|
|
325
|
+
}));
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
311
328
|
if (prepared.kind === 'failed') {
|
|
312
329
|
outcomes.push(preparationFailed(
|
|
313
330
|
// ENFORCED under a trust base, by the same argument as
|
package/package.json
CHANGED
|
@@ -58,6 +58,12 @@
|
|
|
58
58
|
"description": "Only on the vulnerabilities gate. On a pull-request run osv-scanner also scans the base branch copies of the lockfiles that carry findings, and labels each finding introduced or present-on-base. block (the default when the key is absent) blocks on every finding; report reports present-on-base findings without blocking and blocks only on introduced ones. Read from the base branch policy on a pull request, so a pull request cannot set it for itself. Has no effect on a run without a base, where every finding blocks.",
|
|
59
59
|
"enum": ["block", "report"]
|
|
60
60
|
},
|
|
61
|
+
"timeout-seconds": {
|
|
62
|
+
"description": "How long conductor lets this gate run before stopping it, in whole seconds, from 10 to 21600 (six hours, the GitHub-hosted job limit). Every spawn of the gate gets the full limit: the version probe, the scan, the intent gate's preparation steps and osv-scanner's base run. Absent means the default for the product: 120 for dep-guard, vault-guard and intent-guard, 600 for gitleaks, 300 for osv-scanner. A gate stopped at its limit could not run (timed-out). Read from the base branch policy on a pull request, so a pull request cannot change its own limit. Not the same as a gate's own timeout flag under options.",
|
|
63
|
+
"type": "integer",
|
|
64
|
+
"minimum": 10,
|
|
65
|
+
"maximum": 21600
|
|
66
|
+
},
|
|
61
67
|
"stage": {
|
|
62
68
|
"description": "When this gate runs. Stages are cumulative in the order commit, push, ci: a gate runs at its own stage and at every later one, so a run at ci runs everything enabled. Defaults to commit for dependencies and secrets, and to ci for intent, secrets-history and vulnerabilities: the intent gate carries per-task ceremony, and a history scan or a registry lookup is pull-request work. A run with no --stage runs every enabled gate whatever its stage.",
|
|
63
69
|
"enum": ["commit", "push", "ci"]
|