# 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.