From 99e60d5e8f4111f0435d9ea911e2431ec8ef2f7f Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Sat, 14 Nov 2026 01:02:02 +0000 Subject: [PATCH] Raise island holding achievement to fifteen for revision 2 review --- docs/achievements.md | 38 ++++++++++++++++++++++----------- engine/package.json | 2 +- engine/src/achievements.spec.ts | 29 +++++++++++++++++++------ engine/src/achievements.ts | 6 +++--- 4 files changed, 53 insertions(+), 22 deletions(-) diff --git a/docs/achievements.md b/docs/achievements.md index 89bd67b..7d6ae27 100644 --- a/docs/achievements.md +++ b/docs/achievements.md @@ -2,7 +2,7 @@ The engine wrapper exports the optional `achievementDefinitions()` and `achievements(GameState)` hooks using the published `@boardgamers/protocol/engine` -0.11.0 types. Manifest revision is **1**. IDs are permanent; never reuse them for +0.11.0 types. The engine 2.1.9 review candidate has manifest revision **2**. IDs are permanent; never reuse them for another condition. Icons are omitted intentionally (platform generic fallback). ## Manifest @@ -24,27 +24,41 @@ not require a victory. | `four-factories` | Own four factories (the legal maximum) at completion | | `three-warehouses` | Own at least three warehouses at completion | | `five-warehouses` | Own five warehouses at completion | -| `island-five` | At least five containers on the island at completion | +| `island-fifteen` | At least fifteen containers on the island at completion | | `island-ten` | At least ten containers on the island at completion | | `island-diversity` | All five container colors on the island at completion | | `full-ship` | Five containers aboard the ship at completion | | `warehouse-five` | Five containers in the warehouse store at completion | +## Revision 2 change (pending coordinator approval) + +Engine 2.1.9 replaces `island-five` / **Island Investor** (at least five island +containers) with the new ID `island-fifteen` / **Island Magnate** (at least fifteen). +The manifest still contains 17 definitions. `island-ten` and `warehouse-five` +are unchanged. Tests cover fourteen failing and fifteen qualifying, plus a legal +completed game reaching exactly fifteen and reproducing the award on replay. + +No existing award migration, deletion, or backfill is performed. The old ID is +retired, never reused; any existing platform records are left untouched. +Engine 2.1.8 / revision 1 remains the previously delivered release; this review +candidate must not be uploaded or activated until coordinator authorization. +The prior release receipt is unchanged. + ## Threshold attainability audit `warehouse-six` was an invalid review-candidate ID and is retired, not repurposed. Its replacement is `warehouse-five`, included in revision 1 for engine 2.1.8. -| Feats | Legal limits checked | -| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Three/four factories | `BuyFactory` requires fewer than four factories and a new color; four is the cap, with five colors available. | -| Three/five warehouses | `BuyWarehouse` requires fewer than five; setup supplies five warehouse pieces per seat. | -| Warehouse stock five | `BuyFromFactory` requires stock below warehouse count: one container per warehouse, hence five total. | -| Full ship | `BuyFromWarehouse` requires fewer than five cargo containers. | -| Island five/ten/diversity | No island holding cap; auctions transfer cargo to the island. Setup supplies 12/16/20 containers of each of five colors for 3/4/5 seats. Ten holdings and five colors fit even the smallest supply. | -| Score 100/150 | Settled score, not cash; no score ceiling. Accepted bids add matching bank subsidies, and island holdings contribute to scoring. These thresholds are not constrained by a fixed cash supply. | -| Debt-free feats | Zero outstanding loans is legal; borrowing is optional and loans can be repaid. | -| Wins/player counts | Supported 3/4/5-seat games; no solo threshold or solo victory inferred. | +| Feats | Legal limits checked | +| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Three/four factories | `BuyFactory` requires fewer than four factories and a new color; four is the cap, with five colors available. | +| Three/five warehouses | `BuyWarehouse` requires fewer than five; setup supplies five warehouse pieces per seat. | +| Warehouse stock five | `BuyFromFactory` requires stock below warehouse count: one container per warehouse, hence five total. | +| Full ship | `BuyFromWarehouse` requires fewer than five cargo containers. | +| Island fifteen/ten/diversity | No island holding cap; auctions transfer cargo to the island. Setup supplies 12/16/20 containers of each of five colors for 3/4/5 seats. Fifteen holdings across colors fit even the smallest supply of 60. A legal five-player completion/replay fixture finishes with exactly fifteen on one island. | +| Score 100/150 | Settled score, not cash; no score ceiling. Accepted bids add matching bank subsidies, and island holdings contribute to scoring. These thresholds are not constrained by a fixed cash supply. | +| Debt-free feats | Zero outstanding loans is legal; borrowing is optional and loans can be repaid. | +| Wins/player counts | Supported 3/4/5-seat games; no solo threshold or solo victory inferred. | The legal attainability regression starts from setup, buys warehouses and stock using available moves, and completes a seeded game with five warehouse containers. diff --git a/engine/package.json b/engine/package.json index 337ec71..1ba6b16 100644 --- a/engine/package.json +++ b/engine/package.json @@ -1,6 +1,6 @@ { "name": "container-engine", - "version": "2.1.8", + "version": "2.1.9", "description": "An engine for Container", "main": "dist/index.js", "types": "index.ts", diff --git a/engine/src/achievements.spec.ts b/engine/src/achievements.spec.ts index 8f7da43..71cb059 100644 --- a/engine/src/achievements.spec.ts +++ b/engine/src/achievements.spec.ts @@ -10,11 +10,11 @@ import { MoveName } from './move'; // Compile against the published optional hooks, not a local protocol imitation. const hooks: Pick, 'achievementDefinitions' | 'achievements'> = wrapper; -function complete(players: number): GameState { +function complete(players: number, seed = `achievements-${players}`): GameState { const random = Math.random; - Math.random = seedrandom(`achievements-${players}`); + Math.random = seedrandom(seed); try { - let G = setup(players, {}, `achievements-${players}`); + let G = setup(players, {}, seed); for (let i = 0; i < 20000 && !wrapper.ended(G); i++) { G = wrapper.moveAI(G, G.currentPlayers[0]); } @@ -40,10 +40,16 @@ describe('per-game achievements', function () { for (const count of [3, 4, 5]) completed.push(complete(count)); }); - it('publishes a fresh, stable, secret-free revision-one manifest', () => { + it('publishes a fresh, stable, secret-free revision-two manifest', () => { expect(hooks.achievementDefinitions).to.be.a('function'); const manifest = wrapper.achievementDefinitions(); - expect(manifest.revision).to.equal(1); + expect(manifest.revision).to.equal(2); + expect(manifest.achievements.map((d) => d.id)).not.to.include('island-five'); + expect(manifest.achievements.find((d) => d.id === 'island-fifteen')).to.deep.equal({ + id: 'island-fifteen', + name: 'Island Magnate', + description: 'Finish with at least fifteen containers on your island.', + }); expect(manifest.achievements).to.have.length(17); expect(new Set(manifest.achievements.map((d) => d.id)).size).to.equal(17); for (const definition of manifest.achievements) { @@ -82,6 +88,16 @@ describe('per-game achievements', function () { } }); + it('earns island-fifteen in a legal completed game and replay', () => { + const G = complete(5, 'island-fifteen-11'); + expect(G.players[4].containersOnIsland).to.have.length(15); + const result = wrapper.achievements(freeze(G)); + expect(result[4].earned).to.include('island-fifteen'); + expect(result[4].earned).to.include('island-ten'); + expect(result.every((row) => !row.earned.includes('island-five'))).to.equal(true); + expect(wrapper.achievements(wrapper.replay(G))).to.deep.equal(result); + }); + it('earns warehouse-five through legal purchases and completion, including replay', () => { const random = Math.random; Math.random = seedrandom('warehouse-1'); @@ -203,7 +219,8 @@ describe('per-game achievements', function () { boundary(id, n, (n) => (p.warehouses = Array.from({ length: n }, (_, i) => ({ id: `W${i}` })))); const containers = (n: number) => Array.from({ length: n }, (_, i) => ({ id: `C${i}` as const, color: containerColors[i % 5] })); - boundary('island-five', 5, (n) => (p.containersOnIsland = containers(n))); + boundary('island-fifteen', 15, (n) => (p.containersOnIsland = containers(n))); + expect(earned()).not.to.include('island-five'); boundary('island-ten', 10, (n) => (p.containersOnIsland = containers(n))); p.containersOnIsland = containers(4); expect(earned()).not.to.include('island-diversity'); diff --git a/engine/src/achievements.ts b/engine/src/achievements.ts index 824cfb7..2335ebe 100644 --- a/engine/src/achievements.ts +++ b/engine/src/achievements.ts @@ -16,7 +16,7 @@ const definitions = [ ['four-factories', 'Factory Network', 'Finish owning four factories.'], ['three-warehouses', 'Distribution Network', 'Finish owning at least three warehouses.'], ['five-warehouses', 'Warehouse Empire', 'Finish owning five warehouses.'], - ['island-five', 'Island Investor', 'Finish with at least five containers on your island.'], + ['island-fifteen', 'Island Magnate', 'Finish with at least fifteen containers on your island.'], ['island-ten', 'Island Portfolio', 'Finish with at least ten containers on your island.'], ['island-diversity', 'A Colorful Portfolio', 'Finish with all five container colors on your island.'], ['full-ship', 'Loaded Freighter', 'Finish with five containers aboard your ship.'], @@ -25,7 +25,7 @@ const definitions = [ export function achievementDefinitions(): AchievementManifest { return { - revision: 1, + revision: 2, achievements: definitions.map(([id, name, description]) => ({ id, name, description })), }; } @@ -60,7 +60,7 @@ export function achievements(G: GameState): SeatAchievements[] { ['four-factories', p.factories.length === 4], ['three-warehouses', p.warehouses.length >= 3], ['five-warehouses', p.warehouses.length === 5], - ['island-five', p.containersOnIsland.length >= 5], + ['island-fifteen', p.containersOnIsland.length >= 15], ['island-ten', p.containersOnIsland.length >= 10], ['island-diversity', new Set(p.containersOnIsland.map((c) => c.color)).size === 5], ['full-ship', p.ship.containers.length === 5],