- packages/core/src/solver.js: decision tree with perfect recall over the community form's choices; chance events (first dragon, deaths, shadow, meadow dragon, encounter outcome) depend on earlier choices through hierarchical Dirichlet back-off with empirical-Bayes concentration per event; backward induction for P(colour this attempt) and Dinkelbach for P(colour) / (P(colour) + P(other colour)); 200 posterior draws for credible intervals and "still best" rates; cross-fitted held-out check. - Only genuine attempts inform encounter outcomes (goal / Malek intent). - data/public/policy.json (all runs and a low-bias sample) and the readable docs/POLICY.md; published on Pages with solver.js for the bot. - Bot advisor: re-solves from any history, maps advice onto screen text, reports margins so ties can be randomised. docs/BOT_INTEGRATION.md. - Tests on a synthetic world with known answers; daily source update now rebuilds the policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
name: Check sources for new data
|
|
on:
|
|
schedule:
|
|
- cron: "23 10 * * *" # daily
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
issues: write
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
- run: pip install -r research/python/requirements.txt
|
|
- id: check
|
|
run: python research/python/update_sources.py --report "$RUNNER_TEMP/report.md"
|
|
- name: Rebuild graph and run tests
|
|
if: steps.check.outputs.changed == 'true'
|
|
run: |
|
|
node scripts/build-graph.js
|
|
npm run policy
|
|
npm test
|
|
- name: Open a pull request with the new data
|
|
if: steps.check.outputs.changed == 'true'
|
|
uses: peter-evans/create-pull-request@v6
|
|
with:
|
|
branch: data/source-update
|
|
delete-branch: true
|
|
commit-message: "data: update from community sources"
|
|
title: "New data from the community sources"
|
|
body-path: ${{ runner.temp }}/report.md
|
|
labels: data
|
|
- name: Report a broken source link
|
|
if: steps.check.outputs.failed != ''
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
title="Source check failed: ${{ steps.check.outputs.failed }}"
|
|
if ! gh issue list --state open --search "$title in:title" --json number --jq '.[0].number' | grep -q .; then
|
|
gh issue create --title "$title" --body-file "$RUNNER_TEMP/report.md"
|
|
fi
|