Repository navigation
Conversation
scripts/headless/rules.test.mjs plays the rule changes of docs/rule-changes.md with the headless runner, setting scenes in debug mode and checking what tells each change from vanilla: - Hungry at 400 nutrition; worn armor counting half its weight - a food coma instead of choking; a fresh corpse is fine, an old one smells putrid before the first bite, other food keeps - a Wizard's Pw every 12 turns at XL1 - engraving names a wand of striking - the bag of holding question - polypiling: 10 daggers fuse into 4 objects, rocks stay rocks - the pet orders menu - nothing that stays put and no mimics in Sokoban (four seeds) - the thieves' den just above Medusa with a wand of wishing and the held-back tools - a midway set piece at depth 13 to 16 (three seeds) The 13 tests run in parallel in about two seconds. npm run test:rules runs them alone; test:headless includes them. CI runs test:headless, and Build game core (WASM) runs the rule tests on each fresh build, pointing the client at it with POLYPILED_CORE_DIR. AGENTS.md asks for a scenario with every new rule change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/rule-regression-tests
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #101 (headless runner). Retarget this PR to
mainbefore deletingclaude/headless-mcpafter #101 merges, or GitHub closes it.What
scripts/headless/rules.test.mjschecks the rule changes indocs/rule-changes.mdagainst the real core, using the headless runner from #101. Each test sets up a scene in debug mode where it needs one, then checks what tells the Polypiled rule apart from vanilla.reveal#chatwith the pet opens "What do you tell the little dog?" with the four ordersThe 13 tests run in parallel in about 2 s. The results were the same in three consecutive runs.
Where they run
npm run test:rulesruns them alone;npm run test:headlessnow includes them.ci.ymlgains a "Headless game tests" step (npm run test:headless).build-core-wasm.ymlruns the rule tests on each fresh build. It points the client at the build with the newPOLYPILED_CORE_DIR, so a core change that breaks a rule fails before it is shipped topublic/. These steps come after the "source tree is unchanged" check, becausenpm irewritespackage-lock.json..agents/rules/AGENTS.mdasks for a scenario with every new rule change, anddocs/rule-changes.mdlists what is covered.Not covered yet
These depend on chance over many trials, on long waits, or on scenes that are harder to set up:
Testing
npm run test:headless: 26 of 26 pass, locally on the core inpublic/.POLYPILED_CORE_DIR=<copy of public> npm run test:rules: 13 of 13 pass.🤖 Generated with Claude Code