Game-rule checks for runs answered through "Report a run"
Reported and Reddit-comment runs now get the checks the community form gets in core/atlas/coding.py, as data_flags (the run is kept): - first dragon outside the documented pool for the company/direction - a bond or burn by a dragon the encounter does not have (new encounter_colours table in core/spec/form.yaml; Orange/Brown after the two Greens allowed, as a Green's rescue) - a Green on a valley run - a cadet outcome off its scream path, fight answers or a post-fight path on a run that did not help, a second fight move without assessing - died before the hour, yet reached the tree/valley or an encounter planner/policy.yaml drop_flagged: flagged runs of sources read from free text (reddit comment) stay out of the route model; provenance notes do not count as flags. No effect today: the source is not in `sources` yet. On the first 82 scraped runs: 6 flagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -36,6 +36,15 @@ def low_bias(r, lb=CONFIG["low_bias"]):
|
||||
return r["goal"] not in lb["rare_goals"]
|
||||
|
||||
|
||||
def drop_flagged(runs, cfg=CONFIG.get("drop_flagged") or {}):
|
||||
"""Without the flagged runs of the sources read automatically from free text (planner/policy.yaml drop_flagged)."""
|
||||
sources, keep = set(cfg.get("sources") or ()), tuple(cfg.get("except") or ())
|
||||
|
||||
def problems(r):
|
||||
return [f for f in (r.get("data_flags") or "").split("; ") if f and not f.startswith(keep)] if keep else [f for f in (r.get("data_flags") or "").split("; ") if f]
|
||||
return [r for r in runs if r["source"] not in sources or not problems(r)]
|
||||
|
||||
|
||||
def clean(o):
|
||||
"""JSON-safe: numpy numbers to floats, infinities and NaN to null (as JavaScript's JSON.stringify does)."""
|
||||
if isinstance(o, dict):
|
||||
@@ -56,7 +65,7 @@ def main(argv=None):
|
||||
ap.add_argument("--out", default=str(ROOT / "data/public/policy.json"))
|
||||
a = ap.parse_args(argv)
|
||||
|
||||
runs = runs_io.read(a.data, sources=SOURCES)
|
||||
runs = drop_flagged(runs_io.read(a.data, sources=SOURCES))
|
||||
rows = len(runs)
|
||||
samples = {
|
||||
"all": runs,
|
||||
|
||||
@@ -8,6 +8,14 @@ version: 1
|
||||
# the `source` values of data/public/runs_clean.csv the model learns from
|
||||
sources: [reddit spreadsheet, reported, bot]
|
||||
|
||||
# Sources read automatically from free text: a run with any data flag (a broken game rule, an unrecognised answer)
|
||||
# is left out of the model, since the flag may mean the text was misread or misremembered. Flags that only say where
|
||||
# the run came from (`except`, matched at the start of a flag) do not count. A hand fix that clears the flags
|
||||
# brings the run back. Applies once the source is also listed in `sources` above.
|
||||
drop_flagged:
|
||||
sources: [reddit comment]
|
||||
except: ["read from a Reddit comment"]
|
||||
|
||||
# Two samples. "all" is every run above. "lowBias" leaves out runs where a rare sighting is more likely to have
|
||||
# been reported than a miss: form submissions and reports from riders chasing Blue or Black. The bot logs every
|
||||
# run, and bulk-pasted logs record every run of the players who kept them, so both stay in.
|
||||
|
||||
Reference in New Issue
Block a user