1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! **The engine's conformance corpus, vendored as literal text** (yog's
//! `docs/REMOTE.md` §3) — and the one place in this crate that states what the
//! far end says rather than what this crate believes.
//!
//! REMOTE §3 publishes `corpus/request/<op>.json` and `corpus/reply/<kind>.json`,
//! one file per shape holding that shape's frames verbatim, and states what a
//! client owes them: *"decode every frame in both directories into its own
//! types, and round-trip what it emits — decode then re-encode must return the
//! frame exactly"*, with the concession that *"the foot's surface is small
//! enough that it may consume only the subset of shapes it speaks"*. This
//! module is that subset, and [`tests`] is the owing paid.
//!
//! **The text is copied, not derived, and that is the whole mechanism**
//! (bl-e0f0). A conformance fixture built out of the crate it is testing agrees
//! with itself at any value — which is exactly how [`PROTOCOL`] sat five
//! versions behind a live engine while every test passed: the stand-in engine
//! wrote its preface from `channel::hello::PROTOCOL`, so both ends of the wire
//! were one constant wearing two names. Everything here is a literal got from
//! the engine, so a drift is a red test naming both numbers instead of a
//! channel no operator can open.
//!
//! **It is `.rs` rather than vendored `.json`, and that is deliberate.** The
//! files would have to be ruled into `Cargo.toml`'s `include` allowlist to
//! survive a build from the registry, and would then *ship* in the crate — a
//! test fixture in a released binary's tarball. Literals under `src` are
//! already `cfg(test)`, cost a released build nothing, and are read by the same
//! decoders at the same strictness.
//!
//! **What a foot speaks is smaller than the protocol, so most bumps are not
//! its business.** Between PROTOCOL 2 and 8 exactly one shape a foot decodes
//! moved: `reply/advertised` gained `wrote` at 8. The five bumps between are
//! seat-facing — a conversation row's `failure` (3), the queue row's `flag`
//! (4), `reply/governing`'s lineage keys (5), `reply/providers`' `effort` and
//! `priority` (6), `reply/help`'s `surface` (7) — and a foot decodes none of
//! them. It still cannot dial across any of them, because the preface is one
//! integer compared for equality: the version is the *engine's build*, not a
//! statement about the frames this end happens to read.
/// **The protocol number, got from the engine.** yog's `src/wire/hello.rs`
/// reads `pub const PROTOCOL: u32 = 8`, and this is that line copied.
///
/// It is what the suite's stand-in engine states, so every channel test dials
/// across the same equality a real one does — and
/// [`channel::hello::PROTOCOL`](crate::channel::hello::PROTOCOL) agreeing with
/// it is a test rather than a tautology.
pub const PROTOCOL: u32 = 8;
/// `corpus/request/advertise.json`, stamped PROTOCOL 2 — the empty set, one
/// ordinary element, and the element carrying §5.1's optional fourth fact.
pub const ADVERTISE: = ;
/// `corpus/request/invocations.json`, stamped PROTOCOL 1. The follow-class read
/// carries no field at all — a connection drains its own queue.
pub const INVOCATIONS: &str = r#"{"op":"invocations"}"#;
/// `corpus/request/complete.json`, stamped PROTOCOL 1.
pub const COMPLETE: &str = r#"{"capture":{"exit_code":3,"stderr":"warned\n","stdout":"hello\n"},"invocation":"inv-1","op":"complete"}"#;
/// `corpus/reply/advertised.json`, stamped **PROTOCOL 8** — the bump this
/// module was written for. `wrote` is required, and `false` is the ordinary
/// re-presentation.
pub const ADVERTISED: = ;
/// `corpus/reply/invocations.json`, stamped PROTOCOL 2 — nothing queued, one
/// ordinary row, and one carrying the worktree lane's `cwd`.
pub const QUEUED: = ;
/// `corpus/reply/routed.json`, stamped PROTOCOL 1 — the slot as it stands, with
/// the capture absent while the work is still out.
pub const ROUTED: = ;
/// `corpus/reply/refusal.json`, stamped PROTOCOL 1 — the envelope with no
/// `kind`, which is the one shape a refusal may wear.
pub const REFUSAL: &str = r#"{"error":"unknown op \"fhtagn\"","ok":false}"#;