# Arbiter analyses

Every graded Mythic+ run this tool has produced, in one place and one shape.
Written by `arbiter/archive.py`; do not hand-edit the generated files.

## Reading them

  * `viewer.html`  -- open in a browser. Every analysis, arrow keys to page
                      through, `/` to search. Self-contained, works over
                      `file://`, needs no server.
  * `<id>.md`      -- the same analysis as text, for reading in a terminal or
                      pasting into a message.
  * `<id>.json`    -- the same analysis as data. Schema 3. This is the source
                      of truth; the other two are rendered from it.
  * `index.json`   -- one summary row per analysis. Start here to find a run.

## The id

`YYYY-MM-DD_HHMM_<dungeon>_+<level>_<outcome>`, derived from the run itself.
Re-grading the same key rewrites its own files rather than adding a new one.

## Adding the written half

The numbers come from the log. The *analysis* -- what actually happened and
what to change -- is written on top, into the record's `narrative` field, and
survives every re-grade:

    python analyses.py narrate <id> --file note.json

`note.json` is `{"headline", "verdict", "sections":[{"title","body"}],
"actions":[...], "author"}`. All fields optional. See `docs/analyses.md`.

## Where this lives

`ARBITER_ARCHIVE` if set, otherwise this directory (`<repo>/analyses`).
The contents are gitignored: the tool belongs in the repo, verdicts on named
players' keys do not.
