···11-# genesis
11+# agones discovery brief (runtime boundary)
22+33+This document captures Agones-specific discovery needed to close runtime integration gates in Stage 5 planning.
44+55+Primary planning reference: [`/doc/total-host.workstream-dependency-map.md`](/doc/total-host.workstream-dependency-map.md)
66+77+## Why this exists
88+99+`total-host.codex` is intentionally product-first. Agones is introduced at the runtime boundary (`WS-09`) so core host behavior stays implementation-agnostic while platform constraints are still discovered early.
1010+1111+Source requirements: [`/doc/total-host.codex.md`](/doc/total-host.codex.md)
1212+1313+## What Agones gives us
1414+1515+Agones extends Kubernetes for dedicated game server workloads, primarily through CRDs and allocation/runtime controllers.
1616+1717+Key upstream references:
1818+1919+- [`agones-dev/agones` `site/content/en/docs/Overview/_index.md`](https://github.com/agones-dev/agones/blob/main/site/content/en/docs/Overview/_index.md)
2020+- [`agones-dev/agones` `site/content/en/docs/Reference/gameserver.md`](https://github.com/agones-dev/agones/blob/main/site/content/en/docs/Reference/gameserver.md)
2121+- [`agones-dev/agones` `site/content/en/docs/Reference/fleet.md`](https://github.com/agones-dev/agones/blob/main/site/content/en/docs/Reference/fleet.md)
2222+- [`agones-dev/agones` `site/content/en/docs/Reference/fleetautoscaler.md`](https://github.com/agones-dev/agones/blob/main/site/content/en/docs/Reference/fleetautoscaler.md)
2323+- [`agones-dev/agones` `site/content/en/docs/Reference/gameserverallocation.md`](https://github.com/agones-dev/agones/blob/main/site/content/en/docs/Reference/gameserverallocation.md)
2424+- [`agones-dev/agones` `site/content/en/docs/Advanced/allocator-service.md`](https://github.com/agones-dev/agones/blob/main/site/content/en/docs/Advanced/allocator-service.md)
2525+2626+## Candidate CRDs and where they might fit
2727+2828+| Agones resource | What it does | Potential fit for stargones | Notes |
2929+|---|---|---|---|
3030+| `GameServer` | Single dedicated server process with lifecycle states | Runtime unit for one host worker process | Direct control possible, but usually managed via Fleet |
3131+| `Fleet` | Desired pool of warm GameServers | Baseline control plane for capacity and rollout | Likely primary orchestration primitive |
3232+| `FleetAutoscaler` | Fleet scaling policy engine | Optional for bursty host workloads | Useful if turn-generation demand varies |
3333+| `GameServerAllocation` | Atomic selection/allocation of a ready GameServer | Match/scheduling path if we allocate workers on demand | Can be used via Kubernetes API |
3434+| `Allocator Service` | mTLS gRPC/REST allocation API | External allocation path without direct K8s API access | Relevant for multi-cluster or external orchestrators |
3535+3636+## Integration shapes under consideration (not committed)
3737+3838+### Shape A: campaign-affine workers
3939+4040+- One long-lived runtime worker per campaign (or campaign shard) using Agones scheduling/lifecycle.
4141+- Simpler campaign locality and state ownership.
4242+- Could underutilize resources for low-activity campaigns.
4343+4444+### Shape B: pooled generation workers
4545+4646+- Shared pool of workers; campaigns are loaded for turn generation jobs.
4747+- Better utilization at scale.
4848+- Requires stronger artifact locking and isolation guarantees.
4949+5050+### Shape C: hybrid
5151+5252+- Fixed baseline workers plus burst allocation from shared pool.
5353+- Most flexible, most policy complexity.
5454+5555+## Open decisions to close (`WS-09` gates)
5656+5757+- `AGD-01` **Runtime unit**: campaign-affine worker vs pooled worker model.
5858+- `AGD-02` **Primary Agones control primitive**: direct `GameServer` management vs `Fleet`-first control model.
5959+- `AGD-03` **Allocation path**: Kubernetes `GameServerAllocation` objects vs external `agones-allocator` service.
6060+- `AGD-04` **State ownership boundary**: what remains authoritative in stargones storage vs ephemeral worker state.
6161+- `AGD-05` **Lifecycle mapping**: mapping `LIF-*` transitions to Agones lifecycle states and failure semantics.
6262+- `AGD-06` **Recovery model**: worker restart/eviction behavior and required replay or reconciliation flows.
6363+- `AGD-07` **Operational model**: do we run a stargones operator/controller, and if so what exact reconciliation surface it owns.
26433-we don't know much about agones architecture. how do we host a game with some seats? what crds does agones have and what are the elements we might want to be creating?
6565+## Current stance
46655-i somewhat imagine us having our own operator, our own all inclusive system. i sort of suspect that's not the totally normal agones usage?
6767+- We expect to own a stargones-specific control layer/operator regardless of Agones usage style.
6868+- We are intentionally deferring final selection of Shapes A/B/C until `AGD-*` decisions are resolved.
6969+- This is acceptable because Stage 5 currently needs boundary clarity, not final platform lock-in.
7070+7171+## How this connects to current planning artifacts
7272+7373+- `WS-09` gating is tracked in [`/doc/total-host.workstream-dependency-map.md`](/doc/total-host.workstream-dependency-map.md).
7474+- Requirement-level constraints remain in [`/doc/total-host.codex.md`](/doc/total-host.codex.md).
7575+- Coverage and release criteria remain in [`/doc/total-host.coverage-matrix.md`](/doc/total-host.coverage-matrix.md).
7676+7777+## Next discovery outputs (before implementation lock-in)
7878+7979+- `OUT-01` Decision record selecting runtime shape (A/B/C) with tradeoff rationale.
8080+- `OUT-02` Lifecycle mapping table (`LIF-*` -> runtime events/controllers).
8181+- `OUT-03` Failure mode table for worker loss, allocation failures, and reconciliation outcomes.
8282+- `OUT-04` Security model for allocator/API access and operator privileges.
+13-1
doc/total-host.workstream-dependency-map.md
···2121| `WS-06` Distribution and Player Isolation | `DST-01`..`DST-03`, `IFC-005`, `SEC-001`, `SEC-002`, `INV-04`, `CAP-201`, `CAP-202` | `WS-03`, `WS-05` | Delivery/API boundary | Ready |
2222| `WS-07` Operator Visibility and Diagnostics | `NFR-01`, `NFR-02`, `CAP-301`, `CAP-302`, `IFC-006` | `WS-03`, `WS-04`, `WS-06` | Ops telemetry/log boundary | Ready |
2323| `WS-08` Traceability and Compliance Reporting | `TRC-01`..`TRC-05`, `AC-402`, `HND-201` | `WS-01`..`WS-07` | CI/reporting boundary | Ready |
2424-| `WS-09` Runtime Platform Integration (Agones) | `HND-001`, `HND-003`, `HND-301` (runtime gate ownership) | `WS-03`, `WS-04`, `WS-06`, `WS-07` | Kubernetes/Agones boundary | Discovery in progress |
2424+| `WS-09` Runtime Platform Integration (Agones) | `HND-001`, `HND-003`, `HND-301` (runtime gate ownership) | `WS-03`, `WS-04`, `WS-06`, `WS-07` | Kubernetes/Agones boundary | Discovery brief drafted (`AGD-01`..`AGD-07` open) |
2525| `WS-10` ATProto Lexicon and Telemetry Alignment | `OBS-03`, `OBS-04`, `AC-403` | `WS-07`, `WS-08` | ATProto lexicon boundary | Deferred |
26262727## Dependency Graph
···76767777- `WS-09` is the explicit point where Agones platform decisions are introduced.
7878- Agones discovery and gate-closure notes are tracked in [`/doc/agones.md`](/doc/agones.md).
7979+8080+## WS-09 Gate Checklist (Agones)
8181+8282+| Gate | Description | Status |
8383+|---|---|---|
8484+| `AGD-01` | Runtime unit selection (campaign-affine vs pooled vs hybrid) | Open |
8585+| `AGD-02` | Primary control primitive (`Fleet`-first vs direct `GameServer`) | Open |
8686+| `AGD-03` | Allocation interface (`GameServerAllocation` vs allocator service) | Open |
8787+| `AGD-04` | State ownership boundary (stargones vs worker) | Open |
8888+| `AGD-05` | Lifecycle mapping (`LIF-*` to runtime states/events) | Open |
8989+| `AGD-06` | Recovery semantics for worker/runtime failures | Open |
9090+| `AGD-07` | Operator/control-plane ownership model | Open |
79918092## References
8193