Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30aabdf084 | ||
|
|
78e069f03f | ||
|
|
f1027212b6 | ||
|
|
f41bd22439 | ||
|
|
d17155282a | ||
|
|
d301e71d79 | ||
|
|
9af9762314 | ||
|
|
6fae8a9833 | ||
|
|
47da9f1f82 | ||
|
|
a8a4b1901d | ||
|
|
bd89a8941b | ||
|
|
3e21fd8992 | ||
|
|
7d74b6ab8c | ||
|
|
9610765b61 | ||
|
|
73a6f5d355 | ||
|
|
3b5c655d51 | ||
|
|
e5bcd13db2 | ||
|
|
b3fa6c4c5b |
@@ -0,0 +1,60 @@
|
||||
# When the route model changes on main, send it to the bot: open (or update) a pull request on the bot's repo,
|
||||
# DragonKind/DragonKind, that replaces vendor/threshing-atlas/{policy.json,solver.js,graph.js} with this repo's
|
||||
# data/public/policy.json, core/solver.js and core/graph.js. The three always travel together, so the policy and the
|
||||
# solver that reads it never get out of step. Ken reviews and merges it; the running bot reloads the files after a pull.
|
||||
#
|
||||
# Secrets: ATLAS_BOT_TOKEN (repository: read and write, with write access to DragonKind/DragonKind).
|
||||
name: Send the route model to the bot
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- data/public/policy.json
|
||||
- core/solver.js
|
||||
- core/graph.js
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
send:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.ATLAS_BOT_TOKEN }}
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- run: pip install pyyaml
|
||||
- name: Open or update the pull request on the bot's repo
|
||||
env:
|
||||
ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }}
|
||||
run: |
|
||||
set -e
|
||||
dst="$RUNNER_TEMP/dragonkind"
|
||||
export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.https://git.kenschiano.net/.extraheader" \
|
||||
GIT_CONFIG_VALUE_0="AUTHORIZATION: token $ATLAS_BOT_TOKEN"
|
||||
git clone --quiet --depth 1 https://git.kenschiano.net/DragonKind/DragonKind.git "$dst"
|
||||
mkdir -p "$dst/vendor/threshing-atlas"
|
||||
cp data/public/policy.json core/solver.js core/graph.js "$dst/vendor/threshing-atlas/"
|
||||
id=$(python3 -c "import json; print(json.load(open('data/public/policy.json')).get('id', ''))")
|
||||
sha=$(git rev-parse --short HEAD)
|
||||
cd "$dst"
|
||||
if [ -z "$(git status --porcelain -- vendor/threshing-atlas)" ]; then
|
||||
echo "The bot already has route model $id."; exit 0
|
||||
fi
|
||||
git config user.name "Atlas data bot"
|
||||
git config user.email "atlas-bot@noreply.localhost"
|
||||
git checkout -q -b atlas/route-model
|
||||
git add vendor/threshing-atlas
|
||||
git commit -q -m "Threshing Atlas route model $id (atlas $sha)"
|
||||
git push -q --force origin atlas/route-model
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
printf '%s\n' \
|
||||
"The Threshing Atlas route model changed (policy \`$id\`, atlas commit \`$sha\`)." \
|
||||
"" \
|
||||
"This replaces \`vendor/threshing-atlas/\` (policy.json, solver.js, graph.js) together, as \`npm run atlas:sync\` would." \
|
||||
"This pull request is updated in place each time the model changes. After merging, pull on the bot's machine:" \
|
||||
"the running bot reloads the files on its next decision." \
|
||||
"" \
|
||||
"Opened automatically by the Atlas's push-policy workflow." > "$RUNNER_TEMP/body.md"
|
||||
python -m collection forge open-pr --repo DragonKind/DragonKind --base main --head atlas/route-model \
|
||||
--title "Threshing Atlas route model update" --body-file "$RUNNER_TEMP/body.md"
|
||||
@@ -8,6 +8,9 @@
|
||||
# update branch and open the pull request; the built-in token cannot start the CI it needs.
|
||||
# RAW_ARCHIVE_KEY optional: encrypts the private raw store kept in the Actions cache between runs
|
||||
# REDDIT_CLIENT_ID, REDDIT_CLIENT_SECRET optional: read the megathreads through the Reddit API
|
||||
# DK_ACCOUNT_SALT the salt that turns bot account names into anonymous keys (keep it the same forever). With it,
|
||||
# the bot's private repo (DragonKind/DragonKind) is downloaded and imported; without it, skipped.
|
||||
# DRAGONKIND_TOKEN optional: a read-only token for the bot's repo (ATLAS_BOT_TOKEN is used otherwise)
|
||||
name: Check sources for new data
|
||||
on:
|
||||
schedule:
|
||||
@@ -41,14 +44,29 @@ jobs:
|
||||
if [ -n "$RAW_ARCHIVE_KEY" ] && [ -f "$f" ]; then
|
||||
openssl enc -d -aes-256-cbc -pbkdf2 -pass env:RAW_ARCHIVE_KEY -in "$f" | tar -xz -C data
|
||||
fi
|
||||
- name: Download the bot's data (DragonKind/DragonKind, private)
|
||||
env:
|
||||
DK_TOKEN: ${{ secrets.DRAGONKIND_TOKEN || secrets.ATLAS_BOT_TOKEN }}
|
||||
DK_ACCOUNT_SALT: ${{ secrets.DK_ACCOUNT_SALT }}
|
||||
run: |
|
||||
if [ -n "$DK_TOKEN" ] && [ -n "$DK_ACCOUNT_SALT" ]; then
|
||||
GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.https://git.kenschiano.net/.extraheader" \
|
||||
GIT_CONFIG_VALUE_0="AUTHORIZATION: token $DK_TOKEN" \
|
||||
git clone --quiet --depth 1 https://git.kenschiano.net/DragonKind/DragonKind.git "$RUNNER_TEMP/dragonkind"
|
||||
echo "DRAGONKIND_BOT_DIR=$RUNNER_TEMP/dragonkind" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "DK_ACCOUNT_SALT is not set: the bot source is skipped"
|
||||
fi
|
||||
- id: check
|
||||
env:
|
||||
ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }}
|
||||
DK_ACCOUNT_SALT: ${{ secrets.DK_ACCOUNT_SALT }}
|
||||
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
|
||||
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
|
||||
run: python -m collection update --report "$RUNNER_TEMP/report.md"
|
||||
- name: Rebuild the analysis and run tests
|
||||
if: steps.check.outputs.changed == 'true'
|
||||
# not when the combined runs failed validation: the issue below reports the new answers instead
|
||||
if: steps.check.outputs.changed == 'true' && !contains(steps.check.outputs.failed, 'build')
|
||||
run: |
|
||||
python -m collection rebuild
|
||||
npm test
|
||||
@@ -69,11 +87,12 @@ jobs:
|
||||
path: ${{ runner.temp }}/raw-archive
|
||||
key: raw-archive-${{ hashFiles('data/manifest.json') }}
|
||||
- name: Open a pull request with the new data (it merges itself once CI passes)
|
||||
if: steps.check.outputs.changed == 'true'
|
||||
if: steps.check.outputs.changed == 'true' && !contains(steps.check.outputs.failed, 'build')
|
||||
env:
|
||||
ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }}
|
||||
run: |
|
||||
branch="data/source-update-$(date -u +%Y%m%d)"
|
||||
# one branch per run: a second run on the same day (or a leftover branch) never blocks the push
|
||||
branch="data/source-update-$(date -u +%Y%m%d)-run${{ github.run_number }}"
|
||||
git config user.name "Atlas data bot"
|
||||
git config user.email "atlas-bot@noreply.localhost"
|
||||
git checkout -b "$branch"
|
||||
@@ -82,7 +101,7 @@ jobs:
|
||||
git push origin "$branch"
|
||||
python -m collection forge open-pr --head "$branch" --title "New data from the community sources" --body-file "$RUNNER_TEMP/report.md" --automerge
|
||||
- name: Report a broken source or new answers
|
||||
if: steps.check.outputs.failed != ''
|
||||
if: always() && steps.check.outputs.failed != ''
|
||||
env:
|
||||
ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }}
|
||||
run: |
|
||||
|
||||
@@ -20,6 +20,7 @@ sys.path.insert(0, str(ROOT / "core"))
|
||||
from atlas import runs as runs_io # noqa: E402
|
||||
|
||||
OUT = ROOT / "analysis/reports/BLACK.md"
|
||||
OUT_JSON = ROOT / "data/public/black.json" # the same numbers, for the page
|
||||
ROUTE = ["company", "direction", "combat_first", "combat_second", "resolution", "post_path"]
|
||||
ROUTE_NAMES = "company, first direction, first move in the fight, the dagger, the bullies' fate, the fork"
|
||||
|
||||
@@ -97,8 +98,10 @@ def blue_mistake(note):
|
||||
|
||||
|
||||
def build():
|
||||
"""(the report as Markdown, its key numbers as a dict for the page)."""
|
||||
runs = runs_io.read()
|
||||
G = [r for r in runs if gated_tree(r)]
|
||||
facts = {"schema": 1, "by_attempt": {}}
|
||||
L = ["# The Black dragon: what the runs show", "",
|
||||
"Written by `analysis/black/evidence.py` from `data/public/runs_clean.csv`. Counts only; nothing is fitted. "
|
||||
"\"Gated tree runs\" investigated the scream, helped the squadmate and climbed the tree, the two gates the "
|
||||
@@ -114,6 +117,7 @@ def build():
|
||||
for g in ("form", "bulk logs", "bot"):
|
||||
rs = [r for r in G if group(r) == g and r["attempt"] and lo <= r["attempt"] <= hi]
|
||||
cells.append(frac(sum(bool(r["saw_shadow"]) for r in rs), len(rs)))
|
||||
facts["by_attempt"].setdefault(g, {})[name] = [sum(bool(r["saw_shadow"]) for r in rs), len(rs)]
|
||||
L.append(f"| {name} | " + " | ".join(cells) + " |")
|
||||
cells = []
|
||||
for g in ("form", "bulk logs", "bot"):
|
||||
@@ -136,6 +140,10 @@ def build():
|
||||
c[i] += bool(r["saw_shadow"])
|
||||
c[i + 1] += 1
|
||||
orr, obs, exp, z = mantel_haenszel(by.values())
|
||||
facts["same_route"] = {"routes": len(by), "first_shadows": round(obs), "expected": round(exp, 1),
|
||||
"odds_ratio": round(orr, 1), "z": round(z, 1)}
|
||||
facts["form_first"] = [sum(c[0] for c in by.values()), sum(c[1] for c in by.values())]
|
||||
facts["form_later"] = [sum(c[2] for c in by.values()), sum(c[3] for c in by.values())]
|
||||
L += ["## 2. The same route on a first attempt and on a later one", "",
|
||||
f"If the shadow depended only on the choices the form records ({ROUTE_NAMES}), a route would do as well on a "
|
||||
"later attempt as on a first. It does not.", "",
|
||||
@@ -151,6 +159,7 @@ def build():
|
||||
|
||||
# 3. is it decided by route + cadet assignment?
|
||||
best_key, best = max(((k, v) for k, v in by.items() if v[1] >= 20), key=lambda kv: kv[1][0] / kv[1][1])
|
||||
facts["best_route"] = {"route": list(best_key), "first": [best[0], best[1]], "later": [best[2], best[3]]}
|
||||
B = [r for r in F if r["attempt"] == 1 and tuple(r[k] for k in ROUTE) == best_key]
|
||||
cells = tally(B, lambda r: (r["wing"], r["section"], r["squad"]))
|
||||
multi = {k: v for k, v in cells.items() if v[1] >= 2}
|
||||
@@ -178,6 +187,7 @@ def build():
|
||||
t = collections.Counter(r[col] for r in S1)
|
||||
L.append(f"- **{label}:** " + ", ".join(f"{k} {v}" for k, v in t.most_common()))
|
||||
outside = [r for r in runs if r["saw_shadow"] and not (r["scream"] == "Investigate & help" and r["hour"] == "Tree")]
|
||||
facts["shadow_routes"] = {"runs": len(S1), "routes": len({tuple(r[k] for k in ROUTE) for r in S1}), "off_gate": len(outside)}
|
||||
L += ["", f"Shadows reported without both gates: {len(outside)} (likely mis-entered).", ""]
|
||||
|
||||
# 5. after the shadow
|
||||
@@ -190,6 +200,9 @@ def build():
|
||||
ans[a][0] += r["outcome"] == "Bonded"
|
||||
ans[a][1] += 1
|
||||
blue_dead = [r for r in SH if r["enc_Blue"] == "Incinerated"]
|
||||
facts["after_shadow"] = {"reached_black": len(black), "bonded_black": sum(r["outcome"] == "Bonded" for r in black),
|
||||
"died_at_blue": len(blue_dead),
|
||||
"answers": {k: [y, n] for k, (y, n) in sorted(ans.items(), key=lambda kv: -kv[1][1])}}
|
||||
mis = collections.Counter(blue_mistake((r["bond_note"] or "") + " " + (r["death_note"] or "")) for r in blue_dead)
|
||||
L += ["## 5. After the shadow: the Blue, then the Black", "",
|
||||
"The riders' notes describe one sequence: follow the shadow, a Blue lands and burns another cadet, the Blue "
|
||||
@@ -224,6 +237,9 @@ def build():
|
||||
cur = cur + 1 if s is not None and s == prev else (1 if s is not None else 0)
|
||||
prev, streak = s, max(streak, cur)
|
||||
botg = [r for r in G if group(r) == "bot"]
|
||||
facts["bot"] = {"attempts": len(seen), "accounts": len(acc), "gated_tree": len(botg),
|
||||
"shadows": sum(bool(r["saw_shadow"]) for r in botg),
|
||||
"earliest_attempt": min((min(v) for v in acc.values() if v), default=0)}
|
||||
routes = collections.Counter(tuple(r[k] for k in ROUTE) for r in botg)
|
||||
L += [f"{len(seen)} attempts on {len(acc)} accounts; the earliest attempt logged on any account is number "
|
||||
f"{min((min(v) for v in acc.values() if v), default=0)}. Gated tree runs: {len(botg)}, shadows "
|
||||
@@ -231,21 +247,24 @@ def build():
|
||||
f"(the commonest {routes.most_common(1)[0][1] if routes else 0} times). The bot has not played a first attempt, "
|
||||
"so it has not yet tested the one situation where riders report the shadow. The most times any account has "
|
||||
f"repeated one route in a row is {streak}.", ""]
|
||||
return "\n".join(L) + "\n"
|
||||
return "\n".join(L) + "\n", facts
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
ap = argparse.ArgumentParser(description=__doc__)
|
||||
ap.add_argument("--check", action="store_true")
|
||||
a = ap.parse_args(argv)
|
||||
text = build()
|
||||
text, facts = build()
|
||||
data = json.dumps(facts, ensure_ascii=False, indent=1) + "\n"
|
||||
if a.check:
|
||||
if not OUT.exists() or OUT.read_text(encoding="utf-8") != text:
|
||||
print(f"{OUT} is out of date (run python analysis/black/evidence.py)", file=sys.stderr)
|
||||
return 1
|
||||
for path, want in ((OUT, text), (OUT_JSON, data)):
|
||||
if not path.exists() or path.read_text(encoding="utf-8") != want:
|
||||
print(f"{path} is out of date (run python analysis/black/evidence.py)", file=sys.stderr)
|
||||
return 1
|
||||
return 0
|
||||
OUT.write_text(text, encoding="utf-8")
|
||||
print(f"wrote {OUT.relative_to(ROOT)}")
|
||||
OUT_JSON.write_text(data, encoding="utf-8")
|
||||
print(f"wrote {OUT.relative_to(ROOT)} and {OUT_JSON.relative_to(ROOT)}")
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
+32
-32
@@ -6,15 +6,15 @@ Written by `analysis/black/evidence.py` from `data/public/runs_clean.csv`. Count
|
||||
|
||||
| Attempt | Form submissions | Bulk logs | Bot |
|
||||
|---|---|---|---|
|
||||
| 1 | 69 / 748 (9.2%) | 0 / 28 (0.0%) | 0 / 0 |
|
||||
| 2 | 3 / 274 (1.1%) | 0 / 21 (0.0%) | 0 / 4 (0.0%) |
|
||||
| 3 | 1 / 177 (0.6%) | 0 / 14 (0.0%) | 0 / 5 (0.0%) |
|
||||
| 4-10 | 1 / 485 (0.2%) | 0 / 102 (0.0%) | 0 / 36 (0.0%) |
|
||||
| 11-30 | 1 / 524 (0.2%) | 0 / 57 (0.0%) | 0 / 137 (0.0%) |
|
||||
| 31 or more | 1 / 535 (0.2%) | 0 / 0 | 0 / 54 (0.0%) |
|
||||
| not given | 11 / 1406 (0.8%) | 0 / 112 (0.0%) | 0 / 0 |
|
||||
| 1 | 92 / 920 (10.0%) | 0 / 29 (0.0%) | 0 / 0 |
|
||||
| 2 | 0 / 296 (0.0%) | 0 / 21 (0.0%) | 0 / 4 (0.0%) |
|
||||
| 3 | 0 / 192 (0.0%) | 0 / 14 (0.0%) | 0 / 5 (0.0%) |
|
||||
| 4-10 | 0 / 536 (0.0%) | 0 / 102 (0.0%) | 0 / 36 (0.0%) |
|
||||
| 11-30 | 0 / 614 (0.0%) | 0 / 57 (0.0%) | 0 / 137 (0.0%) |
|
||||
| 31 or more | 1 / 679 (0.1%) | 0 / 0 | 0 / 54 (0.0%) |
|
||||
| not given | 3 / 1576 (0.2%) | 0 / 149 (0.0%) | 0 / 0 |
|
||||
|
||||
Complete logs (bot and bulk) have 28 first attempts at the tree and 430 later ones, with 0 shadows. Zero in 430 later attempts rules out a rate above 0.7% for them; zero in 28 first attempts only rules out more than 10%.
|
||||
Complete logs (bot and bulk) have 29 first attempts at the tree and 430 later ones, with 0 shadows. Zero in 430 later attempts rules out a rate above 0.7% for them; zero in 29 first attempts only rules out more than 10%.
|
||||
|
||||
## 2. The same route on a first attempt and on a later one
|
||||
|
||||
@@ -22,39 +22,39 @@ If the shadow depended only on the choices the form records (company, first dire
|
||||
|
||||
| Route | First attempt | Later attempts |
|
||||
|---|---|---|
|
||||
| Alone / West / Assess the situation / Engage the smaller cadet / Squadmate's revenge / West | 21 / 79 (26.6%) | 1 / 80 (1.2%) |
|
||||
| Alone / West / Assess the situation / Engage the smaller cadet / Squadmate's revenge / Forest | 4 / 28 (14.3%) | 0 / 91 (0.0%) |
|
||||
| Alone / Center / Assess the situation / Engage the smaller cadet / Squadmate's revenge / Forest | 4 / 25 (16.0%) | 0 / 70 (0.0%) |
|
||||
| Alone / Center / Assess the situation / Daggers or not (protect squadmate) / Left bullies to the dragons / Forest | 1 / 28 (3.6%) | 0 / 62 (0.0%) |
|
||||
| Alone / Center / Assess the situation / Engage the smaller cadet / Squadmate's revenge / West | 1 / 8 (12.5%) | 1 / 80 (1.2%) |
|
||||
| 1 Squadmate / East / Assess the situation / Engage the smaller cadet / Squadmate's revenge / East | 2 / 28 (7.1%) | 0 / 60 (0.0%) |
|
||||
| Alone / East / Assess the situation / Engage the smaller cadet / Squadmate's revenge / East | 1 / 33 (3.0%) | 0 / 48 (0.0%) |
|
||||
| Alone / West / Assess the situation / Engage the smaller cadet / Left bullies to the dragons / West | 2 / 23 (8.7%) | 0 / 53 (0.0%) |
|
||||
| Alone / West / Assess the situation / Engage the smaller cadet / Squadmate's revenge / West | 23 / 93 (24.7%) | 0 / 94 (0.0%) |
|
||||
| Alone / West / Assess the situation / Engage the smaller cadet / Squadmate's revenge / Forest | 5 / 29 (17.2%) | 0 / 95 (0.0%) |
|
||||
| Alone / Center / Assess the situation / Engage the smaller cadet / Squadmate's revenge / Forest | 4 / 28 (14.3%) | 0 / 78 (0.0%) |
|
||||
| 1 Squadmate / East / Assess the situation / Engage the smaller cadet / Squadmate's revenge / East | 2 / 32 (6.2%) | 0 / 67 (0.0%) |
|
||||
| Alone / East / Assess the situation / Engage the smaller cadet / Squadmate's revenge / East | 1 / 34 (2.9%) | 0 / 60 (0.0%) |
|
||||
| 2 Squadmates / East / Assess the situation / Engage the smaller cadet / Squadmate's revenge / East | 2 / 45 (4.4%) | 0 / 48 (0.0%) |
|
||||
| Alone / Center / Assess the situation / Daggers or not (protect squadmate) / Left bullies to the dragons / Forest | 1 / 28 (3.6%) | 0 / 64 (0.0%) |
|
||||
| Alone / Center / Assess the situation / Engage the smaller cadet / Squadmate's revenge / West | 1 / 8 (12.5%) | 1 / 82 (1.2%) |
|
||||
|
||||
Across all 296 recorded routes, comparing first and later attempts on the same route: 66 first-attempt shadows where 29.4 would be expected if the attempt did not matter (odds ratio 21.5, z = 9.8). First and later attempts choose almost the same routes, so the difference is not in the recorded choices: it is something about the account, or a choice the form does not record.
|
||||
Across all 323 recorded routes, comparing first and later attempts on the same route: 88 first-attempt shadows where 37.2 would be expected if the attempt did not matter (odds ratio 653.8, z = 12.1). First and later attempts choose almost the same routes, so the difference is not in the recorded choices: it is something about the account, or a choice the form does not record.
|
||||
|
||||
## 3. On one route, is the shadow decided by the cadet's wing, section and squad?
|
||||
|
||||
The developer says the Black is decided by choices and by what the site knows about the account, with no dice. If the recorded route and the cadet assignment were all of it, every first attempt with the same route and assignment would agree. On the best-recorded route (Alone / West / Assess the situation / Engage the smaller cadet / Squadmate's revenge / West; 21 / 79 (26.6%) on first attempts), 20 assignments have two or more runs and 10 of them disagree (some runs with the shadow, some without). So something else decides it: a choice the form does not record, or a fact about the account other than its assignment. No wing, section or squad stands out:
|
||||
The developer says the Black is decided by choices and by what the site knows about the account, with no dice. If the recorded route and the cadet assignment were all of it, every first attempt with the same route and assignment would agree. On the best-recorded route (Alone / West / Assess the situation / Engage the smaller cadet / Squadmate's revenge / West; 23 / 93 (24.7%) on first attempts), 26 assignments have two or more runs and 12 of them disagree (some runs with the shadow, some without). So something else decides it: a choice the form does not record, or a fact about the account other than its assignment. No wing, section or squad stands out:
|
||||
|
||||
| | shadow / runs |
|
||||
|---|---|
|
||||
| wing | Fourth: 5/25, Third: 6/23, First: 6/16, Second: 3/12 |
|
||||
| section | Claw: 8/27, Tail: 7/26, Flame: 5/23, (blank): 1/3 |
|
||||
| squad | Second: 10/28, First: 6/26, Third: 4/23 |
|
||||
| first_sighting | Brown: 10/40, Green: 9/37 |
|
||||
| sighting_action | Hold still: 10/43, Respect / face it: 4/16, Unknown: 7/13, Weapon: 0/5 |
|
||||
| wing | Fourth: 5/28, Third: 7/27, First: 6/21, Second: 4/14 |
|
||||
| section | Claw: 9/31, Flame: 5/30, Tail: 8/29, (blank): 1/3 |
|
||||
| squad | Second: 12/35, First: 6/29, Third: 4/27 |
|
||||
| first_sighting | Brown: 12/49, Green: 9/42 |
|
||||
| sighting_action | Hold still: 10/50, Respect / face it: 5/22, Unknown: 8/14, Weapon: 0/5 |
|
||||
|
||||
## 4. There is no single route
|
||||
|
||||
The 87 form runs with a shadow (all attempts) took 44 different recorded routes:
|
||||
The 96 form runs with a shadow (all attempts) took 46 different recorded routes:
|
||||
|
||||
- **Company:** Alone 70, 2 Squadmates 9, 1 Squadmate 8
|
||||
- **First direction:** West 53, Center 20, East 14
|
||||
- **First move in the fight:** Assess the situation 76, (not recorded) 9, Even the numbers (smaller cadet) 2
|
||||
- **The dagger:** Engage the smaller cadet 56, (not recorded) 22, Daggers or not (protect squadmate) 9
|
||||
- **The bullies' fate:** Squadmate's revenge 54, Left bullies to the dragons 22, Killed the bullies yourself 9, Unknown 2
|
||||
- **The fork:** West 40, Forest 35, East 11, Unknown 1
|
||||
- **Company:** Alone 71, 1 Squadmate 13, 2 Squadmates 12
|
||||
- **First direction:** West 60, Center 20, East 16
|
||||
- **First move in the fight:** Assess the situation 85, (not recorded) 9, Even the numbers (smaller cadet) 2
|
||||
- **The dagger:** Engage the smaller cadet 63, (not recorded) 22, Daggers or not (protect squadmate) 11
|
||||
- **The bullies' fate:** Squadmate's revenge 60, Left bullies to the dragons 25, Killed the bullies yourself 9, Unknown 2
|
||||
- **The fork:** West 46, Forest 36, East 13, Unknown 1
|
||||
|
||||
Shadows reported without both gates: 3 (likely mis-entered).
|
||||
|
||||
@@ -62,9 +62,9 @@ Shadows reported without both gates: 3 (likely mis-entered).
|
||||
|
||||
The riders' notes describe one sequence: follow the shadow, a Blue lands and burns another cadet, the Blue leaves, then the Black appears. The Blue is a trial on the way, not an alternative to the Black.
|
||||
|
||||
- Runs that reached the Black: 70, bonded 49.
|
||||
- Runs that reached the Black: 79, bonded 57.
|
||||
- Runs that died at the Blue: 15. What their notes say they did: approached the Blue 10, warned the other cadet / intervened 4.
|
||||
- The answer given to the Black, where the note says (bonded / runs): held its gaze 27/39; lowered eyes 0/7; ignored the sound 0/1.
|
||||
- The answer given to the Black, where the note says (bonded / runs): held its gaze 29/41; lowered eyes 0/7; ignored the sound 0/1.
|
||||
|
||||
Holding its gaze is the only answer recorded with a bond, and it still fails about a quarter of the time. The developer says a rider who knows the system bonds with certainty, so those failures are not explained yet: the notes of the riders who died are too short to show what else they did differently.
|
||||
|
||||
|
||||
+16
-5
@@ -1,6 +1,6 @@
|
||||
"""The repository host (forge.yaml): links, and the few API calls the pipeline makes, for Gitea and GitHub.
|
||||
|
||||
python -m collection forge open-pr --head BRANCH --title T --body-file F [--automerge]
|
||||
python -m collection forge open-pr --head BRANCH --title T --body-file F [--automerge] [--repo OWNER/NAME --base B]
|
||||
python -m collection forge open-issue --title T --body-file F (skipped if an open issue has that title)
|
||||
python -m collection forge ensure-label --name N --color HEX
|
||||
|
||||
@@ -96,10 +96,19 @@ def list_issues(label, env=None, f=None):
|
||||
return sorted(out, key=lambda i: i["number"])
|
||||
|
||||
|
||||
def open_pr(head, title, body, automerge=False, env=None, f=None):
|
||||
f = f or config()
|
||||
def open_pr(head, title, body, automerge=False, env=None, f=None, repo=None, base=None):
|
||||
"""Open a pull request (on this repository, or `repo` on the same host). If one is open for the branch already,
|
||||
it is reused: pushing to its branch has updated it."""
|
||||
f = dict(f or config())
|
||||
if repo:
|
||||
f["repo"] = repo
|
||||
base = base or f["branch"]
|
||||
tok = token(env)
|
||||
pr = _call("POST", f"{api_base(f)}/pulls", {"head": head, "base": f["branch"], "title": title, "body": body}, tok, f)
|
||||
open_prs = _call("GET", f"{api_base(f)}/pulls?state=open&limit=50&per_page=100", tok=tok, f=f) or []
|
||||
same = [p for p in open_prs if (p.get("head") or {}).get("ref") == head]
|
||||
if same:
|
||||
return same[0]["number"]
|
||||
pr = _call("POST", f"{api_base(f)}/pulls", {"head": head, "base": base, "title": title, "body": body}, tok, f)
|
||||
n = pr["number"]
|
||||
if automerge:
|
||||
if f["kind"] == "github":
|
||||
@@ -141,6 +150,8 @@ def main(argv):
|
||||
p.add_argument("--title", required=True)
|
||||
p.add_argument("--body-file", required=True)
|
||||
p.add_argument("--automerge", action="store_true")
|
||||
p.add_argument("--repo", help="another repository on the same host (OWNER/NAME)")
|
||||
p.add_argument("--base", help="the branch to merge into (default: forge.yaml branch)")
|
||||
i = sub.add_parser("open-issue")
|
||||
i.add_argument("--title", required=True)
|
||||
i.add_argument("--body-file", required=True)
|
||||
@@ -150,7 +161,7 @@ def main(argv):
|
||||
a = ap.parse_args(argv)
|
||||
if a.cmd == "open-pr":
|
||||
body = open(a.body_file, encoding="utf-8").read()
|
||||
print(f"pull request #{open_pr(a.head, a.title, body, a.automerge)}")
|
||||
print(f"pull request #{open_pr(a.head, a.title, body, a.automerge, repo=a.repo, base=a.base)}")
|
||||
elif a.cmd == "open-issue":
|
||||
n = open_issue(a.title, open(a.body_file, encoding="utf-8").read())
|
||||
print(f"issue #{n}" if n else "an open issue with that title exists already")
|
||||
|
||||
@@ -77,6 +77,8 @@ def rebuild():
|
||||
"""Everything built from the runs, in order. The one list the local refresh, the bot cycle and the daily
|
||||
workflows all use (`python -m collection rebuild`), so a new report only needs adding here."""
|
||||
py = sys.executable
|
||||
# the runs first: if they do not match data/dictionary.yaml, stop here rather than model yesterday's runs
|
||||
_step("runs, checked against the dictionary", [py, "-m", "collection", "build"])
|
||||
if shutil.which("node"):
|
||||
_step("route graph", ["node", "analysis/network/build-graph.js"])
|
||||
else:
|
||||
|
||||
@@ -95,5 +95,5 @@ sources:
|
||||
# data/raw/bot/account-salt.txt); never committed
|
||||
refuse_fields: [prose, proseNorm, proseExcerpt, email, password, accountId, accountName]
|
||||
max_string: 200 # anything longer looks like game prose
|
||||
load: data/bot # scenes.json (merged) + trajectories-<date>.jsonl
|
||||
load: data/bot # scenes.json and trajectories-bot.jsonl, both merged with what is published
|
||||
runs: bot
|
||||
|
||||
+25
-4
@@ -28,10 +28,33 @@ from datetime import datetime, timezone
|
||||
from .etl import extract as E
|
||||
from .etl import load as L
|
||||
from .etl import codegen, metadata, report_form, runs, validate
|
||||
from .etl.common import Report, path, pipeline
|
||||
from .etl.common import Report, path, pipeline, read_jsonl
|
||||
from .etl.transform import TRANSFORMS
|
||||
|
||||
|
||||
BOT_FILE = "trajectories-bot.jsonl"
|
||||
|
||||
|
||||
def merge_trajectories(target, new):
|
||||
"""Every bot attempt ever imported, in one file (data/bot/trajectories-bot.jsonl), sorted by id. The bot's repo
|
||||
holds each account's full history, so an import is a superset: a re-imported attempt replaces its old copy, and
|
||||
attempts no longer in the bot's repo (an archived account) stay. Older per-import files are folded in."""
|
||||
d = path(target)
|
||||
olds = sorted(d.glob("trajectories-*.jsonl"))
|
||||
by_id = {}
|
||||
for f in olds:
|
||||
for t in read_jsonl(f):
|
||||
by_id.setdefault(t["id"], t)
|
||||
for t in new:
|
||||
by_id[t["id"]] = t
|
||||
wrote = L.jsonl_file(f"{target}/{BOT_FILE}", [by_id[k] for k in sorted(by_id)])
|
||||
for f in olds:
|
||||
if f.name != BOT_FILE:
|
||||
f.unlink()
|
||||
wrote = True
|
||||
return wrote
|
||||
|
||||
|
||||
def update_source(name, spec, manifest, report, local_file=None, env=None):
|
||||
env = os.environ if env is None else env
|
||||
try:
|
||||
@@ -54,9 +77,7 @@ def update_source(name, spec, manifest, report, local_file=None, env=None):
|
||||
old = {"scenes": L.read_json(f"{target}/scenes.json") or {}}
|
||||
lines = mod.describe(old, new)
|
||||
wrote = L.json_file(f"{target}/scenes.json", mod.merge_scenes(old["scenes"], new["scenes"]), compact=False)
|
||||
# one file per import (date + raw checksum), so two imports on the same day (yours, Ken's) never overwrite
|
||||
tag = f"{ctx['changed']}-{manifest[name]['sha256'][:8]}"
|
||||
wrote |= L.jsonl_file(f"{target}/trajectories-{tag}.jsonl", new["trajectories"])
|
||||
wrote |= merge_trajectories(target, new["trajectories"])
|
||||
elif target:
|
||||
old = L.read_json(target)
|
||||
lines = mod.describe(old, new)
|
||||
|
||||
@@ -150,6 +150,10 @@ def code_row(r, C):
|
||||
company = company_raw[: -len(suffix)] if left_squad else company_raw
|
||||
if not left_squad and company in ("1 Squadmate", "2 Squadmates") and not (date and date >= F["left_squadmates_asked_from"]):
|
||||
left_squad = None # the form did not offer "left them" yet: unknown, not "stayed together"
|
||||
alias = F.get("first_sighting_alias") or {}
|
||||
if first in alias:
|
||||
flags.append(f"first sighting answered as {first!r}")
|
||||
first = alias[first]
|
||||
pools = F["sighting_pool"]
|
||||
pool = list(pools.get(company, {}).get(direction, [])) + (list(pools["Alone"].get(direction, [])) if left_squad else [])
|
||||
if first and first != "Unsure" and pool and first not in pool:
|
||||
@@ -250,7 +254,7 @@ def code_row(r, C):
|
||||
goal = g("goal") or (A["goal_v2"].get(goal_raw, goal_raw) if goal_raw and goal_raw != "Unknown" else None) or "(not asked/blank)"
|
||||
return {
|
||||
"source": source, "date": date, "wing": wing, "section": section,
|
||||
"squad": g("squad") or "Unknown", "attempt": attempt,
|
||||
"squad": A["squad_any_case"].get((g("squad") or "").strip().lower(), g("squad") or "Unknown"), "attempt": attempt,
|
||||
# "I've lost count" means many attempts, so it is a later attempt, not missing
|
||||
"attempt_group": "First attempt" if attempt == 1 else ("Later attempt" if (attempt and attempt > 1) or "lost count" in (g("attempt") or "").lower() else "Unknown"),
|
||||
"goal": goal, "company": company, "left_squadmates": left_squad,
|
||||
|
||||
@@ -104,6 +104,12 @@ answers:
|
||||
"Trying to bond the Red dragon under the tree": "Red (tree)"
|
||||
"Daily Run Assignment data": "Daily run data"
|
||||
"Just here for fun, and maybe a dragon": "Any (for fun)"
|
||||
# Squad: matched ignoring case and spaces (riders type it); an answer not listed still stops the build
|
||||
squad_any_case:
|
||||
"first": "First"
|
||||
"second": "Second"
|
||||
"third": "Third"
|
||||
"don't know": "Don't know"
|
||||
sighting_action:
|
||||
"Hold Ground / Stay Still": "Hold still"
|
||||
"Respect / Face it": "Respect / face it"
|
||||
@@ -147,5 +153,10 @@ sighting_pool:
|
||||
1 Squadmate: { East: [Green, Orange, Red], West: [Red, Brown, Green], Center: [Red, Brown] }
|
||||
2 Squadmates: { East: [Red, Orange], West: [Green, Brown, Red], Center: [Red, Brown] }
|
||||
|
||||
# First-sighting answers that are not a single colour: coded as this colour, and the row is flagged with the
|
||||
# original answer (data_flags), so nothing is lost.
|
||||
first_sighting_alias:
|
||||
"2 Greens": Green
|
||||
|
||||
# How a bulk-pasted row's attempt answer is read
|
||||
attempt_words: { first: 1, second: 2, third: 3, fourth: 4, fifth: 5 }
|
||||
|
||||
+13
-13
@@ -88,8 +88,8 @@
|
||||
"description": "Every run from every source, one per row, coded into the same columns (collection/etl/runs.py; the form's rules are core/spec/form.yaml). The `source` column says where each run came from.",
|
||||
"contentUrl": "https://git.kenschiano.net/kathleen/threshing-atlas/raw/branch/main/data/public/runs_clean.csv",
|
||||
"encodingFormat": "text/csv",
|
||||
"sha256": "12060f4497e92abf60de728167cb3d37eaf9ed889060fd110be581df0e1d29f4",
|
||||
"contentSize": "3123252 B"
|
||||
"sha256": "ad595952e25f42ddd07d9ead5d12705b6f73330f2ab8f0f949d82140af93e3b2",
|
||||
"contentSize": "3475159 B"
|
||||
},
|
||||
{
|
||||
"@type": "cr:FileObject",
|
||||
@@ -98,8 +98,8 @@
|
||||
"description": "The community \"Threshing Routes\" form export as published (headers and rows), with email addresses in free-text answers redacted. The source of runs_clean.",
|
||||
"contentUrl": "https://git.kenschiano.net/kathleen/threshing-atlas/raw/branch/main/data/public/form_responses.json",
|
||||
"encodingFormat": "application/json",
|
||||
"sha256": "7ca72f9967a9b15fd52160106b1508c8cfbde804539d6afa3f04df326d7bf2b2",
|
||||
"contentSize": "11019524 B"
|
||||
"sha256": "78122dc3e25ee9267e935722660d7ad7358d0602fdf5cd13f4c33a79a2194c02",
|
||||
"contentSize": "12453893 B"
|
||||
},
|
||||
{
|
||||
"@type": "cr:FileObject",
|
||||
@@ -118,8 +118,8 @@
|
||||
"description": "The Unofficial Dragon Register (which dragon each rider bonded), without rider names.",
|
||||
"contentUrl": "https://git.kenschiano.net/kathleen/threshing-atlas/raw/branch/main/data/public/register.json",
|
||||
"encodingFormat": "application/json",
|
||||
"sha256": "b55e62a7be1d2f8858bc3bf0ad35881bbcd87f61a634f219f2b2bea5a453ff58",
|
||||
"contentSize": "116221 B"
|
||||
"sha256": "32d546c9e9ffb1536b21806e174c98bf60a078478926275404e23a9c90b8bb0f",
|
||||
"contentSize": "118171 B"
|
||||
},
|
||||
{
|
||||
"@type": "cr:FileObject",
|
||||
@@ -128,8 +128,8 @@
|
||||
"description": "Every number the Atlas page shows, for six filter presets (analysis/stats/site_stats.py; what is measured is analysis/stats/measures.yaml).",
|
||||
"contentUrl": "https://git.kenschiano.net/kathleen/threshing-atlas/raw/branch/main/data/public/stats.json",
|
||||
"encodingFormat": "application/json",
|
||||
"sha256": "aa3b1eb313655b75c290f538373b72b1a29b4685f389feabea487b333c0f96a6",
|
||||
"contentSize": "5063942 B"
|
||||
"sha256": "9285350c4d807bcdc7e8ea78cd1c9d207453913638fe4f32e8b7572e4f7927b4",
|
||||
"contentSize": "5426522 B"
|
||||
},
|
||||
{
|
||||
"@type": "cr:FileObject",
|
||||
@@ -138,8 +138,8 @@
|
||||
"description": "The route model: the game (core/spec/game.yaml), the count tables behind every roll, and the best decision tree for every dragon colour under two goals, with posterior intervals (planner/build_policy.py).",
|
||||
"contentUrl": "https://git.kenschiano.net/kathleen/threshing-atlas/raw/branch/main/data/public/policy.json",
|
||||
"encodingFormat": "application/json",
|
||||
"sha256": "695f2ca834f2164ea0bae07bb70353b6a54931b0b984e8aed6f26d1b451e018d",
|
||||
"contentSize": "1083842 B"
|
||||
"sha256": "4709ad4f21cc47173b735d7fd2f33ae9982adef8797a9dd496cc7f230a31948d",
|
||||
"contentSize": "1108090 B"
|
||||
},
|
||||
{
|
||||
"@type": "cr:FileObject",
|
||||
@@ -148,8 +148,8 @@
|
||||
"description": "The route graph over every run in runs_clean.csv, counted per source (analysis/network/build-graph.js).",
|
||||
"contentUrl": "https://git.kenschiano.net/kathleen/threshing-atlas/raw/branch/main/data/public/graph.json",
|
||||
"encodingFormat": "application/json",
|
||||
"sha256": "ab58d8dd04a7b7226439f11aa16443dd67d142eba2734672729f4367fe20fe91",
|
||||
"contentSize": "73218 B"
|
||||
"sha256": "d03f29336b136ab800d6995644cb72a772c5f4181531e5486bcdb3d798c29a46",
|
||||
"contentSize": "74424 B"
|
||||
}
|
||||
],
|
||||
"recordSet": [
|
||||
@@ -196,7 +196,7 @@
|
||||
"@type": "cr:Field",
|
||||
"@id": "runs/entry",
|
||||
"name": "entry",
|
||||
"description": "For spreadsheet runs, the sheet's own row label: \"Form\" for a form submission (it has a timestamp); bulk-pasted logs keep the label they were pasted with. Bulk logs record every run of the players who kept them, so they are the least selectively reported rows. Empty for other sources. Values: Form; Data Import; BulkUpload3; Manual Upload; Historical import; Unknown import.",
|
||||
"description": "For spreadsheet runs, the sheet's own row label: \"Form\" for a form submission (it has a timestamp); bulk-pasted logs keep the label they were pasted with. Bulk logs record every run of the players who kept them, so they are the least selectively reported rows. Empty for other sources. Values: Form; Data Import; BulkUpload3; Manual Upload; Historical import; Unknown import; Unknown.",
|
||||
"dataType": "sc:Text",
|
||||
"source": {
|
||||
"fileObject": {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"sha256": "3778ece486c7fca9b38f1738e7065ba20d7b1fd739bcd1b845d46e7520e3a22e",
|
||||
"bytes": 641363,
|
||||
"sha256": "99953503376b54ee2ca2061bc277c712681a66add4d62737535e4afca11ba03e",
|
||||
"bytes": 638678,
|
||||
"pages": 1,
|
||||
"page_hashes": [
|
||||
"e88c846a14efc549"
|
||||
"513739c2cb809008"
|
||||
],
|
||||
"line_hashes": [
|
||||
"0005ef79b6b0",
|
||||
@@ -27,7 +27,6 @@
|
||||
"09ede21a5670",
|
||||
"0a6389a6b822",
|
||||
"0c3e015009e5",
|
||||
"0c5d7989af41",
|
||||
"0c6edb02c260",
|
||||
"0caca604d8ec",
|
||||
"0d00728c456e",
|
||||
@@ -63,7 +62,6 @@
|
||||
"1fa9e3998e8b",
|
||||
"1fbdd6f48a30",
|
||||
"20539cda4fc1",
|
||||
"208a6d1ce0de",
|
||||
"21499b8293b5",
|
||||
"21e4274038e8",
|
||||
"2287d8613d2a",
|
||||
@@ -90,7 +88,6 @@
|
||||
"2f251aff0a77",
|
||||
"2f501595d6f2",
|
||||
"2f63258bd7ea",
|
||||
"2f80077a0788",
|
||||
"2f943c163229",
|
||||
"2fe14cd5feca",
|
||||
"306a70a396b4",
|
||||
@@ -244,6 +241,7 @@
|
||||
"860ce7852dc3",
|
||||
"87094fc18528",
|
||||
"877de8ebb965",
|
||||
"87ad118c11e5",
|
||||
"87c3e080dcb4",
|
||||
"8838a3634b92",
|
||||
"883caeb7ca11",
|
||||
@@ -263,7 +261,6 @@
|
||||
"919bc9b8d743",
|
||||
"920a5924f124",
|
||||
"935f14ac67b6",
|
||||
"94844cb129a8",
|
||||
"94ab1f4a7216",
|
||||
"954f0ca1b653",
|
||||
"95a14ed2a7fc",
|
||||
@@ -298,7 +295,6 @@
|
||||
"a3d7a6bf2036",
|
||||
"a3f146576c0e",
|
||||
"a5973cf86c17",
|
||||
"a69204c67bcd",
|
||||
"a69a4139b340",
|
||||
"a6e0a42de76e",
|
||||
"a6e8ab03915b",
|
||||
@@ -349,14 +345,12 @@
|
||||
"b7bd4220ff85",
|
||||
"b8ab74d65421",
|
||||
"b8b0e7effd20",
|
||||
"b9514000c923",
|
||||
"b95206531cb4",
|
||||
"ba4788b226aa",
|
||||
"bac081e175b0",
|
||||
"bb0e505c6386",
|
||||
"bb36f57782ca",
|
||||
"bb6db2fb1f33",
|
||||
"bb8b9de8437d",
|
||||
"bc807bf2a135",
|
||||
"be5ba8fe14a3",
|
||||
"bec9019352b4",
|
||||
@@ -414,6 +408,7 @@
|
||||
"d978e0e48792",
|
||||
"d9a847a1a79a",
|
||||
"d9ae6af36f3c",
|
||||
"dab3df07f542",
|
||||
"dab61aea1eb7",
|
||||
"db875b25b06f",
|
||||
"dbb3b50e59c7",
|
||||
@@ -491,5 +486,5 @@
|
||||
"ff1f017072cc",
|
||||
"ffe503ead4e4"
|
||||
],
|
||||
"checked": "2026-11-10"
|
||||
"checked": "2026-11-16"
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ columns:
|
||||
For spreadsheet runs, the sheet's own row label: "Form" for a form submission (it has a timestamp);
|
||||
bulk-pasted logs keep the label they were pasted with. Bulk logs record every run of the players who kept
|
||||
them, so they are the least selectively reported rows. Empty for other sources.
|
||||
values: [Form, Data Import, BulkUpload3, Manual Upload, Historical import, Unknown import]
|
||||
values: [Form, Data Import, BulkUpload3, Manual Upload, Historical import, Unknown import, Unknown]
|
||||
bot_mode:
|
||||
type: text
|
||||
description: >-
|
||||
|
||||
+9
-9
@@ -5,19 +5,19 @@
|
||||
"changed": "2026-11-10"
|
||||
},
|
||||
"reddit_pdf": {
|
||||
"sha256": "3778ece486c7fca9b38f1738e7065ba20d7b1fd739bcd1b845d46e7520e3a22e",
|
||||
"bytes": 641363,
|
||||
"changed": "2026-11-10"
|
||||
"sha256": "99953503376b54ee2ca2061bc277c712681a66add4d62737535e4afca11ba03e",
|
||||
"bytes": 638678,
|
||||
"changed": "2026-11-16"
|
||||
},
|
||||
"reddit_spreadsheet": {
|
||||
"sha256": "97377c3c3cfc9756a3520580441111d5154642e224441e35754f021c701a46fd",
|
||||
"bytes": 4695125,
|
||||
"changed": "2026-11-12"
|
||||
"sha256": "3de851ccfe9d4daeea16e621384d0eba33d42c389773d1a96ee12720193d468c",
|
||||
"bytes": 4685924,
|
||||
"changed": "2026-11-18"
|
||||
},
|
||||
"register": {
|
||||
"sha256": "1a4e98f3a140015f8849c2ff5f3c1635def12614ad60461b8213dcb3b3b420a2",
|
||||
"bytes": 50431,
|
||||
"changed": "2026-11-12"
|
||||
"sha256": "1ed64e285cbc3bc3dc6969970430fd500455fee2fe14d93a7f14a8e10f9e85c3",
|
||||
"bytes": 51191,
|
||||
"changed": "2026-11-18"
|
||||
},
|
||||
"reported": {
|
||||
"sha256": "4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945",
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"by_attempt": {
|
||||
"form": {
|
||||
"1": [
|
||||
92,
|
||||
920
|
||||
],
|
||||
"2": [
|
||||
0,
|
||||
296
|
||||
],
|
||||
"3": [
|
||||
0,
|
||||
192
|
||||
],
|
||||
"4-10": [
|
||||
0,
|
||||
536
|
||||
],
|
||||
"11-30": [
|
||||
0,
|
||||
614
|
||||
],
|
||||
"31 or more": [
|
||||
1,
|
||||
679
|
||||
]
|
||||
},
|
||||
"bulk logs": {
|
||||
"1": [
|
||||
0,
|
||||
29
|
||||
],
|
||||
"2": [
|
||||
0,
|
||||
21
|
||||
],
|
||||
"3": [
|
||||
0,
|
||||
14
|
||||
],
|
||||
"4-10": [
|
||||
0,
|
||||
102
|
||||
],
|
||||
"11-30": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"31 or more": [
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"bot": {
|
||||
"1": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"2": [
|
||||
0,
|
||||
4
|
||||
],
|
||||
"3": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"4-10": [
|
||||
0,
|
||||
36
|
||||
],
|
||||
"11-30": [
|
||||
0,
|
||||
137
|
||||
],
|
||||
"31 or more": [
|
||||
0,
|
||||
54
|
||||
]
|
||||
}
|
||||
},
|
||||
"same_route": {
|
||||
"routes": 323,
|
||||
"first_shadows": 88,
|
||||
"expected": 37.2,
|
||||
"odds_ratio": 653.8,
|
||||
"z": 12.1
|
||||
},
|
||||
"form_first": [
|
||||
92,
|
||||
920
|
||||
],
|
||||
"form_later": [
|
||||
1,
|
||||
2317
|
||||
],
|
||||
"best_route": {
|
||||
"route": [
|
||||
"Alone",
|
||||
"West",
|
||||
"Assess the situation",
|
||||
"Engage the smaller cadet",
|
||||
"Squadmate's revenge",
|
||||
"West"
|
||||
],
|
||||
"first": [
|
||||
23,
|
||||
93
|
||||
],
|
||||
"later": [
|
||||
0,
|
||||
94
|
||||
]
|
||||
},
|
||||
"shadow_routes": {
|
||||
"runs": 96,
|
||||
"routes": 46,
|
||||
"off_gate": 3
|
||||
},
|
||||
"after_shadow": {
|
||||
"reached_black": 79,
|
||||
"bonded_black": 57,
|
||||
"died_at_blue": 15,
|
||||
"answers": {
|
||||
"held its gaze": [
|
||||
29,
|
||||
41
|
||||
],
|
||||
"lowered eyes": [
|
||||
0,
|
||||
7
|
||||
],
|
||||
"ignored the sound": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
},
|
||||
"bot": {
|
||||
"attempts": 415,
|
||||
"accounts": 14,
|
||||
"gated_tree": 236,
|
||||
"shadows": 0,
|
||||
"earliest_attempt": 2
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5913
-4841
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+1
-1
@@ -588,7 +588,7 @@
|
||||
L.push("");
|
||||
L.push(`Interactive route map, full methods, and code to reproduce every number: [Threshing Route Atlas](LINK)`);
|
||||
L.push("");
|
||||
L.push(`*Caveats: self-reported data, no player IDs (so runs from one person aren't independent), and the form doesn't record every in-game choice. The author has said there's a ~10% chaos roll, so nothing is guaranteed.*`);
|
||||
L.push(`*Caveats: self-reported data, no player IDs (so runs from one person aren't independent), and the form doesn't record every in-game choice. The game's author has said no single roll is worse than 1 in 20 and that the Black is not luck, but no route guarantees a bond.*`);
|
||||
return L.join("\n");
|
||||
}
|
||||
$("#cp-reddit").addEventListener("click", () => copyText(redditPost(), "Reddit post"));
|
||||
|
||||
+11
-9
@@ -461,11 +461,12 @@ a { color: var(--accent); text-underline-offset: 2px; }
|
||||
</section>
|
||||
<section aria-labelledby="h-journey">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow">Seven steps, two of them pure luck</span>
|
||||
<span class="eyebrow">Seven steps, and the rolls remember what you did</span>
|
||||
<h2 id="h-journey">How a run unfolds</h2>
|
||||
</div>
|
||||
<div class="journey" id="journey"></div>
|
||||
<p class="lore">In the books, first-years who survive to Threshing walk into a valley of unbonded dragons, and the dragons do the choosing. The <a href="https://dragonkind.com" target="_blank" rel="noopener">Dragonkind</a> site recreates that: every choice can end with you incinerated, and the author has said there is a 10% chance of that no matter what you pick.</p>
|
||||
<div class="panel black-panel" id="black-evidence" hidden></div>
|
||||
<p class="lore">In the books, first-years who survive to Threshing walk into a valley of unbonded dragons, and the dragons do the choosing. The <a href="https://dragonkind.com" target="_blank" rel="noopener">Dragonkind</a> site recreates that: every choice can end with you incinerated, and its author has said no single roll is worse than 1 in 20 and that the Black is not luck.</p>
|
||||
<div class="cta"><button type="button" class="primary" data-go="valley">Walk the valley map</button><button type="button" data-go="deep">Dig into the statistics</button><button type="button" data-go="dragons">Meet the bonded dragons</button></div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -691,22 +692,23 @@ adjusted OR = exp(βⱼ), 95% CI = exp(βⱼ ± 1.96·SEⱼ)</div>
|
||||
<div class="section-head"><span class="eyebrow">Every run helps</span><h2 id="h-report">Report a run</h2>
|
||||
<p class="muted">Every run anyone logs ends up in the Atlas's open data, <a href="data/runs_clean.csv" download>runs_clean.csv</a>, which anyone can download and reuse. Deaths are as useful as bonds: the odds on this page are only as good as the runs behind them. Please report each run in one place only.</p></div>
|
||||
<div class="grid2">
|
||||
<div class="panel"><h3>Report it on the Atlas</h3>
|
||||
<p class="small">A short form with the game's own choices: an issue on the Atlas's repository at {{host}}, so you need an account there. Reports show up in the data the next day with the source <b>reported</b>. Everyone who can see the repository can read reports: please leave out your account name.</p>
|
||||
<p><a class="btnlike primary" href="{{report}}" target="_blank" rel="noopener">Report a run</a></p>
|
||||
</div>
|
||||
<div class="panel"><h3>Or use the community form</h3>
|
||||
<p class="small">The r/fourthwing megathreads collect runs with u/ClumsyBadger's Google Form, and its answers go into a public spreadsheet. The Atlas reads that spreadsheet every day (source <b>reddit spreadsheet</b>), so a run logged there is counted here too.</p>
|
||||
<div class="panel"><h3>Use the community form</h3>
|
||||
<p class="small">The easiest way, no account needed. The r/fourthwing megathreads collect runs with u/ClumsyBadger's Google Form, and its answers go into a public spreadsheet. The Atlas reads that spreadsheet every day (source <b>reddit spreadsheet</b>), so a run logged there is counted here.</p>
|
||||
<p class="btnrow"><a class="btnlike primary" href="https://forms.gle/DRpj9tG8gb5E4Hcu7" target="_blank" rel="noopener">Threshing Routes form</a>
|
||||
<a class="btnlike" href="https://docs.google.com/spreadsheets/d/1gnw1AdRg1XT4JsOfRM6QTA0jSaS3n9ZF-rPWnYewzv0" target="_blank" rel="noopener">The responses spreadsheet</a>
|
||||
<a class="btnlike" href="https://www.reddit.com/r/fourthwing/comments/1wz5cnj/" target="_blank" rel="noopener">The megathread</a></p>
|
||||
<p class="small muted">The form is anonymous and can be filled in once per attempt. Its author asks for random runs too (just pick the top option each time): they show which choices matter without the bias of everyone copying the same "best" route.</p>
|
||||
</div>
|
||||
<div class="panel"><h3>Or report it on the Atlas</h3>
|
||||
<p class="small">A short form with the game's own choices: an issue on the Atlas's repository at {{host}}, so you need an account there. Reports show up in the data the next day with the source <b>reported</b>. Everyone who can see the repository can read reports: please leave out your account name.</p>
|
||||
<p><a class="btnlike" href="{{report}}" target="_blank" rel="noopener">Report a run on {{host}}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel"><h3>Where the Atlas's runs come from</h3>
|
||||
<table class="small"><thead><tr><th scope="col">Source</th><th scope="col">What it is</th></tr></thead><tbody>
|
||||
<tr><td>reddit spreadsheet</td><td>The community form and spreadsheet linked from the r/fourthwing megathreads.</td></tr>
|
||||
<tr><td>reported</td><td>Runs reported here, with "Report a run".</td></tr>
|
||||
<tr><td>register</td><td>The Unofficial Dragon Register: which dragon each rider bonded (no route).</td></tr>
|
||||
<tr><td>reddit thread</td><td>Dragonkind result pages posted in the megathreads (the dragon is known, the route is not).</td></tr>
|
||||
<tr><td>bot</td><td>Runs logged by the DragonKind bot.</td></tr>
|
||||
<tr><td>reddit pdf</td><td>The community route PDF: a map of the choices, used to check the game's routes (it holds no runs).</td></tr>
|
||||
@@ -718,7 +720,7 @@ adjusted OR = exp(βⱼ), 95% CI = exp(βⱼ ± 1.96·SEⱼ)</div>
|
||||
</main>
|
||||
</div>
|
||||
<footer><div class="wrap"><p><b>Data:</b> the community <a href="https://docs.google.com/spreadsheets/d/1gnw1AdRg1XT4JsOfRM6QTA0jSaS3n9ZF-rPWnYewzv0" target="_blank" rel="noopener">"Threshing Routes" responses</a> compiled by <a href="https://www.reddit.com/user/ClumsyBadger/" target="_blank" rel="noopener">u/ClumsyBadger</a>, with percentages in the <a href="https://drive.google.com/file/d/17o72ehHsSPW4UdsKF-sXTxMLEuinWeEg/view" target="_blank" rel="noopener">route PDF</a> by <a href="https://www.reddit.com/user/ClumsyBadger/" target="_blank" rel="noopener">u/ClumsyBadger</a>, <a href="https://www.reddit.com/user/Old_Regular3018/" target="_blank" rel="noopener">u/Old_Regular3018</a> and <a href="https://www.reddit.com/user/Smart_Trifle_2099/" target="_blank" rel="noopener">u/Smart_Trifle_2099</a>; the <a href="https://docs.google.com/spreadsheets/d/1KMiE9sec0l597Pzue1OhGYf07NF4howtQ_lPeqx7jXQ" target="_blank" rel="noopener">Unofficial Dragon Register</a>; and the r/fourthwing bonding megathreads (<a href="https://www.reddit.com/r/fourthwing/comments/1wvwfp9/" target="_blank" rel="noopener">Part 3</a>, <a href="https://www.reddit.com/r/fourthwing/comments/1wz5cnj/" target="_blank" rel="noopener">Part 4</a>). Code and data: <a href="{{repo}}" target="_blank" rel="noopener">{{repo_label}}</a> (MIT, data CC BY 4.0).</p>
|
||||
<p><b>Unofficial fan analysis,</b> not affiliated with <a href="https://dragonkind.com" target="_blank" rel="noopener">Dragonkind</a> or its authors. A 10% "chaos" chance of incineration on any choice has been described by the author, so <b>no route guarantees a bond</b>.</p></div></footer>
|
||||
<p><b>Unofficial fan analysis,</b> not affiliated with <a href="https://dragonkind.com" target="_blank" rel="noopener">Dragonkind</a> or its authors. The author has said no single roll is worse than 1 in 20 and that the Black is not luck, but <b>no route guarantees a bond</b>.</p></div></footer>
|
||||
<div id="tip" hidden></div>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
|
||||
<script src="solver.js"></script>
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
} catch (err) { opts.toast("That file could not be read. Export the register sheet as .xlsx or .csv."); console.error(err); }
|
||||
e.target.value = "";
|
||||
});
|
||||
fetch("data/register.json").then((r) => r.json()).then((raw) => { st.bundled = raw; load(raw, `bundled snapshot (${raw.source_file}, exported ${raw.exported})`); })
|
||||
fetch("data/register.json").then((r) => r.json()).then((raw) => { st.bundled = raw; load(raw, `bundled snapshot (${raw.source}, exported ${raw.exported})`); })
|
||||
.catch((e) => ($("#reg-status").textContent = "The register data could not load."));
|
||||
}
|
||||
|
||||
|
||||
+35
-8
@@ -150,25 +150,52 @@
|
||||
const ENC_LABEL = { "valley-Red": "the valley Red", "meadow-Orange": "the meadow Orange", "meadow-Brown": "the meadow Brown", "tree-Greens": "the two Greens", "meadow-Blue": "the meadow Blue", "shadow-Black": "the Black after the shadow" };
|
||||
const POSE = { Red: "roaring", Orange: "flying", Brown: "resting", Green: "prowling", Blue: "coiled", Black: "flying" };
|
||||
|
||||
let blackP = null;
|
||||
const getBlack = () => blackP || (blackP = fetch("data/black.json").then((r) => r.json()).catch(() => null));
|
||||
const frac = ([k, n]) => `${k.toLocaleString()} of ${n.toLocaleString()}`;
|
||||
// The shadow and the Black: what analysis/black/evidence.py found (data/black.json; the full write-up is BLACK.md).
|
||||
function renderBlack(b) {
|
||||
const t2 = $("#truth-history"), box = $("#black-evidence");
|
||||
if (!b) { if (t2) t2.innerHTML = '<h3>Your first attempt is different</h3><p class="small muted">The shadow evidence could not be loaded.</p>'; return; }
|
||||
const ff = b.form_first, fl = b.form_later, sr = b.same_route, as = b.after_shadow, gaze = as.answers["held its gaze"];
|
||||
if (t2) t2.innerHTML = `<h3>Your first attempt is different</h3><p class="small">Among riders who helped their squadmate and climbed the tree, the shadow came in <b>${frac(ff)}</b> first attempts (${pct(ff[0] / ff[1], 1)}) and <b>${frac(fl)}</b> later ones. On the very same routes, first attempts saw it about ${Math.round(sr.first_shadows / Math.max(sr.expected, 1) * 10) / 10}× as often as chance would give. The shadow is not a dice roll you can repeat.</p>`;
|
||||
if (!box) return;
|
||||
const br = b.best_route;
|
||||
box.hidden = false;
|
||||
box.innerHTML = `<h3>The Black is not dice</h3>
|
||||
<p class="small">The game's author has said the Black is not luck, and the runs agree. The shadow at the tree needs three things: you <b>investigated and helped</b> your squadmate, you <b>climbed the tree</b>, and it is (almost always) your <b>first attempt</b>. ${b.shadow_routes.runs} shadow runs came from ${b.shadow_routes.routes} different routes, so no single route is the trick; only ${b.shadow_routes.off_gate} were logged off that path.</p>
|
||||
<ul class="small">
|
||||
<li>Best-logged route (${esc(br.route.join(" → "))}): shadow in <b>${frac(br.first)}</b> first attempts, <b>${frac(br.later)}</b> later ones.</li>
|
||||
<li>After the shadow, ${as.reached_black} riders reached the Black and <b>${as.bonded_black}</b> bonded it; ${as.died_at_blue} were burned by the Blue first.</li>
|
||||
${gaze ? `<li>At the Black, riders who held its gaze bonded in <b>${frac(gaze)}</b> logged answers.</li>` : ""}
|
||||
<li>The bot has made ${b.bot.attempts.toLocaleString()} attempts on ${b.bot.accounts} accounts, ${b.bot.gated_tree} on the gated path, and seen the shadow ${b.bot.shadows} times: none of them was a first attempt${b.bot.earliest_attempt ? ` (its earliest was attempt ${b.bot.earliest_attempt})` : ""}, which fits.</li>
|
||||
</ul>
|
||||
<p class="small muted">Method and every table: <code>analysis/reports/BLACK.md</code>; the numbers: <a href="data/black.json">data/black.json</a>.</p>`;
|
||||
}
|
||||
|
||||
function renderColourOdds(policy) {
|
||||
if (!policy) { $("#odds-colours").innerHTML = '<p class="small muted">The route model could not be loaded.</p>'; return; }
|
||||
const lb = policy.samples.lowBias, all = policy.samples.all;
|
||||
const cols = ["Red", "Green", "Orange", "Brown", "Blue", "Black"]
|
||||
.map((c) => ({ c, p: lb.targets[c].eventually.pX.mean, pAll: all.targets[c].eventually.pX.mean, lo: lb.targets[c].eventually.pX.lo, hi: lb.targets[c].eventually.pX.hi }))
|
||||
.map((c) => {
|
||||
// the Black only comes after the shadow, and the shadow (almost) only on a first attempt: show that attempt
|
||||
const first = c === "Black" && lb.targets[c].firstAttempt;
|
||||
const src = first ? lb.targets[c].firstAttempt.thisAttempt : lb.targets[c].eventually;
|
||||
const srcAll = first && all.targets[c].firstAttempt ? all.targets[c].firstAttempt.thisAttempt : all.targets[c].eventually;
|
||||
return { c, first: !!first, p: src.pX.mean, pAll: srcAll.pX.mean, lo: src.pX.lo, hi: src.pX.hi };
|
||||
})
|
||||
.sort((a, b) => b.p - a.p);
|
||||
const enc = (c) => { const e = (all.model.tables.encounter || {})[ENC_OF[c]] || { outcomes: {} }; const n = Object.values(e.outcomes).reduce((a, b) => a + b, 0); return { k: e.outcomes[c] || 0, n }; };
|
||||
const art = (c) => window.DragonArt ? `<svg class="odd-art" viewBox="0 0 200 160" aria-hidden="true">${window.DragonArt.svg(POSE[c], { fill: `var(${DV[c]})`, eyeFill: "var(--bg)" })}</svg>` : "";
|
||||
$("#odds-colours").innerHTML = cols.map(({ c, p, pAll, lo, hi }) => {
|
||||
$("#odds-colours").innerHTML = cols.map(({ c, first, p, pAll, lo, hi }) => {
|
||||
const e = enc(c);
|
||||
return `<a class="odd odd-colour" href="#valley/${c.toLowerCase()}" style="--c: var(${DV[c]})">${art(c)}
|
||||
<span class="big">${p >= 0.5 ? pct(p) : `1 in ${oneIn(p)}`}</span><span class="what">${p >= 0.5 ? "of runs" : "runs"} end bonded to ${/^[AEIOU]/.test(c) ? "an" : "a"} ${c}, on the best route</span>
|
||||
<span class="big">${p >= 0.5 ? pct(p) : `1 in ${oneIn(p)}`}</span><span class="what">${p >= 0.5 ? "of runs" : "runs"} end bonded to ${/^[AEIOU]/.test(c) ? "an" : "a"} ${c}, on the best route${first ? ", on your first attempt" : ""}</span>
|
||||
${dots(Math.round(p * 1000), 1000, cssVar(DV[c]))}
|
||||
<span class="how"><b>${pct(p, p < 0.1 ? 1 : 0)}</b> per attempt (95% ${pct(lo, 1)}–${pct(hi, 1)}), from riders who logged every run${Math.abs(pAll - p) / p > 0.25 ? `; all form posts suggest ${pct(pAll, 1)}` : ""}. At ${ENC_LABEL[ENC_OF[c]]}, <b>${e.k} of ${e.n}</b> genuine attempts bonded.</span>
|
||||
<span class="how"><b>${pct(p, p < 0.1 ? 1 : 0)}</b> ${first ? "on a first attempt" : "per attempt"} (95% ${pct(lo, 1)}–${pct(hi, 1)}), from riders who logged every run${first ? "; later attempts almost never see the shadow" : ""}${Math.abs(pAll - p) / p > 0.25 ? `; all form posts suggest ${pct(pAll, 1)}` : ""}. At ${ENC_LABEL[ENC_OF[c]]}, <b>${e.k} of ${e.n}</b> genuine attempts bonded.</span>
|
||||
<span class="go">See the route →</span></a>`;
|
||||
}).join("");
|
||||
const meadowAlpha = all.model.alphas.meadow, shadowAlpha = all.model.alphas.shadow;
|
||||
const t2 = $("#truth-history");
|
||||
if (t2) t2.innerHTML = `<h3>Earlier choices barely change who waits</h3><p class="small">${meadowAlpha >= 10000 ? "Which dragon waits in the meadow shows no link to anything you chose before." : "Which dragon waits in the meadow depends only a little on earlier choices."} ${shadowAlpha >= 500 ? "The shadow at the tree depends on them only weakly." : "The shadow at the tree shows some dependence on earlier choices, but the evidence is thin."} The model lets every roll depend on your history, and measured how much it does. Choices the form doesn't record (what you answered inside an encounter) might still matter.</p>`;
|
||||
getBlack().then(renderBlack);
|
||||
const t3 = $("#truth-burn");
|
||||
if (t3) {
|
||||
const rates = cols.map(({ c }) => ({ c, ...enc(c) })).filter((x) => x.n >= 20).map((x) => ({ ...x, p: x.k / x.n })).sort((a, b) => a.p - b.p);
|
||||
@@ -207,7 +234,7 @@
|
||||
{ t: "The scream", d: "Help the squadmate fighting two cadets, walk away, or ignore it and find a wounded cadet.", v: helpK ? `${helpK.n} logged runs died in the fight.` : "" },
|
||||
{ t: "Fork in the road", d: "After the fight: west, deeper into the forest, or east.", v: "Only the bully path has a fork." },
|
||||
{ t: "Tree or valley", d: "Climb the tallest tree, or walk to the valley centre.", v: "The tree holds a Red, two Greens and the rare shadow. The valley holds a Red, then the meadow's Orange, Brown and sometimes a Blue." },
|
||||
{ t: "The bonding", d: "Who is waiting is partly luck. Then every answer is a test.", v: greens.green_encounters ? `At the two Greens, ${pct((greens.rescued_orange + greens.rescued_brown) / greens.green_encounters)} were rescued by an Orange or Brown.` : "", roll: true },
|
||||
{ t: "The bonding", d: "Who is waiting depends on what you did before: the shadow comes only to first-attempt riders who helped and climbed. Then every answer is a test.", v: greens.green_encounters ? `At the two Greens, ${pct((greens.rescued_orange + greens.rescued_brown) / greens.green_encounters)} were rescued by an Orange or Brown.` : "", roll: true },
|
||||
];
|
||||
$("#journey").innerHTML = stops.map((s, i) => `<div class="stop${s.roll ? " roll" : ""}"><span class="n">${["I", "II", "III", "IV", "V", "VI", "VII"][i]}</span><span class="t">${esc(s.t)}</span><span class="d">${esc(s.d)}</span>${s.v ? `<span class="verdict">${esc(s.v)}</span>` : ""}</div>`).join("");
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ for (const f of fs.readdirSync(path.join(root, "site/atlas"))) copy(`site/atlas/
|
||||
copy("core/graph.js", "graph.js");
|
||||
copy("core/solver.js", "solver.js");
|
||||
// The numbers the page shows (all computed in Python) and the published data
|
||||
for (const f of ["stats.json", "register.json", "graph.json", "policy.json"]) copy(`data/public/${f}`, `data/${f}`);
|
||||
for (const f of ["stats.json", "register.json", "graph.json", "policy.json", "black.json", "tree.json", "experiments.json"]) copy(`data/public/${f}`, `data/${f}`);
|
||||
copy("data/public/runs_clean.csv", "data/runs_clean.csv");
|
||||
for (const f of ["croissant.json", "dictionary.yaml"]) copy(`data/${f}`, `data/${f}`);
|
||||
// Source files shown in the page's "view the code" panel
|
||||
|
||||
@@ -34,6 +34,7 @@ NEW = {
|
||||
"hour": "After walking an hour, what did you do?",
|
||||
"goal_v2": "Why are you doing this run?",
|
||||
"malek": "Would you seek Malek?",
|
||||
"squad": "What squad were you assigned?",
|
||||
**{f"enc_{c}": f"Did you attempt to bond? [{c}]" for c in coding.COLORS},
|
||||
}
|
||||
|
||||
@@ -62,6 +63,10 @@ class Columns(unittest.TestCase):
|
||||
|
||||
|
||||
class Rows(unittest.TestCase):
|
||||
def test_squad_ignores_case(self):
|
||||
for typed, coded in (("second", "Second"), (" THIRD ", "Third"), ("Don't know", "Don't know"), (None, "Unknown")):
|
||||
self.assertEqual(code(NEW, company="Alone", squad=typed)["squad"], coded)
|
||||
|
||||
def test_form_submission_vs_bulk_import(self):
|
||||
self.assertEqual(code(OLD, timestamp="2026-10-03 14:02:11")["source"], "Form")
|
||||
r = code(OLD, timestamp="Data Import")
|
||||
|
||||
Reference in New Issue
Block a user