Advisor: never advise an option that makes the target impossible while another keeps it possible
CI / test (pull_request) Successful in 57s

On a later attempt the data put the Black near zero on every route, so every option
tied and the bot's tie rule (random among options within 0.2 points) walked away from
the squadmate or went to the valley (DragonKind research runs 90, 91 and 102). The
advisor now also solves the game with no data (every roll possible except through a
closed gate; an encounter bonds its own colour) and marks options after which the
target cannot happen at all as `ruledOut`. The choice is never one of them while
another option keeps the target possible, and recommendOption leaves them out of the
options it gives the bot. For the Black: always investigate, help and climb the tree.

Values are unchanged; the published route tree still matches option for option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
2026-11-22 02:15:44 +00:00
co-authored by Claude Opus 5.5
parent 778e844752
commit d9f3c200b8
2 changed files with 49 additions and 7 deletions
+23
View File
@@ -145,3 +145,26 @@ test("known answers load and answer in the shape the bot expects", () => {
assert.ok(Array.isArray(r.choices));
}
});
test("the bot's tie rule never takes an option that rules the Black out, even when every option's odds are about zero", () => {
// the bot (src/atlasPolicy.js) picks at random among options within tieMargin of the best. On a later attempt the
// data put the Black near zero everywhere, so before the advisor ruled such options out every option tied, and the
// bot walked away from the squadmate or went to the valley (DragonKind research runs 90, 91, 102, November 2026).
const TIE = 0.002; // DEFAULT_TIE_MARGIN in the bot
const tiedAt = (offered, history) => {
const rec = advise({ targetDragon: "black", events: history, offered });
if (!rec || rec.margin === null) return rec ? [rec.choice] : [];
const best = Math.max(...Object.values(rec.options).map((v) => v.pX));
return Object.entries(rec.options).filter(([, v]) => best - v.pX < TIE).map(([o]) => o);
};
// the screens exactly as the bot saw them (DragonKind research run 91)
const start = [{ optionText: "Enter the valley alone" }, { optionText: "Head toward the center of the forest" }, { tint: "red", optionText: "Lower your eyes in respect" }, { optionText: "Head deeper into the forest" }];
const t1 = tiedAt(["Investigate the scream", "Keep walking. The cadets are just as dangerous as the dragons today"], [...start, {}]);
assert.ok(t1.length && !t1.includes("Keep walking"), `scream: ${t1}`);
const t2 = tiedAt(["Play it safe and leave them to their own defense so you can find your dragon", "Help your squadmate"], [...start, { optionText: "Investigate the scream" }, {}]);
assert.ok(t2.length && !t2.includes("Walk away"), `clearing: ${t2}`);
const path = [...start, { optionText: "Investigate the scream" }, { optionText: "Help your squadmate" }, { optionText: "Pause to assess the situation even though it may risk your squadmate's life" },
{ optionText: "Engage the smaller cadet" }, { optionText: "Allow your squadmate to exact their own revenge" }, { optionText: "Walk farther into the forest" }, {}];
const t3 = tiedAt(["Find the tallest tree and climb for a better view", "Continue toward the center of the valley"], path);
assert.deepStrictEqual(t3, ["Tree"], `hour: ${t3}`);
});