Core: fix three coding bugs from the core review, with rule tests (#11)
1. Letting the Red pass. Only climbing down quickly puts you above the Red, so a tree run that passed on the Red and then met the Greens let it pass. Those 16 runs were coded as slow descents; they are now "Descend quickly: let the Red pass" and count for the Greens' encounter, so the route model's "let it pass" option rests on its own runs. A tree run with both the Red and the Greens attempted (impossible in one run) is now flagged. 2. Leaving your squadmates. The form only offered "> Left them" from 2026-10-27 (0 of 504 squad runs before chose it, 40 of 144 after). Earlier and undated squad runs are now unknown rather than "stayed together" (form.yaml: left_squadmates_asked_from). 3. Bot text. The wounded cadet's other two choices map onto the form; a test checks every choice the bot has logged maps onto a form variable (encounter answers excepted, not modelled yet). Each rule has a test in tests/core/test_coding.py. Data rebuilt (runs, graph, policy, report); the headline odds move by at most 0.02 points. The Methods tab describes both rules. Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
cc86343668
commit
963b08c522
@@ -70,3 +70,14 @@ test("Beta credible interval", () => {
|
||||
const p = G.betaPosterior(0, 4);
|
||||
assert.ok(p.lo >= 0 && p.hi < 0.5 && p.mean === 0.1);
|
||||
});
|
||||
|
||||
test("every choice the bot has seen maps onto a form variable, except answers inside a bonding encounter", () => {
|
||||
const scenes = require("../../data/bot/scenes.json");
|
||||
const unmapped = [];
|
||||
for (const s of Object.values(scenes)) {
|
||||
if (s.options.length < 2) continue; // nothing to choose
|
||||
if (/two Greens in the clearing/.test(s.label)) continue; // answers at the Greens' encounter: not modelled yet
|
||||
for (const o of s.options) if (!G.CROSSWALK.some(([re]) => re.test(G.norm(o.text)))) unmapped.push(`${s.label}: ${o.text}`);
|
||||
}
|
||||
assert.deepStrictEqual(unmapped, []);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user