[roads] QA F-05 and F-06: classic custom blocks, and roads across address families

F-05: plan.custom took classic from the road only, so a raw block on a classic
device without classic: true was labelled post-quantum. The device's flag now
counts too, as it already did for peers.

F-06: a device has one mesh address, so a can-reach road from IPv4 devices to
an IPv6 place compiled to rules that could never match, silently. Those
devices now get nothing for that road, and the road is reported inactive
(road.family) naming them.
This commit is contained in:
2026-11-25 08:52:01 +01:00
parent ff78361165
commit ecafe194a5
6 changed files with 57 additions and 4 deletions
-2
View File
@@ -175,7 +175,6 @@ fn f04_deleting_a_person_revokes_them_and_nobody_else() {
/// F-05. A custom road on a classic device is carried as `classic: false` unless the road says otherwise, so the
/// plan labels a classic peer's raw block as post-quantum (CLAUDE.md: classic peers are labelled everywhere).
#[test]
#[ignore = "QA F-05 (minor): plan.custom takes `classic` from the road, not from the device"]
fn f05_a_custom_block_on_a_classic_device_is_labelled_classic() {
let router = key(5);
let text = Parts::home()
@@ -198,7 +197,6 @@ fn f05_a_custom_block_on_a_classic_device_is_labelled_classic() {
/// other way round) compile cleanly into rules that can never match: a road that grants nothing, reported as
/// nothing.
#[test]
#[ignore = "QA F-06 (minor): a road across address families compiles into a rule that never matches"]
fn f06_a_road_across_address_families_is_reported() {
let parts = with(
Parts::home().edit_devices(|d| {
+24
View File
@@ -42,6 +42,7 @@ fn inactive_code(code: &str) -> bool {
rules::ROAD_SELF,
rules::EXIT_CONFLICT,
rules::DIRECT_KILL_SWITCH,
rules::ROAD_FAMILY,
]
.contains(&code)
}
@@ -242,6 +243,29 @@ fn generated(baseline: &[u8]) -> BTreeSet<String> {
);
}
hit.insert(rules::STORE_ROADS.into());
// road.family: an IPv4 subject to an IPv6 subnet needs an IPv6 route in devices.json (QA F-06).
let v6 = Parts::home()
.edit_devices(|d| {
d.replace(
r#""routes": ["192.168.100.0/24"]"#,
r#""routes": ["192.168.100.0/24", "fd00:1::/64"]"#,
)
})
.with_road(
"b00004-mark-v6.md",
"---\nid: b00004\nsubject: person:mark\nverb: can-reach\nobject: subnet:fd00:1::/64\ncreated: 2026-11-25T10:00:00Z\n---\n",
);
let c = v6.compile();
let hit_family = c
.problems
.iter()
.find(|p| p.path == "roads/b00004-mark-v6.md" && p.code == rules::ROAD_FAMILY);
assert!(
hit_family.is_some_and(|p| !p.is_error() && p.field.as_deref() == Some("object")),
"{:?}",
c.problems
);
hit.insert(rules::ROAD_FAMILY.into());
hit
}