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
100 lines
6.7 KiB
Markdown
100 lines
6.7 KiB
Markdown
# For Ken: what the bot needs for the automated cycle
|
|
|
|
The Atlas side is done (branch `first-attempt-cycle`). This is the bot's side. Details and code are in
|
|
`docs/BOT_INTEGRATION.md`, "The automated cycle". Nothing here was changed in the bot's repository.
|
|
|
|
## Why
|
|
|
|
Two things changed the plan (16 November).
|
|
|
|
**The developer says the Black is not dice** (`planner/knowledge.yaml`). The seed plays no part in whether it shows:
|
|
it shows when the rider's choices meet its conditions, and a rider who knows them bonds with certainty. There is no
|
|
single route; the bullies encounter and the tree are gates; there are a handful of conditions, not dozens.
|
|
|
|
**The runs say it is close to a first-attempt event** (`analysis/reports/BLACK.md`). On one and the same recorded
|
|
route, riders report the shadow on 21 of 79 first attempts and 1 of 80 later ones. The bot has 236 tree runs and no
|
|
shadow, all on attempt 2 or later; it has never logged a first attempt.
|
|
|
|
So the bot stops estimating a rate and starts looking for the rule: one exact path on every fresh account, then
|
|
one choice changed at a time. If the answer is not dice, a few accounts per question are enough.
|
|
|
|
## The five changes
|
|
|
|
1. **Play attempt 1 with the bot and log it** (`accountAttempt: 1`). Today the records start at attempt 2.
|
|
2. **Give every account a number** in the order the accounts are made (`accountSeq`: 0, 1, 2, ...), fixed for
|
|
its life. The plan uses it to balance the arms across accounts.
|
|
3. **At the start of every attempt**, load the kit from `vendor/threshing-atlas/` (when `atlas-kit.json` changed),
|
|
then:
|
|
|
|
```js
|
|
const a = Solver.assign(plan, { accountSeq, attempt, facts: { sawShadowBefore } }); // what this attempt is for
|
|
const adv = Solver.advisor(policy.samples.all, a.target, a.objective,
|
|
{ attempt, fix: a.fix, sampling: a.sampling, seed: a.seed });
|
|
```
|
|
|
|
and log `experimentId`, `arm`, `planId`, `policyId`, `accountAttempt` and the propensity on the run. Never
|
|
reload the kit in the middle of an attempt.
|
|
4. **The account's life** (`plan.lifecycle`): attempt 1 is the Black attempt; then three days of research
|
|
attempts; then retire the account, except when `accountSeq % 10` is 0 or 1 (those keep running).
|
|
5. **Run the cycle on a timer** on the bot's machine, from a clone of the Atlas:
|
|
|
|
```
|
|
# every hour; does nothing but deliver when there are no new runs
|
|
17 * * * * cd ~/threshing-atlas && git pull -q && DK_ACCOUNT_SALT=... python -m collection cycle \
|
|
--bot ~/DragonKind --deliver ~/DragonKind/vendor/threshing-atlas >> ~/atlas-cycle.log 2>&1
|
|
```
|
|
|
|
or as the Gitea workflow `.gitea/workflows/bot-cycle.yml` on a runner on that machine, which also opens the
|
|
pull request with the new public data. Use Kathleen's salt (sent privately), so the accounts keep the hashes
|
|
they already have in the data.
|
|
|
|
## What the plan asks for now (`planner/experiments.yaml`)
|
|
|
|
| Attempts | Experiment | What the bot does |
|
|
|---|---|---|
|
|
| 1 | `fresh-replicate` (60 accounts) | One exact path: alone, west, hold still, investigate, help, pause to assess, engage the smaller cadet, squadmate's revenge, fork west, tree. Burn when there is no shadow. |
|
|
| 1, afterwards | `fresh-ablate` (12 arms, 15 accounts each) | The same path with one choice changed. Starts by itself when the replication is complete. |
|
|
| 2 to 4, accounts that saw the shadow and died | `shadow-again` | The same path again. |
|
|
| 2, half of the other accounts | `second-attempt-same-path` | The same path again. |
|
|
| 3 onward, one account in ten | `veteran-repeat` | The same path on every attempt, indefinitely. |
|
|
| 3 onward, one account in ten | `veteran-variety` | A different combination of company, direction, fight, fate and fork on every attempt, both gates kept. |
|
|
| 2 onward, the rest | `meadow-blue-route` 50%, `mapping` 35%, `sentinel` 15% | As before. |
|
|
|
|
`assign()` now takes the account's facts: `Solver.assign(plan, { accountSeq, attempt, facts: { sawShadowBefore } })`.
|
|
|
|
## When the shadow shows
|
|
|
|
The bot has never seen these screens, so `experiments.json` carries the sequence riders report for a bonded Black
|
|
(`plan.scripts.shadow`): for each screen in order, a pattern for the option to take and one for options never to
|
|
take. In riders' notes, approaching the Blue or warning the other cadet has always been fatal, lowering your eyes to
|
|
the Black has never bonded (0 of 7), and holding its gaze bonded 27 of 39. Where a screen matches nothing in the
|
|
script, stop and notify a person: do not guess. Log every screen, its options and the pick; the 12 failures while
|
|
holding its gaze are unexplained, and the screens before it are where the explanation should be.
|
|
|
|
## What to record about the account
|
|
|
|
`plan.record` lists it: `accountSeq`, `accountAttempt`, `accountCreatedAt`, the cadet's `wing`, `section` and
|
|
`squad` as the site shows them, and `sawShadowBefore`. If identical paths on fresh accounts disagree about the shadow,
|
|
the difference is something the site knows about the account, and these are the candidates we can see.
|
|
|
|
The plan updates itself from the runs: a finished experiment stops being assigned and its share goes to the others.
|
|
|
|
## The screen tree, and two things found in the logs (16 November)
|
|
|
|
`tree.json` is now in the kit: every screen the bot has stood on, every option on it, how often each was played and
|
|
where it led (`analysis/reports/TREE.md` is the readable version). 47 of the 116 options seen have never been played.
|
|
|
|
- **Picking from the tree.** `Solver.screenPick(tree, sceneId, offeredTexts, { mode, seed })` returns the option to
|
|
pick. `plan.screenPicks` says when: `least-tried` in the mapping experiment (fills the gaps first), `thompson`
|
|
while bonding the target dragon (tries untested answers, drops the ones that kill). The four deadly screens of the
|
|
Blue encounter have only ever been answered one way each, so their other answers are unknown.
|
|
- **Overridden picks are in the logs as if they were played.** In 37 runs the bot logged the atlas's pick with
|
|
`to: "BURNED"` and then, on the same screen, the pick its own rule made (91 steps: first direction 37, the fork 33,
|
|
the dagger 11, the first dragon 9). The atlas now drops such steps, in the importer and in `graph.js`
|
|
(`playedSteps`), so the runs are coded with the choices that were made. Two things for the bot: log an overridden
|
|
recommendation as something other than a step, and note that in those runs the atlas's direction and fork advice
|
|
never took effect (`ENTER_TOWARDS_FOREST_CENTER` and `ROAD_FORK_DEEPER_FOREST` won). The experiments need the
|
|
plan's picks to win over those rules.
|
|
- **The best-reported route has already been played 64 times on later attempts** (alone, west, engage the smaller
|
|
cadet, squadmate's revenge, fork west) with no shadow, which matches riders' 1 in 80.
|