Fearless Draft in a BO3 or BO5 series is a one-sentence rule: any champion picked in an earlier game of the series is locked out for both teams in every later game. Stated in prose, it sounds trivial. Tracked across game four alongside current-game bans, role assignments, and ban-count limits, it is the exact kind of stateful constraint that LLMs quietly get wrong when they try to reason from chat history alone.
While building c9-tactical-scout (MIT, TypeScript on Node 22, zero runtime npm dependencies, live workbench at xgbtxy.github.io/c9-tactical-scout), I ran into that failure mode early: whenever an AI coding agent guessed at draft legality from prose context, edge cases slipped through. Once the series rules lived behind a pure fail-closed engine and stdio MCP tools—with negative controls in the test suite—the guessing stopped.
It follows the same habit I use in my Rust coding-agent toolkit ap: keep stateful invariants in small, deterministic code paths, expose them as tools, and make illegal states fail with an explicit reason.
1. Fail-closed legality and traceable recommendations
At the core of c9-tactical-scout is a pure TypeScript engine running directly on Node 22 with zero runtime packages in node_modules.
Draft legality is handled by a single fail-closed check over prior series games, current bans, role slots, and a proposed action. Instead of returning a vague boolean or silently filtering bad inputs, illegal states are rejected with an explicit reason:
- Prior-game Fearless locks: a pick used by either team in game 1 or game 2 is rejected in later games.
- Current-game bans and over-bans: banned picks and invalid ban counts fail closed.
- Role clashes: duplicate role assignments within a team draft are rejected immediately.
On top of legality sits a deterministic recommendation and scouting layer. Rather than an opaque heuristic score, each candidate recommendation computes a counter edge from an explicit style ring, early/mid/late power-spike balance, and role flexibility, with deterministic tie-breaking. Every score carries an inspectable trace showing the exact inputs that produced it, so an agent—or a human reviewing the output—can audit why pick A ranked ahead of pick B.
2. Three stdio MCP tools so agents query rules instead of recalling them
To let MCP-compatible clients query the engine without adding SDK bloat, the repository includes a zero-dependency stdio server (node src/mcp/server.ts) speaking newline-delimited JSON-RPC:
{ "mcpServers": { "c9-tactical-scout": { "command": "node", "args": ["src/mcp/server.ts"] } } } It exposes three deterministic tools backed by the exact same engine functions:
-
verify_series_rules— validates cumulative BO3/BO5 series history, bans, and proposed picks fail-closed, returning acceptance or the specific rule violation reason. -
draft_recommend— returns legal candidate picks for the active slot with deterministic tie-breaking and the full style-ring / spike-balance / flex calculation trace. -
macro_scout_series— summarizes per-team early/mid/late tempo mix, per-role pool pressure, remaining flexible picks, and the cumulative Fearless lock list across the series.
When an agent calls verify_series_rules or draft_recommend, it no longer needs to reconstruct four games of Fearless state inside its token window.
3. Byte-synced browser workbench and negative controls (32/32 tests)
Two small engineering guardrails kept the project honest while iterating with AI coding agents:
First, negative controls in the test suite (32/32 deterministic tests in CI). When an agent iterates against tests, a common failure mode is making a test pass by loosening a validation check. Pairing positive series tests with negative controls—asserting that cross-team prior-game re-picks, banned champions, role collisions, and over-bans are rejected for the exact expected reason—catches rule-weakening immediately. All 32 tests run on fixed fixtures with zero randomness and zero network calls.
Second, a byte-sync test between the server and the browser workbench. Interactive demo pages often drift away from the real TypeScript code. Here, npm run build generates docs/engine.js directly from the TypeScript source, and a test verifies that the browser bundle stays byte-synced with the type-stripped source. If the workbench and the MCP server ever diverge, npm test fails.
4. Honest scope and limitations
To be completely plain about what this repo is and is not:
- Synthetic fixtures only: every champion name, role profile, and style-ring counter in the repository is an invented synthetic fixture. There is zero publisher artwork, zero team logos, zero real rosters, and zero real player data, and the project is not affiliated with any game publisher or esports organization.
- Not implemented: wiring live pro-match feeds (such as a GRID-style API) or packaging a JetBrains IDE plugin are optional future directions—neither is implemented or claimed here.
Links if you want to poke at the code or try breaking a Game 3 draft in the browser:
- Source &
32/32tests (MIT): https://github.com/xgbtxy/c9-tactical-scout - Byte-synced browser workbench: https://xgbtxy.github.io/c9-tactical-scout/
- Upstream Rust agent toolkit (
ap): https://github.com/xgbtxy/ap
When you build agent workflows around stateful rules—series drafts, scheduling constraints, or policy gates—where do you draw the line between explaining a rule in the prompt and wrapping it in a deterministic MCP tool?
我觉得技术没有壁垒,如今我们在最好的时代,可以轻而易举地获取很多有价值的信息,让我们在合适的时间做到合适的事情,hhh