diff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.md index c736cbd8..a165a4ed 100644 --- a/docs/CURRENT_STATUS.md +++ b/docs/CURRENT_STATUS.md @@ -17,6 +17,21 @@ open mode gates. ## Current checkpoint and work +**Basic No-Field reveal at Emperor auction gifts — 16 November. Prototyped / +Partial.** Richese can voluntarily reveal during a supported allied gift +opportunity or active gift response in ordinary and Richese cache auctions. +Public-start journeys retain original bids, committed aid, response passes +and legal continuation, including cancellation; they stage board counters, +cards, Spice order and wallets. Seven related unit files pass 34 cases. Other +parents, optional combinations, complete games and deployed acceptance remain +open. [Scope](RICHESE_NO_FIELD_RULES.md#basic-reveal-at-emperor-auction-gifts--16-november-2026). + +The latest bounded scan found first versions of the standalone Basic native +faction powers inspected, with interaction and complete-game boundaries still +open. Next source-clear Advanced candidates for review are the Emperor gift +during a Guild-rate response and truthful ally-funding commitments; neither is +implemented or verified by this checkpoint. + **Basic Emperor gifts while Sandtrout waits — 16 November. Prototyped / Partial.** Supported opening, ordinary auction and Richese cache gift windows remain available after an actual Sandtrout draw and a subsequent Ecaz diff --git a/docs/RICHESE_NO_FIELD_RULES.md b/docs/RICHESE_NO_FIELD_RULES.md index 5e4d2031..fdf41147 100644 --- a/docs/RICHESE_NO_FIELD_RULES.md +++ b/docs/RICHESE_NO_FIELD_RULES.md @@ -2,6 +2,22 @@ Audit date: 2026-09-06. This document distinguishes the printed token lifecycle from engine integration and unresolved combinations. It does not certify Richese, Homeworlds, or any other gated game mode. +## Basic reveal at Emperor auction gifts — 16 November 2026 + +**Prototyped / Partial.** In supported Basic ordinary and Richese cache +auctions, the voluntary before-Battle reveal may occur during the Emperor's +allied gift opportunity or its active response. The same original gift, lot, +funding and response passes remain pending; the player then continues the +sale. This is an extension of the existing provisional online ordering, not a +separate publisher timing ruling. Unsupported child windows, commitments and +module profiles remain guarded. + +[Public-start journeys](../tests/richese-reveal-emperor-auction-gift.test.ts) +use an actual paid No-Field shipment, earned alliance and paid ordinary, Once +Around and Silent lots. Spice draw order, initial force positions, card +custody and auction wallets are staged. Other parents and combinations, +complete games and deployed acceptance remain open. + ## Basic reveal with waiting Sandtrout — 16 November 2026 **Prototyped / Partial.** Waiting Sandtrout does not block the existing diff --git a/docs/RULE_DECISIONS.md b/docs/RULE_DECISIONS.md index 61797aeb..e5715cfa 100644 --- a/docs/RULE_DECISIONS.md +++ b/docs/RULE_DECISIONS.md @@ -1,5 +1,11 @@ # Rule decision index +## Basic No-Field reveal at Emperor auction gifts — 16 November 2026 + +The existing provisional before-Battle reveal ordering extends to supported +Emperor auction gift opportunities and their active responses, preserving the +original sale. [Scope](RICHESE_NO_FIELD_RULES.md#basic-reveal-at-emperor-auction-gifts--16-november-2026). + ## Basic Emperor gifts with waiting Sandtrout — 16 November 2026 The existing provisional phase-opening and auction gift opportunities apply diff --git a/game/engine.ts b/game/engine.ts index 77b65429..dc65a88c 100644 --- a/game/engine.ts +++ b/game/engine.ts @@ -4978,7 +4978,7 @@ function noFieldRevealBlock(g: Game, p: Player): string | null { if (g.status !== 'playing' || g.phase >= 6) return 'Voluntary No-Field reveal is available before the Battle phase.'; if (!p.noField?.deployed) return 'No concealed No-Field is deployed.'; - if ((g.truthtrance || g.phaseOpening || g.response || g.decision) && + if ((g.truthtrance || g.phaseOpening || g.response || g.decision || g.pendingEmperorAuctionGift) && !richeseRevealInterruptSupported(g)) return 'Resolve the pending interaction before revealing the No-Field.'; return null; diff --git a/game/reference.ts b/game/reference.ts index 696c893e..672ff836 100644 --- a/game/reference.ts +++ b/game/reference.ts @@ -1137,6 +1137,7 @@ export const RULE_TOPICS: RuleTopic[] = [ 'A waiting Sandtrout does not prevent the supported Basic voluntary-reveal interruption windows.', 'In supported Basic interruptions, a current-turn history of factual Truthtrance answers does not by itself block your reveal. Live promises and questions about future actions retain their existing safeguards.', 'In supported Basic games the voluntary reveal can also occur while CHOAM decides whether to prevent an already-declared free Revival. Reveal uses current reserves; the original Revival and CHOAM decision then continue once.', + 'In supported Basic auctions, reveal can also occur during the Emperor’s allied gift opportunity or its response. The original lot, pledged funds and gift continue unchanged.', 'In supported Basic native games, voluntary revelation is also available during an Ix phase opening or selected auction and market decisions without replacing that decision. Other interruption windows remain unfinished.', 'In supported Basic games, your voluntary reveal can also interrupt a clean Emperor allied spice gift or extra-revival response, Tleilaxu revival-income response, Atreides Movement-phase Spice forecast without Bene Gesserit, or Guild’s own ordinary reserve-shipment rate response when the shipment enters a different territory from the marker. If Richese receives the extra revival, reveal from current reserves before that return. The original response and payment continue once; other interruptions remain guarded.', 'An active public agreement does not by itself prevent a supported reveal. Existing current-turn travel and other binding commitments still retain their separate safeguards, and a reveal does not settle or cancel a payment.', @@ -1757,7 +1758,7 @@ export const RULE_TOPICS: RuleTopic[] = [ 'During Shipment and Movement, Guild can use its special Karama to stop another eligible off-planet Ambassador shipment before forces arrive; it does not stop this grant during a phase-one worm sequence. A successful off-planet shipment may invite Bene Gesserit accompaniment and accrues applicable phase-five Heighliner income once. BG can accompany Ixians into the mobile stronghold. Projected accompaniment choices show blocked sectors and keep Polar Sink and decline available when legal. Intrusion, separate Terror and accompanying fighter-triggered Ambassadors finish before the original entrant or worm rider resumes.', 'In supported plain Basic and Advanced Richese/Ecaz tables, No-Field may replace the whole Guild grant under an explicit provisional policy: concealed native0/3/5 counts as one and ships free; allied use reveals immediately within four available counters and keeps the one/two-spice transport payment to Guild or Bank. Richese chooses its token/payer and the beneficiary must accept before transfer. Prior native revelation, shared token history and physical fallback after scoped prevention remain; ordinary allowances are unchanged. Other optional profiles remain separate. In bounded classic plus Ecaz/Moritani games, a shared Ambassador/Terror entry gives both owners saved optional prompts in current storm order without repeating the committed entry; this is a provisional table order, not a printed publisher priority. A Terror entry now waits for the arrival’s own interaction — Guild income, a Bene Gesserit fighter Intrusion or advisor choice, or Fremen storm protection — and then opens without replaying payment or force transfer. Ambassador-created child arrivals retain their own contracts. The native-module extension now composes ordinary paid arrival order with Atomics, Homeworlds and Nexus; other combinations and complete rules remain unfinished.', 'The Tleilaxu Ambassador returns one eligible own leader or up to four physical forces free. First-death leaders and the first-killed Atreides KH need not wait for the ordinary cohort. Under the provisional repeat interpretation, later native leaders must satisfy their ordinary death condition, and later KH returns must meet their saved next-cohort marker. Preserve the actual opening before resurrection; KH advances its marker beyond both owner and old KH cycles without resetting activation losses or adding a native disc. Ecaz retains native identity bookkeeping. Ecaz may instead return the shared Duke alive and unclaimed under his independent permission; its ally cannot inherit that permission. Native and BG copied grants share eligibility and exclusive alternatives. A positive return provisionally earns seated Tleilaxu one bank spice per beneficiary/turn, sharing ordinary free revival; Ghola stays separate. Canceling income keeps the return and spent entitlement. Ordinary allowance independence and wider custody/module combinations remain provisional.', - 'All eleven effect guides are readable. Emperor, Atreides, Harkonnen, CHOAM, Ixian, Richese, Fremen and Guild entry effects are integrated, together with Bene Gesserit copies of those eight effects and direct Duke acquisition or consensual alliance through the reusable Ecaz token. Advanced combined Occupy has a separate bounded Development Verified guide, and Basic even-force Occupy now composes the same shared controls. Remaining effects, exceptional Duke custody and complete Ecaz rules remain unfinished. Ambassadors can be placed on the genuinely placed Hidden Mobile Stronghold, including when its pointer is in storm: the interior is sheltered. Its face-up marker stays attached through Ixian movement. Placement still pays the increasing fee and can be prevented by Karama. This supplies no Terror or direct-shipment permission. Normal public Ecaz starts remain development previews; complete rules and unsupported combinations stay gated.', + 'All eleven effect guides are readable. Emperor, Atreides, Harkonnen, CHOAM, Ixian, Richese, Fremen, Guild and Tleilaxu entry effects are integrated, together with their Bene Gesserit copies and direct Duke acquisition or consensual alliance through the reusable Ecaz token. Advanced combined Occupy has a separate bounded Development Verified guide, and Basic even-force Occupy now composes the same shared controls. Remaining interactions, exceptional Duke custody and complete Ecaz rules remain unfinished. Ambassadors can be placed on the genuinely placed Hidden Mobile Stronghold, including when its pointer is in storm: the interior is sheltered. Its face-up marker stays attached through Ixian movement. Placement still pays the increasing fee and can be prevented by Karama. This supplies no Terror or direct-shipment permission. Normal public Ecaz starts remain development previews; complete rules and unsupported combinations stay gated.', ], checklist: [ { diff --git a/game/richese-reveal-interruption.ts b/game/richese-reveal-interruption.ts index ea677f89..2614713b 100644 --- a/game/richese-reveal-interruption.ts +++ b/game/richese-reveal-interruption.ts @@ -61,6 +61,23 @@ export function richeseRevealInterruptSupported(g: Game): boolean { // receipt. Empty pending arrays do not represent a live child. const foreignMovement = richeseRevealForeignMovementPending(g); const revival = g.pendingRevival, decision = g.decision; + const gift = g.pendingEmperorAuctionGift; + const giftOwner = g.players.find(player => player.id === gift?.owner); + const giftBuyer = g.players.find(player => player.id === gift?.recipient); + const auctionGift = !!gift && g.phase === 3 && gift.turn === g.turn && + typeof gift.event === 'string' && !!gift.event && giftOwner?.faction === 'emperor' && + !!giftBuyer && giftOwner.ally === giftBuyer.id && giftBuyer.ally === giftOwner.id && + (gift.source === 'richese' + ? !decision && !g.auction && g.richeseAuction?.source === 'cache' && + gift.quote?.winner === giftBuyer.id + : gift.source === undefined && decision?.kind === 'auctionPayment' && + decision.player === giftBuyer.id && g.auction?.bidder === giftBuyer.id && !g.richeseAuction) && + (!g.response ? gift.giftAmount === undefined : + g.response.kind === 'emperorGift' && g.response.owner === giftOwner.id && + g.response.recipient === giftBuyer.id && g.response.emperorAuctionGiftEvent === gift.event && + g.response.amount === gift.giftAmount && Number.isSafeInteger(gift.giftAmount) && gift.giftAmount! > 0 && + Array.isArray(g.response.passed) && new Set(g.response.passed).size === g.response.passed.length && + g.response.passed.every(id => g.players.some(player => player.id === id))); let choamRevival = false; if (g.phase === 4 && decision?.kind === 'choamFreeRevival' && Object.keys(decision).sort().join(',') === 'kind,player,recipient' && @@ -74,7 +91,8 @@ export function richeseRevealInterruptSupported(g: Game): boolean { } } if (Object.entries(g).some(([key, value]) => key.startsWith('pending') && - !(key === 'pendingShipment' && guildRate) && !(key === 'pendingRevival' && choamRevival) && key !== foreignMovement && + !(key === 'pendingShipment' && guildRate) && !(key === 'pendingRevival' && choamRevival) && + !(key === 'pendingEmperorAuctionGift' && auctionGift) && key !== foreignMovement && (Array.isArray(value) ? value.length > 0 : value !== null && value !== undefined && value !== false))) return false; const live = (rows: readonly {turn: number; fulfilled?: boolean; released?: boolean}[] | undefined) => @@ -98,6 +116,7 @@ export function richeseRevealInterruptSupported(g: Game): boolean { g.mixedAllianceQuestions, g.mixedMovementQuestions, g.mixedTraitorQuestions, g.mixedBattleQuestions]; if (mixed.some(rows => rows?.some(row => row.turn === g.turn && row.binding))) return false; + if (auctionGift) return !g.phaseOpening && !g.choamMarket; if (foreignMovement) return true; if (g.response) { // Only independent, un-nested native responses with a stable original diff --git a/tests/richese-reveal-emperor-auction-gift.test.ts b/tests/richese-reveal-emperor-auction-gift.test.ts new file mode 100644 index 00000000..ead3b2ee --- /dev/null +++ b/tests/richese-reveal-emperor-auction-gift.test.ts @@ -0,0 +1,155 @@ +import assert from 'node:assert/strict'; +import test from 'node:test'; +import {applyAction, createGame, joinGame, newPlayer, viewGame, type Action, type Game} from '../game/engine'; +import {botActions} from '../game/bots'; +import {DIFFICULTIES} from '../game/bot-profiles'; +import {richeseRevealInterruptSupported} from '../game/richese-reveal-interruption'; +import {beforeIxSpiceDraw, orderIxSpiceCards} from './fixture-ix-spice-cards'; +import {nextSemutaNexusTradeNativeStep} from './fixture-semuta-nexus-trade'; + +const act=(g:Game,id:string,action:Action)=>applyAction(g,id,action); +const seat=(g:Game,id:string)=>{const p=g.players.find(row=>row.id===id);assert.ok(p);return p;}; +const clean=(g:Game)=>!g.phaseOpening&&!g.response&&!g.decision&&!g.truthtrance&&!g.pendingTreacheryDiscard; +function next(g:Game) { + if(g.turn===1&&g.phase===5&&g.active==='r'&&clean(g)) { + const p=seat(g,'r'); + if(!p.shipped) { + const token=p.noField!.tokens.find(row=>row.value===3);assert.ok(token&&p.noFieldEvent); + return {actor:'r',action:{type:'ship',noField:token.id,event:p.noFieldEvent,territory:'polar_sink',sector:0,allyPayment:0} satisfies Action}; + } + return {actor:'r',action:{type:'endMovement'} satisfies Action}; + } + if(g.phase===5&&g.active&&clean(g))return {actor:g.active,action:{type:'endMovement'} satisfies Action}; + return nextSemutaNexusTradeNativeStep(g); +} +function advance(g:Game,until:(state:Game)=>boolean) { + for(let i=0;i<2400;i++) { + if(until(g))return g; + assert.notEqual(g.status,'finished'); + const step=next(g);g=act(g,step.actor,step.action); + } + throw Error('Original native play did not reach the auction'); +} +function passResponse(g:Game) { + for(let i=0;g.response&&i<20;i++) { + const p=g.players.find(row=>!g.response!.passed.includes(row.id));assert.ok(p); + g=act(g,p.id,{type:'passResponse'}); + } + assert.equal(g.response,null);return g; +} +/** Public native Basic setup, actual paid No-Field shipment, natural second-turn + * worm and mutual alliance, then original paid lot. Staging moves only the + * unopened Spice prefix, initial board counters, hands/deck and wallets. */ +function fixture(source:'ordinary'|'onceAround'|'silent') { + let g=createGame('REVEALGIFT',newPlayer('e','Emperor','emperor'),false,['choam','ix']); + for(const [id,faction] of [['g','guild'],['r','richese'],['a','atreides']] as const) + joinGame(g,newPlayer(id,faction,faction)); + for(const p of g.players)g=act(g,p.id,{type:'ready'}); + g=act(g,'e',{type:'start'}); + g=advance(g,s=>s.status==='playing'); + for(const p of g.players){p.reserves+=Object.values(p.forces).reduce((sum,n)=>sum+n,0);p.forces={};} + g=advance(g,beforeIxSpiceDraw);orderIxSpiceCards(g,['land','land']); + g=advance(g,s=>s.turn===2&&beforeIxSpiceDraw(s)); + const marker=seat(g,'r').noField?.deployed;assert.ok(marker,'Richese shipped its actual marker on turn one'); + orderIxSpiceCards(g,['worm','land','land']); + g=advance(g,s=>!!s.nexus&&!s.spiceWindow&&clean(s)); + g=act(g,'e',{type:'alliance',target:'g'});g=act(g,'g',{type:'alliance',target:'e'}); + g=advance(g,s=>s.phase===3&&s.phaseOpening?.initialize===true); + for(const p of g.players)g.deck.push(...p.hand.splice(0)); + const counter=g.deck.findIndex(card=>card.effect==='karama');assert.ok(counter>=0); + seat(g,'a').hand.push(...g.deck.splice(counter,1)); + seat(g,'g').spice=7;seat(g,'e').spice=8; + const event=seat(g,'r').noFieldEvent;assert.ok(event); + if(source==='ordinary') { + g=advance(g,s=>s.phase===3&&!!s.auction&&!s.richeseAuction&&clean(s)); + while(g.auction!.active!=='g')g=act(g,g.auction!.active,{type:'passBid'}); + const card=g.auction!.cards[g.auction!.index].id; + g=act(g,'e',{type:'pledgeAid',amount:1}); + g=act(g,'g',{type:'bid',amount:3,allyPayment:1}); + for(let n=0;g.auction&&!g.response&&!g.decision&&n<15;n++)g=act(g,g.auction.active,{type:'passBid'}); + assert.equal(g.decision?.kind,'auctionPayment');assert.ok(g.pendingEmperorAuctionGift); + return {g,card,token:marker.tokenId,event}; + } + g=advance(g,s=>s.decision?.kind==='richeseCache'); + const card=g.richeseCache![0];assert.ok(card); + g=act(g,'r',{type:'decision',event:g.richeseBidding!.event,card:card.id,method:source, + ...(source==='onceAround'?{direction:'clockwise' as const}:{})}); + g=act(g,'e',{type:'pledgeAid',amount:1}); + let bid=false; + for(let n=0;!g.pendingEmperorAuctionGift&&n<300;n++) { + const lot=g.richeseAuction; + if(lot&&!lot.outcome&&!g.response&&!g.decision&&lot.method==='onceAround'&&lot.active) { + const buyer=lot.active==='g'&&!bid; + g=act(g,lot.active,{type:'richeseBid',event:lot.event,amount:buyer?3:null,...(buyer?{allyPayment:1}:{})}); + if(buyer)bid=true; + } else if(lot&&!lot.outcome&&!g.response&&!g.decision&&lot.method==='silent') { + const actor=lot.eligible.find(id=>!Object.hasOwn(lot.sealed,id));assert.ok(actor); + const buyer=actor==='g'&&!bid; + g=act(g,actor,{type:'richeseBid',event:lot.event,amount:buyer?3:0,...(buyer?{allyPayment:1}:{})}); + if(buyer)bid=true; + } else {const step=next(g);g=act(g,step.actor,step.action);} + } + assert.ok(bid);assert.ok(g.pendingEmperorAuctionGift); + return {g,card:card.id,token:marker.tokenId,event}; +} + +for(const source of ['ordinary','onceAround','silent'] as const) for(const duringResponse of [false,true]) void test( + `Basic Richese reveals during ${source} Emperor auction gift ${duringResponse?'response':'opportunity'}`,()=>{ + const f=fixture(source);let g=f.g; + const offer=viewGame(g,'e').emperorAuctionGift;assert.ok(offer); + if(duringResponse){ + g=act(g,'e',{type:'emperorGift',amount:2});assert.equal(g.response?.kind,'emperorGift'); + g=act(g,'g',{type:'passResponse'});assert.ok(g.response?.passed.includes('g')); + } + const before=structuredClone(g), funds=seat(g,'r').reserves, onBoard=seat(g,'r').forces['polar_sink:0']??0; + assert.ok(funds>=3);assert.equal(viewGame(g,'r').richeseNoField?.canReveal,true); + g=act(g,'r',{type:'revealNoField',token:f.token,event:f.event}); + assert.equal(seat(g,'r').reserves,funds-3);assert.equal(seat(g,'r').forces['polar_sink:0'],onBoard+3); + assert.deepEqual(g.pendingEmperorAuctionGift,before.pendingEmperorAuctionGift); + assert.deepEqual(g.auction,before.auction);assert.deepEqual(g.richeseAuction,before.richeseAuction); + assert.deepEqual(g.richeseFunding,before.richeseFunding);assert.deepEqual(g.aid,before.aid); + assert.deepEqual(g.response,before.response);assert.deepEqual(g.decision,before.decision); + if(duringResponse)g=passResponse(g); + for(const difficulty of DIFFICULTIES) { + const view=viewGame(g,'e');view.players.find(row=>row.id==='e')!.bot=difficulty; + const action=botActions(view).find(row=>row.type==='emperorAuctionGiftContinue');assert.ok(action,difficulty); + assert.doesNotThrow(()=>act(g,'e',action),difficulty); + } + g=act(g,'e',{type:'emperorAuctionGiftContinue',event:offer.event}); + if(g.decision?.kind==='auctionPayment')g=act(g,'g',{type:'decision',karama:false}); + g=passResponse(g); + assert.ok(seat(g,'g').hand.some(card=>card.id===f.card)); + assert.equal(g.aid.e?.amount??0,0); + }); + +void test('auction-gift reveal rejects unrelated child windows and mismatched gift responses',()=>{ + const f=fixture('ordinary'); + const withOpening=structuredClone(f.g);withOpening.phaseOpening={passed:[],initialize:true}; + assert.equal(richeseRevealInterruptSupported(withOpening),false); + let response=act(f.g,'e',{type:'emperorGift',amount:2}); + assert.equal(response.response?.kind,'emperorGift'); + assert.equal(richeseRevealInterruptSupported(response),true); + response=structuredClone(response);response.response!.emperorAuctionGiftEvent='different-event'; + assert.equal(richeseRevealInterruptSupported(response),false); +}); + +void test('a canceled auction gift still resumes after the No-Field reveal',()=>{ + const f=fixture('ordinary'); + const counter=seat(f.g,'a').hand.find(card=>card.effect==='karama');assert.ok(counter); + const original=structuredClone(f.g.auction), owner=seat(f.g,'e').spice, buyer=seat(f.g,'g').spice; + let g=act(f.g,'e',{type:'emperorGift',amount:2});assert.equal(g.response?.kind,'emperorGift'); + g=act(g,'r',{type:'revealNoField',token:f.token,event:f.event}); + g=act(g,'a',{type:'card',mode:'cancel',card:counter.id}); + while(g.pendingTreacheryDiscard?.reaction?.stage==='offer') { + const pending=g.pendingTreacheryDiscard,reaction=pending.reaction; + if(!reaction || reaction.stage!=='offer') throw Error('Discard offer disappeared'); + const actor=g.players.find(player=>!reaction.passed.includes(player.id));assert.ok(actor); + g=act(g,actor.id,{type:'semutaPass',event:pending.batch.event}); + } + assert.equal(g.response,null);assert.deepEqual(g.auction,original); + assert.equal(seat(g,'e').spice,owner);assert.equal(seat(g,'g').spice,buyer); + const offer=viewGame(g,'e').emperorAuctionGift;assert.ok(offer); + g=act(g,'e',{type:'emperorAuctionGiftContinue',event:offer.event}); + if(g.decision?.kind==='auctionPayment')g=act(g,'g',{type:'decision',karama:false}); + g=passResponse(g);assert.ok(seat(g,'g').hand.some(card=>card.id===f.card)); +});