Files
threshing-atlas/.gitea/workflows/bot-cycle.yml
ekcSchianoandClaude Fable 5.2 ab3664f369 Route model: first attempts are their own shadow roll; experiment plan and automated bot cycle
- game.yaml: `givens` (first or later attempt) and `distinct` levels that are not pooled; the shadow roll
  depends on the attempt first. Form submissions show the shadow on 9% of first attempts and 0.3% of later ones.
- Reporting bias: a roll whose bias cannot be measured can borrow another roll's (`borrow: {shadow: meadow}`),
  so form submissions inform the shadow again. An assumption, stated in planner/policy.yaml.
- policy.json: targets.<colour>.firstAttempt (this attempt, eventually). Black: about 1.4% on a first attempt,
  0.07% on a later one.
- solver.js: advisor options `attempt`, `fix`, sampling "uniform"; assign() and armFor() for the plan.
- planner/experiments.yaml + build_experiments.py -> data/public/experiments.json (progress and status per
  experiment, rebuilt from the bot's runs).
- python -m collection cycle: import bot runs, refit, re-plan, deliver the kit; .gitea/workflows/bot-cycle.yml.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014jqCC2LZ4x1WHQ1V57nTsv
2026-11-12 03:31:33 +00:00

54 lines
2.5 KiB
YAML

# The loop with the bot, every four hours: import the bot's new runs, refit the route model, rebuild the experiment
# plan, hand the bot its files, and open a pull request with the new public data (it merges itself once CI passes).
# Gitea Actions. Needs a runner on the machine that has the bot's folder (the runner label below), because the
# bot's raw data (game prose, account names) never leaves that machine: only the anonymised runs are committed.
#
# Variables (repository Settings -> Actions -> Variables):
# DRAGONKIND_BOT_DIR the bot's folder on the runner, e.g. /home/ken/DragonKind
# ATLAS_DELIVER_DIR where the bot reads its files, e.g. /home/ken/DragonKind/vendor/threshing-atlas
# Secrets:
# DK_ACCOUNT_SALT the salt account names are hashed with (the same one every time)
# ATLAS_BOT_TOKEN as in update-sources.yml
name: Bot cycle
on:
schedule:
- cron: "41 */4 * * *"
workflow_dispatch:
jobs:
cycle:
runs-on: bot-host # a runner on the bot's machine; change it to that runner's label
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.ATLAS_BOT_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r requirements.txt
- name: Import, refit, re-plan, deliver
env:
DK_ACCOUNT_SALT: ${{ secrets.DK_ACCOUNT_SALT }}
run: python -m collection cycle --bot "${{ vars.DRAGONKIND_BOT_DIR }}" --deliver "${{ vars.ATLAS_DELIVER_DIR }}"
- id: diff
run: |
git add -A data analysis/reports
if git diff --cached --quiet; then echo "changed=false" >> "$GITHUB_OUTPUT"; else echo "changed=true" >> "$GITHUB_OUTPUT"; fi
- name: Tests
if: steps.diff.outputs.changed == 'true'
run: npm test
- name: Open a pull request with the new data (it merges itself once CI passes)
if: steps.diff.outputs.changed == 'true'
env:
ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }}
run: |
branch="data/bot-cycle-$(date -u +%Y%m%d-%H%M)"
git config user.name "Atlas data bot"
git config user.email "atlas-bot@noreply.localhost"
git checkout -b "$branch"
git commit -m "data: bot cycle (new runs, route model, experiment plan)"
git push origin "$branch"
python -m collection forge open-pr --head "$branch" --title "Bot cycle: new runs, route model and plan" --body-file exports/last-cycle.md --automerge