Test the bot's call chain in CI; send it the experiment plan and screen tree (#26, part 2) #51

Merged
kathleen merged 1 commits from planner/bot-contract into main 2026-11-19 21:48:27 +00:00
Owner

Part of #26: the bot's copy of the solver, and the experiment list.

The bot's copy of the solver is current. Ken merged DragonKind #3, and vendor/threshing-atlas/{solver.js,graph.js,known_answers.json} on his main now match this repo byte for byte.

New: tests/core/bot_contract.test.js (added to npm run test:unit). It copies the bot's AtlasPolicy.advise() chain from DragonKind src/atlasPolicy.js (at ebe134a2): trajectory → trajectoryVariables → solverHistory → next → recommendOption. It then plays the bot's own recorded screens (tree.json) through that chain. It checks:

  • every colour, sample and goal gets valid advice on every screen, with no exceptions and no index off the screen;
  • the Black is routed through both gates (investigate, help) and up the tree;
  • every assignment of the experiment plan (Solver.assign) has a valid target, propensity and fixed choices, and the advisor plays it;
  • the known answers come back in the shape the bot expects.

A change here that would break the bot now fails in this repo's CI before it reaches him.

The experiment plan never reached the bot. docs/BOT_INTEGRATION.md says the bot reads vendor/threshing-atlas/experiments.json and tree.json (Solver.assign, screenPick), but push-policy only sent the policy, solver, graph and known answers. It now sends all six files together. The bot side is in an issue for Ken:

  • bot.js still uses its own v1 knowledge/experiments.json;
  • that file's EXP-01 arm B ("ignore the scream") closes the Black's gate.

The two "convince your squad" options need no new experiment. fresh-ablate already has a stay-with-one-squadmate arm (West: go along) and a stay-with-two arm (West: convince). mapping picks uniformly among every option the game knows, including convincing.

🤖 Generated with Claude Code

Part of #26: the bot's copy of the solver, and the experiment list. **The bot's copy of the solver is current.** Ken merged DragonKind #3, and `vendor/threshing-atlas/{solver.js,graph.js,known_answers.json}` on his main now match this repo byte for byte. **New: `tests/core/bot_contract.test.js`** (added to `npm run test:unit`). It copies the bot's `AtlasPolicy.advise()` chain from DragonKind `src/atlasPolicy.js` (at ebe134a2): trajectory → `trajectoryVariables` → `solverHistory` → `next` → `recommendOption`. It then plays the bot's own recorded screens (`tree.json`) through that chain. It checks: - every colour, sample and goal gets valid advice on every screen, with no exceptions and no index off the screen; - the Black is routed through both gates (investigate, help) and up the tree; - every assignment of the experiment plan (`Solver.assign`) has a valid target, propensity and fixed choices, and the advisor plays it; - the known answers come back in the shape the bot expects. A change here that would break the bot now fails in this repo's CI before it reaches him. **The experiment plan never reached the bot.** `docs/BOT_INTEGRATION.md` says the bot reads `vendor/threshing-atlas/experiments.json` and `tree.json` (`Solver.assign`, `screenPick`), but push-policy only sent the policy, solver, graph and known answers. It now sends all six files together. The bot side is in an issue for Ken: - `bot.js` still uses its own v1 `knowledge/experiments.json`; - that file's EXP-01 arm B ("ignore the scream") closes the Black's gate. The two "convince your squad" options need no new experiment. `fresh-ablate` already has a stay-with-one-squadmate arm (West: go along) and a stay-with-two arm (West: convince). `mapping` picks uniformly among every option the game knows, including convincing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kathleen added 1 commit 2026-11-19 21:47:35 +00:00
tests/core/bot_contract.test.js copies the bot's AtlasPolicy.advise (DragonKind
src/atlasPolicy.js at ebe134a2) and plays the bot's own recorded screens through it
for every colour, sample and goal; checks the Black is routed through both gates and
up the tree; checks every assignment of the experiment plan is playable; checks the
known answers' shape. Added to npm run test:unit.

push-policy now also sends data/public/experiments.json and tree.json, which
docs/BOT_INTEGRATION.md says the bot reads (Solver.assign, screenPick) but which were
never delivered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
kathleen merged commit 6ba87691d6 into main 2026-11-19 21:48:27 +00:00
kathleen deleted branch planner/bot-contract 2026-11-19 21:48:27 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DragonKind/threshing-atlas#51