import io

p = 'PR-BODY-W2.md'
s = io.open(p, encoding='utf-8', newline='').read()

# ── 1. Replace the "int arm was rewritten" paragraph with the ruled account ──
old = """**The int arm for the remote helper was rewritten, not extended.** Its previous
positive asked with an origin the owner had never sent, and it PASSED — because
the F1 binding did not exist yet. That old green was the hole."""
assert s.count(old) == 1
new = """**The int arm for the remote helper was rewritten, not extended.** Its previous
positive asked with an origin the owner had never sent, and it PASSED — because
the F1 binding did not exist yet. That old green was the hole.

The rewrite went further than the binding, because closing the hole exposed a
second one. The replacement arm drove `request_serve_for` **from the test
process**, and it did not run: it ate the brain IPC read deadline at the first
call. That client lives INSIDE the receiving daemon's WAN ingress in
production — the same place the fetch path's client lives — so the arm was
driving a client that does not exist. *A deadline I would have to widen to make
my own test shape work is the test being wrong about where the client lives.*

So the arm is now driven the only way production drives it: one real
`spt send --user-msg` from a Gateway-typed endpoint on B to an endpoint hosted
on A, quoting an absolute path that exists on B, and then **waited for on A's
helperline store**. That wait is the observable — it can only be satisfied by
the ingress caller firing after delivery and completing a daemon-to-daemon
round trip. The Gateway type is not decoration: WAN ingress re-stamps an
arriving `user-msg` down to a plain `msg` unless the origin endpoint is
advertised as a Gateway (REQ-MSG-6), and the arm asserts the send was not
degraded before it asserts anything that depends on it.

**The five F1 conjuncts had NO evidence outside the arm being reshaped.** That
is a measurement, not an impression: `msgid`'s existing cells cover
`local_msg_out_in`'s LOOKUP — found, not found, nested perch — and a grep across
every crate finds the conjuncts themselves named in exactly one place, the int
arm. They sat inline in the daemon's `serve_for`, reachable only through a QUIC
round trip. So reshaping that arm would have taken the gate finding's own fix
down to zero evidence, which is why the conjuncts moved rather than shrank:
they are now `spt_store::msgid::user_authorized_serve_for`, PURE, taking nothing
the requester sent except the `audience` and `path` the request is about, with
one unit cell per conjunct asserting both the refusal and the admit side of the
same inputs. `serve_for` looks the row up and calls it where conjunct 3 always
sat. The extraction is a fix, not a scope cut.

Four of the five cannot be produced end to end AT ALL — the receiving daemon
only ever asks for a path the user's own words carried, addressed to that
message's own target, under that message's own id — so the int arm keeps the
one that can: an agent-authored message quoting the same path, which is a
DIFFERENT gate (the receiver's own "only a `user-msg` triggers this") and has
no other evidence. Its zero is judged after the positive raises the same
counters through the same pipe, so it cannot be the zero of a dead emitter."""
s = s.replace(old, new, 1)

# ── 2. Findings closed in-lane ───────────────────────────────────────────────
anchor = "## Order of work"
assert s.count(anchor) == 1
findings = """## Two defects the battery found, closed in-lane

Both are product defects this PR introduced and this PR fixes; neither is a test
accommodation.

**The quoted-path extractor trimmed once each in a fixed order.** A path written
the way people write them — `see "C:\\x\\notes.md".` — carries a closing quote
INSIDE the sentence dot, so one pass of quote-then-dot left the quote attached
and minted a URL naming a file that does not exist. It now trims to a FIXED
POINT. Measured before the fix: the token came back as `C:\\x\\notes.md"`.

**A torn helperline tail fused with the next record.** A crash mid-append leaves
a fragment with no newline; appending straight onto it produced one unparseable
line out of two records, so a single interruption cost TWO records rather than
one. `append_at` now closes a torn tail with a newline before writing. The cell
asserting that a torn line costs only itself was red until this existed — and
the module's own doc had already claimed the property the code lacked.

"""
s = s.replace(anchor, findings + anchor, 1)

io.open(p, 'w', encoding='utf-8', newline='').write(s)
print("ok")
