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.

test(merge): preserve fresh reviewer standing checks [V1,H16]

Corey Olsone5290db0a646
diff --git a/test/merge-only-verdict.test.js b/test/merge-only-verdict.test.js
index 9a52a21c..a3ee063b 100644
--- a/test/merge-only-verdict.test.js
+++ b/test/merge-only-verdict.test.js
@@ -110,10 +110,21 @@ test('a merge-only resubmission keeps its accept and records the resolution diff
assert.equal(store.getItem(origin, id).item_status, 'verified');
assert.deepEqual(withoutObjects, withObjects, 'one canonical move must emit identical events and event IDs without Git objects');
assert.deepEqual(exportBoard(objectless), exportBoard(origin), 'replicas must retain exactly identical native state');
+ const freshReview = prepareEngineMove(origin, 'verify', [id, { agentId: 'coordinator', decision: 'ACCEPT',
+ note: 'a fresh verdict still requires its own reviewer authority', head,
+ digest: pending.item.item_frozen_digest, check: 'green',
+ review: { commit: head, head, trunk, paths: detail.paths } }]);
+ const unprivilegedCoordinator = { kind: 'agent', agent: 'coordinator', userId: 'private-coordinator-without-root',
+ policy: MERGE_ONLY_VERDICT_ENGINE };
+ const denied = applyRelayMove(origin, freshReview, { sequence: 2, at, sender: unprivilegedCoordinator, kind: 'move' });
+ assert.equal(denied.error?.code, 'VERIFIER_STANDING', 'retaining a verdict must never authorize a fresh unprivileged review');
+ assert.deepEqual(applyRelayMove(objectless, freshReview,
+ { sequence: 2, at, sender: unprivilegedCoordinator, kind: 'move' }), denied);
+ assert.deepEqual(store.verdictsFor(origin, id), original.verdicts);
const subsequent = prepareEngineMove(origin, 'reopen', [id, { agentId: 'coordinator', withdrawVerdict: true,
note: 'withdraw the original acceptance after canonical carry' }]);
- const next = applyEngineMove(origin, subsequent, { sequence: 2, at });
- assert.deepEqual(applyEngineMove(objectless, subsequent, { sequence: 2, at }), next,
+ const next = applyEngineMove(origin, subsequent, { sequence: 3, at });
+ assert.deepEqual(applyEngineMove(objectless, subsequent, { sequence: 3, at }), next,
'a later verdict-ID-bound move must retain the same outcome and event IDs');
assert.deepEqual(exportBoard(objectless), exportBoard(origin));