{
  "schemaVersion": 1,
  "kind": "odin-rnd.amendment",
  "experiment": "EXP 020",
  "amendment": "04",
  "title": "Both advocates settle nine readings of the S2 rules before the verdict; both veto item 8, so the report checks the disturbance windows itself",
  "authoredOn": "2026-10-28",
  "name": "EXP 020 amendment 04, the name the MongoDB advocate asked for. It is not the S2 runner protocol's own 'Amendment 04' (runner/PROTOCOL-S2.md, published with amendment 01), which is a different change.",
  "amends": {
    "preregistration": "experiments/mongodb-home-ground/preregistration.json",
    "preregistrationSha256": "128087dbba8b09c97fcbf2ab4a873b1c4b9c656b27ad07291ba4693e26d83fec",
    "frozenCommit": "0af2c4861c489531916884ceb6894ee771d0ec71",
    "after": {
      "amendment": "03",
      "record": "experiments/mongodb-home-ground/amendment-03/amendment.json",
      "sha256": "43eb48af053601ff69bf9ced9a95148a6c343369dc99b96a72ad35eec0fca2e9"
    }
  },
  "why": "Writing the S2 report code showed nine places where the published rules (the pre-registration and amendments 01 to 03) leave a reading open. The runner owner did not decide them alone: before any S2 verdict was computed, both EXP 020 advocates reviewed all nine, with veto power, without opening a counted cell. Both accept eight. Both veto item 8, and the stricter alternative (the MongoDB advocate's) is adopted. This amendment records the nine readings, both reviews and the report code that implements them, so they are public before the verdict.",
  "timing": "Proposed by the runner owner on 2026-10-25 at 23:22Z (report code at private commit ce98d2082469b3d63dc3354163de820141213a59). Both reviews at private commit 6580157c2bc2a79768900415d09d4d0ad3707096, posted 23:26Z. The report code that applies them at private commit 125b4c7d767adad9f9ef36d7ef3d7e1c60c179aa, posted 23:36Z. Published here on 2026-10-28. As of those posts, no S2 verdict had been computed.",
  "reviews": {
    "mongodbAdvocate": {
      "verdict": "8 ACCEPT, 1 VETO (item 8); item 3 accepted on condition that the literal-bullet counts are published too",
      "file": "experiments/mongodb-home-ground/reviews/amendment-04-mongodb-advocate.md"
    },
    "postgresqlAdvocate": {
      "verdict": "8 ACCEPT, 1 VETO (item 8); notes, against its own side, that pgoutput could arguably count 4, and does not ask for it",
      "file": "experiments/mongodb-home-ground/reviews/amendment-04-postgresql-advocate.md"
    },
    "source": "Both reviews at private commit 6580157c2bc2a79768900415d09d4d0ad3707096, published with one substitution each (the private repository's name); source and published sha256 below. Neither reviewer opened a counted cell.",
    "proposal": "The runner owner's brief to the reviewers is not published. For each item this record gives what is public: the runner owner's summary of the item, each review's own answer to it, verbatim, and the clause of the adopted report code (private commit 125b4c7d, sha256-pinned below) that implements it, verbatim.",
    "proposalSummary": "4–9 are bookkeeping: the old pairing's gate and components, invalid vs missing files, which file names count, excluded variants, trusting `discarded/`, and the seed-2 selection's candidate set.",
    "reviewedBuild": "Both reviews read the report code at private commit ce98d208. The adopted build, which applies their answers, is at private commit 125b4c7d; it was not reviewed again."
  },
  "documents": [
    {
      "file": "experiments/mongodb-home-ground/reviews/amendment-04-mongodb-advocate.md",
      "sourceSha256": "fb74aca4c176c318e596f55f86c63601d5580d46370d08ae5b6cc40473843a41",
      "publishedSha256": "748741d214a5d7bf46598b53d2dd93e61f7564e61353118a8760e26b9ed6a9f7",
      "substitutions": [
        {
          "was": "(report code at [the private repository's name] `ce98d208`)",
          "now": "(report code at private commit `ce98d208`)"
        }
      ]
    },
    {
      "file": "experiments/mongodb-home-ground/reviews/amendment-04-postgresql-advocate.md",
      "sourceSha256": "c55fdc3eb8baf8613c69582c433fa8a1efd190c067aa8ca8a47d3fa00d8aba30",
      "publishedSha256": "be0f5f5f091f875368557758a945b3b95b449adc8b7c296028bd0510428d8452",
      "substitutions": [
        {
          "was": "(report code at [the private repository's name] `ce98d208`)",
          "now": "(report code at private commit `ce98d208`)"
        }
      ]
    }
  ],
  "changes": [
    {
      "item": 1,
      "what": "\"Same direction\" on seed 2",
      "verdict": "ACCEPT x2",
      "rule": "\"Same direction\" is the sign of the median of the five seed-2 paired differences; a zero median counts for neither store.",
      "proposal": "the median of the five seed-2 paired differences has the winner's sign (as EXP 021 A4b)."
    },
    {
      "item": 2,
      "what": "\"Beats by at least 20 %\"",
      "verdict": "ACCEPT x2",
      "rule": "The winner's lag p95 is at most 0.8 x the other store's (not 'the other is at least 1.2 x the winner'). Both advocates call it the stricter of the two readings; it binds both stores the same way."
    },
    {
      "item": 3,
      "what": "Component counts for the tie-break",
      "verdict": "ACCEPT x2, each checked against the code",
      "rule": "The counts that decide are MongoDB 4 (replica set, keyFile, oplog sizing, oplog alarm), pgoutput 5, outbox 0. Cursor objects, consumers and growth alarms count on neither arm. S2's MongoDB consumer resumes only by start_after on its stored token, with no fallback, so the oplog window is needed for correctness. The literal-bullet counts of the S2 protocol's list (MongoDB 5, pgoutput 6, outbox 4) are published next to them, labelled as never deciding.",
      "conditions": [
        "The MongoDB advocate's condition: the literal-bullet counts (5 / 6 / 4) are published too, because the pre-registration says both counts are published. The report code at 125b4c7d publishes them, labelled 'never decides'.",
        "The PostgreSQL advocate, against its own side: pgoutput could arguably count 4, because PostgreSQL's default max_slot_wal_keep_size=-1 keeps the slot's WAL without limit. It does not ask for that change, and says no verdict changes either way."
      ],
      "visibleEffect": "The runner owner reports a test in which the same data gives postgres-fits on the deciding counts and both-fit on the literal counts, so the choice matters and both are shown."
    },
    {
      "item": 4,
      "what": "Item 4: the old pairing's gate and components",
      "verdict": "ACCEPT x2, as written",
      "proposal": "the old pairing's gate and components (the runner owner's summary of the item, quoted in full under 'proposalSummary')",
      "reviewsSay": {
        "mongodbAdvocate": "**ACCEPT.** It is secondary, labelled as favouring PostgreSQL, and never decides.",
        "postgresqlAdvocate": "**ACCEPT.** This is secondary only, and it is defined before any result is seen."
      },
      "implementedAs": [
        "PROTOCOL-S2.md's old pairing (labelled, favours PostgreSQL): per (seed, repetition) the lower lag p95 among the PostgreSQL variants whose cell passes the gate; PostgreSQL 'passes' when every pair has one.",
        "3 each passing variant on its own vs MongoDB under the unchanged rule, plus the per-repetition best (PROTOCOL-S2.md's old pairing, which favours PostgreSQL)",
        "Secondary items are labelled and never decide a verdict."
      ],
      "componentsReading": "The publisher's reading of the pinned code, not a quoted rule: for the old pairing, the component count compared with MongoDB's is that of the PostgreSQL variant picked most often on seed 1 (a tie goes to the pre-registration's listing order, pgoutput before the outbox), using the deciding counts of item 3.",
      "operativeRule": "The old pairing's gate: PostgreSQL passes at a scale only when every (seed, repetition) pair has a passing variant, and in each pair the passing variant with the lower lag p95 is compared. Its result is published as a secondary item and never decides."
    },
    {
      "item": 5,
      "what": "Item 5: invalid vs missing files",
      "verdict": "ACCEPT x2, as written",
      "proposal": "invalid vs missing files (the runner owner's summary of the item, quoted in full under 'proposalSummary')",
      "reviewsSay": {
        "mongodbAdvocate": "**ACCEPT.** This matches PREREG's `invalid` when \"a cell is incomplete\". The reason is shown.",
        "postgresqlAdvocate": "**ACCEPT.** It matches PREREG's `invalid` (\"a cell is incomplete\") and keeps the reason visible."
      },
      "implementedAs": [
        "A missing or malformed counted cell at a scale: `invalid` (the cells are listed).",
        "It REFUSES (exit 2, nothing written) while any of the 60 counted cells is missing; --allow-incomplete writes the report with every verdict replaced by INCOMPLETE (never a verdict)."
      ]
    },
    {
      "item": 6,
      "what": "Item 6: which file names count",
      "verdict": "ACCEPT x2, as written",
      "proposal": "which file names count (the runner owner's summary of the item, quoted in full under 'proposalSummary')",
      "reviewsSay": {
        "mongodbAdvocate": "**ACCEPT.** Extra file names are visible in the report and cannot be swapped in.",
        "postgresqlAdvocate": "**ACCEPT.** These are the frozen matrix's names, and every ignored file is listed."
      },
      "implementedAs": [
        "Counted cells: only files directly in --dir named <arm>-x<scale>-rep<r>-seed<s>.json, arm in mongo / pgoutput / outbox, scale 1 / 10, r 0-4, s 1 / 2 (3 x 2 x 5 x 2 = 60). discarded/, smoke-*, smoke-history/ never count."
      ]
    },
    {
      "item": 7,
      "what": "Item 7: excluded variants",
      "verdict": "ACCEPT x2, as written",
      "proposal": "excluded variants (the runner owner's summary of the item, quoted in full under 'proposalSummary')",
      "reviewsSay": {
        "mongodbAdvocate": "**ACCEPT.** A variant that fails the gate has no comparison to make. The cells it failed are shown.",
        "postgresqlAdvocate": "**ACCEPT.** PROTOCOL-S2 defines \"best\" among the variants that pass the gate. Publishing failing variants as excluded meets \"every variant, every outcome\"."
      },
      "implementedAs": [
        "1 every PostgreSQL variant's gate outcome in every cell on both seeds; excluded variants with the reason",
        "No candidate -> PostgreSQL does not pass at that scale."
      ]
    },
    {
      "item": 8,
      "what": "Which counted cells a disturbance removes: the report checks it, instead of trusting the discarded/ directory",
      "verdict": "VETO x2; the MongoDB advocate's stricter alternative is adopted",
      "proposal": "trusting `discarded/`",
      "why": "Both advocates refuse a report that trusts the directory. Trusting it had already failed twice: one cell flagged at 17:05 stayed counted until about 20:00, and five cells from 13:07 to 14:18 stayed counted until 21:35. A re-run reuses the cell's name, so a check by name alone cannot work.",
      "alternatives": {
        "mongodbAdvocate": "The report reads every heavy-work window flagged in the disturbance log, from a table a script can read, refuses while any counted cell's run overlaps one, and lists by name the cells kept under a light overlap.",
        "postgresqlAdvocate": "The report reads the cell names flagged in the disturbance log and refuses to run while any of them is outside discarded/."
      },
      "rule": "As the runner owner posted, and as the pinned code's docstring says (quoted under implementedAs): the report refuses (exit 2, writes nothing, even with --allow-incomplete) when a counted cell's run, from its own t0 to its last event, overlaps a heavy window, and lists by name the counted cells that overlap a light window. The windows come from a machine-readable file, disturbance-windows.json, transcribed from the runner's private disturbance log as it is at private commit b1b857b8 (sha256 b62df233d45492df93eec8be465c5fbd6ac33656861d9dc97ad0aeebe6cdce68, the file amendment 01 cites); the log itself stays untouched. This record does not independently establish that the code behaves so: see reportCode.verifiedHere and limits.",
      "windows": "12 windows, one per table row of the log: 7 heavy, 5 light (counted in the file as fetched, matching the runner owner's post). Where a row's own wording does not decide heavy or light, the file says why the call was made in a 'judgement' field. The strictest: 19:34 to 19:51 is heavy as a whole, because a browser e2e ran at about 19:47 inside mostly light tests.",
      "implementedAs": [
        "The report REFUSES (exit 2, nothing written, --allow-incomplete or not) while any counted cell's run overlaps a heavy window, or while a counted cell's run cannot be placed in time; it lists by name the counted cells that overlap a light window."
      ],
      "reviewsSay": {
        "mongodbAdvocate": "**VETO.** Alternative: the report reads every heavy-work window flagged in DISTURBANCES.md, in a table a script can read. It refuses, the same way it refuses on a missing cell, when any top-level counted cell's run (`t0` to its end) overlaps one of those windows. It also lists by name the cells kept under light overlap. Reason: the disturbance rule says such a cell \"is discarded and re-run\", and trusting the directory has already failed twice. `pgoutput-x1-rep4-seed2` stayed counted from 17:05 to about 20:00, and five cells from 13:07–14:18 stayed counted until 21:35. Checking by name alone cannot work, because a re-run reuses the name. Amendment 03 shows that load on the host hit the MongoDB arm hardest.",
        "postgresqlAdvocate": "**VETO.** Alternative: the report reads the cell names flagged in `DISTURBANCES.md` and refuses to run while any of them is outside `discarded/`. Reason: the doctrine says explicit > implicit and everything must be reproducible. Moving the files by hand is a step a stranger cannot check. The check works the same for both stores and costs one parse."
      }
    },
    {
      "item": 9,
      "what": "Item 9: the seed-2 selection's candidate set",
      "verdict": "ACCEPT x2, as written",
      "proposal": "the seed-2 selection's candidate set (the runner owner's summary of the item, quoted in full under 'proposalSummary')",
      "reviewsSay": {
        "mongodbAdvocate": "**ACCEPT.** It uses the same gate set, and only the seed changes.",
        "postgresqlAdvocate": "**ACCEPT.** The gates already span both seeds, so the candidate set is the same. Breaking ties on seed-2 values is the only reading consistent with a seed-2 selection."
      },
      "implementedAs": [
        "5 the variant a seed-2-based selection would pick, and whether it matches"
      ]
    }
  ],
  "reportCode": {
    "commit": "125b4c7d767adad9f9ef36d7ef3d7e1c60c179aa",
    "repository": "private",
    "files": [
      {
        "path": ".ai/experiments/mongodb-home-ground/runner/s2_report.py",
        "sha256": "6cfe7873c350290656e83b79dbe4138095a210888dd26712a1d5f8dc4d1a2d03"
      },
      {
        "path": ".ai/experiments/mongodb-home-ground/runner/results/s2/disturbance-windows.json",
        "sha256": "5730ef140d02da7b021977fbb601409115e6cde8c30b153b667ee9e95ed1fa86"
      },
      {
        "path": ".ai/experiments/mongodb-home-ground/runner/test_s2_report.py",
        "sha256": "16b44b6a6477e591b7817561ea0f1abba8d9938f82ef6b48c22209bce0fab6b7"
      }
    ],
    "statedByRunnerOwner": "As the runner owner posted: 54 tests, synthetic data only; no counted cell was opened. While any of the 60 cells is missing, the report exits 2 and writes nothing; --allow-incomplete replaces every verdict word with INCOMPLETE.",
    "verifiedHere": "What the publisher checked, and what that does not show. Checked on 2026-10-28: s2_report.py, disturbance-windows.json, test_s2_report.py, DISTURBANCES.md, PREREG.md and PROTOCOL-S2.md fetched at private commit 125b4c7d; the first two match the runner owner's sha256, DISTURBANCES.md matches the b62df233 that amendment 01 cites, and the two review files' source sha256 match. The publisher's own run of the test file there (pytest 9.1.1, synthetic data only, no counted cell read) gave 54 passed, 0 failed, including test_cli_refuses_and_writes_nothing_while_cells_are_missing, test_allow_incomplete_labels_everything_and_never_emits_a_verdict, test_heavy_overlap_refuses_even_with_allow_incomplete, test_heavy_overlap_by_one_second_at_either_end_refuses_and_just_outside_passes, test_light_overlap_is_listed_by_name, test_a_cell_with_no_run_interval_refuses, test_only_plan_names_count, test_literal_component_counts_are_published_but_never_decide and test_transcription_has_one_window_per_disturbances_table_row. Not shown: the code and the tests are private, so a reader cannot inspect or re-run them; that run is the publisher's, not an independent one; and no advocate reviewed the adopted build. The refusal and listing behaviour is therefore the runner owner's statement, backed by the pinned code's own docstring and the publisher's test run, not a published proof."
  },
  "unchanged": "Amendments 02 and 03 stand: one PostgreSQL variant per scale, chosen once, ties by the lower seed-1 mean, symmetry, and the six-item secondary analysis that never decides. The frozen record and amendments 01 to 03 stay byte-identical. S1, S3 and S4 are not affected.",
  "limits": [
    "The nine readings were proposed by the runner owner, who also implements them; the advocates reviewed a brief that is not published. Each review says which files it read.",
    "Which code clause implements which of items 4 to 7 and 9 is the publisher's reading: the brief is unpublished, so each item is matched by the runner owner's summary, in its order, and by each review's own words for that item.",
    "The tests were run by the publisher on a copy of the pinned files, not by an independent party.",
    "Every behaviour of the report code that this record describes (refusing, writing nothing, --allow-incomplete, the light-overlap list, the old pairing) is the runner owner's statement and the pinned code's own docstring, checked only by the publisher's run of the private tests. It is not independently verifiable from this repository.",
    "The PostgreSQL advocate's own alternative for item 8 was not adopted; the stricter MongoDB-advocate version was. The thread records no second review of the adopted version by the PostgreSQL advocate.",
    "Whether a disturbance window is heavy or light is the runner owner's transcription of the log. The runner owner's post says six of the calls were judgements; the file as fetched has five windows with a non-empty 'judgement' field. The file, not the post, is what the report reads.",
    "The report code and the windows file are in a private repository and are cited here by commit and sha256, not published; a reader can check a hash but not open them."
  ],
  "notBefore": "S2's verdict is computed only after this amendment is merged to main of odin-labs-ai/odin-rnd, and only after all 60 counted cells exist.",
  "resolution": "Both vetoes are accepted: the report checks the disturbances itself and trusts no directory. The eight other items stand as proposed."
}
