ReportJson Module
AOT-safe `System.Text.Json` metadata for the opt-in JSONL report serializer: one self-describing JSON
object per line for `Outcome`, `ProcessResult<string>`/`ProcessResult<byte[]>`,
`ProcessGroupStats`, `RunProfile`, `MemberInfo`, and `LimitEvidence` — the shapes this port has today.
Ports the **shape**, not the code, of ProcessKit-rs's `report-serde` feature; see
`docs/jsonl-reports.md` for the full schema, the versioning promise, and C#/F# consumer examples
reading a JSONL stream.
**Opt-in.** Nothing on `ProcessResult`/`ProcessGroupStats`/`RunProfile`/`MemberInfo`/`LimitEvidence`
themselves changed — this is a separate serializer you reach for explicitly, via
`JsonSerializer.Serialize(value, ReportJson.OutcomeTypeInfo)` or the `ToReportJson()` extension methods
on `ReportJsonExtensions`.
**Four rules, matching the source feature:**
1. **A tagged shape carries a `"kind"` identifier**, spelled as this schema's own stable, documented
machine name — never a raw union-case ordinal or a BCL `.ToString()`. `Outcome` is `exited` /
`signalled` / `timed_out` / `unobserved`; each report line's own envelope is `process_result` /
`process_group_stats` / `run_profile` / `member_info` / `limit_evidence`.
2. **`Serialize` only — deliberately no `Deserialize`.** These are values the library *reports*, never
values a caller supplies back to it; every converter's `Read` throws `NotSupportedException`. Every
`JsonTypeInfo<'T>` below is still safe to pass to a `JsonSerializer.Deserialize` call by a
caller who ignores this and does so anyway — it simply throws instead of fabricating a value.
3. **Reports *about* processes, never what a process produced.** No converter here ever reads captured
stdout/stderr content, argv, or environment values — `ProcessResult.Stdout`/`Stderr`/`Combined` are
never touched, whatever `'T` is.
4. **Fields are additive; a field's spelling and unit are frozen.** Every one of these report types is
`[<Sealed>]` with an internal constructor and grows fields across minor releases without
breaking this schema's readers — a JSONL consumer must ignore keys it does not recognize, the same
discipline any self-describing format needs. Time is always a number of fractional seconds
(`duration_secs`, `total_cpu_time_secs`, `cpu_time_secs`, …); a measurement the platform cannot
report is `null`, never a fabricated `0`.
Functions and values
| Function or value |
Description
|
|
AOT-safe metadata for serializing a `LimitEvidence` report.
|
|
AOT-safe metadata for serializing a `MemberInfo` snapshot.
|
|
AOT-safe metadata for serializing an `Outcome` on its own, e.g. from a supervision or streaming callback that only has the outcome in hand.
|
|
AOT-safe metadata for serializing a `ProcessGroupStats` snapshot.
|
|
AOT-safe metadata for serializing a `ProcessResult<byte[]>` — `OutputBytesAsync`'s result type.
|
|
AOT-safe metadata for serializing a `ProcessResult<string>` — the text capture verbs' (`OutputStringAsync`, `RunAsync`, …) result type.
|
|
AOT-safe metadata for serializing a `RunProfile`.
|
ProcessKit API Reference