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.

chore(merge): integrate submit receipt and waiver guards [C7,V4]

Corey Olson8d52e89dcc72
diff --cc src/board.js
index 3a451b20,38f376bc..32ac3d7c
--- a/src/board.js
+++ b/src/board.js
@@@ -21,13 -21,9 +21,15 @@@ import { causeProblem, requireNeverAgai
import { barCorrectionFields } from './bar-corrections.js';
import { factReference } from './fact-reference.js';
import { factFromEvent, requestAnswerRefusal, tellAnswerImplications, tellFactImplications, tellVerdictImplications } from './implies.js';
+ import { landingFlakes, landingWaiverCovers, landingWaiverKind } from './landing-exceptions.js';
import { parseSpec } from './spec.js';
+import { invariantEvidence } from './submit-invariants.js';
+import { preserveInvariantEvidence } from './submit-invariants.js';
+import { validateLandingBatch } from './submit-invariants.js';
+import { validateLandingRevision } from './submit-invariants.js';
+import { submissionProof } from './submit-invariants.js';
+import { SUBMISSION_PROOF_ENGINE } from './submit-invariants.js';
+ export { landingFlakes, landingWaiverCovers, landingWaiverKind };
export { acceptCheck } from './check-accept.js';
export const ACCEPT_REASON = 'CRITERION_MET';
diff --cc src/cli.js
index df84238a,c8c764bb..24fa8917
--- a/src/cli.js
+++ b/src/cli.js
@@@ -20,8 -20,8 +20,9 @@@ import { AGENT_SESSION_IDS, agentSessio
import { bindLocalSession, localSessionMatches, localSessionSeats } from './agent-session.js';
import { decisionAnswer, decisionProjection, handAnsweredQuestions, pendingAnswers, planRowApply, prepareRowDecisions, restoreRowApply, writeRowApply } from './row-decisions.js';
import { digestOf, gateReport, refuseSandboxBlocked, runGate, runProfiledShell, runSubmitGate, submitGateReport, timingDigest, withGateSlot } from './gate.js';
+ import { gateWaitReporter } from './gate-wait.js';
import { checkNeedsBrowser, explicitCheckFiles } from './browser-admission.js';
+import { submitInvariantLine, submitInvariantProposals } from './submit-invariants.js';
import { bareWorktreeFinding, codeIsFromMain, contains, differFromHead, git, gitChildEnv, headCommit, headTree, invalidateGitFacts, isClean, mainCheckout, patchId, repoInfo, resolveCommit, tryGit, untracked, withGitFacts } from './git.js';
import {
FIX_NOTE,
@@@ -2372,14 -2373,20 +2376,21 @@@ async function submitHere(ctx, id)
);
}
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,
+ submissionProof: { version: 1, files: gate.files, full: gate.full, deferred: gate.deferred, reason: gate.reason },
...(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 })) } : {}) }, doctrine);
}
/** Report and pin the original submitted commit, including a recovered acknowledged outcome. */
diff --cc src/land.js
index 50219cdc,c60844b5..53d5b2e7
--- a/src/land.js
+++ b/src/land.js
@@@ -216,23 -213,14 +216,23 @@@ 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`);
+ if (headCommit(state.batch.root) !== commit || headTree(state.batch.root) !== tree || !isClean(state.batch.root)) {
+ throw new Refused('LAND_SOURCE_CHANGED', `the landing source changed while the gate ran; inspect ${logPath} and restore the recorded batch before adopting`);
+ }
- 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);
+ const evidence = state.batch.invariantEvidence ?? { version: 1, gates: [], diagnostics: [] };
+ const tested = { commit, isGreen: gate.isGreen && completeGate(gate),
+ submissions: state.batch.items.map(({ id, commit }) => ({ id, commit })),
+ failures: [...new Set(landingFailures(gate.output, state.batch.root, { excludeCancelled: true }).map(failure => failure.file).filter(Boolean))],
+ fileTimes: landingFileTimes(state.batch.root, gate.profile) };
- 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 })) });
++ ({ tree: testedTree, isGreen, failures, accounted: accounted ?? null, complete: complete ?? null, requiresGreen: Boolean(requiresGreen), logPath: log })),
+ invariantEvidence: { ...evidence, gates: [...evidence.gates, tested] } });
return result;
}
diff --cc test/team-engine.test.js
index 235af85e,39198a9e..33894970
--- a/test/team-engine.test.js
+++ b/test/team-engine.test.js
@@@ -154,8 -153,10 +154,11 @@@ test('a landing snapshot binds the chec
branch: 'refs/heads/main', root: '/fixture/landing', owner: 'fixture', logPath: '/fixture/landing.log',
candidates: [entry], items: [entry], revision: 0 };
const record = prepareEngineMove(one, 'recordLandingBatch', [{ agentId: 'coordinator', batch }], { id: 'checked-landing-snapshot' });
+ assert.equal(VERDICT_REVIEW_ENGINE, 33, 'checked reviews retain their stable first engine');
- assert.equal(record.engine, ENGINE_VERSION, 'a new envelope uses the current writer independently of that minimum');
+ // A new move carries the writer's current engine; the checked-review feature only sets the minimum (17 Oct: pinning the
+ // current version to the feature number broke every later engine item).
+ assert.equal(record.engine, ENGINE_VERSION);
+ assert.ok(record.engine >= VERDICT_REVIEW_ENGINE, 'the checked-review snapshot is written at or above its feature engine');
const before = exportBoard(one);
assert.throws(() => applyEngineMove(one, { ...record, engine: 12 }, { sequence: 2, at: AT }), { code: 'RELAY_MOVE' });
assert.deepEqual(exportBoard(one), before, 'a downgraded checked-head snapshot cannot mutate the prefix');