pkg:clod/com.clodhub/tournament 0.11.0 Entries, rebuy offers, eliminations, finishing places, the winner and results of a tournament made of rounds, over an injected chip ledger, level schedule and seating. `tournament` keeps who is in, who is out and in what order. Everyone seated enters with the starting stack (issued through the chip-ledger); when a round ends, a player with no chips is offered a rebuy if they have one left and the round was dealt at or below the last rebuy level; offers have a deadline (a person who does not answer is out) and computer players accept after a delay; once every offer is answered the players still without chips are eliminated and placed (same-round bust-outs by stack at the deal, equal stacks sharing a place), and either a winner is found or the next round starts. It also finishes a game early when only computer players are left, supports cancellation, and gives result rows for the standings screens. Examples Three players start with 5000. One loses everything in a level 1 round, is offered the one rebuy and takes it; later loses again, has no rebuy left and is eliminated third. Two players bust in the same round with 300 and 100 at the deal: the 300 stack places higher. A person who does not answer a rebuy offer within the deadline is eliminated. Package URL: pkg:clod/com.clodhub/tournament@0.11.0 Class: Tournament (pkg:clod/com.clodhub/tournament-class@1.1.0): Entries, rebuys, eliminations, places and the result screen. Any component of this class can fill a recipe slot that asks for it. Category games/tournaments; https://clodhub.com/classes/tournament-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Ftournament-class Provides (1) - tournament (com.clodhub/tournament 1.0.0): A tournament of rounds: entries, rebuy offers, eliminations, finishing places and the winner. Pure: every member takes a state and returns a new one. Chips live in an injected chip ledger, levels in an injected level schedule, the people and computers in a seating. Times given to it (actionMs) are milliseconds on the table's action clock. Server: TypeScript `implementation/server/tournament.ts`, `implementation/server/migrate.ts` (exportAll, importAll). Build once with createTournament(settings, {ledger, schedule, seating}); methods named `Tournament.` are members of the object it returns. Client standings rows: TypeScript `implementation/web/results.ts`, Swift `implementation/apple/Sources/ResultRows.swift`, Kotlin `com.clodhub.tournament` `ResultRows.kt` (resultRows, headingKey). components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Ftournament Requires (3) - chip-ledger (com.clodhub/chip-ledger 1.0.0): Whole-number chip accounting: stacks, bets, pots and side pots, odd chips. No game rules and no card knowledge: callers say who won each pot. Every function returns a new ledger and never changes its input. TypeScript, `implementation/server/ledger.ts`. Methods named `LedgerApi.` are members of the object createLedgerApi returns (the operations a tournament calls, with the settings bound). components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fchip-ledger - level-schedule (com.clodhub/level-schedule 1.0.0): Stakes that rise on a timer. A level is {label, values}: the values are whatever the game steps up (blinds, an ante, a target score); the component never looks inside them except to scale them. TypeScript, `implementation/server/levels.ts`. Methods named `ScheduleApi.` are members of the object createScheduleApi returns: the tournament's view, with the clock reading as the only argument. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Flevel-schedule - seating (com.clodhub/seating 1.0.0): Seats for a table of people and computer players. Build the component once with createSeating(settings, identity); methods named `Seating.` are members of the object it returns. Every member takes a state and returns a new one, never changing its input. Server: TypeScript `implementation/server/seating.ts` and `implementation/server/migrate.ts` (exportAll, importAll). Client lobby rows: TypeScript `implementation/web/lobby.ts`, Swift `implementation/apple/Sources/SeatRows.swift`, Kotlin `com.clodhub.seating` `SeatRows.kt` (seatRows, canTakeSeat; Swift and Kotlin take the same values as structs and enums). components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fseating Settings (6) Settings (all optional): `startingStack` (5000), `rebuysPerPlayer` (1), `rebuyStack` (5000), `lastRebuyLevel` (3; 0 means no rebuy at any level), `rebuyDecisionSeconds` (30) and `tiebreak` (`stackAtDeal`: same-round bust-outs rank by the stack they had at the deal, equal stacks tie; `shared`: all share one place). They map to the house-rules entries `chips.starting_stack`, `rebuy.maximum_per_player`, `rebuy.stack_awarded`, `rebuy.eligibility.maximum_level`, `rebuy.decision_seconds` and `results.same_hand_bustouts`. `startingStack` is the only starting-stack number the tournament uses: every entry is issued it through the ledger, so chip-ledger's own `startingStack` must not add a second stack. - startingStack: integer; optional, default 5000 - rebuysPerPlayer: integer; optional, default 1 - rebuyStack: integer; optional, default 5000 - lastRebuyLevel: integer; optional, default 3 - rebuyDecisionSeconds: integer; optional, default 30 - tiebreak: string (identifier); optional, default "stackAtDeal" Depends on components: none How to use in a recipe A recipe uses it through a slot of class Tournament (pkg:clod/com.clodhub/tournament-class 1.1.0), naming pkg:clod/com.clodhub/tournament as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (tournament) to the slots that use it. It fills what the component needs (chip-ledger, level-schedule and seating) from slots whose components provide them. The recipe sets startingStack, rebuysPerPlayer, rebuyStack, lastRebuyLevel, rebuyDecisionSeconds and tiebreak; any it leaves out takes its default. - as a slot in recipe.json components: {"id":"tournament","class":{"name":"pkg:clod/com.clodhub/tournament-class","version":"1.1.0","digest":"69633676ac28ef4cebef5230f8d7fbc31fc9dd27f513972724cff39ca57e1649"},"preferred":{"name":"pkg:clod/com.clodhub/tournament","version":"0.11.0"}} - in place of another component of the class: clod fetch tournament@0.11.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=tournament@0.11.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot tournament) For developers: how an application uses it Build it once with `createTournament(settings, {ledger, schedule, seating})` from `implementation/server/tournament.ts`, passing the chip-ledger, level-schedule and seating components. The state holds the chip ledger; the game moves chips through `ledger(t)` and the turn engine puts the new ledger back with `withLedger`. The turn engine calls `start`, `roundStarted`, `roundSettled`, `dueOffer`, `nextOfferDue`, `resolve`, `conclude`, `cancel`, `levelAt` and the readers. Clients use `resultRows` (web `implementation/web/results.ts`, Apple `ResultRows.swift`, Android `ResultRows.kt`); end screens, icons and text stay with the recipe. The ledger offers `create/issue/balance/issued/setSeats` (`start` tells it each player's seat number) and the schedule `levelAt/describe`; `createLedgerApi(settings)` of chip-ledger and `createScheduleApi(schedule)` of level-schedule are such objects. `levelAt` and `clockInfo` take the level clock of game-clock (`elapsed(clock, 'level')`). `levelClockRuns(t)` is false exactly while rebuy offers are open; the turn engine passes it as `runs.level` so the blind level does not advance during a rebuy decision. Accounts and services No service is deployed. The tournament state is part of the game state the room stores. No accounts or keys. How it is checked `node --test tests/web.test.ts` checks settings, entries, offers with deadlines and computer acceptance, the level cut-off and rebuy limits, taken and declined rebuys, same-round and shared placing, successive places, computers-only completion, cancellation, chip conservation, result rows, the runnable consumer and export/import with checksums. `python3 tests/native.py apple` compiles and runs the Swift result-row checks. `python3 tests/native.py android` is written for Kotlin 2.2 but was not run on the extraction machine (no kotlinc). `authoring/integration.test.ts` (not packaged) runs the tournament over the real chip-ledger and level-schedule siblings. The tests use small stand-ins for the three required components (`tests/fakes.ts`). - `node --test tests/web.test.ts` (web, required-local; tools: node 26.5) - `python3 tests/native.py apple` (apple, platform; tools: python3 3.12, swiftc 6.4) - `python3 tests/native.py android` (android, platform; tools: python3 3.12, kotlinc 2.2, java 26.0) Updates Patch updates replace files; the state shape is `interfaces/tournament-state.schema.json` version 1.0.0 and `migration.json` describes export and import as newline-delimited JSON with a checksum per record. Removal deletes the owned sources and the application's imports; stored results stay in the room's own storage. Tags: games, tournament, tournaments Targets: client android, ios, macos, tvos, web, windows; server none Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/tournament release v0.11.0; digest sha256:b3c5aedb64c424e7d68f816fe5f7f08a5592194ba565ee604db304d0b4a7a06c Release: features Line 0.11: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/tournament/0.11.0/vulnerabilities Downloads: 1 in 30 days; 1 of this version Classes: https://clodhub.com/classes.txt; this component as JSON: https://clodhub.com/api/components/tournament/0.11.0 Bundle download: GET https://clodhub.com/api/components/tournament/0.11.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/tournament-class@1.1.0 69633676ac28ef4cebef5230f8d7fbc31fc9dd27f513972724cff39ca57e1649 com.clodhub/tournament 1.0.0 entry modules: android android/src/main/java, ios apple/Sources, macos apple/Sources, server server/index.ts, tvos apple/Sources, web web/index.ts, windows web/index.ts shared behaviour suites: shared Platforms: android, ios, macos, server, tvos, web, windows Toolchains: android >=8.0.0, ios >=17.0.0, java >=17.0.0 <27.0.0, kotlin =2.4.21, macos >=14.0.0, node >=26.5.0 <27.0.0, swift =6.4.2, tvos >=17.0.0 Frameworks: none Styles: scope none; 0 namespaces; 0 conflicts Licence: Apache-2.0; 0 upstream sources, 0 exact dependencies, 35 files (listed on the details page) Suitable for jobs: tournament profile any: cost none; load none; regions any; compliance none Notes: Pure library; the tournament state is part of the room's own stored state, a few kilobytes. Data migration: stores tournament-results (com.clodhub/tournament-state 1.0.0); formats ndjson; requires stop no; retention 0 days Maintainers: Level N Ltd; https://github.com/clodhub/tournament/issues; updates https://github.com/clodhub/tournament/releases (manual) What you download tournament-0.11.0.tar, from release v0.11.0 of clodhub/tournament: 35 files - Documents and manifests (9): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.md, ... - Source code (7): android/ (1), apple/ (1), server/ (3), web/ (2) - Tests (5): android/ (1), apple/ (1), fakes.ts, native.py, web.test.ts - Interface documents (5): required-chip-ledger.json, required-level-schedule.json, required-seating.json, tournament-state.schema.json, tournament.json - Class files: the class's interfaces and shared checks (3): tournament-class/ (3) - Examples (1): consumer.ts - Diagrams (5): definition.json, examples/ (1), output/ (3) Installing copies 7 of them into the application under components/tournament/: android 1, apple 1, server 3, web 2 Not included: the components that provide what it requires (com.clodhub/chip-ledger, com.clodhub/level-schedule, com.clodhub/seating), each a separate download; the values of its settings, which the recipe writes; any secret The archive is a release file on the publisher's public GitHub repository; ClodHub keeps this page and a pointer to the release, not the code. clod checks the archive's sha256 fingerprint before anything is copied, and installing runs none of the package's code. Versions - 0.11.0 features (2026-11-26T11:34:26.562Z) sha256:b3c5aedb64c424e7d68f816fe5f7f08a5592194ba565ee604db304d0b4a7a06c Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/tournament/details.txt?version=0.11.0 Page: https://clodhub.com/components/tournament; JSON: https://clodhub.com/api/components/tournament/0.11.0; connections diagram: https://clodhub.com/api/components/tournament/0.11.0/connections.svg Copyright Level N Ltd 2026