Files
threshing-atlas/collection/pipeline.yaml
T
ekcSchianoandClaude Opus 5.5 43066ad67f Bot import: one folder per account, run records with steps
- the importer reads data/accounts/*/runs.jsonl and logs/accounts/*/encounters.jsonl;
  with account folders, the top-level files (a mirror of the first account) are skipped
- run records that carry their steps (schema 2) become trajectories directly, keeping
  what the bot saw (shadow, meadow dragons), propensities, decision mode and policy id;
  older runs are still rebuilt from the decision log; bonded runs without steps are kept
- account names become salted hashes (DK_ACCOUNT_SALT, or a private salt in data/raw)
- runs_clean.csv: new bot_mode column; saw_shadow and saw_blue_meadow from what the bot
  saw; deliberate burns say why
- crosswalk: the valley Red, leaving squadmates, squad direction, hold your ground,
  hide/approach reactions, the wounded cadet's other two choices

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
2026-11-10 02:08:57 +00:00

96 lines
5.9 KiB
YAML

# Data collection as extract -> transform -> load, one block per source. collection/run.py reads this file.
#
# extract fetches the source as it is now. The raw file goes to data/raw/<source>/current.<ext> (git-ignored,
# never published); the version it replaces is kept as previous.<ext>, and the daily workflow keeps
# that previous copy in an encrypted, private cache. Nothing older is kept.
# transform turns the raw file into the public source file: a pure function of the raw file (no network, no
# clock), with the source's privacy rules applied. Named transforms live in collection/etl/transform/.
# load writes the public source file (byte-stable: same input, same bytes) and reports what changed.
#
# Then `build` codes every public source file into one run per row (runs: the coder) and writes
# data/public/runs_clean.csv: every run from every source, with a `source` column. Each table is checked against
# data/dictionary.yaml before it is written. Every input to `build` is committed, so CI can rebuild it exactly.
version: 1
raw_dir: data/raw
manifest: data/manifest.json # for each source: the sha256 of the current raw file and when it last changed
runs:
path: data/public/runs_clean.csv
# sources in this order; within a source, the order the coder returns
order: [reddit_spreadsheet, reddit_thread, reported, bot, reddit_pdf]
sources:
reddit_spreadsheet:
label: Threshing Routes form and spreadsheet (u/ClumsyBadger, linked from the r/fourthwing megathreads)
run_source: reddit spreadsheet
links:
sheet: https://docs.google.com/spreadsheets/d/1gnw1AdRg1XT4JsOfRM6QTA0jSaS3n9ZF-rPWnYewzv0
form: https://forms.gle/DRpj9tG8gb5E4Hcu7 # the Threshing Routes Google Form the megathreads link to
extract: { kind: http, url: "https://docs.google.com/spreadsheets/d/1gnw1AdRg1XT4JsOfRM6QTA0jSaS3n9ZF-rPWnYewzv0/export?format=xlsx", ext: xlsx }
transform: { name: sheet, sheet_contains: form responses }
privacy: { redact_emails: true }
load: data/public/form_responses.json
runs: spreadsheet # core/spec/form.yaml + core/atlas/coding.py
register:
label: Unofficial Dragon Register (which dragon each rider bonded)
links: { sheet: https://docs.google.com/spreadsheets/d/1KMiE9sec0l597Pzue1OhGYf07NF4howtQ_lPeqx7jXQ }
extract: { kind: http, url: "https://docs.google.com/spreadsheets/d/1KMiE9sec0l597Pzue1OhGYf07NF4howtQ_lPeqx7jXQ/export?format=xlsx", ext: xlsx }
transform: { name: sheet, sheet_contains: form responses, extra: collection/manual/reddit_results.yaml }
privacy: { redact_emails: true, drop_columns_matching: [photo, cadet name] } # no rider names, no photos
load: data/public/register.json
runs: null # bonded dragons without the route that led there
reddit_pdf:
label: Community route PDF (u/ClumsyBadger)
run_source: reddit pdf
links: { view: https://drive.google.com/file/d/17o72ehHsSPW4UdsKF-sXTxMLEuinWeEg/view }
extract: { kind: http, url: "https://drive.google.com/uc?export=download&id=17o72ehHsSPW4UdsKF-sXTxMLEuinWeEg", ext: pdf }
transform: { name: pdf_fingerprint }
privacy: { redistribute: false } # only hashes of the file, its pages and its lines are kept
load: data/derived/pdf_fingerprint.json
runs: null # a flowchart of the routes, not a log of runs (see collection/README.md)
reddit_thread:
label: Runs posted in the r/fourthwing Dragonkind megathreads
run_source: reddit thread
links:
part3: https://www.reddit.com/r/fourthwing/comments/1wvwfp9/
part4: https://www.reddit.com/r/fourthwing/comments/1wz5cnj/
# the official Reddit API (app-only OAuth); skipped with a note when the secrets are not set
extract: { kind: reddit, threads: [1wvwfp9, 1wz5cnj], secrets: [REDDIT_CLIENT_ID, REDDIT_CLIENT_SECRET], ext: json }
# lists dragonkind.com result links that are not in the manual file yet; usernames are never kept
transform: { name: reddit_results, manual: collection/manual/reddit_results.yaml }
load: null # the public source file is the hand-checked collection/manual/reddit_results.yaml
runs: reddit_results
reported:
label: Runs reported on the Atlas ("Report a run", a GitHub issue form)
run_source: reported
links: { report: "https://github.com/ekcSchiano/threshing-atlas/issues/new?template=report-a-run.yml" }
extract: { kind: github_issues, repo: ekcSchiano/threshing-atlas, label: run report, ext: json }
# GitHub usernames are dropped; issues closed as "not planned" or labelled "invalid" are left out
transform: { name: reports, form: collection/specs/report_form.yaml, reject_labels: [invalid, duplicate] }
load: data/public/reports.json
runs: reports
bot:
label: DragonKind bot runs (Ken's private bot, imported locally)
run_source: bot
# the bot's repo is private: this step runs only on a machine with a copy of it
# data/accounts/<account>/ and logs/accounts/<account>/: one folder per game account (account names are
# replaced by salted hashes); the top-level files are the bot's original single account
extract:
kind: local_dir
env: DRAGONKIND_BOT_DIR
files: [data/knowledge.json, data/runs.jsonl, logs/encounters.jsonl, data/accounts/*/runs.jsonl, logs/accounts/*/encounters.jsonl]
transform: { name: bot, spec: collection/specs/bot.yaml }
privacy:
account_salt_env: DK_ACCOUNT_SALT # account names are hashed with this salt (or, if unset, one kept in
# 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
runs: bot