Reading the event log

The raw record, and what the scorer took back.

The event log is everything the scorer did, in the order they did it. That includes the things they undid. Nothing is deleted from it, so you have to apply the corrections yourself.

Apply rewinds first, then replacements. In the other order you bring back a play the scorer took off the board.

Do you need this at all?

Probably not. The plays read and the box score read are already corrected: the plays a scorer took back are gone from them and every replacement is already applied. Read those unless you are rebuilding the game yourself.

This log is for a consumer that wants the game as it was kept — who fixed what, and when.

The two kinds of correction

A rewind.to entry takes the game back to a point. It carries throughSequence, and everything recorded after that number, up to the rewind itself, is off the board. The scorer then rescores from there.

A supersedes number on an entry says this entry replaces an earlier one. The earlier entry stays in the list. You drop it.

The order, worked through

Five entries. Entry 43 rewinds the game through entry 41, which voids entry 42. Entry 45 is a correction that replaces entry 42 — the entry the rewind already voided. A second scorer who had not seen the rewind is how that happens.

  { sequence: 41, event: { type: 'plate_appearance.completed', … } }
  { sequence: 42, event: { type: 'plate_appearance.completed', … } }
  { sequence: 43, event: { type: 'rewind.to', throughSequence: 41 } }
  { sequence: 44, event: { type: 'plate_appearance.completed', … } }
  { sequence: 45, event: { type: 'plate_appearance.completed', … }, supersedes: 42 }
What each order leaves
OrderWhat is leftVerdict
Rewinds first, then replacements41, 43, 44Correct.
Replacements first, then rewinds41, 43, 44, 45Wrong: an extra plate appearance.

Rewinds first: entry 42 is voided, so entry 45 has nothing left to replace and goes with it. You are left with the two plate appearances the scorer meant to keep, 41 and 44.

Replacements first: entry 45 takes entry 42’s place in the log. The rewind then finds no entry 42 to void, and entry 45’s own number is above the rewind, so it survives. You are left with a plate appearance the scorer took off the board, wearing a new number — one more at bat than the game had.

One more rule, and it is the cheap one: read type first and skip a type you do not know. The list of types only ever gains members, and a new one must never break a consumer that has not heard of it.

A real log

This is the recorded answer for one game, exactly as the read returns it. Every entry carries its sequence, the moment it was recorded, and which scorer recorded it — numbered 1, 2, 3 in the order they appear. It names nobody: we do not publish who kept the book.

{
  "events": [
    {
      "event": {
        "awayLineup": [],
        "homeLineup": [],
        "startedAt": 0,
        "type": "game.started"
      },
      "recordedAt": 0,
      "scorer": 1,
      "sequence": 0
    },
    {
      "event": {
        "half": "top",
        "inning": 1,
        "type": "half_inning.started"
      },
      "recordedAt": 0,
      "scorer": 1,
      "sequence": 1
    },
    {
      "event": {
        "pitcher": "p1",
        "side": "home",
        "type": "pitching_change"
      },
      "recordedAt": 0,
      "scorer": 1,
      "sequence": 2
    },
    {
      "event": {
        "batter": "a1",
        "movements": [
          {
            "cause": "batted_ball",
            "from": "batter",
            "runner": "a1",
            "to": 1
          }
        ],
        "outcome": "single",
        "type": "plate_appearance.completed"
      },
      "recordedAt": 0,
      "scorer": 1,
      "sequence": 3
    },
    {
      "event": {
        "batter": "a1",
        "movements": [
          {
            "cause": "batted_ball",
            "from": "batter",
            "runner": "a1",
            "to": 2
          }
        ],
        "outcome": "double",
        "type": "plate_appearance.completed"
      },
      "recordedAt": 0,
      "scorer": 1,
      "sequence": 4,
      "supersedes": 3
    }
  ],
  "version": "v1",
  "generatedAt": 0
}

The field-by-field description of every entry is on the Reference page, under the events read.