# Outbound patches — diffs mgf-hrb supplies to federation siblings

When an mgf-hrb FEEDBACK paper is **outbound** (the fix belongs in a sibling
repo, not here), this directory holds the concrete diff mgf-hrb supplies so the
sibling can adopt it directly. Each patch is a pure `git apply`-able unified
diff against the sibling's tree; provenance + verification live here so the
sibling's maintainer can apply with confidence.

| Patch | Paper | Target repo | Verified |
|---|---|---|---|
| [`LOG-01-mgf-common-zig016.patch`](LOG-01-mgf-common-zig016.patch) | [`FEEDBACK.md` LOG-01](../../FEEDBACK.md) | `mgf-common` | ✅ compiles + passes conformance under Zig 0.16 — **adopted in mgf-common `37e2b01` (2026-05-30)** |

## `LOG-01-mgf-common-zig016.patch`

**What it fixes.** mgf-common 0.42.0 (unified logging, OB-10) ships the Zig
reference emitter `clients/zig/log_record.zig` and designates mgf-hrb as the
federation member that compiles + pins it (mgf-common has no Zig toolchain). But
the file as authored does **not** compile under Zig 0.16 — `toJsonlAlloc` and the
conformance test use the removed managed `std.ArrayList(u8).init(allocator)` /
`.writer()` / `.toOwnedSlice()` / `.items` API. Because mgf-common's CI has no Zig
toolchain, this never surfaced upstream.

**What the patch does.** Two hunks port the buffer plumbing to the Zig 0.16
`std.Io.Writer` idiom (`std.Io.Writer.Allocating` for the allocating render,
`std.Io.Writer.fixed` for the test), plus a one-line-each README pin of the Zig
0.16 toolchain version. The emit logic (`writeJsonObject` + helpers, generic over
`anytype`) is **byte-for-byte unchanged** — only the alloc/test harness moves.
This is the same port mgf-hrb already runs in CI on its vendored copy
(`hrb-code/vendor/logrecord/log_record.zig`); adopting it upstream lets the two
copies reconverge exactly.

**Verification.** Applied to a pristine copy of mgf-common's `clients/zig/` tree:
without the patch `zig test clients/zig/log_record.zig` fails to compile
(`std.ArrayList(u8) ... has no member named 'init'`); with it applied the file
compiles and the upstream conformance test passes ("reproduces every golden
fixture line"). The patch `git apply --check`s cleanly against mgf-common `main`
as of 2026-05-30.

**Apply (from the mgf-common repo root):**

```bash
git apply /path/to/LOG-01-mgf-common-zig016.patch
zig test clients/zig/log_record.zig   # 1/1 OK
```
