CB-WP-0008-T01: bots — the kernel's first non-scenario consumer
Some checks failed
ci / check (push) Failing after 4s

A Policy trait, a seeded random policy and a greedy one with a stated
heuristic, a legal-command generator that filters candidates through
validate, and a driver that runs a 3-player all-bot game to GameEnded.
Same-seed runs are hash-identical (K8), and a different policy seed
produces a different game — without that second assertion the first is
satisfied by a bot that ignores its RNG.

Every failure is loud, because the one a bot driver must not have is the
silent one: no legal move, passing where an action is required, an
out-of-range index (not clamped), a rejected command, and a stall guard.

What the second consumer found, none of it fixed here:
- GR-A13 admits SOLVE against an already-claimed Problem and resolution
  then does nothing — the action is silently wasted. The policy avoids
  it; the rule is left for a ruling.
- The 3-player standard fixture cannot reach GR-E01's threshold of 7:
  three Problems valued 1,2,3 cap the total at 6. No scenario noticed
  because none plays to scoring.
- K13's Project trait still has zero implementors. T02 is its first.

Mutation-checked by hand. The first mutation was a no-op and survived;
removing the Resolve call outright turned three tests red for the stated
reason. Third instance of the weak-mutation class.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-08-01 14:29:45 +02:00
parent be2d7a3e5a
commit 6197677126
4 changed files with 926 additions and 2 deletions

View file

@ -2,6 +2,12 @@
//! GameKernel K15K16). Every rule realized here names its GR-id in a doc
//! comment, giving a greppable rule→code→scenario chain.
/// Bots (CB-WP-0008 T01) — the kernel's first non-scenario consumer.
/// Deliberately **not** gated on `scenarios`: a bot needs only the
/// aggregate. That its tests do need `scenarios` is a real seam — setup
/// presets currently live behind that feature (see `bot.rs`).
pub mod bot;
#[cfg(feature = "scenarios")]
use cb_game_runtime::{parse_actor, CommandStep, ScenarioGame, Setup};
use cb_kernel::{Actor, Aggregate, ChaChaRng, KernelRng, PlayerId, Rejection, Seed};