# Container per-game achievements The engine wrapper exports the optional `achievementDefinitions()` and `achievements(GameState)` hooks using the published `@boardgamers/protocol/engine` 0.11.0 types. Engine **2.2.0** includes manifest revision **4** with 19 achievements as part of the authorized Offshore Island release. IDs are permanent; never reuse them for another condition. The original 17 definitions, conditions and stable `achievement-` asset references remain unchanged. Original SVG/PNG artwork, provenance, reproduction instructions and contact sheets are in [achievement-art](achievement-art/README.md). The historical revision-3 artwork manifest and release receipt are preserved, not regenerated. The Offshore additions were reviewed and tested before release authorization. Revision 4 adds **Offshore Magnate** (`offshore-win`) and **Two-Way Trade** (`offshore-trader`). Both require `options.offshoreIsland === true` and the same committed completion and human-seat eligibility checks as base achievements. Offshore Magnate requires a sole game victory (not a draw). Two-Way Trade requires both `player.offshoreStats.cashAuctionsWon >= 1` and `player.offshoreStats.containerAuctionsWon >= 1` in that completed game; it does not require winning the game. Missing/partial counters cannot prove both auctions. Disabled or absent expansion options never earn either new award, even if counters are present. The engine records counters on bank auction settlement and reproduces them on replay; final holdings alone are not evidence of these auction wins. Protocol 0.11.0 supports text badges, not emoji: the new icons use built-in `OI` and `BANK` badges and require no nonexistent artwork or upload. ## Manifest All conditions require a committed, completed 3–5-player game. Non-win feats do not require a victory. | ID | Condition | | ------------------ | ----------------------------------------------------------------------------------------- | | `win` | Sole winner after final score and island-container tiebreaker | | `win-three-player` | Win a three-player game | | `win-four-player` | Win a four-player game | | `win-five-player` | Win a five-player game | | `debt-free-win` | Win with zero outstanding loans | | `score-100` | Final score at least 100 | | `score-150` | Final score at least 150 | | `debt-free` | Zero outstanding loans at completion | | `three-factories` | Own at least three factories at completion | | `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-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 | | `offshore-win` | Sole winner of a completed Offshore Island expansion game | | `offshore-trader` | Win a cash bank auction and a container bank auction in the same completed expansion game | ## Revision 2 change (historical) 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. This change subsequently shipped with the revision-3 artwork in engine 2.1.10. The historical activation receipt remains 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 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. It checks capacities throughout and replays the serialized completed game to the same awards. It does not inject final holdings or alter money/supply/phase. The expansion regression starts from seeded Offshore Island setup, makes legal bank calls from seat zero (first bidding a stored container for cash, then bidding cash for bank containers), and otherwise uses legal AI moves through completion. The serialized finished game earns Two-Way Trade and awards Offshore Magnate to the sole winner; replay reproduces all awards without injecting counters or state. ## Rules and authority This is Container, not Gaia Project. The engine ends after two supply colors run out, at the relevant turn/auction boundary. Settlement replaces `player.money` with the final score, including island values, warehouse stock ($2 each), cargo ($3 each), and loan penalties ($11 each). The hook reads that settled value; it never applies scoring a second time or mistakes it for remaining cash. The existing wrapper ranks by score then island-container count. Achievements use those same comparisons, but do **not** use array/seat order to break an exact tie: tied leaders get `draw`, others `loss`, and no win achievements are granted. The existing wrapper assigns sequential rankings even for exact ties; that separate ranking bug is intentionally not changed by these achievement hooks. Bot and dropped seats receive no rows, but their results remain opponents' results; filtering eligibility cannot turn a loss into a win. Player count means original seats, including bots/drops. Singleton/unsupported games get no rows. Island holdings come from auctions (including retaining one's own cargo), but do not prove any particular number of auction victories or deliveries. Base achievements have no historical shipping, auction, production or borrowing feats; only the expansion trading feat reads the explicit bank-auction counters. In particular, `debt-free` does not claim the player never borrowed. No log, objective card, secret breakdown or extra evidence is exposed or required. Hooks do not mutate inputs, and each manifest call returns a fresh object graph. ## Integration prerequisites / release boundary - BGS calls the hook with authoritative completed serialized state and maps zero-based seats to accounts. In the reviewed platform code, capture excludes `game.cancelled`, `game.winClaim`, and `game.soloEditedAt`, requires ended status, and skips already-ended games/existing evidence. Bot, dropped and quit seats are mapped to null and discarded; other human seats can still earn feats. See `apps/game-server/app/services/game-achievements.ts` (capture/extraction). Admin edit-data and replay routes set `soloEditedAt` even for multiplayer games. Container itself has no cancellation flag or account IDs; the hook additionally filters its `isAI` and `isDropped` flags. - **No blanket practice exclusion is established.** Capture does not consult `soloRanked` or test custom seeds, `platformRewoundAt`, `soloAnalysisAt`, unlisted games, or a generic tutorial/practice marker. Solo ranking policy is separate (`packages/models/solo-ranking.ts`), and does not establish Container eligibility. Platform analysis uses separate analysis records; Container tutorials run the engine locally in the viewer. Neither fact is a general capture-time exclusion. Container's `GameState` contains optional `analysisCash` (created by `createAnalysisScenario`), but `createAnalysis` has no durable provenance flag; the achievement hook does not classify practice from these states. No multiplayer Container exposure through those paths has been demonstrated. Broader practice exclusion, if required, remains a coordinator/platform policy prerequisite rather than a guarantee of this implementation. - Install published protocol **0.11.0** using the committed lockfile. No local unpublished protocol dependency is used. - Engine 2.1.8 carries the reviewed revision-1 manifest (17 achievements). Release authorization follows independent approval of commit `6ae62e0`. Publication must follow `AGENTS.md`: deliver source, dependencies, lockfile and version changes to canonical `master` alongside the BGS engine upload. Activation must verify the installed manifest and public album, without creating fake production games. Tests play legal seeded 3/4/5-player games through completion, serialize and replay them, check immutable/idempotent evaluation, and separately vary final states to cover all thresholds, exact ties, the tiebreaker, eligibility and unsupported/unfinished inputs. Synthetic boundary variations are explicitly not presented as legal game replays.