Screen tree, register rows in the master list, and bot runs coded from the picks that were played
CI / test (pull_request) Canceled after 0s
CI / test (pull_request) Canceled after 0s
- analysis/tree/build_tree.py -> data/public/tree.json, analysis/reports/TREE.md: every screen the bot has seen, every option, where each led (fixed or dice, with ranges), best known picks per colour chosen cautiously, where any picks end, and the untested options. solver.js screenPick(): least-tried and Thompson picks from the tree. - The bot logs a pick it then overrode as a step: 37 runs were coded with choices they never made. Importer and graph.js now use the played steps only. - runs_clean.csv: the Unofficial Dragon Register's 288 bonded dragons are in the master list as outcome-only rows, flagged (no analysis uses them). - Cycle, refresh and the bot kit rebuild and carry the tree; tests check every generated report is current. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014jqCC2LZ4x1WHQ1V57nTsv
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
d01ec46fcc
commit
f8e4f575f4
@@ -224,3 +224,31 @@ test("the experiment plan: what each attempt of each account is for", () => {
|
||||
assert.notStrictEqual(S.assign(done, { accountSeq: 5, attempt: 5 }).experimentId, "meadow-blue-route");
|
||||
assert.strictEqual(S.assign({ ...plan, experiments: [] }, { accountSeq: 1, attempt: 5 }), null);
|
||||
});
|
||||
|
||||
test("screenPick: least-tried fills gaps, Thompson avoids what has killed", () => {
|
||||
const tree = { screens: { s1: { options: {
|
||||
a: { text: "Hold its gaze", n: 40, to: { next: { n: 38 }, DIED: { n: 2 } } },
|
||||
b: { text: "Lower your eyes", n: 40, to: { DIED: { n: 40 } } },
|
||||
c: { text: "Step back", n: 0, to: {} } } } } };
|
||||
const screen = ["Lower your eyes", "Hold its gaze", "Step back", "An option the tree has never seen"];
|
||||
const lt = S.screenPick(tree, "s1", screen, { mode: "least-tried", seed: 1 });
|
||||
assert.ok([2, 3].includes(lt.index) && lt.n === 0);
|
||||
assert.deepStrictEqual(lt, S.screenPick(tree, "s1", screen, { mode: "least-tried", seed: 1 })); // same seed, same pick
|
||||
const picks = {};
|
||||
for (let seed = 1; seed <= 300; seed++) { const p = S.screenPick(tree, "s1", screen, { mode: "thompson", seed }); picks[p.index] = (picks[p.index] || 0) + 1; }
|
||||
assert.ok(!picks[0] || picks[0] < 3, "an option that died 40 times in 40 is almost never drawn");
|
||||
assert.ok(picks[1] > 200 && picks[2] >= 5 && picks[3] >= 5, JSON.stringify(picks)); // mostly the good one; the untested ones still get tried
|
||||
assert.strictEqual(S.screenPick(tree, "unknown-screen", ["x", "y"], { seed: 2 }).n, 0);
|
||||
assert.strictEqual(S.screenPick(tree, "s1", []), null);
|
||||
});
|
||||
|
||||
test("picks the bot logged and then overrode are not part of the run", () => {
|
||||
const G = require("../../core/graph.js");
|
||||
const steps = [
|
||||
{ scene: "a68f681076c6", optionText: "Head west toward the scent", to: "BURNED" },
|
||||
{ scene: "a68f681076c6", optionText: "Head toward the center of the forest", to: "bc4ee4754b9c" },
|
||||
{ scene: "bc4ee4754b9c", optionText: "Lower your eyes in respect", to: "84780dab01e3", tint: "red" }];
|
||||
assert.strictEqual(G.playedSteps(steps).length, 2);
|
||||
assert.strictEqual(G.trajectoryVariables({ steps, outcome: {} }).vars.direction, "Center");
|
||||
assert.strictEqual(G.playedSteps([{ scene: "x", optionText: "only" }]).length, 1); // a run in progress
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user