Support group departures in joint commitment plans
Verify and publish checkpoint container / container (push) Successful in 11m20s

This commit is contained in:
Quintine committed 2026-10-29 01:01:51 +11:00
1 parent 6524ed3bf2
commit 52d932002b
12 files changed
+552 -39

No files matched your search

@@ -43,24 +43,17 @@ function commitmentsLive(game: Game) {
assert.equal(game.alliancePromises![0].released ?? false, false);
}
void test('joint accepted-order promises cannot be released by group proposal or approval', () => {
void test('joint accepted-order promises remain binding after group admission', () => {
let game = fixture();
const before = structuredClone(game);
assert.throws(() => act(game, 'a', proposal(game)));
assert.deepEqual(game, before);
game = act(game, 'a', proposal(game));
commitmentsLive(game);
// Another member may propose; the affected player can still decline, but
// cannot approve a group while the scalar reconciliation is unsupported.
game = act(game, 'b', proposal(game));
game = act(game, 'b', answer(game, true));
commitmentsLive(game);
game = act(game, 'c', answer(game, true));
commitmentsLive(game);
const pending = structuredClone(game);
assert.throws(() => act(game, 'a', answer(game, true)));
assert.deepEqual(game, pending);
commitmentsLive(game);
game = act(game, 'a', answer(game, false));
commitmentsLive(game);
assert.equal(game.coalitionState!.proposal, null);
assert.deepEqual(coalitionOf(game.players, game.coalitionState, 'a')!.members, ['a','b','c']);
game = act(game, 'a', {type:'bribe', target:'e', amount:1});
assert.equal(game.bribePromises![0].fulfilled, true);
assert.equal(game.alliancePromises![0].released ?? false, false);
});