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.

fix: require receipts for modern submissions [C7,V4]

Corey Olson0aa7767871d9
diff --git a/docs/formats.md b/docs/formats.md
index a80a1e9e..3314264d 100644
--- a/docs/formats.md
+++ b/docs/formats.md
@@ -132,7 +132,7 @@ Engine 24 adds the person's `acceptCheck`: an item's current check, named by its
Engine 30 lets a reject and a reopen carry a cause key (`cause`: `test:<file>::<title>`, `refusal:<CODE>`, `row:<id>` or `doctrine:<id>`) and lets the person record a never-again fact with `cause` and `neverAgain: true`, for `pullboard rigor`. Only a move that carries one of these needs engine 30; engine-29 and older moves replay unchanged, and clients on an older engine refuse an engine-30 move with `RELAY_MOVE` before changing their board or cursor. Engine 20 is the implied-items engine above; engine numbers 21 through 29 are allocated to other changes.
-Engine 34 records submission test selections and normalized landing evidence. A `submit` carrying `submissionProof` or a `recordLandingBatch` carrying `invariantEvidence` requires engine 34; earlier engines refuse these envelopes before applying them, and a malformed proof is refused with `SUBMISSION_PROOF`. Moves recorded under engines 33 and earlier replay without inferred coverage. Recorded invariant evidence is append-only when a landing batch is adopted. Engine slots 25 through 33 are allocated to earlier train changes; preserve their semantics when composing this item.
+Engine 34 records submission test selections and normalized landing evidence. A `submit` carrying `submissionProof` or a `recordLandingBatch` carrying `invariantEvidence` requires engine 34; earlier engines refuse these envelopes before applying them, and a missing or malformed proof is refused with `SUBMISSION_PROOF` on a modern submit before its item or events change. Moves recorded under engines 33 and earlier replay without inferred coverage. Recorded invariant evidence is append-only when a landing batch is adopted. Engine slots 25 through 33 are allocated to earlier train changes; preserve their semantics when composing this item.
The CLI declares its engine in every relay request's `X-Pullboard-Engine` header.
A linked board requires at least engine 3 after issuing any agent token, including
diff --git a/src/engine.js b/src/engine.js
index 864e388e..3a60743f 100644
--- a/src/engine.js
+++ b/src/engine.js
@@ -9,7 +9,7 @@ import { CAUSE_ENGINE, ENGINE_VERSION } from './machine.js';
import { Refused } from './refused.js';
import { requestMoveProblem, recordRequestMove } from './relay-requests.js';
import { relayMoveActor, relaySenderProblem, validRelaySender } from './relay-sender.js';
-import { SUBMISSION_PROOF_ENGINE } from './submit-invariants.js';
+import { SUBMISSION_PROOF_ENGINE, submissionProof } from './submit-invariants.js';
const ITEM_ID_FIRST_ARGUMENT = new Set(['acceptCheck', 'editItem', 'escalate', 'recordAttempt', 'claim', 'release', 'submit', 'reserveReview', 'verify', 'merged', 'withdraw', 'refreeze', 'reopen', 'appendFact']);
@@ -77,6 +77,7 @@ export function startRelayEpoch(board) {
/** Turn caller-only callbacks into deterministic values before sealing an executable operation. */
export function prepareEngineMove(board, operation, args, { id = randomUUID(), actor } = {}) {
if (!ENGINE_OPERATIONS.includes(operation) || !Array.isArray(args)) throw new Refused('RELAY_MOVE', 'use a supported board-engine operation with its argument array');
+ if (operation === 'submit' && ENGINE_VERSION >= SUBMISSION_PROOF_ENGINE) submissionProof(args[1]?.submissionProof);
const minimumEngine = minimumOperationEngine(operation, args);
if (ENGINE_VERSION < minimumEngine) throw new Refused('ENGINE_VERSION', `${operation} requires engine version ${minimumEngine}; this pullboard uses engine ${ENGINE_VERSION}; upgrade before sending it`);
const values = args.map((value) => value && typeof value === 'object' ? { ...value } : value);
diff --git a/src/submit-invariants.js b/src/submit-invariants.js
index dbc41102..b120f574 100644
--- a/src/submit-invariants.js
+++ b/src/submit-invariants.js
@@ -14,9 +14,8 @@ function projectFile(value) {
&& value.split('/').every(part => part && part !== '.' && part !== '..');
}
-/** Normalize a versioned selection receipt; absent legacy receipts remain unknown. */
+/** Normalize the receipt required by modern submits; legacy replay skips this guard. */
export function submissionProof(value) {
- if (value === undefined) return undefined;
if (!value || value.version !== 1 || typeof value.full !== 'boolean'
|| typeof value.deferred !== 'boolean' || typeof value.reason !== 'string'
|| value.reason.length > 8192 || !Array.isArray(value.files) || value.files.some(file => !projectFile(file))) {