Inspect how AI requests to a game get fenced, one Rust contract at a time.
Today: deterministic, in-memory contract tests you can replay here and re-run with cargo. Proposed: a live Slay the Spire 2 path through mod, gateway, MCP adapter, and harness. Runtime and game compatibility: unverified.
Independent project; not affiliated with Mega Crit or Valve.
The line that decides
An AI holds a lease that went stale. Without a fence, its next request would reach the game host. With this contract, the gateway denies it before any transport call happens. A person can read the exact line that decided.
control_plane.rs::stale_epoch_and_wrong_instance_are_denied_before_transport · sts2-gateway@e7bce21
The ascent
The proposed runtime path, top tier first as printed and read from the bottom up. Each repository row carries its approved description and a stamp for what is tested today. The two endpoints are not repositories.
-
tier 5 · endpoint
model / provider
A pluggable model-provider interface exists in the harness; no provider is called anywhere today. Model cost: none.
-
tier 4 · repository
Experiment coordinator for AI runs: episodes, a pluggable model-provider interface, replay of recorded records, and artifact lineage.
-
tier 3 · repository
Thin MCP tool adapter that maps approved calls to the authenticated gateway API without bypassing it.
-
tier 2 · repository
In-memory control plane for game-host instances: lifecycle, one lease per instance with epoch fencing, and fixed routes.
-
tier 1 · repository
Game-process adapter: a bounded main-thread work queue, versioned ABI check, and HTTP request admission limits.
-
tier 0 · authority
game host
The game process keeps authority. Nothing here launches, patches, or connects to it today.
Beside the ascent, not runtime tiers
-
domain
Host-independent Rust domain core: typed game-state values, pure validation, and policy rules with no I/O.
-
metadata
Shared metadata contracts (identity, versions, error envelopes) in language-neutral schemas with golden test vectors.
Pick your path
Four ways in. Each one answers its own first objection with the same proof, translated for that reader.
Nothing here touches a game yet; you can watch exactly what is tested today and what is only proposed.
- Objection
- “Is this a cheat/bot for the game?” — No: no game files, no live game path, host stays authoritative.
- First win
- See the denial line and the stamp that says
unverifiedfor live play. - Proof frame
- Stale lease fenced before transport.
- Do this
- Run the proof
- Next step
- Read evidence.html.
- Contribute
- Report a confusing label via the evidence issue form.
One boundary (the gateway lease fence) and one bounded first task (add a fence case fixture) — no need to understand all six repos.
- Objection
- “Where do I even start across six repos?”
- First win
cargo runprints the identical trace in under a minute.- Proof frame
- Same trace, with the exact test names and source lines.
- Do this
- Run the recipe with cargo
- Next step
- Open the fence-case starter issue.
- Contribute
- Submit a new fixture or contract observation via the proof-recipe form.
An MCP tool call maps to exactly one gateway request path, and malformed frames never reach the gateway.
- Objection
- “Is this just a wrapper that lets the model do anything?”
- First win
- Reproduce the fixture locally without any credentials.
- Proof frame
- MCP seam trace (
seam.rs) + gateway fence. - Do this
- Read architecture.html, then run the recipe.
- Next step
- Sketch an adapter example against the tool schema.
- Contribute
- Adapter example or schema observation via issue form.
Authority stays with the host; the gateway fences stale epochs, wrong instances, and oversize bodies before transport, and fails closed on faults.
- Objection
- “What happens when something breaks or a token leaks?”
- First win
- Verify the claim-to-test mapping yourself.
- Proof frame
- Fail-closed cases (
readiness_and_crash_fail_closed,shutdown_reports_stop_failure_and_closes_admission). - Do this
- Read evidence.html + SECURITY.
- Next step
- File a security note privately.
- Contribute
- Security note or failure-handling observation.
What is tested today, what is only proposed
confirmed Tested today
- Gateway: lease and epoch fencing (
StaleEpoch,WrongInstance,WrongCaller,WrongSession,WrongLease,Missing,Expired), fixed routes, body and response byte limits, fail-closed on process, readiness, and transport faults. In memory, with injected fakes. - MCP adapter: one tool call maps to exactly one gateway request; malformed JSON, invalid params, and unsupported capabilities are rejected before the gateway.
- Game mod: bounded main-thread queue, versioned ABI descriptor validation, transport-free HTTP admission guard.
- Harness: retry with idempotency, record and replay, artifact lineage, bounded shutdown — against deterministic fakes.
- Core and protocol: pure validation with no mutation; golden vectors reproducible.
- All six trees: Rust only, checked by a policy tool; tests pass locally at the pinned commits.
proposed Proposed only and unverified
- A live Slay the Spire 2 path through mod, gateway, MCP adapter, and harness — and the four-model live race described at aiascension.tech, which this path is built for.
- Any listener, process supervisor, game connection, or authentication at an external boundary.
- Isolation under real concurrency; host compatibility; any release.
- A managed loader, a real host adapter, a route catalog, domain behavior, and packaging.
- Provider execution, live MCP transport, replay fidelity against a game, scoring, training.
- Traction of any kind: unknown, not zero.
Every claim above is mapped to a file, test, or command on the evidence page.