Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

Merge remote-tracking branch 'origin/main' into core/655-merge

Corey Olson4e70be8d9822
diff --cc bin/run-tests.js
index 0e5ba66d,a2cd2931..89fa8936
--- a/bin/run-tests.js
+++ b/bin/run-tests.js
@@@ -17,7 -17,9 +17,10 @@@ const runner = fileURLToPath(import.met
const LANDING_RUN_ENV = 'PULLBOARD_LANDING_RUN';
const LANDING_WORKER_STARTS_ENV = 'PULLBOARD_LANDING_WORKER_STARTS';
const LANDING_ATTEMPT_ENV = 'PULLBOARD_LANDING_ATTEMPT';
+const LANDING_WAIVERS_ENV = 'PULLBOARD_LANDING_WAIVERS';
+ // Mirrors src/landing-shards.js; this preload stays free of that module until a landing needs it.
+ const LANDING_SHARD_ENV = 'PULLBOARD_LANDING_SHARD';
+ const LANDING_FILE_TIMES_ENV = 'PULLBOARD_LANDING_FILE_TIMES';
export const DEFAULT_TEST_TIMEOUT_MS = 660_000;
export const DEFAULT_TEST_FILE_TIMEOUT_MS = 30_000;
// Worker identity startup retries stay below the ordinary per-file ceiling even if ps is unavailable.
diff --cc src/cli.js
index a6fe4572,3c5fb08f..97693701
--- a/src/cli.js
+++ b/src/cli.js
@@@ -88,7 -94,8 +94,8 @@@ import { readRelayMachine } from './rel
import { relayJoin, relayPair } from './relay-pairing-client.js';
import { executePersonRequests } from './relay-request-execution.js';
import { engineReceipt } from './engine.js';
- import { accountedFailures, land, liveWaiverProjection, waivedFailures, waiverLine } from './land.js';
-import { land, landingRemote, landingSubject } from './land.js';
++import { accountedFailures, land, landingRemote, landingSubject, liveWaiverProjection, waivedFailures, waiverLine } from './land.js';
+ import { installStep } from './worktree.js';
const CHECKOUT_LEASES = new WeakMap();
const CHECKOUT_BOARD_ONLY = new WeakMap();
@@@ -2234,12 -2323,8 +2328,12 @@@ async function submitHere(ctx, id)
return await ordered(ctx, board, 'submit', [id, { agentId: me.id, commit, tree: headTree(root) ?? '', files: filesSince(root, id, claimHead, commit), policyCommit: acceptedMain.commit,
...(gate.deferred ? { note: 'full suite deferred to the landing gate' } : {}) }]);
});
- return reportSubmission(ctx, id, commit, { green: gate.isGreen, report: submitGateReport(gate), files: gate.files, full: gate.full, deferred: gate.deferred, deferFullFallback: gate.deferFullFallback, reason: gate.reason, check: gate.check,
- log: gate.log, profile: gate.profile, profilePath: gate.profilePath, proofLog: gate.proofLog, proofProfilePath: gate.proofProfilePath }, doctrine);
+ const report = waived
+ ? `submission proof waived, not green: ${waived.length} failure(s), each covered by a live person waiver; the whole output is in ${gate.log}\n${waivedLines.join('\n')}`
+ : submitGateReport(gate);
+ return reportSubmission(ctx, id, commit, { green: gate.isGreen, report, files: gate.files, full: gate.full, deferred: gate.deferred, deferFullFallback: gate.deferFullFallback, reason: gate.reason, check: gate.check,
+ log: gate.log, profile: gate.profile, profilePath: gate.profilePath, proofLog: gate.proofLog, proofProfilePath: gate.proofProfilePath,
- ...(waived ? { waived: waived.map(({ file, name, waiver }) => ({ file, name, waiver: waiver.id, reason: waiver.reason, until: waiver.until })) } : {}) });
++ ...(waived ? { waived: waived.map(({ file, name, waiver }) => ({ file, name, waiver: waiver.id, reason: waiver.reason, until: waiver.until })) } : {}) }, doctrine);
}
/** Report and pin the original submitted commit, including a recovered acknowledged outcome. */
diff --cc src/gate.js
index 32818637,bb2e99c5..d8e9e6a0
--- a/src/gate.js
+++ b/src/gate.js
@@@ -213,10 -152,10 +234,10 @@@ function readStages(output, marker, cou
*
* @param {string} root
* @param {string} command
- * @param {{ pipefail?: boolean, env?: NodeJS.ProcessEnv }} [options] - Gate-only pipefail and additional child environment values.
- * @returns {{ isGreen: boolean, output: string, seconds: number }}
+ * @param {{ pipefail?: boolean, env?: NodeJS.ProcessEnv, stages?: boolean }} [options] - Gate-only pipefail, additional child environment values and per-stage accounting.
- * @returns {{ isGreen: boolean, output: string, seconds: number, stages?: Array<{ status: number|null, output: string }> | null }}
++ * @returns {{ isGreen: boolean, output: string, seconds: number, sandboxBlocked: string|null, stages?: Array<{ status: number|null, output: string }> | null }}
*/
-export function runShell(root, command, { pipefail = false, env = {} } = {}) {
+export function runShell(root, command, { pipefail = false, env = {}, stages = false } = {}) {
const started = Date.now();
const options = { cwd: root, env: { ...gitChildEnv(root), ...env }, shell: true, stdio: ['ignore', 'pipe', 'pipe'], encoding: 'utf8', maxBuffer: 2 ** 30 };
let prefix = '';
@@@ -228,16 -167,151 +249,157 @@@
throw new Refused('PIPEFAIL_UNAVAILABLE', 'the repo gate shell cannot enable pipefail; rewrite the gate without a pipe');
}
}
+ const split = stages ? gateStages(command) : null;
+ const marker = `PULLBOARD_STAGE_${randomUUID().replaceAll('-', '')}`;
// Newlines, not spaces, around the command, so a trailing comment in it cannot swallow the `)`.
- const result = spawnSync(`${prefix}(\n${command}\n) 2>&1`, options);
+ const result = spawnSync(`${prefix}(\n${split ? stagedScript(split, marker) : command}\n) 2>&1`, options);
invalidateGitFacts();
- const output = `${result.stdout ?? ''}${result.stderr ?? ''}`;
- return { isGreen: result.status === 0, output, seconds: Math.round((Date.now() - started) / 1000),
- sandboxBlocked: result.status === 0 ? null : sandboxBlockedOperation(root, output) };
+ const raw = `${result.stdout ?? ''}${result.stderr ?? ''}`;
+ const seconds = Math.round((Date.now() - started) / 1000);
- if (!stages) return { isGreen: result.status === 0, output: raw, seconds };
- if (!split) return { isGreen: result.status === 0, output: raw, seconds, stages: null };
- return { isGreen: result.status === 0, seconds, ...readStages(raw, marker, split.length) };
++ const blocked = (output) => (result.status === 0 ? null : sandboxBlockedOperation(root, output));
++ if (!stages) return { isGreen: result.status === 0, output: raw, seconds, sandboxBlocked: blocked(raw) };
++ if (!split) return { isGreen: result.status === 0, output: raw, seconds, stages: null, sandboxBlocked: blocked(raw) };
++ const staged = readStages(raw, marker, split.length);
++ return { isGreen: result.status === 0, seconds, ...staged, sandboxBlocked: blocked(staged.output) };
+ }
+
+ /** Resolve existing path prefixes so a symlink cannot hide an outside-worktree operation. */
+ function diagnosticPath(path) {
+ let current = resolve(path);
+ const missing = [];
+ for (;;) {
+ try { return resolve(realpathSync(current), ...missing); }
+ catch (error) {
+ if (!['ENOENT', 'ENOTDIR'].includes(error.code)) return null;
+ const parent = dirname(current);
+ if (parent === current) return null;
+ missing.unshift(relative(parent, current));
+ current = parent;
+ }
+ }
+ }
+
+ /** Describe one OS permission message, resolving file targets against the command's worktree. */
+ function permissionOperation(root, message, { includeFilePaths = true } = {}) {
+ const network = /^(listen|bind) (EPERM|EACCES)\b/u.exec(message);
+ if (network) return { code: network[2], syscall: network[1], operation: `${network[1]} (${network[2]})` };
+ if (!includeFilePaths) return null;
+ const file = /^(EPERM|EACCES): [^\n]*?, (open|mkdir|read|write|rename|unlink|scandir|access) (['"])([^\n]+?)\3(?= -> |$)/u.exec(message);
+ const python = /^PermissionError: \[Errno (?:1|13)\] [^\n]*?: ['"]([^'"\n]+)['"]/u.exec(message);
+ if (!file && !python) return null;
+ const path = diagnosticPath(resolve(root, file ? file[4] : python[1]));
+ const tree = diagnosticPath(root);
+ if (!path || !tree) return null;
+ const within = relative(tree, path);
+ if (within !== '..' && !within.startsWith('../') && !isAbsolute(within)) return null;
+ const code = file ? file[1] : 'EACCES';
+ return { code, path, syscall: file ? file[2] : null,
+ operation: `${file ? file[2] : 'file access'} ${JSON.stringify(path)} (${code})` };
+ }
+
+ /** Decode the single-line quoted YAML scalars emitted by Node's TAP reporter. */
+ function tapScalar(value) {
+ if (value.startsWith('"')) {
+ try { return JSON.parse(value); } catch { return null; }
+ }
+ if (value.startsWith("'") && value.endsWith("'")) return value.slice(1, -1).replace(/''/gu, "'");
+ return /^[A-Z_]+$/u.test(value) ? value : null;
+ }
+
+ /** Scan complete lines with bounded TAP state so assertion messages cannot impersonate OS codes. */
+ export function sandboxBlockedScanner(root, { includeFilePaths = true } = {}) {
+ let failureIndent = null;
+ let fieldIndent = null;
+ let permission = null;
+ let code = null;
+ let comment = null;
+ let startup = null;
+ let failureMessage = null;
+ let failureType = false;
+ let exitCode = null;
+ /** Retain one pending fatal diagnostic and the current failed TAP record. */
+ return (raw) => {
+ const line = raw.trim().replace(/^#\s*/u, '');
+ const indent = raw.length - raw.trimStart().length;
+ // Node's TAP reporter prints test-console output as comments and assertion details
+ // as indented YAML. Neither is a standalone gate diagnostic, even when it contains
+ // text that looks exactly like an operating-system denial.
+ if (indent === 0 && !raw.startsWith('#') && /^(?:Error: |PermissionError: )/u.test(line)) {
+ const direct = permissionOperation(root, line.replace(/^Error: /u, ''), { includeFilePaths });
+ if (direct) return direct.operation;
+ }
+ if (/^TAP version \d+$/u.test(raw)) {
+ comment = null; startup = null;
+ failureIndent = null; fieldIndent = null; permission = null; code = null;
+ failureMessage = null; failureType = false; exitCode = null;
+ }
+ // Uncaught module-load errors are comments too. Keep their complete Node fatal
+ // diagnostic pending; it is evidence only if the following file record failed
+ // to start. A test logging a caught error and then asserting is not that record.
+ if (indent === 0 && raw.startsWith('#')) {
+ if (line.startsWith('Error: ')) {
+ const operation = permissionOperation(root, line.slice('Error: '.length), { includeFilePaths });
+ comment = operation ? { operation, code: null, syscall: null, path: null, closed: false, fatal: false } : null;
+ } else if (comment) {
+ const field = /^(code|syscall|path): (.*)$/u.exec(line);
+ if (field) comment[field[1]] = tapScalar(field[2].replace(/,$/u, ''));
+ else if (line === '}') comment.closed = true;
+ else if (/^Node\.js v\d+\./u.test(line)) comment.fatal = true;
+ else if (line && !/^at |^errno: |^address: |^port: /u.test(line)
+ && !(comment.closed && comment.fatal && line.startsWith('Subtest: '))) comment = null;
+ }
+ }
+ if (/^(?:not )?ok \d+\b/u.test(line)) {
+ failureIndent = /^not ok /u.test(line) ? indent : null;
+ const operation = comment?.operation;
+ startup = failureIndent !== null && comment?.closed && comment.fatal
+ && comment.code === operation.code && comment.syscall === operation.syscall
+ && (!operation.path || (typeof comment.path === 'string'
+ && diagnosticPath(resolve(root, comment.path)) === operation.path)) ? operation : null;
+ comment = null;
+ fieldIndent = null; permission = null; code = null;
+ failureMessage = null; failureType = false; exitCode = null;
+ } else if (line === '---' && failureIndent !== null && indent === failureIndent + 2) {
+ fieldIndent = indent;
+ } else if (line === '...' && indent === fieldIndent) {
+ failureIndent = null; fieldIndent = null; permission = null; code = null;
+ startup = null; comment = null;
+ failureMessage = null; failureType = false; exitCode = null;
+ } else if (fieldIndent !== null && indent === fieldIndent) {
+ const field = /^(error|code|failureType|exitCode): (.*)$/u.exec(line);
+ if (field) {
+ const value = tapScalar(field[2]);
+ if (field[1] === 'error') {
+ failureMessage = value;
+ permission = typeof value === 'string' ? permissionOperation(root, value, { includeFilePaths }) : null;
+ } else if (field[1] === 'code') {
+ code = value;
+ if (code !== 'ERR_TEST_FAILURE') startup = null;
+ } else if (field[1] === 'failureType') failureType = value === 'testCodeFailure' || field[2] === 'testCodeFailure';
+ else exitCode = /^[1-9]\d*$/u.test(field[2]) && Number.isSafeInteger(Number(field[2])) ? Number(field[2]) : null;
+ if (permission && permission.code === code) return permission.operation;
+ if (startup && code === 'ERR_TEST_FAILURE' && failureMessage === 'test failed'
+ && failureType && exitCode !== null) return startup.operation;
+ }
+ }
+ return null;
+ };
+ }
+
+ /** Recognize concrete OS permission diagnostics, keeping ordinary assertion failures ordinary. */
+ export function sandboxBlockedOperation(root, output, options) {
+ const scan = sandboxBlockedScanner(root, options);
+ for (const line of output.split('\n')) {
+ const operation = scan(line);
+ if (operation) return operation;
+ }
+ return null;
+ }
+
+ /** Refuse an environment-blocked proof after its ordinary raw logs and timings are persisted. */
+ export function refuseSandboxBlocked(run) {
+ if (run.sandboxBlocked) throw new Refused('SANDBOX_BLOCKED',
+ `The environment refused ${run.sandboxBlocked}. Ask the person to allow this operation, or run the gate outside the sandbox; keep the tests unchanged.`);
}
/** Replace a possible secret-bearing line before persisting a direct item-check log. */
@@@ -264,14 -338,16 +426,19 @@@ export function runProfiledShell(root,
const inherited = {
...(gateLease && !gateLease.runner ? gateSlotEnvironment(gateLease) : gateSlotHeld ? { [GATE_SLOT_HELD_ENV]: '1' } : {}),
[LANDING_RUN_ENV]: landing ? '1' : '0',
+ [LANDING_WAIVERS_ENV]: landing ? JSON.stringify(waivers) : '[]',
};
- const run = gateLease?.runner ? runOnRunner(root, command, { runner: gateLease.runner, source: gateLease.source,
- browser: gateLease.browser, pipefail, metadata: { ...(gateLease.runMetadata ?? {}), landing } }) : runShell(root, command, { pipefail, env: inherited });
+ // A remote run keeps no per-stage record, so it is never waivable: stages null fails closed [B3,R3].
+ const run = gateLease?.runner ? { ...runOnRunner(root, command, { runner: gateLease.runner, source: gateLease.source,
+ browser: gateLease.browser, pipefail, metadata: { ...(gateLease.runMetadata ?? {}), landing } }), ...(stages ? { stages: null } : {}) }
+ : runShell(root, command, { pipefail, env: inherited, stages });
+ const sandboxBlocked = run.isGreen ? null : run.sandboxBlocked ?? (run.executionRunner
+ // The controller cannot realpath remote files; retain the network denial signal without treating remote paths as local paths.
+ ? sandboxBlockedOperation(root, run.output, { includeFilePaths: false })
+ : sandboxBlockedOperation(root, run.output));
+ const profiledRun = { ...run, sandboxBlocked };
const profile = writeTimingProfile(profilePath, {
- ...runTiming(run, command),
+ ...runTiming(profiledRun, command),
waitMs: Math.max(0, Math.round(waitMs)), wallMs: Math.max(0, Date.now() - started),
});
if (logPath) writeFileSync(logPath, safeLog(run.output), { mode: 0o600 });
@@@ -476,14 -580,15 +671,15 @@@ export async function runGate(root, con
}
/** Run a full gate while its caller owns the queue lease; only a full run may stamp its tree. */
-function fullGateRun(root, config, trustStamp = false, { waitMs = 0, log = gitPath(root, LOG), gateLease, landing = false } = {}) {
+function fullGateRun(root, config, trustStamp = false, { waitMs = 0, log = gitPath(root, LOG), gateLease, landing = false, stages = false, waivers = [] } = {}) {
if (trustStamp && isStampedGreen(root)) return { isGreen: true, isCached: true, output: '', seconds: 0, log: '' };
const before = committedTree(root);
- const run = runProfiledShell(root, config.gate, { waitMs, pipefail: true, profileFile: `${log}.profile.json`, gateLease, landing });
+ const run = runProfiledShell(root, config.gate, { waitMs, pipefail: true, profileFile: `${log}.profile.json`, gateLease, landing, stages, waivers });
const { isGreen, output, seconds, profile, profilePath } = run;
writeFileSync(log, output);
+ refuseSandboxBlocked(run);
if (isGreen && before !== null && committedTree(root) === before) writeFileSync(gitPath(root, STAMP), `${before}\n`);
- return { isGreen, isCached: false, output, seconds, log, profile, profilePath };
+ return { isGreen, isCached: false, output, seconds, log, profile, profilePath, ...(stages ? { stages: run.stages } : {}) };
}
/** Quote a fixed executable or selected path without permitting shell expansion. */
diff --cc src/land.js
index 9b7ae1aa,e5e12876..73b4c7f4
--- a/src/land.js
+++ b/src/land.js
@@@ -127,12 -197,14 +197,14 @@@ async function gateGroup(state, label)
mkdirSync(directory, { recursive: true });
const logPath = join(directory, `${label}-${state.batch.revision}.log`);
await save(state, { state: 'gating', tip: headCommit(state.batch.root), logPath });
- const gate = await runGate(state.batch.root, state.config, { trustStamp: false, landing: true, agent: 'coordinator', onWait: state.onWait });
+ const gate = await runGate(state.batch.root, state.config, { trustStamp: false, landing: true, agent: 'coordinator', onWait: state.onWait, stages: true, waivers: liveWaiverProjection(state.board) });
copyFileSync(gate.log, logPath);
if (gate.profilePath) copyFileSync(gate.profilePath, `${logPath}.profile.json`);
- const result = { ...gate, failures: landingFailures(gate.output, state.batch.root), accounted: accountedFailures(gate, state.batch.root), tree, logPath };
- const result = { ...gate, failures: landingFailures(gate.output, state.batch.root), complete: completeGate(gate),
++ const result = { ...gate, failures: landingFailures(gate.output, state.batch.root), accounted: accountedFailures(gate, state.batch.root), complete: completeGate(gate),
+ requiresGreen: Boolean(cached && !completeGate(cached)), tree, logPath };
state.gates.set(tree, result);
- await save(state, { gateResults: [...state.gates.values()].map(({ tree: testedTree, isGreen, failures, accounted, logPath: log }) => ({ tree: testedTree, isGreen, failures, accounted: accounted ?? null, logPath: log })) });
- await save(state, { gateResults: [...state.gates.values()].map(({ tree: testedTree, isGreen, failures, complete, requiresGreen, logPath: log }) =>
- ({ tree: testedTree, isGreen, failures, complete: complete ?? null, requiresGreen: Boolean(requiresGreen), logPath: log })) });
++ await save(state, { gateResults: [...state.gates.values()].map(({ tree: testedTree, isGreen, failures, accounted, complete, requiresGreen, logPath: log }) =>
++ ({ tree: testedTree, isGreen, failures, accounted: accounted ?? null, complete: complete ?? null, requiresGreen: Boolean(requiresGreen), logPath: log })) });
return result;
}
@@@ -155,98 -227,12 +227,99 @@@ async function diagnose(state, failures
return flakes;
}
+/**
+ * Read one stage's TAP strictly: test lines outside YAML blocks, each failure's file from its own
+ * block, and a final `# fail N` that equals the failures read. Anything after that summary other
+ * than summary counts or the package manager's own failure report means something else failed,
+ * so the stage is unaccounted and null is returned [B3,R3].
+ */
+export function tapFailures(output, root) {
+ const lines = output.split('\n');
+ const failures = [];
+ let yaml = null;
+ let active = null;
+ let version = false;
+ let summary = null;
+ let summaryAt = -1;
+ let cancelled = 0;
+ for (const [index, line] of lines.entries()) {
+ if (yaml !== null) {
+ if (line === `${yaml}...`) { yaml = null; continue; }
+ const location = /^\s*location:\s*['"]?(.+?):\d+(?::\d+)?['"]?\s*$/u.exec(line);
+ if (active && location) {
+ const path = location[1];
+ const file = isAbsolute(path) ? relative(root, path) : path.replace(/^\.\//u, '');
+ if (file && !file.startsWith('../') && !file.includes('\\')) active.file = file;
+ }
+ continue;
+ }
+ const block = /^(\s*)---\s*$/u.exec(line);
+ if (block) { yaml = block[1]; continue; }
+ if (/^TAP version \d+\s*$/u.test(line)) version = true;
+ const failed = /^\s*not ok\s+\d+\s+-\s+(.*)$/u.exec(line);
+ if (failed) {
+ active = { name: failed[1].replace(/\s+#.*$/u, ''), file: null };
+ if (/^(?:\.\/)?(?:test|tests)\/[^\r\n]+\.(?:[cm]?js|ts|py)$/u.test(active.name)) active.file = active.name.replace(/^\.\//u, '');
+ failures.push(active);
+ continue;
+ }
+ if (/^\s*ok\s+\d+/u.test(line)) { active = null; continue; }
+ const count = /^# fail (\d+)\s*$/u.exec(line);
+ if (count) { summary = Number(count[1]); summaryAt = index; }
+ const stopped = /^# cancelled (\d+)\s*$/u.exec(line);
+ if (stopped) cancelled = Number(stopped[1]);
+ }
+ if (yaml !== null || !version || summary === null || summary < 1 || summary !== failures.length || cancelled !== 0) return null;
+ const trailer = lines.slice(summaryAt + 1).every((line) => !line.trim() || /^# [a-z_]+ \d+(?:\.\d+)?\s*$/u.test(line) || /^npm (?:ERR!|error|warn|notice)\b/u.test(line));
+ return trailer ? failures : null;
+}
+
+/**
+ * The failures that explain a red run, or null when anything else may have failed: the command
+ * could not be split into stages, a stage did not finish, or a stage exited other than 0 without
+ * exactly 1 and a complete TAP account of its failures. Waivers only ever subtract these [B3,R3].
+ */
+export function accountedFailures(gate, root) {
+ if (gate.isGreen || !Array.isArray(gate.stages) || !gate.stages.length) return null;
+ const failures = [];
+ for (const stage of gate.stages) {
+ if (!Number.isInteger(stage.status)) return null;
+ if (stage.status === 0) continue;
+ const own = stage.status === 1 ? tapFailures(stage.output ?? '', root) : null;
+ if (!own) return null;
+ failures.push(...own);
+ }
+ return failures.length ? failures : null;
+}
+
+/**
+ * Pair every named failure of a red run with the live person waiver covering it, or return null.
+ * One unnamed, unfiled or unwaived failure voids the whole run, so a waiver never hides another red [B3,R3].
+ */
+export function waivedFailures(board, failures) {
+ if (!Array.isArray(failures) || !failures.length || failures.some((entry) => !entry.file)) return null;
+ const covered = failures.map((failure) => ({ ...failure, waiver: store.landingWaiverFor(board, failure) }));
+ return covered.every((entry) => entry.waiver) ? covered : null;
+}
+
+/** Project the live person waivers a landing run may read, so it does not stop early on one [B3]. */
+export function liveWaiverProjection(board) {
+ const now = board.clock.now().getTime();
+ return store.landingWaivers(board).filter((waiver) => Date.parse(waiver.until) > now)
+ .map((waiver) => ({ kind: waiver.kind ?? store.landingWaiverKind(waiver.test), test: waiver.test }));
+}
+
+/** Name one waived failure with the person's waiver, its reason and its expiry [B3]. */
+export function waiverLine(failure) {
+ const { waiver } = failure;
+ return `waived: ${failure.name} (${failure.file}) by person waiver ${waiver.id} for ${waiver.kind ?? store.landingWaiverKind(waiver.test)} ${waiver.test}: ${waiver.reason}; expires ${waiver.until}`;
+}
+
/** Record every failure's exact live waiver rather than changing which tests the gate runs. */
function waivedProof(state, gate) {
+ if (!completeGate(gate) || gate.requiresGreen) return null;
- if (!gate.failures.length || gate.failures.some((entry) => !entry.file)) return null;
- const failures = gate.failures.map((failure) => ({ ...failure, waiver: store.landingWaiverFor(state.board, failure)?.id }));
- return failures.every((entry) => entry.waiver) ? { tree: gate.tree, failures, logPath: gate.logPath } : null;
+ const failures = waivedFailures(state.board, gate.accounted);
+ return failures ? { tree: gate.tree, failures: failures.map((entry) => ({ ...entry, waiver: entry.waiver.id })), logPath: gate.logPath } : null;
}
/** Bisect a reproducible red without retrying any previously tested group. */