p = 'docs/INFRA-REGISTER.md'
raw = open(p, 'rb').read()
crlf = b'\r\n' in raw
s = raw.decode('utf-8').replace('\r\n', '\n')


def rep(a, b):
    global s
    assert s.count(a) == 1, (s.count(a), a[:80])
    s = s.replace(a, b)


rep("- **Status:** OPEN; fix owned by hertz (test-only, next lane after this one). Filed by hertz, 2026-09-24,",
    "- **Status:** BUILT (hertz, lane `fix/ir155-long-child-direct-ping`, fix commit `6e5ec878` on main `14350a78`); measured A/B below. Filed by hertz, 2026-09-24,")
rep("- **Predicted population:** every `long_child()` test whose candidate the supervisor KILLS. At `a1f4901e` the users are at `brainproc.rs` :1529, :1953, :2227, :2271 and :2313. Only 2 of them were in doyle's pinned 10.",
    "- **Predicted population, FALSIFIED IN PART by the A/B below:** every `long_child()` test whose candidate the supervisor KILLS. At `a1f4901e` the users are at `brainproc.rs` :1529, :1953, :2227, :2271 and :2313. Only 2 of them were in doyle's pinned 10.\n"
    "  - The measured arm U leaked 1 of the 4 `long_child` tests it ran, not all of them. `trial_kills_alive_never_ready_candidate_before_rollback` leaked in doyle's run and PASSED clean in arm U. So the leak is INTERMITTENT per test.\n"
    "  - Hypothesis, UNTESTED: the supervisor sometimes kills `cmd` before `cmd` has started `PING.EXE`, which leaves no grandchild to leak. The fix does not depend on it: it removes the grandchild altogether.")
rep("- **Fix.** On Windows, spawn PING directly (`Command::new(\"ping\").args([\"-n\", \"30\", \"127.0.0.1\"])`), so the kill hits the process that holds the handles. Also null its stderr and stdin. **Acceptance:** those tests report no LEAK on Windows nextest, and A11 still holds.",
    "- **Fix.** On Windows, spawn PING directly (`Command::new(\"ping\").args([\"-n\", \"30\", \"127.0.0.1\"])`), so the kill hits the process that holds the handles. Also null its stderr and stdin. **Acceptance:** those tests report no LEAK on Windows nextest, and A11 still holds.\n"
    "- **A/B MEASURED (hertz, hfenduleam Windows, one pool, 2026-09-25 02:13–02:17Z; doyle's GO `ZHKQYE34`).**\n"
    "  - Setup: a write census before launch read 0 writers (a SEPARATE call), with 131.6 GB free. The command was `cargo nextest run -p spt-daemon --lib brainproc::tests --no-fail-fast`, run once per arm. Arm U ran FIRST, with the pre-fix helper restored in the working tree. Each arm went to its own file, and each exit was read on its own call.\n"
    "  - **Arm U (unfixed):** `26 tests run: 26 passed (1 leaky)`. LEAK: `ready_but_old_gen_never_drains_does_not_promote_rolls_back`. That is the positive control: the defect reproduced in this pool.\n"
    "  - **Arm F (fix `6e5ec878`):** `26 tests run: 26 passed`, 0 leaky. All four `long_child` tests PASS, including A11's `trial_kills_alive_never_ready_candidate_before_rollback`, so the hazard assert still holds.\n"
    "  - Limits: n = 1 per arm. Because the leak is intermittent (above), an arm F with no LEAK is strong evidence only together with the mechanism: with no `cmd` wrapper, there is no grandchild left to hold the pipe. Records: `.spt/preserved/331/hertz/ir155/` (`armU.nextest.txt`, `armF.nextest.txt`, the exits, the driver script).")
out = s.replace('\n', '\r\n') if crlf else s
open(p, 'wb').write(out.encode('utf-8'))
print('ok crlf', crlf)
