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(relay): current-engine checks follow the standing engine [H2,V1]
Corey Olson453d8985903a
diff --git a/test/relay-deploy.test.js b/test/relay-deploy.test.jsindex ac5de844..c83ac3e3 100644--- a/test/relay-deploy.test.js+++ b/test/relay-deploy.test.js@@ -9,7 +9,7 @@ import { tmpdir } from 'node:os';import { pathToFileURL } from 'node:url';import { test } from 'node:test';import { releaseHeadlinesBetween } from '../src/changelog.js';-import { ENGINE_VERSION } from '../src/machine.js';+import { ENGINE_VERSION, VERIFIER_STANDING_ENGINE } from '../src/machine.js';import { relayClientFixture } from './relay-client-fixture.js';import { githubFixture } from './relay-fixture.js';import { createRelayBrowserHandler } from '../relay/browser-page.js';@@ -291,7 +291,7 @@ test('[H5,H18] the Railway checklist matches the container and relay runtime settest('[H5,H18] the Railway smoke links, reads one unsealed move and unlinks locally', async (t) => {const box = await relayClientFixture(t);await box.link();- assert.equal(await box.requireEngineThree(), 27, 'a machine-linked board requires the engine-27 seat-provenance replay engine');+ assert.equal(await box.requireEngineThree(), VERIFIER_STANDING_ENGINE, `a machine-linked board requires the engine-${VERIFIER_STANDING_ENGINE} seat-provenance replay engine`);const previous = JSON.parse(readFileSync(box.linkFile, 'utf8'));const legacy = await fetch(`${previous.url}/api/v1/boards/${previous.board}/state`, {headers: { authorization: `Bearer ${previous.token}`, 'x-pullboard-engine': '2' },diff --git a/test/relay-machine-auth.test.js b/test/relay-machine-auth.test.jsindex aea23942..8cc68a9e 100644--- a/test/relay-machine-auth.test.js+++ b/test/relay-machine-auth.test.js@@ -8,6 +8,7 @@ import { DatabaseSync } from 'node:sqlite';import { createRelayAuth } from '../relay/auth.js';import { createGitHubClient } from '../relay/github.js';import { githubFixture } from './relay-fixture.js';+import { VERIFIER_STANDING_ENGINE } from '../src/machine.js';/** Create an actual signed-in account against the loopback GitHub protocol fixture. */async function signedPerson(box, auth) {@@ -58,7 +59,7 @@ test('machine credentials mint and list same-board agents but cannot link, revokassert.equal(tokens.some(value => Object.hasOwn(value, 'token') || Object.hasOwn(value, 'hash')), false);await assert.rejects(auth.listTokens(machine.token, beta), { code: 'TOKEN_BOARD' });await assert.rejects(auth.issueToken(machine.token, { board: beta, agent: 'cross-board' }), { code: 'TOKEN_BOARD' });- assert.equal(auth.minimumEngineVersion(alpha), 27, 'machine and agent credentials require engine 27 (#579)');+ assert.equal(auth.minimumEngineVersion(alpha), VERIFIER_STANDING_ENGINE, `machine and agent credentials require engine ${VERIFIER_STANDING_ENGINE} (#579)`);await assert.rejects(auth.listTokens(agent.token, alpha), { code: 'HUMAN_REQUIRED' });await assert.rejects(auth.revoke(machine.token, agent.id), { code: 'TOKEN_NOT_OWNED' });diff --git a/test/relay-retention.test.js b/test/relay-retention.test.jsindex 1050effb..8b4ce3bf 100644--- a/test/relay-retention.test.js+++ b/test/relay-retention.test.js@@ -13,6 +13,7 @@ import { createRelayJournal } from '../relay/journal.js';import { createRelayRetention } from '../relay/retention.js';import { serveRelay } from '../relay/service.js';import { githubFixture } from './relay-fixture.js';+import { VERIFIER_STANDING_ENGINE } from '../src/machine.js';const DAY = 86_400_000;const A = 'a'.repeat(32);@@ -60,7 +61,7 @@ async function fixture(t) {/** Return status/body without ever placing credentials in diagnostic text or URLs. */async function call(id, { path = '/state', method = 'GET', token = signed.token, body } = {}) {const response = await fetch('http://127.0.0.1:' + relay.port + '/api/v1/boards' + (id ? '/' + id + path : ''), {- method, headers: { 'x-pullboard-engine': '27', authorization: 'Bearer ' + token, ...(body ? { 'content-type': 'application/json' } : {}) },+ method, headers: { 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), authorization: 'Bearer ' + token, ...(body ? { 'content-type': 'application/json' } : {}) },...(body ? { body: JSON.stringify(body) } : {}),});return { status: response.status, body: await response.json() };@@ -88,7 +89,7 @@ test('[H18] warnings begin at sixty days on authorized contact; compaction and rwarningTimeout.unref();t.after(() => { clearTimeout(warningTimeout); controller.abort(); });const stream = await fetch('http://127.0.0.1:' + box.relay.port + '/api/v1/boards/' + A + '/events?after=0', {- headers: { 'x-pullboard-engine': '27', authorization: 'Bearer ' + box.signed.token, accept: 'text/event-stream' }, signal: controller.signal,+ headers: { 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), authorization: 'Bearer ' + box.signed.token, accept: 'text/event-stream' }, signal: controller.signal,});const reader = stream.body.getReader();let delivered = '';diff --git a/test/relay-version.test.js b/test/relay-version.test.jsindex b2acdb1c..2382296b 100644--- a/test/relay-version.test.js+++ b/test/relay-version.test.js@@ -8,6 +8,7 @@ import { createRelayAuth } from '../relay/auth.js';import { createGitHubClient } from '../relay/github.js';import { serveRelay } from '../relay/service.js';import { githubFixture } from './relay-fixture.js';+import { VERIFIER_STANDING_ENGINE } from '../src/machine.js';const A = 'a'.repeat(32); // no board credential has ever existedconst B = 'b'.repeat(32); // historical board credential, even after revocation@@ -28,10 +29,10 @@ test('relay enforces the minimum engine ever required by each board [H16,H3]', aawait auth.revoke(person.token, historical.id);time += 10;assert.equal(auth.minimumEngineVersion(A), 1);- assert.equal(auth.minimumEngineVersion(B), 27, 'agent tokens now require engine 27 (#579)');+ assert.equal(auth.minimumEngineVersion(B), VERIFIER_STANDING_ENGINE, `agent tokens now require engine ${VERIFIER_STANDING_ENGINE} (#579)`);auth.close();auth = createRelayAuth(authConfig);- assert.equal(auth.minimumEngineVersion(B), 27, 'the minimum survives revocation, expiry and reopening the real auth database');+ assert.equal(auth.minimumEngineVersion(B), VERIFIER_STANDING_ENGINE, 'the minimum survives revocation, expiry and reopening the real auth database');const relay = await serveRelay({ directory: join(directory, 'data'), auth, maintenanceMs: 0, pollMs: 10 });t.after(async () => { await relay.close(); auth.close(); rmSync(directory, { recursive: true, force: true }); });const base = `http://127.0.0.1:${relay.port}/api/v1/boards/`;@@ -48,19 +49,19 @@ test('relay enforces the minimum engine ever required by each board [H16,H3]', a}// Seed opaque snapshots so eligible reads reach actual state and event handlers.for (const board of [A, B]) {- const seeded = await call(board, '/state', { engine: 27, method: 'PUT', body: JSON.stringify({ sequence: 0, sealed: opaque }) });+ const seeded = await call(board, '/state', { engine: VERIFIER_STANDING_ENGINE, method: 'PUT', body: JSON.stringify({ sequence: 0, sealed: opaque }) });assert.equal(seeded.status, 200, seeded.text);}for (const board of [A, B]) {- const currentState = await call(board, '/state', { engine: 27 });+ const currentState = await call(board, '/state', { engine: VERIFIER_STANDING_ENGINE });assert.equal(currentState.status, 200, currentState.text);- assert.equal((await call(board, '/events?after=0', { engine: 27 })).status, 200);+ assert.equal((await call(board, '/events?after=0', { engine: VERIFIER_STANDING_ENGINE })).status, 200);}for (const board of [A, B]) {const controller = new AbortController();const streamed = await fetch(base + board + '/events?after=0', {- headers: { authorization: `Bearer ${person.token}`, 'x-pullboard-engine': '27', accept: 'text/event-stream' }, signal: controller.signal,+ headers: { authorization: `Bearer ${person.token}`, 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), accept: 'text/event-stream' }, signal: controller.signal,});assert.equal(streamed.status, 200);await streamed.body.cancel(); controller.abort();diff --git a/test/relay.test.js b/test/relay.test.jsindex 21fb25bb..9a5a7342 100644--- a/test/relay.test.js+++ b/test/relay.test.js@@ -15,6 +15,7 @@ import { relayClientFixture } from './relay-client-fixture.js';import { serveView } from '../src/serve.js';import { fetchFresh } from './http-fixture.js';import { fetchPrintedViewLink } from './view-link-fixture.js';+import { VERIFIER_STANDING_ENGINE } from '../src/machine.js';const CLI = resolve(import.meta.dirname, '../bin/pullboard.js');@@ -823,7 +824,7 @@ test('revoking a board credential while its upload body is open stores nothing [const origin = `http://127.0.0.1:${service.port}`;const snapshot = await fetch(`${origin}/api/v1/boards/${board}/state`, {method: 'PUT',- headers: { 'x-pullboard-engine': '27', authorization: `Bearer ${person.token}`, 'content-type': 'application/json' },+ headers: { 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), authorization: `Bearer ${person.token}`, 'content-type': 'application/json' },body: JSON.stringify({ sequence: 0, sealed: 'AQ' }),});assert.equal(snapshot.status, 200);@@ -843,7 +844,7 @@ test('revoking a board credential while its upload body is open stores nothing [let stream;const upload = fetch(`${origin}/api/v1/boards/${board}/moves`, {method: 'POST',- headers: { 'x-pullboard-engine': '27', authorization: `Bearer ${agent.token}`, 'content-type': 'application/json' },+ headers: { 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), authorization: `Bearer ${agent.token}`, 'content-type': 'application/json' },body: new ReadableStream({ start(controller) { stream = controller; controller.enqueue(Buffer.from('{"sequence":1,"sealed":"')); } }),duplex: 'half',});@@ -859,7 +860,7 @@ test('revoking a board credential while its upload body is open stores nothing [assert.equal(response.status, 401, JSON.stringify(refusal));assert.equal(refusal.error.code, 'AUTH_REQUIRED');const events = await fetch(`${origin}/api/v1/boards/${board}/events?after=0`, {- headers: { 'x-pullboard-engine': '27', authorization: `Bearer ${person.token}` },+ headers: { 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), authorization: `Bearer ${person.token}` },});assert.equal(events.status, 200);assert.deepEqual((await events.json()).events, [], 'the revoked upload never appends a move');@@ -880,7 +881,7 @@ test('revoking a person token during snapshot upload preserves the prior snapshoconst origin = `http://127.0.0.1:${service.port}`;const firstSnapshot = await fetch(`${origin}/api/v1/boards/${board}/state`, {method: 'PUT',- headers: { 'x-pullboard-engine': '27', authorization: `Bearer ${person.token}`, 'content-type': 'application/json' },+ headers: { 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), authorization: `Bearer ${person.token}`, 'content-type': 'application/json' },body: JSON.stringify({ sequence: 0, sealed: 'AQ' }),});assert.equal(firstSnapshot.status, 200);@@ -900,7 +901,7 @@ test('revoking a person token during snapshot upload preserves the prior snapsholet stream;const upload = fetch(`${origin}/api/v1/boards/${board}/state`, {method: 'PUT',- headers: { 'x-pullboard-engine': '27', authorization: `Bearer ${person.token}`, 'content-type': 'application/json' },+ headers: { 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), authorization: `Bearer ${person.token}`, 'content-type': 'application/json' },body: new ReadableStream({ start(controller) { stream = controller; controller.enqueue(Buffer.from('{"sequence":0,"sealed":"')); } }),duplex: 'half',});@@ -916,7 +917,7 @@ test('revoking a person token during snapshot upload preserves the prior snapshoassert.equal(response.status, 401, JSON.stringify(refusal));assert.equal(refusal.error.code, 'AUTH_REQUIRED');const current = await fetch(`${origin}/api/v1/boards/${board}/state`, {- headers: { 'x-pullboard-engine': '27', authorization: `Bearer ${observer.token}` },+ headers: { 'x-pullboard-engine': String(VERIFIER_STANDING_ENGINE), authorization: `Bearer ${observer.token}` },});assert.equal(current.status, 200);const saved = await current.json();