From 635d3802c1aa31bf56620b2c6bed534be7f446cf Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 25 Nov 2026 08:17:26 +0100 Subject: [PATCH] [roads] QA F-09: an emptied until: or ports: silently widens a road (failing test, ignored) until: with no value (or only a comment) reads as absent, so a temporary grant becomes permanent; ports: with no value reads as all traffic. No problem is reported. Verified to fail on this code. --- crates/roads/tests/qa_findings.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/crates/roads/tests/qa_findings.rs b/crates/roads/tests/qa_findings.rs index 8213b33..0a8f7c4 100644 --- a/crates/roads/tests/qa_findings.rs +++ b/crates/roads/tests/qa_findings.rs @@ -234,3 +234,30 @@ fn f08_mesh_addresses_are_never_internet_addresses() { "198.51.100.4 was accepted as a mesh address; an exit's `internet` rule covers it" ); } + +/// F-09. An empty value means "absent" (docs/FORMATS.md), and for the two conditions that narrow a road absent +/// is the widest value: `until:` left empty is a permanent grant and `ports:` left empty is all traffic, with no +/// problem reported. The same failure as QA R-35 (a misspelt `until`), reached by deleting the value instead. +#[test] +#[ignore = "QA F-09 (major): an emptied `until:` or `ports:` silently widens the road to its maximum"] +fn f09_an_emptied_narrowing_condition_is_an_error() { + for (from, to) in [ + ("until: 2026-11-29T23:59:59+01:00\n", "until:\n"), + ("ports: [tcp/443]\n", "ports:\n"), + ("until: 2026-11-29T23:59:59+01:00\n", "until: # Sunday\n"), + ] { + let text = Parts::home().road_text("7tq0mz").replace(from, to); + assert!(text.contains(to), "fixture edit {to:?}"); + let c = Parts::home().replace_road("7tq0mz", &text).compile(); + assert!( + c.problems.iter().any(|p| p.path.contains("7tq0mz")), + "`{}` compiled as {} with no problem reported", + to.trim_end(), + if to.starts_with("until") { + "a permanent grant" + } else { + "all traffic" + } + ); + } +}