Compose market, early cache and phase bid promises
Verify and publish checkpoint container / container (push) Successful in 12m4s

This commit is contained in:
Quintine committed 2026-11-16 20:51:03 +11:00
1 parent 225b2174ad
commit 6a30fdf376
16 files changed
+1183 -21

No files matched your search

@@ -61,7 +61,7 @@ function market(game:Game, f:TruthtranceRichesePromisesFixture, card:string, met
return game;
}
void test('Advanced current Black Market bid question cannot strand a waiting early cache Yes', () => {
void test('Advanced current Black Market answer cannot strand a waiting early cache Yes', () => {
const f = source();
let game = ask(f.game,f.f,f.f.truth,f.f.emperor,'earlyRicheseBid',6,'yes');
const early = game.earlyRicheseBidPromises?.find(row => row.player === f.f.emperor); assert.ok(early);
@@ -70,11 +70,16 @@ void test('Advanced current Black Market bid question cannot strand a waiting ea
const lot = game.richeseAuction!, event = lot.event;
game = act(game,f.f.asker,{type:'card',card:f.second});
game = advance(game,state => state.truthtrance?.stage === 'ask');
const before = structuredClone(game);
const question = {kind:'richeseBid',target:f.f.emperor,turn:game.turn,event,minimum:6};
assert.throws(() => act(game,f.f.asker,{type:'truthAsk',question}),
'The separately asked current-lot promise awaits a three-ledger planner');
assert.deepEqual(game,before,'Rejected question cannot mutate the auction, question or cache receipt');
game = act(game,f.f.asker,{type:'truthAsk',question});
const choices = viewGame(game,f.f.emperor).truthRicheseBidAnswers;
assert.ok(!choices?.includes('yes'),'The two six-spice purchases cannot both be funded from ten');
assert.ok(choices?.includes('no'),'A lower or declined current bid can preserve the cache promise');
const before = structuredClone(game);
assert.throws(() => act(game,f.f.emperor,{type:'truthAnswer',answer:'yes'}));
assert.deepEqual(game,before,'Rejected answer cannot mutate the auction, question or cache receipt');
game = passTruthRicheseFreshDiscard(act(game,f.f.emperor,{type:'truthAnswer',answer:'no'}));
assert.ok(game.richeseBidPromises?.some(row => row.player === f.f.emperor && row.event === event && !row.answer));
assert.ok(game.earlyRicheseBidPromises?.some(row => row.id === early.id && !row.boundEvent && !row.released));
assert.equal(player(game,f.f.emperor).spice,10);
assert.deepEqual(inventory(game),f.f.originalCards);