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
fix(relay): bind roadmap writes to coordinator tokens [H2,H9]
Corey Olsone81b27abc972
diff --git a/src/engine.js b/src/engine.jsindex 2d882169..dff52b87 100644--- a/src/engine.js+++ b/src/engine.js@@ -83,6 +83,7 @@ export function engineActor(operation, args) {if (operation === 'answerDecision' && args[1]?.asPerson) return 'person';if (operation === 'release') return args[1];if (operation === 'addItem') return args[0]?.by;+ if (operation === 'addMilestone') return args[0]?.agentId;if (operation === 'shout') return args[0]?.from;if (operation === 'reserveNextReview') return args[0]?.agentId;return args[1]?.agentId;diff --git a/test/engine.test.js b/test/engine.test.jsindex c6657227..d18e59eb 100644--- a/test/engine.test.js+++ b/test/engine.test.js@@ -107,6 +107,26 @@ test('authenticated relay senders bind every move and refusals preserve replicaassert.equal(replayCursor(two), cases.length + 2);});+test('authenticated coordinator milestones replay and reject foreign sender identity [H2,H9,H3,H16]', (t) => {+ const { copies, item } = engineCopies(t);+ const [one, two] = copies;+ const move = prepareEngineMove(one, 'addMilestone', [{ agentId: 'coordinator', name: 'Fixture milestone', items: [item] }], { id: 'coordinator-milestone', actor: 'coordinator' });+ for (const board of copies) {+ const before = store.milestones(board);+ const refused = applyEngineMove(board, move, { sequence: 1, at: CLAIM_AT, sender: { kind: 'agent', userId: 'fixture-user', agent: 'web-1' } });+ assert.equal(refused.error?.code, 'RELAY_ACTOR');+ assert.deepEqual(store.milestones(board), before, 'a foreign scoped token cannot change milestone metadata');+ }+ const valid = { ...move, id: 'valid-coordinator-milestone' };+ const sender = { kind: 'agent', userId: 'fixture-user', agent: 'coordinator' };+ const outcomes = copies.map((board) => applyEngineMove(board, valid, { sequence: 2, at: CLAIM_AT, sender }));+ assert.deepEqual(outcomes[0], outcomes[1]);+ assert.equal(outcomes[0].error, undefined, 'the coordinator scoped token binds the native milestone actor');+ assert.deepEqual(store.milestones(one), [{ name: 'Fixture milestone', note: null, items: [item] }]);+ assert.deepEqual(store.milestones(one), store.milestones(two));+ assert.deepEqual(store.events(one), store.events(two));+});+test('the same sealed claim replays to identical rows and sequence retries are idempotent [H3,H16]', (t) => {const { copies, item } = engineCopies(t);const [one, two] = copies;