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.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
chore(merge): carry main into #655 [B3]
Corey Olson1c0932b4aff2
diff --cc bin/run-tests.jsindex 048f1d1f,dd6c1ce7..a04c383f--- a/bin/run-tests.js+++ b/bin/run-tests.js@@@ -775,29 -774,8 +775,29 @@@ async function drainLandingWorkerDescenif (firstError) throw new Error(`owned descendants drained after cleanup error: ${firstError.message}`, { cause: firstError });}- /** Run a landing check with execution-ordered failure detection and native runner reporters. */+/**+ * Read the live person waivers Pullboard projects into a landing run, as `{kind, test}` pairs.+ * The projection only decides whether the run keeps going past a failure; whether the run is+ * waived is decided afterwards by Pullboard against the board, so a forged list only makes a run+ * longer, never greener. Anything unreadable projects nothing, and the run stops as before [B3].+ */+function landingWaiverProjection(text) {+ try {+ const parsed = JSON.parse(text ?? '[]');+ return Array.isArray(parsed) ? parsed.filter(entry => ['file', 'name'].includes(entry?.kind) && typeof entry.test === 'string' && entry.test) : [];+ } catch { return []; }+}++/** True when a projected waiver covers this failing test by its file or by its exact name. */+function landingFailureWaived(waivers, file, name) {+ const path = typeof file === 'string' ? relative(process.cwd(), file.startsWith('file:') ? fileURLToPath(file) : file) : null;+ return waivers.some(waiver => waiver.kind === 'file' ? waiver.test === path : waiver.test === name);+}++ /** Run a landing check with execution-ordered failure detection and native runner reporters. */async function runLandingTests(args, env, concurrency) {+ const waivers = landingWaiverProjection(process.env[LANDING_WAIVERS_ENV]);+ const waivedFiles = new Map();const { run } = await import('node:test');const { PassThrough } = await import('node:stream');const { createWriteStream } = await import('node:fs');@@@ -1050,10 -1027,8 +1050,11 @@@setup(tests) {tests.on('test:complete', data => {const { file, name, details } = data;- if (file && details?.type === 'test' && details.passed === false && !firstFailure) {+ // Node 22.13 leaves ordinary/file completions untyped; newer versions label them as tests.+ if (file && details?.passed === false && (details.type === undefined || details.type === 'test') && !firstFailure) {+ // A failure a live person waiver covers does not stop the run; every other file still runs.+ if (landingFailureWaived(waivers, file, name)) { waivedFiles.set(file, waivedFiles.get(file) ?? true); return; }+ waivedFiles.set(file, false);firstFailure = { file, name, error: details.error };abortLandingRun();}diff --cc src/cli.jsindex 39515736,9ccc8f9c..5e4efa94--- a/src/cli.js+++ b/src/cli.js@@@ -2134,10 -2136,9 +2136,11 @@@ 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 gate = await runSubmitGate(root, ctx.config, { 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) });+ const submitConfig = { ...ctx.config, submitGate: acceptedMain.config.submitGate };+ 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();@@@ -2154,19 -2155,13 +2157,20 @@@);}const currentTrunk = requireTrunkMerge(root, commit); // The trunk may have moved while the gate ran.+ const waivedLines = waived ? waived.map(waiverLine) : [];await withBoard(ctx, async (board) => {refuseUnverifiedStack(root, board, store.getItem(board, id), commit, currentTrunk);+ // The waived run is written to the item's thread before the submission, so no waived proof reads as green.+ if (waived) await ordered(ctx, board, 'appendFact', [id, { agentId: me.id, kind: 'measurement', text: `submission proof at ${commit.slice(0, 12)} was red and is recorded as waived, not green; every failure is covered by a live person waiver:\n${waivedLines.join('\n')}` }]);- return await ordered(ctx, board, 'submit', [id, { agentId: me.id, commit, tree: headTree(root) ?? '', files: filesSince(root, id, claimHead, commit), policyCommit: acceptedMain.commit }]);+ 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 });+ 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, reason: gate.reason, check: gate.check,++ 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 })) } : {}) });}/** Report and pin the original submitted commit, including a recovered acknowledged outcome. */diff --cc src/gate.jsindex 8fa52c3d,f2154b49..0e0ccb1b--- a/src/gate.js+++ b/src/gate.js@@@ -481,15 -398,16 +488,17 @@@ 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;+ // The proof keeps each stage's status, so a person's waiver can only ever explain named test failures.- if (selection.full) proof = fullGateRun(root, config, false, { waitMs: proofWait, log: proofLog, gateLease: lease, stages: true });+ 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 });++ 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: '' };else {const command = `${config.affectedTests.trimEnd()} ${selection.files.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);}- writeFileSync(log, `item check:\n${criterion.output}\n${selection.full ? 'full gate' : 'affected tests'}:\n${proof.output}`);+ const phase = deferFullFallback ? '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 });}