Repository navigation
Implement programmable units and game resolution mechanics - #41
Merged
Merged
Conversation
Scaffolds the programmable-units change and writes its proposal. A unit type carries a program run every turn by each of its units against the army's shared map; thinking is charged in ticks through a meter sized by a fourth statistic, compute; a game resolves to its end at commit and is watched as a replay. Specs, design and tasks are still to come. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
A game that resolves to its end at commit has nothing to concede; the proposal no longer names it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
A new unit-program capability states the controller: a program per type, the instruction set and its tick table, the meter that turns ticks into energy through compute, sleep and waking, the army's shared map, the radio and the controller trace. Deltas on ten existing capabilities move the game from hand-ordered turns to a setup that is resolved to its end and watched as a replay. The design settles the VM, the snapshot discipline, the state hash that stops an unchanging game, and what each role shows. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
The validator refuses a MODIFIED block that drops a scenario, so the renamed ones take their old titles back with the new behaviour. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
The strict validator fails a requirement body over 500 characters. The instruction set, the meter, the map, the radio and the trace are split into shorter requirements with the detail in their scenarios, and the flagged bodies in the other deltas are trimmed the same way. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
A sleep with no bound was free dormancy. A unit sleeps ten turns at most and pays a tick to sleep again, so every unit looks at the board at least every ten turns. The Keep's default program sleeps in stretches of ten. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
domain/program.py is the machine: a parser that refuses a bad line by number, an executor with eight registers, a word memory and a published tick per instruction, and a meter sized by the type's new fourth statistic, compute, that charges one energy each time it fills. A controller halts at the turn's cap or when the meter would charge energy the unit lacks, and a halted controller gives no order. domain/army_map.py is what an army knows: the squares its units have stood on and the enemies they have fought, stamped with the turn, shared by every controller and filled only by standing or fighting. The board runs every awake controller against one snapshot per army before anything moves, delivers the radio's three-word messages next turn in a settled order, lets a unit sleep for up to a hundred turns and wakes it with a blow, and records what every controller did as a trace for its owner. Compute 0 is a type with no controller: a wall, or a turret that stands, strikes back and rests. The determinism tests now play programmed boards under every permutation of their units. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
…turn The service layer now plays a game out the moment the last setup is committed: `resolve_game` loops the turn resolution under one hold, writes each turn's record (board, units, flags, events, every army's map and every trace) through the repository's new `write_turn`, hashes the whole state after each turn and stops on a repeated state, on a decision or at the turn cap, recording why. A finished game's barrier is never met and it waits for nobody. Both backends persist a type's compute and program and a unit's controller state (meter, sleep, memory, inbox), keep the per-turn records (a `turns` table; a `turns/` directory), and refuse to open a game whose stored types have no compute, naming the game. A player file that names no compute is a type with none. Refusals at resolution are attributed to the owner of the unit named. The client settles a deployment onto its own board with `Board.settle`, which places the unit and nothing more: the full commit now runs the controllers, and a scout deployed during setup walked off before the game had begun. The default army carries compute and the default programs, the budget is 320 and the array costs 304. The registry tells an undecided stop from a decided game. Tests that drove turns by hand are reworked to the rule that nobody is waited for after setup. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
The default army's programs are checked to parse and, over every turn of a stock-army game, to run within their type's per-turn cap; two stock armies played to the end reach an outcome with both sides moving on the first turn of play. Divergence 32 is closed: an undecided contest names each survivor with its owner and a player is told of their own unit once, whatever the other player's units are called. The sqlite controller columns are nullable, as the YAML line is optional: whether a unit may lack a controller record is the service's rule. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
A game resolved to its end writes a feed and a record every turn. The feed was read back whole and re-emitted by the pure Python emitter on each write, which made a sixty-turn game take twenty seconds; the repository now keeps the feed it last wrote and uses libyaml where the interpreter has it, and the same game takes under two. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
…away A player gives no orders: `move` and `hold` are gone from the grammar, the parser, completion, help and the service. In their place a player sets a type's program from a file with `set program`, reads it back with `show program` listed line by line with its ticks, and reads the record of a resolved game with `show turn <n>`, `show turn <n> known`, `next` and `prev`. `add type` takes an optional compute. The client commits its setup and, when the last setup is in, is shown the result and the final turn; otherwise it says whose setups are still to come and waits. The observer opens a resolved game at its final turn and steps through every seat's traces. The server resolves the whole game when the last setup commit lands, reports the outcome and exits, or reads the record at the prompt with `--replay`. A new `service/replay.py` builds a turn as a seat may read it - the board from the record, the events, the refusals and the traces that are the seat's own - and a type's program listing; the HTTP tier serves both. The refusals a player is shown for a turn are read from that turn's record. A fallen unit no longer re-stamps the enemy that killed it on its army's map, which kept a finished game from repeating its state. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
The draft, replay, defect and take-back tests reached for the order commands the grammar no longer has. Drafts now hold programs as well as types and units, and the defect about a shared unit name is held by a controller walking its own unit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
…ogram editor The browser watches a resolved game as a replay: a scrubber over every turn of the record, play, pause, step and speed, the board at each turn drawn whole from the record with every unit moving from its old square to its new, the turn's events and refusals, and the seat's own controllers' traces. A seat switches the board to what its army knew after the turn; the observer and the administrator choose whose. While setups are outstanding the screen says whose and moves to the replay of its own accord. Every control has a key. The armoury takes compute beside the other three statistics, prices a design by all four, and writes a type's program in an editor that lists each line's ticks from the tariff the server exports, marks a line the instruction set refuses where it stands, and sends nothing until every line is accepted. A type with no compute is offered no program. Box selection, the double-click, the compass, the order arrows and the ordering keyboard are gone with the orders; dragging stays for deploying. The HTTP tier serves the record a turn at a time, a type's program with its listing, the tariff, and a check of a program against the one parser there is. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
GAME_RULES.md now describes a game of programs: compute as a fourth statistic, the setup that ends at commit, the six phases of a turn, the record and its replay, the army map, the repeated-state and turn-cap endings, and the instruction tariff. The board test of the order arrow is removed with the arrow. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
README, MODULE_DESCRIPTION and SPEC_COVERAGE describe the game as it now is: a program per type written in the armoury or set from a file, the one commit each seat makes, the resolution to the end that follows, and the record every role replays. The coverage document gains the unit-program capability and a table saying where each requirement of the change is held, and retires the box-selection section with the orders. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
Twelve capabilities updated and unit-program created, by merging each delta's requirements into its main spec: the added and modified requirements take the delta's text, the removed ones go, and everything the deltas do not mention stays. Every spec validates. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
A doctrine is a file now: the types it fields with their four statistics, the program each type's units run, where its units stand by depth from its own edge and which carries the flag - or only programs, for one that keeps the stock army. The arena types each seat's setup at its own client, commits, and reads the record back at an observer's prompt once the last commit has resolved the game; nothing orders anything. The ten doctrines are rewritten as data with eleven programs, the record checker and the series script follow, and the harness tests play every doctrine against the Garrison in process and read the traces for a controller stopped at its cap. The catalogue's hunter walks round its own units on both axes rather than stepping onto one on the second, which was a fight with friendly fire; that takes it to thirty-three ticks, so the Lance's compute is four. The match-series spec is brought up to a game nobody orders. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
An undecided game names two turns - the one it stopped on and the one it stood as - and the harness took the last. The earlier write-up carries the superseded notice, and the coverage document says where the match harness is held. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
SELF writes r0 to r5, so the enemy's row parked in r5 became the unit's number among its type and the front rank stood still. The row lives in r6 now, and the harness test plays every doctrine that hunts against the Garrison and requires it to move, and the Bulwark against a hunt. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
The head of RESULTS-PROGRAMMED.md says what the series is played under; the results follow as the games finish. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
A sleeping unit struck in a contest is woken, and the event said so only as its raw fields. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
The session grew one string a character at a time, which is quadratic in the transcript; a record of five hundred turns is a megabyte of it, and reading one back took an hour. Thirty seconds now. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
Twenty games through the real roles, nobody giving an order: eleven decided, ten by a flag falling and one a draw of two flags at once; five stopped on a repeated state and four ran to the cap. RESULTS-PROGRAMMED.md says what was played, what decided each game, what the tariff cost each doctrine, and what the series does not show - chiefly that the catalogue's programs send two Heavies and leave twelve units boxed in and paying to stand still, and that sleep counters keep a static board from repeating. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
The catalogue's programs field two Heavies and twelve bystanders, and a sleeping unit's countdown keeps a static board from repeating; both are design choices the series surfaced rather than defects. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
…ered Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
…ts is done The in-process games the harness tests play resolve to their end, which the YAML backend takes minutes over for nothing the SQLite run does not show. Both backends' suites and the slow tests are green. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
Every artifact done, every task ticked, every delta already in the main specs; the change moves to the archive as 2026-11-08-programmable-units. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
Every artifact done and all fourteen tasks ticked. Its two deltas are in the main specs already: board-model identically, and unit-types inside the later programmable-units text, which kept every scenario of this one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
The rule it proposed has been in the game since August: a survivor with nowhere to fall back crashes into whoever took its square, down the column, and a unit strikes each other unit once a turn. What was left was the bookkeeping: its delta is now in the combat-resolution spec, with the one-strike-per-pair rule as the requirement the main spec never carried, a tasks file records where the work landed, and the wording of the shared outcome nothing emits any more is gone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HCQiS5yWPsmeVnxUAkYg1R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.