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 origin/main 59a6e2b2 into #655 for 0.8.29 [B3,R3,C7]

Corey Olson81d06f233955
diff --cc src/cli.js
index 5e4efa94,062d6c58..a6fe4572
--- a/src/cli.js
+++ b/src/cli.js
@@@ -2136,11 -2202,12 +2202,14 @@@ async function submitHere(ctx, id)
withBoard(ctx, (board) => refuseUnverifiedStack(root, board, held, commit, trunk));
// Every submit proves its frozen check and reachable tests anew on this exact commit (V4,V16).
// A full-gate stamp never substitutes for either proof; only an actual full fallback may stamp.
- const submitConfig = { ...ctx.config, submitGate: acceptedMain.config.submitGate };
+ const submitConfig = { ...ctx.config, submitGate: acceptedMain.config.submitGate,
+ submitInvariants: acceptedMain.config.submitInvariants,
+ // The accepted project runner interprets its current invariant files; candidate config cannot replace it.
+ ...(acceptedMain.config.submitInvariants.length ? { affectedTests: acceptedMain.config.affectedTests } : {}) };
const gate = await runSubmitGate(root, submitConfig, { base: claimHead, trunk: acceptedMain.commit, check: frozenCheck(held), agent: me.id, item: String(id), onWait: gateWaitReporter(ctx.io), onBrowserFallback: browserAdmissionReporter(ctx.io, ctx.io.relayJson) });
- if (!gate.isGreen) {
+ // Only the person's live waivers can pass a red proof, failure by failure; the item's own check is never waived [B3].
+ const waived = !gate.isGreen && gate.check?.green ? withBoard(ctx, (board) => waivedFailures(board, accountedFailures(gate, root))) : null;
+ if (!gate.isGreen && !waived) {
const message = `the submission proof is red at ${commit.slice(0, 12)}; fix it, commit, submit again. ${submitGateReport(gate)}`;
// No submission can follow this verdict. Read-only main comparisons must not retain the seat's write lease.
CHECKOUT_LEASES.get(ctx.io)?.release();
@@@ -3415,19 -3618,20 +3627,30 @@@ async function runCommand(argv, io)
&& existsSync(join(ctx.info.root, CONFIG_FILE))) {
throw new Refused('NO_POLICY', `${CONFIG_FILE} is not committed; add and commit the initialized project before running the gate: git add ${CONFIG_FILE}`);
}
+ // Refused prefixes its message with the code, so match the condition itself, not the text:
+ // pullboard.json on disk but absent from the primary checkout's commit. Any other
+ // missing policy or claim base keeps its own refusal.
+ if (error instanceof Refused && error.code === 'NO_POLICY') {
+ let setup = null;
+ try { setup = uncommittedPolicySetup(ctx.info); } catch { /* Report the original refusal below. */ }
+ if (setup) {
+ const files = setup.files.map(shellWord).join(' ');
+ throw new Refused('NO_POLICY', `${CONFIG_FILE} and Pullboard's initialized setup files are uncommitted; commit them before running the gate: ${setup.stage} && git commit -q -m "chore: set up pullboard" -- ${files}`);
+ }
+ }
throw error;
}
- const gate = await runGate(ctx.info.root, config, { landing: values.landing, agent: resourceAgent(ctx), onWait: gateWaitReporter(io) });
+ const waivers = values.landing ? withBoard(ctx, (board) => liveWaiverProjection(board)) : [];
+ const gate = await runGate(ctx.info.root, config, { landing: values.landing, agent: resourceAgent(ctx), onWait: gateWaitReporter(io), stages: Boolean(values.landing), waivers });
+ // A landing gate honours the person's live waivers exactly as land does; a red run never stamps, so it stays waived, not green [B3,R3].
+ const waived = values.landing && !gate.isGreen ? withBoard(ctx, (board) => waivedFailures(board, accountedFailures(gate, ctx.info.root))) : null;
+ if (waived) {
+ const lines = waived.map(waiverLine);
+ const report = `landing gate waived, not green: ${waived.length} failure(s), each covered by a live person waiver; the whole output is in ${gate.log}\n${lines.join('\n')}`;
+ io.result?.({ green: false, waived: waived.map(({ file, name, waiver }) => ({ file, name, waiver: waiver.id, reason: waiver.reason, until: waiver.until })), report });
+ io.say(report);
+ return 0;
+ }
io.result?.({ green: gate.isGreen, report: gateReport(gate) });
io.say(gateReport(gate));
return gate.isGreen ? 0 : 1;
diff --cc src/gate.js
index 0e0ccb1b,d605a9a3..32818637
--- a/src/gate.js
+++ b/src/gate.js
@@@ -260,13 -174,13 +262,16 @@@ export function runProfiledShell(root,
const logPath = persistLog ? join(directory, `${artifactPrefix}-${id}.log`) : null;
const started = Date.now();
const inherited = {
- ...(gateLease ? gateSlotEnvironment(gateLease) : gateSlotHeld ? { [GATE_SLOT_HELD_ENV]: '1' } : {}),
+ ...(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 = runShell(root, command, { pipefail, env: inherited, stages });
- 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 profile = writeTimingProfile(profilePath, {
- ...timingFromOutput(run.output, timingRunner(command)),
+ ...runTiming(run, command),
waitMs: Math.max(0, Math.round(waitMs)), wallMs: Math.max(0, Date.now() - started),
});
if (logPath) writeFileSync(logPath, safeLog(run.output), { mode: 0o600 });
@@@ -488,16 -465,14 +557,15 @@@ export async function runSubmitGate(roo
// The proof already owns this lease: its phase profile has no additional queue wait.
const proofWait = check ? 0 : lease.waitMs;
let proof;
- if (!deferFullFallback && selection.full) proof = fullGateRun(root, config, false, { waitMs: proofWait, log: proofLog, gateLease: lease });
+ // The proof keeps each stage's status, so a person's waiver can only ever explain named test failures.
- if (deferFullFallback) proof = { isGreen: true, isCached: false, output: '', seconds: 0, log: '' };
- else if (selection.full) proof = fullGateRun(root, config, false, { waitMs: proofWait, log: proofLog, gateLease: lease, stages: true });
- else if (!selection.files.length) proof = { isGreen: true, output: '', seconds: 0, isCached: false, log: '' };
++ if (!deferFullFallback && selection.full) proof = fullGateRun(root, config, false, { waitMs: proofWait, log: proofLog, gateLease: lease, stages: true });
+ else if (!proofFiles.length) proof = { isGreen: true, output: '', seconds: 0, isCached: false, log: '' };
else {
- const command = `${config.affectedTests.trimEnd()} ${selection.files.map(path => commandWord('./' + path)).join(' ')}`;
+ const command = `${config.affectedTests.trimEnd()} ${proofFiles.map(path => commandWord('./' + path)).join(' ')}`;
- proof = { ...runProfiledShell(root, command, { waitMs: proofWait, profileFile: `${proofLog}.profile.json`, gateLease: lease }), isCached: false, log: proofLog };
+ proof = { ...runProfiledShell(root, command, { waitMs: proofWait, profileFile: `${proofLog}.profile.json`, gateLease: lease, stages: true }), isCached: false, log: proofLog };
writeFileSync(proofLog, proof.output);
}
- const phase = deferFullFallback ? 'full suite deferred to the landing gate' : selection.full ? 'full gate' : 'affected tests';
+ const phase = deferFullFallback ? `submit invariants: ${invariants.length ? invariants.join(', ') : 'none'}; full suite deferred to the landing gate` : selection.full ? 'full gate' : 'affected tests';
writeFileSync(log, `item check:\n${criterion.output}\n${phase}:\n${proof.output}`);
return finish(proof);
}, { browser, agent, item, kind, itemCheck: true, onWait });