Documentation
¶
Overview ¶
Package gorge holds the sources that decide a binary card table's bytes, so that a binary knows which tables match it without a source tree: a pinned tool, a gate's base tree and a deployed server all outlive their checkout, and walking up to hash dirac/kgen at run time would load whatever the cwd happens to be in. It sits at the module root because that is the only directory above both dirac/ and engine/. It imports the standard library only; only dirac/cardset and dirac/kgen import it, so a kgen edit does not recompile dirac.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TableSourceHash ¶
func TableSourceHash() string
TableSourceHash is the hex sha256 of the embedded table sources (hashSources). Memoised.
func TableSources ¶
TableSources is the embedded source tree, slash paths from the module root. kgen reads its pool lists from here, not from disk, so the tables it publishes under this binary's key are a function of this binary and the corpus alone.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bots is the registry of bot policies a host can link in.
|
Package bots is the registry of bot policies a host can link in. |
|
all
Package all links every built-in hosted bot policy.
|
Package all links every built-in hosted bot policy. |
|
azmcts
Package azmcts is the AlphaZero-style tree search of docs/design/2026-09-27-alphazero-mcts-design.md: a PUCT tree over ONE seat's searched decisions (single perspective: every value is that seat's win probability, no sign flips), whose leaf is a value -- the policynet value head, or the frozen heuristic searchprobe.LeafValue for generation 0 -- never a rollout.
|
Package azmcts is the AlphaZero-style tree search of docs/design/2026-09-27-alphazero-mcts-design.md: a PUCT tree over ONE seat's searched decisions (single perspective: every value is that seat's win probability, no sign flips), whose leaf is a value -- the policynet value head, or the frozen heuristic searchprobe.LeafValue for generation 0 -- never a rollout. |
|
azredeal
Package azredeal hosts the az-redeal policy (spec 2026-09-28-hosted-bot-packages §3.1): the adapter over internal/azmcts.Seat in its honest redeal world (generation 0: uniform prior, heuristic leaf, 100 simulations, a fresh deal per simulation) that answers the searched kinds from the host's honest root and the seat's own observation feed, and plays the wrapped default bot everywhere else.
|
Package azredeal hosts the az-redeal policy (spec 2026-09-28-hosted-bot-packages §3.1): the adapter over internal/azmcts.Seat in its honest redeal world (generation 0: uniform prior, heuristic leaf, 100 simulations, a fresh deal per simulation) that answers the searched kinds from the host's honest root and the seat's own observation feed, and plays the wrapped default bot everywhere else. |
|
botpolicy
Package botpolicy holds the one bot decision policy, in one copy.
|
Package botpolicy holds the one bot decision policy, in one copy. |
|
castprofile
Package castprofile hosts the cast-profile policy: the production bot playing from a cast profile.
|
Package castprofile hosts the cast-profile policy: the production bot playing from a cast profile. |
|
explain
Package explain is the per-intent decision note a match record carries beside its log: who answered one decision, by which route, and -- for a search or a scoring net -- what it saw.
|
Package explain is the per-intent decision note a match record carries beside its log: who answered one decision, by which route, and -- for a search or a scoring net -- what it saw. |
|
forgeheuristic
Package forgeheuristic registers the Forge-derived experimental policy.
|
Package forgeheuristic registers the Forge-derived experimental policy. |
|
gonet/gonettest
Package gonettest writes a tiny, deterministic network file for tests.
|
Package gonettest writes a tiny, deterministic network file for tests. |
|
hosttest
Package hosttest holds the host-level gates of the hosted bot policies cmd/gorged links on top of bots/all (search, sb-search-lite-atk, sb-heuristic, sb-uniform, sb-first, cast-profile), run through the REAL host.
|
Package hosttest holds the host-level gates of the hosted bot policies cmd/gorged links on top of bots/all (search, sb-search-lite-atk, sb-heuristic, sb-uniform, sb-first, cast-profile), run through the REAL host. |
|
internal/simdk
Package simdk holds the width-generic AVX-512 kernels the bots' network forwards share: CPU feature detection, a register-blocked fp32 GEMM over pre-packed weight panels, LayerNorm and GELU.
|
Package simdk holds the width-generic AVX-512 kernels the bots' network forwards share: CPU feature detection, a register-blocked fp32 GEMM over pre-packed weight panels, LayerNorm and GELU. |
|
netsimd
Package netsimd is a SIMD forward pass for the mlp value network (bots/gonet's network file): the same arithmetic as gonet.Net.eval, with the weights laid out transposed and padded to 64 bytes per row so every layer runs as whole-layer AVX-512 kernels (kern_amd64.s), and a scalar Go fallback (kern_generic.go) with identical semantics for every other CPU.
|
Package netsimd is a SIMD forward pass for the mlp value network (bots/gonet's network file): the same arithmetic as gonet.Net.eval, with the weights laid out transposed and padded to 64 bytes per row so every layer runs as whole-layer AVX-512 kernels (kern_amd64.s), and a scalar Go fallback (kern_generic.go) with identical semantics for every other CPU. |
|
policynet
Package policynet is the feature layer of the learned per-option policy: a deterministic, dependency-light encoder from one seat's view.View plus its decision surface into fixed-width dense scalars and hashed sparse rows, and a streaming loader for the search-teacher label corpus (the search teacher -labels).
|
Package policynet is the feature layer of the learned per-option policy: a deterministic, dependency-light encoder from one seat's view.View plus its decision surface into fixed-width dense scalars and hashed sparse rows, and a streaming loader for the search-teacher label corpus (the search teacher -labels). |
|
sanity
Package sanity is the common-sense layer of the hand-written hosted bots.
|
Package sanity is the common-sense layer of the hand-written hosted bots. |
|
sbbuiltin
Package sbbuiltin hosts the three SpellBench builtin policies (sb-first, sb-uniform and sb-heuristic) behind one hosted adapter.
|
Package sbbuiltin hosts the three SpellBench builtin policies (sb-first, sb-uniform and sb-heuristic) behind one hosted adapter. |
|
sbsearch
Package sbsearch hosts the sb-search-lite-atk policy (docs/design/2026-09-28-hosted-bot-packages.md): the adapter over bots/spellbench/sbsearch.Seat, the honest determinized search that plays sb-tactical's pick unless a candidate it dealt four worlds for beats that pick by the margin (lite: W4, a 2-turn horizon with the material leaf, attacks searched).
|
Package sbsearch hosts the sb-search-lite-atk policy (docs/design/2026-09-28-hosted-bot-packages.md): the adapter over bots/spellbench/sbsearch.Seat, the honest determinized search that plays sb-tactical's pick unless a candidate it dealt four worlds for beats that pick by the margin (lite: W4, a 2-turn horizon with the material leaf, attacks searched). |
|
sbtactical
Package sbtactical hosts the sb-tactical policy (spec 2026-09-28-hosted-bot-packages §3.1): the adapter over internal/spellbench/builtins.NewTactical (the scored seat-visible heuristic behind SpellBench's sb-tactical arm) that rides the host's Env path for its planner and plays the plain View path everywhere else.
|
Package sbtactical hosts the sb-tactical policy (spec 2026-09-28-hosted-bot-packages §3.1): the adapter over internal/spellbench/builtins.NewTactical (the scored seat-visible heuristic behind SpellBench's sb-tactical arm) that rides the host's Env path for its planner and plays the plain View path everywhere else. |
|
search
Package search hosts the search-teacher policy (docs/design/2026-09-28-hosted-bot-packages.md): the adapter over searchseat.SearchBot that answers the covered kinds from the host's honest root and the seat's own observation feed, and plays the wrapped default bot everywhere else.
|
Package search hosts the search-teacher policy (docs/design/2026-09-28-hosted-bot-packages.md): the adapter over searchseat.SearchBot that answers the covered kinds from the host's honest root and the seat's own observation feed, and plays the wrapped default bot everywhere else. |
|
searchprobe
Package searchprobe contains the experimental history-conditioned search harness.
|
Package searchprobe contains the experimental history-conditioned search harness. |
|
searchseat
Package searchseat is the PIMC search teacher's decision function, shared by a label-corpus generator and any seat that plays the teacher's answer.
|
Package searchseat is the PIMC search teacher's decision function, shared by a label-corpus generator and any seat that plays the teacher's answer. |
|
spellbench
Package spellbench holds gorge's side of the SpellBench arena (github.com/jackmaiorino/spellbench): the benchmark deck catalogs gorge serves, and (later) the protocol adapters.
|
Package spellbench holds gorge's side of the SpellBench arena (github.com/jackmaiorino/spellbench): the benchmark deck catalogs gorge serves, and (later) the protocol adapters. |
|
spellbench/builtins
Package builtins ports SpellBench's three builtin bots -- uniform, heuristic and first (github.com/jackmaiorino/spellbench, python/spellbench/arena/bots/*.py for protocol v1 and python/spellbench/builtins/*.py on branch protocol-v2) -- onto gorge's decision model, so gorge can run a SpellBench-style workup natively (a bench runner -spellbench).
|
Package builtins ports SpellBench's three builtin bots -- uniform, heuristic and first (github.com/jackmaiorino/spellbench, python/spellbench/arena/bots/*.py for protocol v1 and python/spellbench/builtins/*.py on branch protocol-v2) -- onto gorge's decision model, so gorge can run a SpellBench-style workup natively (a bench runner -spellbench). |
|
spellbench/payexec
Package payexec lowers a gorge payment plan onto the manual mana surface.
|
Package payexec lowers a gorge payment plan onto the manual mana surface. |
|
spellbench/sbsearch
Package sbsearch is sb-search: determinized search over honest redealt worlds with sb-tactical as both the candidate prior and the rollout policy.
|
Package sbsearch is sb-search: determinized search over honest redealt worlds with sb-tactical as both the candidate prior and the rollout policy. |
|
traceboard
Package traceboard is the decision-trace board schema: the redacted, deterministic per-seat board snapshot the bot benchmark writes into every decision-trace record and the search teacher writes into every label record.
|
Package traceboard is the decision-trace board schema: the redacted, deterministic per-seat board snapshot the bot benchmark writes into every decision-trace record and the search teacher writes into every label record. |
|
Package cli is gorge's command-line layer: cobra/viper conventions built on the standard library alone (the root module has no requires; invariant 7).
|
Package cli is gorge's command-line layer: cobra/viper conventions built on the standard library alone (the root module has no requires; invariant 7). |
|
cmd
|
|
|
cardfuzz
command
Command cardfuzz plays bot-vs-bot games between randomly generated mono-colour decks drawn from the whole supported corpus, to surface engine panics, livelocks, submit errors and replay divergences that the curated repo decks never reach.
|
Command cardfuzz plays bot-vs-bot games between randomly generated mono-colour decks drawn from the whole supported corpus, to surface engine panics, livelocks, submit errors and replay divergences that the curated repo decks never reach. |
|
checkratchet
command
Command checkratchet refuses a pull request that lowers a shrink-only ratchet.
|
Command checkratchet refuses a pull request that lowers a shrink-only ratchet. |
|
codeshape
command
Command codeshape prints the rules engine's code-shape metrics (internal/codeshape): functions over 300 lines in engine/rules/ and engine/effects/, Engine method count, effects.Host width, effects.Ctx and resumePoint field counts, string-literal Params reads and case literals, and the effects.Ctx / SpecContext / TriggerContext composite literals outside the context-constructor files.
|
Command codeshape prints the rules engine's code-shape metrics (internal/codeshape): functions over 300 lines in engine/rules/ and engine/effects/, Engine method count, effects.Host width, effects.Ctx and resumePoint field counts, string-literal Params reads and case literals, and the effects.Ctx / SpecContext / TriggerContext composite literals outside the context-constructor files. |
|
deckimport
command
Command deckimport turns a plain-text decklist into a repo deck file (the {name, count} JSON that testkit/testutil/decks/*.json already holds) and reports, card by card, what the corpus is missing — the gap that otherwise only surfaces at runtime, mid-deal, when the deck cannot be dealt.
|
Command deckimport turns a plain-text decklist into a repo deck file (the {name, count} JSON that testkit/testutil/decks/*.json already holds) and reports, card by card, what the corpus is missing — the gap that otherwise only surfaces at runtime, mid-deal, when the deck cannot be dealt. |
|
deckpool
command
Command deckpool drafts seeded 8-seat pods with bot drafters, builds each seat's 40-card deck with a bot builder and writes every deck as a loadable deck file, plus an index (decks.jsonl), the seat pairs (pairs.tsv), a pool.tsv naming every deck and a manifest (manifest.json), under --out.
|
Command deckpool drafts seeded 8-seat pods with bot drafters, builds each seat's 40-card deck with a bot builder and writes every deck as a loadable deck file, plus an index (decks.jsonl), the seat pairs (pairs.tsv), a pool.tsv naming every deck and a manifest (manifest.json), under --out. |
|
draftres
command
Command draftres is the draft-research harness: it drafts 8-seat pods with a mix of drafter variants (seat s of pod i plays variant (s+i) mod K), builds every pool with one or more builders, writes decks, pool.tsv and a pairs.tsv of cross-label games (both seat orders), plays them in dirac's dplay (hbot vs hbot, lockstep-autopay, refused cards skipped) and prints each label's win rate with a 95% pod-bootstrap interval.
|
Command draftres is the draft-research harness: it drafts 8-seat pods with a mix of drafter variants (seat s of pod i plays variant (s+i) mod K), builds every pool with one or more builders, writes decks, pool.tsv and a pairs.tsv of cross-label games (both seat orders), plays them in dirac's dplay (hbot vs hbot, lockstep-autopay, refused cards skipped) and prints each label's win rate with a 95% pod-bootstrap interval. |
|
draftsim
command
Command draftsim runs headless draft pods: 4 or 8 seats draft (or open sealed packs) with draft/limited/pickbot, every seat builds its deck, and the pod's series are played as Bo1 games through the rules engine the way cmd/mtgsim drives one — round robin by default, Swiss with -structure swiss, or build-only with -structure none — with -verify replaying each event from its own log.
|
Command draftsim runs headless draft pods: 4 or 8 seats draft (or open sealed packs) with draft/limited/pickbot, every seat builds its deck, and the pod's series are played as Bo1 games through the rules engine the way cmd/mtgsim drives one — round robin by default, Swiss with -structure swiss, or build-only with -structure none — with -verify replaying each event from its own log. |
|
enginebench
command
Command enginebench measures gorge on a fixed set of rows: random play turns/s on two FDN pairs and the Pauper Burn mirror, the heuristic bot's games/s, Engine.Clone cost on a mid-game state, one search step (Clone + Submit), and the built-in searches' per-thread rates.
|
Command enginebench measures gorge on a fixed set of rows: random play turns/s on two FDN pairs and the Pauper Burn mirror, the heuristic bot's games/s, Engine.Clone cost on a mid-game state, one search step (Clone + Submit), and the built-in searches' per-thread rates. |
|
extagent
command
Command extagent runs gorge's reference gorge-agent/1 agent as a process: over stdin/stdout by default, or on a Unix socket with -listen.
|
Command extagent runs gorge's reference gorge-agent/1 agent as a process: over stdin/stdout by default, or on a Unix socket with -listen. |
|
forgec
command
Command forgec fetches the Forge card corpus, compiles it into mtgcore's IR cache, and reports how much of it the engine can currently play.
|
Command forgec fetches the Forge card corpus, compiles it into mtgcore's IR cache, and reports how much of it the engine can currently play. |
|
gcgate
command
Command gcgate runs a package's test binary under a garbage-collector budget and fails when the collector eats more than its share of the CPU.
|
Command gcgate runs a package's test binary under a garbage-collector budget and fails when the collector eats more than its share of the CPU. |
|
gentypes
command
Command gentypes writes web/src/protocol.ts from package protocol's structs.
|
Command gentypes writes web/src/protocol.ts from package protocol's structs. |
|
gorged
command
Command gorged serves bot tables, play-vs-bot, spectating and, with -events, draft events to a browser: the reference server (server/gorged), and the binary the demo deploys (scripts/deploy-demo.sh).
|
Command gorged serves bot tables, play-vs-bot, spectating and, with -events, draft events to a browser: the reference server (server/gorged), and the binary the demo deploys (scripts/deploy-demo.sh). |
|
headdiff
command
Command headdiff shows WHAT moved a golden acceptance chain head, instead of four changed hashes.
|
Command headdiff shows WHAT moved a golden acceptance chain head, instead of four changed hashes. |
|
kcensus
command
Command kcensus is a mechanic census: it loads a deck pool, resolves every distinct card through the compiled corpus, tabulates the mechanics each card reaches (API codes along every Sub/trigger/replacement/SVar chain, trigger modes, static modes, replacement events, keyword heads, mana-cost class and non-mana cost tokens) and prints the smallest mechanic set that fully covers 50/80/95/100% of the decks, plus the share of decks that need the general layer, replacement, copy or control machinery.
|
Command kcensus is a mechanic census: it loads a deck pool, resolves every distinct card through the compiled corpus, tabulates the mechanics each card reaches (API codes along every Sub/trigger/replacement/SVar chain, trigger modes, static modes, replacement events, keyword heads, mana-cost class and non-mana cost tokens) and prints the smallest mechanic set that fully covers 50/80/95/100% of the decks, plus the share of decks that need the general layer, replacement, copy or control machinery. |
|
keywordbench
command
Command keywordbench measures keyword presence separately from event-log use.
|
Command keywordbench measures keyword presence separately from event-log use. |
|
labdemo
command
Command labdemo runs the draft-lab example workflow: play some random-deck games, freeze the player policy, build decks from sealed pools, draft 8-seat pods under Swiss, and gauntlet the built decks against a spellbench catalog — writing every 17Lands-shaped artifact to -out when it is set, and a summary to stdout either way.
|
Command labdemo runs the draft-lab example workflow: play some random-deck games, freeze the player policy, build decks from sealed pools, draft 8-seat pods under Swiss, and gauntlet the built decks against a spellbench catalog — writing every 17Lands-shaped artifact to -out when it is set, and a summary to stdout either way. |
|
mtgsim
command
Command mtgsim plays headless games between heuristic.Bot instances over the repo's 12 Legacy decks and verifies that each one replays to the same event chain: a way to run many real games with no client, no network and no wall clock in the loop.
|
Command mtgsim plays headless games between heuristic.Bot instances over the repo's 12 Legacy decks and verifies that each one replays to the same event chain: a way to run many real games with no client, no network and no wall clock in the loop. |
|
paymirror
command
Command paymirror plays auto-pay bot games over the repo decks and mirror- checks every planned cast: at each priority decision where a bot submits a payment-plan intent, a pre-submit clone reproduces the same cast manually (floating each planned source through the ordinary priority "activate" option, then casting and replaying the planned run's follow-up answers) and the two engines are compared for state equivalence (testkit/paymirror).
|
Command paymirror plays auto-pay bot games over the repo decks and mirror- checks every planned cast: at each priority decision where a bot submits a payment-plan intent, a pre-submit clone reproduces the same cast manually (floating each planned source through the ordinary priority "activate" option, then casting and replaying the planned run's follow-up answers) and the two engines are compared for state equivalence (testkit/paymirror). |
|
pkgmap
command
Command pkgmap generates the public docs site's package map (docs/site/architecture/packages.md includes its output): one markdown table per tier listing every Go package in the module with its one-line purpose, its non-test and test line counts, its in-repo reverse importers and its status, followed by a mermaid tier-dependency summary built from the actual imports.
|
Command pkgmap generates the public docs site's package map (docs/site/architecture/packages.md includes its output): one markdown table per tier listing every Go package in the module with its one-line purpose, its non-test and test line counts, its in-repo reverse importers and its status, followed by a mermaid tier-dependency summary built from the actual imports. |
|
recstream
command
Command recstream converts JSON Lines record history to and from the condensed form of package testkit/recstream (delta frames, keyframes, gzip), and reads any of the forms.
|
Command recstream converts JSON Lines record history to and from the condensed form of package testkit/recstream (delta frames, keyframes, gzip), and reads any of the forms. |
|
repro
command
Command repro turns a feedback snapshot directory — the match.json / log.json / view.json (plus report.json) a gorged server's feedback capture writes beside a bug report — into a working reproduction:
|
Command repro turns a feedback snapshot directory — the match.json / log.json / view.json (plus report.json) a gorged server's feedback capture writes beside a bug report — into a working reproduction: |
|
spellbench-gorge-agent
command
Command spellbench-gorge-agent serves gorge's registered bot policies in the Spellbench v2 agent role over stdio.
|
Command spellbench-gorge-agent serves gorge's registered bot policies in the Spellbench v2 agent role over stdio. |
|
spellbench-gorge-env
command
Command spellbench-gorge-env serves the Spellbench v2 environment role over stdio.
|
Command spellbench-gorge-env serves the Spellbench v2 environment role over stdio. |
|
testbudget
command
Command testbudget enforces the per-test budget: every single test fits 4 GB RSS, 4 vCPU and 1 minute wall.
|
Command testbudget enforces the per-test budget: every single test fits 4 GB RSS, 4 vCPU and 1 minute wall. |
|
Package dirac is a second Magic rules engine, also called the kernel: a 2-player game as a State (clone with CopyFrom; go vet rejects an assignment) driven as a Step/Apply state machine over a kop.Table of cards.
|
Package dirac is a second Magic rules engine, also called the kernel: a 2-player game as a State (clone with CopyFrom; go vet rejects an assignment) driven as a Step/Apply state machine over a kop.Table of cards. |
|
adapter
Package adapter serves dirac behind the host's game interfaces with no rules engine beside it.
|
Package adapter serves dirac behind the host's game interfaces with no rules engine beside it. |
|
canon
Package canon is the vocabulary both engines' decisions are compared in, and the translation of the kernel's actions into it.
|
Package canon is the vocabulary both engines' decisions are compared in, and the translation of the kernel's actions into it. |
|
cardset
Package cardset is the engine-neutral interface over a card pool and the way to one: ByName serves the binary tables dirac/kgen writes (load.go).
|
Package cardset is the engine-neutral interface over a card pool and the way to one: ByName serves the binary tables dirac/kgen writes (load.go). |
|
cardset/cardsettest
Package cardsettest is a test's door to card sets.
|
Package cardsettest is a test's door to card sets. |
|
cmd/dplay
command
Command dplay plays dirac games with no other engine in the loop and reports them: one JSON line per game and a summary.
|
Command dplay plays dirac games with no other engine in the loop and reports them: one JSON line per game and a summary. |
|
cmd/kgen
command
Command kgen compiles card pools from gorge's compiled card IR into the dirac kernel's binary tables.
|
Command kgen compiles card pools from gorge's compiled card IR into the dirac kernel's binary tables. |
|
cmd/kmanifest
command
Command kmanifest keeps dirac's namespace manifest (dirac/manifest, one file per vocabulary code) and the Go it generates.
|
Command kmanifest keeps dirac's namespace manifest (dirac/manifest, one file per vocabulary code) and the Go it generates. |
|
cmd/sbv2dirac
command
Command sbv2dirac serves the engine role of SpellBench v2 with the dirac kernel as the authority for game flow, reading NDJSON requests on stdin and writing responses on stdout.
|
Command sbv2dirac serves the engine role of SpellBench v2 with the dirac kernel as the authority for game flow, reading NDJSON requests on stdin and writing responses on stdout. |
|
cmd/sbv2dirac/sbv2
Package sbv2 serves the ENGINE role of SpellBench protocol v2 with the dirac kernel (dirac.State) as the authority for game flow.
|
Package sbv2 serves the ENGINE role of SpellBench protocol v2 with the dirac kernel (dirac.State) as the authority for game flow. |
|
cmd/shadowbench
command
Command shadowbench plays the dirac shadow seat (dirac/shadowseat) against the heuristic bot in gorge games, gorge being the host, and prints one JSON line: how often the seat staged, why it fell back, and its win rate with a Wilson interval.
|
Command shadowbench plays the dirac shadow seat (dirac/shadowseat) against the heuristic bot in gorge games, gorge being the host, and prints one JSON line: how often the seat staged, why it fell back, and its win rate with a Wilson interval. |
|
feat
Package feat encodes a kernel position into the network inputs gorge's bots/policynet produces for the same position under FeaturesEntity (the entity network's feature set): the state (92 dense scalars, the sorted hashed sparse bag, one entity card per visible card) and one option encoding per decision option -- byte-for-byte what policynet.EncodeStateWith and EncodeOptionsWith produce from gorge's redacted view.View of the deciding seat.
|
Package feat encodes a kernel position into the network inputs gorge's bots/policynet produces for the same position under FeaturesEntity (the entity network's feature set): the state (92 dense scalars, the sorted hashed sparse bag, one entity card per visible card) and one option encoding per decision option -- byte-for-byte what policynet.EncodeStateWith and EncodeOptionsWith produce from gorge's redacted view.View of the deciding seat. |
|
kgen
The gap-4 keyword wave's four expanded heads (Soulshift, Reinforce, Embalm, Eternalize) registered in kwHandlers instead of a case in lowerKeywords' switch.
|
The gap-4 keyword wave's four expanded heads (Soulshift, Reinforce, Embalm, Eternalize) registered in kwHandlers instead of a case in lowerKeywords' switch. |
|
kop
Package kop is dirac's card-effect vocabulary: the op enum generated and hand-written card tables target, and the Table / CardDef / Ability / Instr types they are written in.
|
Package kop is dirac's card-effect vocabulary: the op enum generated and hand-written card tables target, and the Table / CardDef / Ability / Instr types they are written in. |
|
lab
Package lab is a small wrapper for playing games and setting up experiments on dirac, with no other engine in the loop.
|
Package lab is a small wrapper for playing games and setting up experiments on dirac, with no other engine in the loop. |
|
manifest
Package manifest reads and checks dirac's namespace manifest: one small file per vocabulary code, under dirac/manifest/<Family>/<GoName>, that gives the code its value once and for all.
|
Package manifest reads and checks dirac's namespace manifest: one small file per vocabulary code, under dirac/manifest/<Family>/<GoName>, that gives the code its value once and for all. |
|
neteval
Package neteval is dirac/search's network Evaluator: the dirac/feat encoder (policynet FeaturesEntity inputs from a dirac position) feeding one of two in-process backends, picked when the weights load:
|
Package neteval is dirac/search's network Evaluator: the dirac/feat encoder (policynet FeaturesEntity inputs from a dirac position) feeding one of two in-process backends, picked when the weights load: |
|
oracle
Package oracle runs gorge (github.com/adams-shaun/gorge) and dirac (package dirac) in lockstep: the same decks and seed, the same canonicalised option list at every decision, the same canonical state projection after every action gorge commits.
|
Package oracle runs gorge (github.com/adams-shaun/gorge) and dirac (package dirac) in lockstep: the same decks and seed, the same canonicalised option list at every decision, the same canonical state projection after every action gorge commits. |
|
oracle/cmd/cardaudit
command
Command cardaudit writes one row a card joining gorge's claim, dirac's support lists and sidecar, and the optional hunt ledgers.
|
Command cardaudit writes one row a card joining gorge's claim, dirac's support lists and sidecar, and the optional hunt ledgers. |
|
oracle/cmd/kfuzz
command
Command kfuzz plays random generated-set pairings with gorge and a kernel in lockstep (dirac/oracle) and stops at the first divergence, writing its shrunk repro.
|
Command kfuzz plays random generated-set pairings with gorge and a kernel in lockstep (dirac/oracle) and stops at the first divergence, writing its shrunk repro. |
|
oracle/cmd/khbot
command
Command khbot measures a kernel search bot against the bot it ports, gorge's heuristic autopay bot: FDN pool pairings played in lockstep (gorge and the kernel), gorge's bot choosing every action on gorge, the kernel bot asked the same decisions on the kernel's state (oracle.HBotParityGame).
|
Command khbot measures a kernel search bot against the bot it ports, gorge's heuristic autopay bot: FDN pool pairings played in lockstep (gorge and the kernel), gorge's bot choosing every action on gorge, the kernel bot asked the same decisions on the kernel's state (oracle.HBotParityGame). |
|
oracle/cmd/ksbt
command
Command ksbt measures the kernel's sbt agent (dirac/oracle.SBT) against gorge's sb-tactical: FDN pool pairings played in lockstep (gorge and the kernel), sb-tactical choosing every action on gorge, the agent asked the same decisions on the kernel's state (oracle.SBTParityGame).
|
Command ksbt measures the kernel's sbt agent (dirac/oracle.SBT) against gorge's sb-tactical: FDN pool pairings played in lockstep (gorge and the kernel), sb-tactical choosing every action on gorge, the agent asked the same decisions on the kernel's state (oracle.SBTParityGame). |
|
search
Package search is gorge bots/azmcts's AlphaZero search ported onto dirac state, for the production config az:sims=100:autopay:oppnodes:oppfull: morekinds:closedlist:topk=6 (DefaultOptions).
|
Package search is gorge bots/azmcts's AlphaZero search ported onto dirac state, for the production config az:sims=100:autopay:oppnodes:oppfull: morekinds:closedlist:topk=6 (DefaultOptions). |
|
search/hbot
Package hbot is gorge's heuristic bot with auto-pay mana (bots/heuristic.Bot.EnableAutoPayMana over bots/botpolicy.Decide, the bot bots/azmcts's autopay walk asks for both seats) ported natively onto kernel state: the kernel search's Bot (dirac/search.Bot), answering every decision the tree does not search and supplying candidate 0 at every searched point.
|
Package hbot is gorge's heuristic bot with auto-pay mana (bots/heuristic.Bot.EnableAutoPayMana over bots/botpolicy.Decide, the bot bots/azmcts's autopay walk asks for both seats) ported natively onto kernel state: the kernel search's Bot (dirac/search.Bot), answering every decision the tree does not search and supplying candidate 0 at every searched point. |
|
search/mull
Package mull is gorge's London-mulligan policies (bots/botpolicy/mulligan.go, mulligan_constructed.go, mulligan_registry.go) ported natively onto kernel card facts, the way dirac/search/hbot ports the auto-pay bot: the kernel Decision is not gorge's decision.Decision, so the policies cannot be called directly and the logic is ported, not the types.
|
Package mull is gorge's London-mulligan policies (bots/botpolicy/mulligan.go, mulligan_constructed.go, mulligan_registry.go) ported natively onto kernel card facts, the way dirac/search/hbot ports the auto-pay bot: the kernel Decision is not gorge's decision.Decision, so the policies cannot be called directly and the logic is ported, not the types. |
|
shadow
Package shadow stages a dirac State from what a seat can see.
|
Package shadow stages a dirac State from what a seat can see. |
|
shadowseat
Package shadowseat is a gorge seat.Seat that plays by searching on dirac.
|
Package shadowseat is a gorge seat.Seat that plays by searching on dirac. |
|
vanilla
Package vanilla is a hand-written kernel card table for phase-1 tests: basic lands, vanilla and keyword creatures across keyword combinations, burn, removal, a pump, a token maker, a draw spell, a counter spell, a +1/+1-counter spell, ETB- and dies-trigger creatures, and four synthetic 40-card decks built from them.
|
Package vanilla is a hand-written kernel card table for phase-1 tests: basic lands, vanilla and keyword creatures across keyword combinations, burn, removal, a pump, a token maker, a draw spell, a counter spell, a +1/+1-counter spell, ETB- and dies-trigger creatures, and four synthetic 40-card decks built from them. |
|
draft
|
|
|
draftlab
Package draftlab is the Go composition API a training program imports (draft events): open a card corpus, resolve built-in drafters, builders and players by name@version, open packs (pod, flat, sealed pool), run a draft of 4 or 8 seats into pools plus a replayable event log, and turn pools or lists into engine-loadable decks.
|
Package draftlab is the Go composition API a training program imports (draft events): open a card corpus, resolve built-in drafters, builders and players by name@version, open packs (pod, flat, sealed pool), run a draft of 4 or 8 seats into pools plus a replayable event log, and turn pools or lists into engine-loadable decks. |
|
draftlab/extern
Package extern connects gorge to out-of-process Magic agents over the gorge-agent/1 wire: one dialed session (a child's stdio or a Unix socket) serves any number of concurrent games, batched by the process-wide hub.
|
Package extern connects gorge to out-of-process Magic agents over the gorge-agent/1 wire: one dialed session (a child's stdio or a Unix socket) serves any number of concurrent games, batched by the process-wide hub. |
|
draftlab/extern/refagent
Package refagent is gorge's reference gorge-agent/1 agent: a small uniform-random, first-legal (and deliberately illegal, for tests) agent used by tests, benchmarks and as a worked example of the wire.
|
Package refagent is gorge's reference gorge-agent/1 agent: a small uniform-random, first-legal (and deliberately illegal, for tests) agent used by tests, benchmarks and as a worked example of the wire. |
|
draftlab/extern/wire
Package wire is the gorge-agent/1 wire: the JSON-lines messages an out-of-process drafter, builder or player speaks with gorge.
|
Package wire is the gorge-agent/1 wire: the JSON-lines messages an out-of-process drafter, builder or player speaks with gorge. |
|
event
Package event implements the draft-event lifecycle: the LOBBY → DRAFT → BUILD → ROUND(1..3) → COMPLETE state machine, the append-only log with its Apply mutator, the circle-method pairings, the MTR Appendix C standings and the 17Lands draft-data export.
|
Package event implements the draft-event lifecycle: the LOBBY → DRAFT → BUILD → ROUND(1..3) → COMPLETE state machine, the append-only log with its Apply mutator, the circle-method pairings, the MTR Appendix C standings and the 17Lands draft-data export. |
|
eventhost
Package eventhost is the draft-event runtime that lives inside gorged: the event store (<dir>/events/<id>/event.json + log.jsonl), create and join, the DRAFT phase (humans pick over the API, bots pick synchronously and deterministically between their picks), BUILD, the rounds on host tables, per-event SSE frames, and restart resume for every phase.
|
Package eventhost is the draft-event runtime that lives inside gorged: the event store (<dir>/events/<id>/event.json + log.jsonl), create and join, the DRAFT phase (humans pick over the API, bots pick synchronously and deterministically between their picks), BUILD, the rounds on host tables, per-event SSE frames, and restart resume for every phase. |
|
gorgedevents
Package gorgedevents plugs the draft-event runtime (draft/eventhost) into gorge's reference server through gorged.EventsPlugin: a binary that links it passes Plugin{} in gorged.Extensions.Events, and -events then serves 4-seat draft events under /api/events with persistence under <dir>/events.
|
Package gorgedevents plugs the draft-event runtime (draft/eventhost) into gorge's reference server through gorged.EventsPlugin: a binary that links it passes Plugin{} in gorged.Extensions.Events, and -events then serves 4-seat draft events under /api/events with persistence under <dir>/events. |
|
limited
Package limited holds the shared types of the draft stack: the pure vocabulary every draft/limited/ package (booster, draft, build, pickbot) speaks.
|
Package limited holds the shared types of the draft stack: the pure vocabulary every draft/limited/ package (booster, draft, build, pickbot) speaks. |
|
limited/booster
Package booster opens seeded packs from a draft/limited/setdata Spec's MTGJSON collation config: it picks a pack variant by weight, fills each contents sheet by the cards' collation weights, never puts the same card name twice in one pack, honours a sheet's allow_duplicates and fixed flags, and colour-balances the sheets marked balance_colors.
|
Package booster opens seeded packs from a draft/limited/setdata Spec's MTGJSON collation config: it picks a pack variant by weight, fills each contents sheet by the cards' collation weights, never puts the same card name twice in one pack, honours a sheet's allow_duplicates and fixed flags, and colour-balances the sheets marked balance_colors. |
|
limited/build
Package build turns a drafted pool into an engine-loadable deck.
|
Package build turns a drafted pool into an engine-loadable deck. |
|
limited/draft
Package draft runs an N-seat (2..8) booster-draft state machine — the pure half of a pod; the hosted pod is 4 seats × 3 rounds.
|
Package draft runs an N-seat (2..8) booster-draft state machine — the pure half of a pod; the hosted pod is 4 seats × 3 rounds. |
|
limited/pickbot
Package pickbot answers a draft's pick and build decisions the way a bot seat does: the rating-colour Drafter and the best23 Builder, plus the committed/Balanced pair named `balanced`.
|
Package pickbot answers a draft's pick and build decisions the way a bot seat does: the rating-colour Drafter and the best23 Builder, plus the committed/Balanced pair named `balanced`. |
|
limited/pickbot/internal/gentrk
command
Command gentrk regenerates draft/limited/pickbot/ratings/TRK.json, the TRK draft-bot rating file, from the published simulated card-strength list docs/site/research/card-strength/TRK.csv (list trk-nonet-11k).
|
Command gentrk regenerates draft/limited/pickbot/ratings/TRK.json, the TRK draft-bot rating file, from the published simulated card-strength list docs/site/research/card-strength/TRK.csv (list trk-nonet-11k). |
|
limited/setdata
regenerate.go carries the go:generate directive that refreshes the embedded set specs.
|
regenerate.go carries the go:generate directive that refreshes the embedded set specs. |
|
limited/setdata/internal/gen
command
Command gen regenerates the embedded per-set booster specs in draft/limited/setdata/sets from the trimmed MTGJSON booster inputs in limited/setdata/mtgjson.
|
Command gen regenerates the embedded per-set booster specs in draft/limited/setdata/sets from the trimmed MTGJSON booster inputs in limited/setdata/mtgjson. |
|
engine
|
|
|
cards
Package cards compiles Forge card scripts into the engine's card IR.
|
Package cards compiles Forge card scripts into the engine's card IR. |
|
cards/oracletext
Package oracletext renders the printed-card view of a corpus card -- what a player can read, never the Forge script -- for the Oracle-text card audit (docs/design/2026-09-27-oracle-text-card-audit.md).
|
Package oracletext renders the printed-card view of a corpus card -- what a player can read, never the Forge script -- for the Oracle-text card audit (docs/design/2026-09-27-oracle-text-card-audit.md). |
|
decision
Package decision defines the only vocabulary a client needs: the engine asks a Decision listing every legal Option, and the client answers with an Intent naming option indices.
|
Package decision defines the only vocabulary a client needs: the engine asks a Decision listing every legal Option, and the client answers with an Intent naming option indices. |
|
deck
Package deck reads the repo's deck-list JSON — a bare {name, count} card list — and resolves it against a cards.Registry into the flat, repeated []*cards.Card that rules.Config.Decks wants.
|
Package deck reads the repo's deck-list JSON — a bare {name, count} card list — and resolves it against a cards.Registry into the flat, repeated []*cards.Card that rules.Config.Decks wants. |
|
effects
Package effects implements the primitives Forge card scripts reference: the api: effects (DealDamage, Draw, ChangeZone, Pump, Token, ...), the filter language that matches cards and players (ValidTgts$, Defined$, Affected$), and the count: value expressions (Count$..., SVar amounts).
|
Package effects implements the primitives Forge card scripts reference: the api: effects (DealDamage, Draw, ChangeZone, Pump, Token, ...), the filter language that matches cards and players (ValidTgts$, Defined$, Affected$), and the count: value expressions (Count$..., SVar amounts). |
|
effects/params
Package params is the leaf home of the compiled ability-parameter records that both the resolution (package effects) and the payment layer (engine/rules/pay) read: the mana production record (ManaOf), the generic targeting tier (TargetsOf), the Defined-reference tier (DefinedOf, Ref) and api:DealDamage's record (DealDamageOf), plus the pure Produced$ Combo classifier (ComboColours).
|
Package params is the leaf home of the compiled ability-parameter records that both the resolution (package effects) and the payment layer (engine/rules/pay) read: the mana production record (ManaOf), the generic targeting tier (TargetsOf), the Defined-reference tier (DefinedOf, Ref) and api:DealDamage's record (DealDamageOf), plus the pure Produced$ Combo classifier (ComboColours). |
|
eventdiff
Package eventdiff compares two event streams and names the first event where they part ways.
|
Package eventdiff compares two event streams and names the first event where they part ways. |
|
events
Event folds for the stack and casting: CastInfo, Resolve, Priority, Choose answers and SVar storage.
|
Event folds for the stack and casting: CastInfo, Resolve, Priority, Choose answers and SVar storage. |
|
game
Package game is what a host needs from a running game: the board and log it projects from, the decision it poses, the answer it submits.
|
Package game is what a host needs from a running game: the board and log it projects from, the decision it poses, the answer it submits. |
|
game/gorgegame
Package gorgegame runs engine/rules behind the game interfaces.
|
Package gorgegame runs engine/rules behind the game interfaces. |
|
replay
Package replay re-executes a match from its recorded event log and verifies the rebuilt event stream against the one on file, naming the first sequence number where they part ways.
|
Package replay re-executes a match from its recorded event log and verifies the rebuilt event stream against the one on file, naming the first sequence number where they part ways. |
|
rules
Package rules is the authoritative rules engine: turn structure, priority, casting and the stack, combat, triggers, replacement effects, the layer system, mana payment and state-based actions.
|
Package rules is the authoritative rules engine: turn structure, priority, casting and the stack, combat, triggers, replacement effects, the layer system, mana payment and state-based actions. |
|
rules/chars
Package chars is the read-only characteristic computation of CR 613: the layer walk that turns an object's printed face and the active continuous effects into its current characteristics (effects.Chars).
|
Package chars is the read-only characteristic computation of CR 613: the layer walk that turns an object's printed face and the active continuous effects into its current characteristics (effects.Chars). |
|
rules/combat
defender.go implements the CanAttackDefender permission static (CR 702.3b's effect half: "can attack as though it didn't have defender").
|
defender.go implements the CanAttackDefender permission static (CR 702.3b's effect half: "can attack as though it didn't have defender"). |
|
rules/cost
Package cost is the cost vocabulary every rules subsystem shares: the parsed Cost and its CostPart components, the Forge cost-string parsers (ParseCost, the strict ParseUnlessCost), the client-notation and prose renderers (FormatCost, CostPhrase) and the pure predicates and arithmetic over a Cost (CMC, WithX, Plus, Priceable, HasNonMana, the mana-symbol helpers).
|
Package cost is the cost vocabulary every rules subsystem shares: the parsed Cost and its CostPart components, the Forge cost-string parsers (ParseCost, the strict ParseUnlessCost), the client-notation and prose renderers (FormatCost, CostPhrase) and the pure predicates and arithmetic over a Cost (CMC, WithX, Plus, Priceable, HasNonMana, the mana-symbol helpers). |
|
rules/pay
Package pay is the payment-planning layer of the rules engine: the planner's vocabulary -- a source's Alt alternatives, the Consequence an activation carries, the lexicographic Rank that orders plans, the Witness a chosen plan discloses -- and its bounded, rank-aware Search over classes of interchangeable source units.
|
Package pay is the payment-planning layer of the rules engine: the planner's vocabulary -- a source's Alt alternatives, the Consequence an activation carries, the lexicographic Rank that orders plans, the Witness a chosen plan discloses -- and its bounded, rank-aware Search over classes of interchangeable source units. |
|
rules/resolve
Package resolve is the resolution kernel of the rules engine: checkpoint at the intent boundary that begins a resolution, and answer every decision posed while that resolution is in progress by re-executing it from the checkpoint with the recorded intents as an answer tape.
|
Package resolve is the resolution kernel of the rules engine: checkpoint at the intent boundary that begins a resolution, and answer every decision posed while that resolution is in progress by re-executing it from the checkpoint with the recorded intents as an answer tape. |
|
rules/scriptfacts
Package scriptfacts holds the pure facts a card's PRINTED text and compiled Forge script imply, derived without evaluating any game state: the printed keyword-head summary the priority walk reads off a hand card, the foretell alternative cost, a trigger's Redis 603.5 optionality, the number of turns an ability's SkipTurn rider takes, and the triggered ability a granted keyword line mints.
|
Package scriptfacts holds the pure facts a card's PRINTED text and compiled Forge script imply, derived without evaluating any game state: the printed keyword-head summary the priority walk reads off a hand card, the foretell alternative cost, a trigger's Redis 603.5 optionality, the number of turns an ability's SkipTurn rider takes, and the triggered ability a granted keyword line mints. |
|
rules/trigmatch
Package trigmatch is the trigger-mode matching layer of the rules engine: the Mode$ registry (one matcher per trigger mode, registered from each mode's file) and the per-mode predicates that decide whether one compiled cards.Trigger fires for one events.Event.
|
Package trigmatch is the trigger-mode matching layer of the rules engine: the Mode$ registry (one matcher per trigger mode, registered from each mode's file) and the per-mode predicates that decide whether one compiled cards.Trigger fires for one events.Event. |
|
seat
Package seat is who answers the engine's decisions.
|
Package seat is who answers the engine's decisions. |
|
state
ContinuousEffect and its Layer/Sublayer vocabulary live in state, below effects and rules, purely so effects primitives (Pump, PumpAll, Animate, Protection -- see mtgcore/effects/combatfx.go) can build one and hand it to rules.Engine through the effects.Host interface without effects ever importing rules (the dependency order is cards -> state -> decision -> events -> effects -> rules -> view -> seat -> replay -> cmd/*, and effects must never import rules).
|
ContinuousEffect and its Layer/Sublayer vocabulary live in state, below effects and rules, purely so effects primitives (Pump, PumpAll, Animate, Protection -- see mtgcore/effects/combatfx.go) can build one and hand it to rules.Engine through the effects.Host interface without effects ever importing rules (the dependency order is cards -> state -> decision -> events -> effects -> rules -> view -> seat -> replay -> cmd/*, and effects must never import rules). |
|
view
Package view projects one seat's view of a state.Game: a hidden zone contributes a count and nothing else unless the viewer owns it, another seat's decision is never attached, and everything that can or will hit the stack is described for every seat.
|
Package view projects one seat's view of a state.Game: a hidden zone contributes a count and nothing else unless the viewer owns it, another seat's decision is never attached, and everything that can or will hit the stack is described for every seat. |
|
internal
|
|
|
archtest
Package archtest holds no code, only tests that walk the module's import graph and fail when a dependency-order or determinism constraint from the engine spec is broken: time outside the host, effects importing rules, the wire types importing the engine, the host importing test fixtures.
|
Package archtest holds no code, only tests that walk the module's import graph and fail when a dependency-order or determinism constraint from the engine spec is broken: time outside the host, effects importing rules, the wire types importing the engine, the host importing test fixtures. |
|
codeshape
Package codeshape measures the shape of the rules engine's code: how long its functions are, how wide its interfaces and context structs are, and how much of its behaviour is still keyed on string literals.
|
Package codeshape measures the shape of the rules engine's code: how long its functions are, how wide its interfaces and context structs are, and how much of its behaviour is still keyed on string literals. |
|
schemacheck
Package schemacheck validates JSON documents against a directory of JSON Schema files that refer to each other by relative name.
|
Package schemacheck validates JSON documents against a directory of JSON Schema files that refer to each other by relative name. |
|
testbudget
Package testbudget stores per-test-binary peak RSS records.
|
Package testbudget stores per-test-binary peak RSS records. |
|
tsgen
Package tsgen turns Go structs into TypeScript interfaces from their SOURCE, type-checked with go/types (no runtime reflection): json tags name the fields, omitempty makes them optional, pointers admit null, slices become arrays, string-keyed maps become Records.
|
Package tsgen turns Go structs into TypeScript interfaces from their SOURCE, type-checked with go/types (no runtime reflection): json tags name the fields, omitempty makes them optional, pointers admit null, slices become arrays, string-keyed maps become Records. |
|
server
|
|
|
divergence
Package divergence holds the record types and comparison predicates of the human-divergence capture (design: docs/design/2026-10-10-human-divergence-design.md).
|
Package divergence holds the record types and comparison predicates of the human-divergence capture (design: docs/design/2026-10-10-human-divergence-design.md). |
|
divergence/shadow
Package shadow computes the shadow answer B of the human-divergence capture (design 2026-10-10-human-divergence-design.md §3, §5.4): the intent a fresh, deterministically seeded instance of a hosted bot policy would give at an engine's pending decision, built from exactly the inputs the host's dispatch hands that policy.
|
Package shadow computes the shadow answer B of the human-divergence capture (design 2026-10-10-human-divergence-design.md §3, §5.4): the intent a fresh, deterministically seeded instance of a hosted bot policy would give at an engine's pending decision, built from exactly the inputs the host's dispatch hands that policy. |
|
host
Package host keeps tables running: a registry of table configurations, one goroutine per table that plays match after match with bot seats, sessions that subscribe to overview widgets or a focused table's event stream, turn-start snapshots that answer "view at seq N", append-only persistence, and crash handling that halts a table rather than hiding a bug.
|
Package host keeps tables running: a registry of table configurations, one goroutine per table that plays match after match with bot seats, sessions that subscribe to overview widgets or a focused table's event stream, turn-start snapshots that answer "view at seq N", append-only persistence, and crash handling that halts a table rather than hiding a bug. |
|
host/httpapi
Package httpapi serves a host.Registry over plain net/http: JSON GETs for tables, matches, views and events; POSTs for subscriptions; one SSE stream per client; and the embedded web client.
|
Package httpapi serves a host.Registry over plain net/http: JSON GETs for tables, matches, views and events; POSTs for subscriptions; one SSE stream per client; and the embedded web client. |
|
host/manabrewhttp
Package manabrewhttp is the wire transport that carries server/manabrew's translation over HTTP.
|
Package manabrewhttp is the wire transport that carries server/manabrew's translation over HTTP. |
|
host/sbv2http
Package sbv2http serves a human seat's SpellBench v2 decisions over HTTP: GET .../state, GET .../stream (SSE) and POST .../send.
|
Package sbv2http serves a human seat's SpellBench v2 decisions over HTTP: GET .../state, GET .../stream (SSE) and POST .../send. |
|
manabrew
Package manabrew is gorge's ManaBrew translator: a pure library that projects a seat-scoped view.View into the ManaBrew GameViewDto and maps a pending decision.Decision into the ManaBrew prompt of its decision.Kind.
|
Package manabrew is gorge's ManaBrew translator: a pure library that projects a seat-scoped view.View into the ManaBrew GameViewDto and maps a pending decision.Decision into the ManaBrew prompt of its decision.Kind. |
|
manabrew/mbtest
Package mbtest is the ManaBrew adapter's test support: a deterministic mock ManaBrew client that answers every prompt type server/manabrew's Translator can build, a seat.Seat wrapper (TranslatingSeat) that drives decision -> prompt -> mock response -> intent in-process, and the census/replay-equivalence tests that exercise both against real repo-deck games.
|
Package mbtest is the ManaBrew adapter's test support: a deterministic mock ManaBrew client that answers every prompt type server/manabrew's Translator can build, a seat.Seat wrapper (TranslatingSeat) that drives decision -> prompt -> mock response -> intent in-process, and the census/replay-equivalence tests that exercise both against real repo-deck games. |
|
matchrecord
Package matchrecord is the portable record of one played game: the replay input (the match's genesis configuration and its events.Log) plus who produced it, written as one gzip-compressed JSON file per game, `<id>.match.json.gz`.
|
Package matchrecord is the portable record of one played game: the replay input (the match's genesis configuration and its events.Log) plus who produced it, written as one gzip-compressed JSON file per game, `<id>.match.json.gz`. |
|
protocol
Package protocol is the versioned wire between a match host and its clients: one envelope, a closed set of frame types, and JSON bodies whose TypeScript twins cmd/gentypes generates.
|
Package protocol is the versioned wire between a match host and its clients: one envelope, a closed set of frame types, and JSON bodies whose TypeScript twins cmd/gentypes generates. |
|
protocol/manabrew
Package manabrew defines the ManaBrew protocol's JSON wire types and codecs.
|
Package manabrew defines the ManaBrew protocol's JSON wire types and codecs. |
|
protocol/manabrew/internal/schemagen
command
Command schemagen writes server/protocol/manabrew/schema_gen.go: the typed JSON schema graph manabrew.Decode walks to report unknown fields, plus the target and union-member type switches, all read from the package SOURCE with go/types so the codec needs no runtime reflection.
|
Command schemagen writes server/protocol/manabrew/schema_gen.go: the typed JSON schema graph manabrew.Decode walks to report unknown fields, plus the target and union-member type switches, all read from the package SOURCE with go/types so the codec needs no runtime reflection. |
|
spellbench/agent
Package agent serves gorge's bots in the Spellbench v2 agent role, reading only the forwarded seat decision, its declared extensions and public decks.
|
Package agent serves gorge's bots in the Spellbench v2 agent role, reading only the forwarded seat decision, its declared extensions and public decks. |
|
spellbench/catalog
Package catalog holds the engine's catalog decks: the five Spellbench Pauper
|
Package catalog holds the engine's catalog decks: the five Spellbench Pauper |
|
spellbench/env
Package server implements the Spellbench v2 environment role for gorge.
|
Package server implements the Spellbench v2 environment role for gorge. |
|
spellbench/gamecfg
Package gamecfg builds a gorge engine whose every random draw comes from
|
Package gamecfg builds a gorge engine whose every random draw comes from |
|
spellbench/humanseat
Package humanseat answers a human seat's native decisions through SpellBench v2 candidates: the codec behind an opt-in v2 client for a gorge table.
|
Package humanseat answers a human seat's native decisions through SpellBench v2 candidates: the codec behind an opt-in v2 client for a gorge table. |
|
spellbench/identity
Package identity issues Section 5.3 object ids: per viewer, fresh on every
|
Package identity issues Section 5.3 object ids: per viewer, fresh on every |
|
spellbench/internal/testcorpus
Package testcorpus shares one corpus registry across a test binary.
|
Package testcorpus shares one corpus registry across a test binary. |
|
spellbench/internal/testgame
Package testgame drives real gorge games for tests.
|
Package testgame drives real gorge games for tests. |
|
spellbench/mapping
Package mapping turns one gorge decision into a transaction of v2
|
Package mapping turns one gorge decision into a transaction of v2 |
|
spellbench/minihost
Package minihost is an in-process Spellbench v2 host for this adapter's
|
Package minihost is an in-process Spellbench v2 host for this adapter's |
|
spellbench/neutral
Package neutral lets gorge's policies play a protocol v2 game hosted by another engine (mtg-kernel on pauper-kernel-v2).
|
Package neutral lets gorge's policies play a protocol v2 game hosted by another engine (mtg-kernel on pauper-kernel-v2). |
|
spellbench/neutral/twin
Package twin pairs two gorge agents behind one v2 seat.
|
Package twin pairs two gorge agents behind one v2 seat. |
|
spellbench/observe
Package observe builds the Section 6 observation for one seat from gorge's
|
Package observe builds the Section 6 observation for one seat from gorge's |
|
spellbench/protocol
Package protocol holds the Spellbench v2 wire types this engine emits and reads.
|
Package protocol holds the Spellbench v2 wire types this engine emits and reads. |
|
spellbench/seat
Package seat adapts a Spellbench v2 stdio agent to gorge's seat.Seat contract, so a v2 bot can play at an ordinary gorge table.
|
Package seat adapts a Spellbench v2 stdio agent to gorge's seat.Seat contract, so a v2 bot can play at an ordinary gorge table. |
|
spellbench/secrets
Package secrets implements the HMAC constructions of Spellbench v2
|
Package secrets implements the HMAC constructions of Spellbench v2 |
|
spellbench/session
Package session runs one v2 game over a gorge engine.
|
Package session runs one v2 game over a gorge engine. |
|
spellbench/validate
Package validate is a Go subset of the live validator in Section 11.3 of the SpellBench v2 protocol (spec/SPELLBENCH_PROTOCOL_V2.md in github.com/jackmaiorino/spellbench), used by this adapter's tests and qualification.
|
Package validate is a Go subset of the live validator in Section 11.3 of the SpellBench v2 protocol (spec/SPELLBENCH_PROTOCOL_V2.md in github.com/jackmaiorino/spellbench), used by this adapter's tests and qualification. |
|
spellbench/wire
Package wire holds the transport rules of Spellbench v2 Section 2 and the
|
Package wire holds the transport rules of Spellbench v2 Section 2 and the |
|
spellbench/xview
Package xview builds x_gorge_view_v1: gorge's own seat view and native
|
Package xview builds x_gorge_view_v1: gorge's own seat view and native |
|
testkit
|
|
|
bench
Package bench is the policy-agnostic, head-to-head game matrix shared by the bot benchmark and policy-tuning tools.
|
Package bench is the policy-agnostic, head-to-head game matrix shared by the bot benchmark and policy-tuning tools. |
|
cardcov
Package cardcov is the per-card coverage inventory and use probe the card-fuzzing harnesses share: which of a card's own abilities (activated, mana, non-bookkeeping triggered, and each mode of a modal spell or ability) a finished game cast, played, offered or used.
|
Package cardcov is the per-card coverage inventory and use probe the card-fuzzing harnesses share: which of a card's own abilities (activated, mana, non-bookkeeping triggered, and each mode of a modal spell or ability) a finished game cast, played, offered or used. |
|
conformance
Package conformance plays one game on two engines through a client wire and reports the first thing the wire says differently.
|
Package conformance plays one game on two engines through a client wire and reports the first thing the wire says differently. |
|
hiddeninfo
Package hiddeninfo is a test oracle for what a seat may read: it follows a game and says whether a piece of text names a card that seat cannot see.
|
Package hiddeninfo is a test oracle for what a seat may read: it follows a game and says whether a piece of text names a card that seat cannot see. |
|
paymirror
Package paymirror is an A/B differential check for cast payment plans (docs/design/2026-09-24-cast-payment-plans.md §10: "compare a manual execution of the same selected payment with planned execution for state equivalence").
|
Package paymirror is an A/B differential check for cast payment plans (docs/design/2026-09-24-cast-payment-plans.md §10: "compare a manual execution of the same selected payment with planned execution for state equivalence"). |
|
recstream
Package recstream reads and writes condensed record streams: JSON Lines in which each record is stored as a delta against the record before it, with a full keyframe every N records, compressed with gzip.
|
Package recstream reads and writes condensed record streams: JSON Lines in which each record is stored as a delta against the record before it, with a full keyframe every N records, compressed with gzip. |
|
testutil
Package testutil holds fixtures and checks shared by tests that sit outside the rules package's own test binary -- the acceptance harness and engine/rules/fuzz_test.go's invariant gate both need this without rules importing itself, so this package sits beside state and decision in the dependency order (cards -> state -> decision -> events -> effects -> rules -> view -> seat -> replay -> cmd/*) and imports only cards, state and decision.
|
Package testutil holds fixtures and checks shared by tests that sit outside the rules package's own test binary -- the acceptance harness and engine/rules/fuzz_test.go's invariant gate both need this without rules importing itself, so this package sits beside state and decision in the dependency order (cards -> state -> decision -> events -> effects -> rules -> view -> seat -> replay -> cmd/*) and imports only cards, state and decision. |
|
testutil/feedback
Package feedback loads a feedback snapshot directory — the match.json / log.json (plus optional view.json / report.json) files the server's feedback capture writes beside a bug report — back into the (events.Log, rules.Config) pair a deterministic replay needs, and drives that replay to a chosen intent.
|
Package feedback loads a feedback snapshot directory — the match.json / log.json (plus optional view.json / report.json) files the server's feedback capture writes beside a bug report — back into the (events.Log, rules.Config) pair a deterministic replay needs, and drives that replay to a chosen intent. |
|
testutil/feedback/diracfb
Package diracfb replays a feedback snapshot on whichever engine played it, dirac included.
|
Package diracfb replays a feedback snapshot on whichever engine played it, dirac included. |