From f7dff25f9ded8aa87ab2c09cbbd21c425c1f0033 Mon Sep 17 00:00:00 2001 From: "glm-5.3-flash" Date: Sun, 20 Sep 2026 08:30:48 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20review=20002=20trivial=20batch=20?= =?UTF-8?q?=E2=80=94=20D-3=20honest=20serde=20test=20name=20+=20D-4=20CHAN?= =?UTF-8?q?GELOG=20preamble=20trim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - D-3: inline the serde-layer check into the renamed serde_rejects_unknown_substrate_value; delete the overpromising jsonschema_valid helper (the registry's real schema gate stays pinned end-to-end by the integration probes) - D-4: trim the stale Unreleased preamble to a one-liner (written before the six graduation implementation commits landed) Verified: cargo fmt --check; cargo clippy --all-targets -D warnings; cargo test (86 + 2 doc-tests) green --- CHANGELOG.md | 7 ++----- src/params.rs | 23 ++++++++--------------- tasks/tunnels/review-002-trivial-batch.md | 21 +++++++++++++++++++-- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e52525..7d4daf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,8 @@ this crate adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] -Spec work for the graduation (ADRs 007/008 — the direct op, listen -metadata + the forwarded op) is committed and pinned; implementation -is decomposed in `tasks/tunnels/` and lands in the next release. The -dependency bump below is the only behavior-affecting change so far -(no wire or API change at this level yet). +The graduation implementation (the direct op, listen metadata + the +forwarded op — ADRs 007/008) landed — see Added below. ### Added diff --git a/src/params.rs b/src/params.rs index ffc967f..1d442f2 100644 --- a/src/params.rs +++ b/src/params.rs @@ -599,12 +599,16 @@ mod tests { } #[test] - fn schema_rejects_unknown_substrate_value() { - let schema = tunnel_open_spec().input_schema; + fn serde_rejects_unknown_substrate_value() { + // The serde layer (the enum deserializer), not the JSON Schema — + // the registry's real schema gate is pinned end-to-end by the + // integration probes (`schema_rejects_unknown_substrate_loudly`, + // `malformed_target_is_schema_class_and_leaves_no_channel`, the + // forwarded `listen: 0` gate). let substrate_ok = json!({"resource": "r", "substrate": "udp"}); let substrate_bad = json!({"resource": "r", "substrate": "sctp"}); - assert!(jsonschema_valid(&schema, &substrate_ok)); - assert!(!jsonschema_valid(&schema, &substrate_bad)); + assert!(serde_json::from_value::(substrate_ok).is_ok()); + assert!(serde_json::from_value::(substrate_bad).is_err()); } #[test] @@ -625,17 +629,6 @@ mod tests { assert_eq!(establishment_reason(&local_only), None); } - fn jsonschema_valid(_schema: &serde_json::Value, value: &serde_json::Value) -> bool { - let Ok(params) = serde_json::from_value::(value.clone()) else { - return false; - }; - let allowed = ["tcp", "udp", "unix"]; - matches!( - substrate_str(params.substrate), - "tcp" | "udp" | "unix" if allowed.contains(&substrate_str(params.substrate)) - ) - } - // --- direct op (ADR-007) ------------------------------------------- #[test] diff --git a/tasks/tunnels/review-002-trivial-batch.md b/tasks/tunnels/review-002-trivial-batch.md index 54d2013..95f5a2e 100644 --- a/tasks/tunnels/review-002-trivial-batch.md +++ b/tasks/tunnels/review-002-trivial-batch.md @@ -1,7 +1,7 @@ --- id: tunnels/review-002-trivial-batch name: "Trivial batch — D-3 (rename the overpromising schema test helper) + D-4 (trim the stale CHANGELOG preamble)" -status: pending +status: completed depends_on: [] scope: narrow risk: trivial @@ -67,4 +67,21 @@ wording agent's choice) or drop it. ## Notes -> Agent fills during implementation. \ No newline at end of file +> Agent fills during implementation. + +## Implementation Notes (2026-09-20) + +- **D-3**: inlined the honest serde check directly into the renamed + test `serde_rejects_unknown_substrate_value` (the `jsonschema_valid` + helper deleted — it had exactly one call-site, and its + `matches!`-with-guard body was convoluted beyond its job). The doc + comment names the integration probes that pin the real registry-side + gate end-to-end. No `jsonschema` dev-dependency added (the + structural-assertion sibling `direct_target_schema_gates_shape_per_ + substrate` is untouched and stays honest). +- **D-4**: trimmed the preamble to the one-liner ("The graduation + implementation … landed — see Added below."); the stale + `tasks/tunnels/` sentence and the "only behavior-affecting change" + claim are gone. +- Verification: `cargo fmt --check`, `cargo clippy --all-targets -D + warnings`, `cargo test` (86 default tests + 2 doc-tests) all green. \ No newline at end of file