docs(cli-rs): describe bounded parity deviations

This commit is contained in:
Simon Klee
2026-11-06 06:21:45 +01:00
Unverified
parent 6860262731
commit 06ef2d310f
2 changed files with 11 additions and 7 deletions
+8 -5
View File
@@ -37,7 +37,7 @@ export default defineApp({
{ path: "/api/session/ses_b/message", json: { data: [assistant("msg_2", "Done."), user("msg_1", "Why?")], cursor: {} } },
],
steps: [
{ checkpoint: "open", until: "Why?", deviation: ["V01-plain-transcript"] },
{ checkpoint: "open", until: "Why?", deviation: [{ file: "V01-plain-transcript", cells: 70 }] },
{ keys: ["ctrl+x", "n"] },
{ event: { type: "session.text.delta", data: { /* … */ } } },
{ type: "hello" },
@@ -68,10 +68,13 @@ export default defineApp({
`{ x, y, width, height }` or a `line` regex, which blanks every match on every row. Masks are for
nondeterministic text (the random prompt placeholder, durations, relative times). Plan 7.5: a mask over
a whole widget needs a deviation file.
- `deviation`: a list of names of `parity/deviations/<name>.md`, one per row that differs. The
checkpoint may then differ: the Rust runner prints a one-line summary and passes (`PARITY_VERBOSE=1`
prints the full report). A difference without a deviation fails, and so does a missing file. A
checkpoint that now matches prints a note to remove its deviations.
- `deviation`: a list of `{ file, cells, styleOnly? }`, one per row that differs: the file
`parity/deviations/<file>.md` and the number of cells it allows to differ. With `styleOnly`, those cells
must keep their symbols; only colors or attributes may differ. The entries add up, and the checkpoint
passes when it differs in no more cells than they allow: the Rust runner prints a one-line summary
(`PARITY_VERBOSE=1` prints the full report). A difference beyond them fails, and so does a missing file.
A checkpoint that now matches prints a note to remove its deviations. The Rust runner masks the recorded
cells again too, so a mask edited into a recording covers both sides.
- **`requests: { deviation }`** at the top level does the same for P-REQ, with one name.
Scenario data uses fixed IDs and times, so no ID or time normalizer is needed in cells. Helpers in
+3 -2
View File
@@ -70,8 +70,9 @@ One file per scenario, `parity/scenarios/<step>/<name>.sim.ts`, with `export def
- `applyMasks` from `parity/lib/app.ts` masks both sides, then the cells are compared one by one (symbol, fg, bg,
attributes), as `opencode_parity::compare` does. The report lists the differing rows with markers and the first
differing cells, in the H.1 report shape.
- A checkpoint passes when the cells are equal, or when it lists deviation files and all of them exist. A listed
file that does not exist fails the checkpoint.
- A checkpoint passes when the cells are equal, or when they differ in no more cells than its deviations allow
(H.2's `{ file, cells, styleOnly? }`) and all of their files exist. A listed file that does not exist fails the
checkpoint.
- Requests: writes (anything but GET and plugin `get` RPCs, H.2's `isRead`) must match in order by method, path,
and body after the plan 7.5 normalizers (prefixed IDs, the sandbox root, ports). Reads that one side sent and the
other did not are listed, not failed, as in H.2. Bodies are compared as JSON values (key order does not count),