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
test(landing): retain legacy replay and pending engine guards [Q1,H16]
Corey Olson854ef03787b6
diff --git a/docs/formats.md b/docs/formats.mdindex 42fd8aec..8bbea43e 100644--- a/docs/formats.md+++ b/docs/formats.md@@ -529,3 +529,6 @@ A row approved after the board’s compatibility baseline is reported as `agent-Engine 68 retains the existing validated verifier note in new acceptance-event detail. Earlier engines retain their original receipt shape; later person confirmations project current approval state beside that immutable history. No new row status or approval authority is inferred from a Git author or an unsigned receipt.The engine-68 `recordSpecApprovalBaseline` move carries `{agentId, baseline: {version: 1, file, anchor, rows: [{id, text, source}]}}`. `anchor` is the current commit or `null` before the first commit; exact source rows also cover uncommitted initial requirements. Only the authenticated coordinator may establish the snapshot; a person uses the main checkout’s coordinator path. Lane commands never seed or replace it. The first snapshot is indexed under `board_meta.spec_approval_baseline` with a `spec_approval_baseline` event. Replay writes metadata only, never checkout files. Sender attribution is authenticated normally, older engines refuse the new move, and later bootstrap attempts cannot replace or expand the original snapshot. No local sidecar establishes shared approval authority. The metadata snapshot must agree with its single original coordinator event; a partial restore with either half missing or changed is invalid. A malformed stored marker remains in place with an invalid-baseline diagnostic; it is not treated as an absent migration baseline or reseeded by later commands. Board imports remain trusted recovery operations; agreement of these records is a consistency check, not cryptographic authentication of an imported history.+++Landing queue grants, first queue entries and releases are shared ordered transitions. New landing-local-heartbeat engine moves leave renewal and repeated-poll events out of history; old engine receipts keep their recorded meaning. `local:landing-lease:<token>` board metadata binds a physical board id, token/generation, process, branch and coordinator lineage to its local deadline. It is excluded from exports, imports and semantic digests and is retained only on the receiving physical board during a same-board relay snapshot restore. A linked foreign holder has no clock-based expiry: release or coordinator takeover fences it; local heartbeat deadlines never authorize another machine to merge.diff --git a/test/engine.test.js b/test/engine.test.jsindex 9fe2af2d..aaee3785 100644--- a/test/engine.test.js+++ b/test/engine.test.js@@ -664,7 +664,21 @@ test('the engine version is the highest feature engine [C7,V4]', () => {const source = new URL('../src/', import.meta.url);const files = readdirSync(source).filter((file) => /-engine\.js$/u.test(file));assert.deepEqual(Object.keys(ENGINE_REGISTRY), files.map((file) => file.slice(0, -'-engine.js'.length)).sort(), 'every src/*-engine.js leaf is a feature engine, discovered by its file name');- for (const file of files) assert.match(readFileSync(new URL(file, source), 'utf8'), /^export const [A-Z][A-Z0-9_]*_ENGINE = \d+;$/mu, `${file} declares its one engine constant`);+ const pending = [], landed = [];+ for (const file of files) {+ const text = readFileSync(new URL(file, source), 'utf8');+ const declarations = text.split('\n').filter(line => /^export const /u.test(line));+ assert.equal(declarations.length, 1, `${file} declares exactly one engine constant`);+ const match = /^export const [A-Z][A-Z0-9_]*_ENGINE = (?:(\d+)|unassignedEngine\(\));$/u.exec(declarations[0]);+ assert.ok(match, `${file} declares a landed number or the native landing placeholder`);+ if (match[1] !== undefined) landed.push(Number(match[1]));+ else {+ assert.ok(text.split('\n').includes("import { unassignedEngine } from './engine-next.js';"), `${file} imports the actual placeholder resolver`);+ pending.push(file.slice(0, -'-engine.js'.length));+ }+ }+ for (const name of pending) assert.equal(ENGINE_REGISTRY[name], Math.max(0, ...landed) + 1,+ `${name} resolves to the next landed engine until its own merge assigns a permanent number`);assert.doesNotMatch(readFileSync(new URL('machine.js', source), 'utf8'), /Math\.max\([A-Z_]+ENGINE,/u, 'src/machine.js lists no engine by name');});diff --git a/test/landing-local-lease.test.js b/test/landing-local-lease.test.jsindex 8a613add..b6905e31 100644--- a/test/landing-local-lease.test.js+++ b/test/landing-local-lease.test.js@@ -11,6 +11,7 @@ import { exportBoard, importBoard, restoreRelaySnapshot, semanticBoardDigest } fimport { assertLandingLease } from '../src/landing-lease.js';import { LANDING_LOCAL_PREFIX, localLandingEntry } from '../src/landing-local-lease.js';import { takeLandingResource } from '../src/landing-resource.js';+import { LANDING_LEASE_ENGINE } from '../src/landing-lease-engine.js';/** Give each test two physical boards and a private receipt clock, never a live coordinator credential. */function fixture(t) {@@ -97,3 +98,21 @@ test('physical heartbeat identity cannot attach to another board or arrive in anboard.db.prepare("UPDATE board_meta SET meta_value=? WHERE meta_key='board_id'").run(old);} finally { await lease.release(); }});+++test('historical landing lease receipts retain their original renewal events [Q1,H16]', t => {+ const box = fixture(t); const [board] = box.boards;+ const request = { agentId: 'coordinator', action: 'request', token: randomUUID(), branch: 'refs/heads/main', pid: process.pid };+ let sequence = 0;+ /** Replay the old sealed protocol rather than silently rewriting historical event meaning. */+ const oldMove = args => {+ const move = { ...prepareEngineMove(board, 'landingLeaseMove', [args]), engine: LANDING_LEASE_ENGINE };+ const outcome = applyEngineMove(board, move, { sequence: ++sequence, at: board.clock.now().toISOString() });+ assert.equal(outcome.error, undefined, JSON.stringify(outcome.error));+ return outcome.result;+ };+ const grant = oldMove(request);+ box.advance(1000);+ oldMove({ ...request, action: 'renew', generation: grant.generation });+ assert.equal(board.db.prepare("SELECT count(*) AS n FROM event WHERE event_kind='landing_lease'").get().n, 2);+});