Skip to content

Commit 566bcde

Browse files
committed
test: assert every first-party module id by name in one loop
PLEX ran the constant-function mutation on their copy of this list and found their suite green with the allowlist replaced by false: three thorough tests, all fencing the refusal direction, nothing proving the list can accept at all. A trust surface acquires exactly that bias, because a refusal reads as a failure someone tests while a grant reads as the happy path. The loop asserts each accepted id by name, so an empty allowlist reddens every name and a dropped entry reddens exactly the missing one — both mutations verified here before committing.
1 parent 0fee25f commit 566bcde

1 file changed

Lines changed: 15 additions & 26 deletions

File tree

crates/aft/src/subc/mod.rs

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6259,32 +6259,21 @@ mod tests {
62596259
trust_for_principal(&Some(Principal::Direct)),
62606260
BindTrust::FirstParty
62616261
);
6262-
assert_eq!(
6263-
trust_for_principal(&Some(Principal::Reserved {
6264-
module_id: "llm-runner".to_string(),
6265-
})),
6266-
BindTrust::FirstParty
6267-
);
6268-
assert_eq!(
6269-
trust_for_principal(&Some(Principal::Reserved {
6270-
module_id: "aft".to_string(),
6271-
})),
6272-
BindTrust::FirstParty
6273-
);
6274-
// Both halves of each transitional rename pair stay first-party
6275-
// until the flip settles (see the allowlist comment).
6276-
assert_eq!(
6277-
trust_for_principal(&Some(Principal::Reserved {
6278-
module_id: "alfonso-core".to_string(),
6279-
})),
6280-
BindTrust::FirstParty
6281-
);
6282-
assert_eq!(
6283-
trust_for_principal(&Some(Principal::Reserved {
6284-
module_id: "prefrontal".to_string(),
6285-
})),
6286-
BindTrust::FirstParty
6287-
);
6262+
// Every first-party reserved id is asserted BY NAME, in one loop over
6263+
// the full set, so two failure classes stay distinguishable: an empty
6264+
// or broken allowlist reddens every name at once, while a dropped
6265+
// single entry (the rename hazard) reddens exactly the missing name.
6266+
// Both halves of each transitional rename pair stay listed until the
6267+
// flip settles (see the allowlist comment).
6268+
for module_id in ["llm-runner", "aft", "broca", "alfonso-core", "prefrontal"] {
6269+
assert_eq!(
6270+
trust_for_principal(&Some(Principal::Reserved {
6271+
module_id: module_id.to_string(),
6272+
})),
6273+
BindTrust::FirstParty,
6274+
"reserved module id '{module_id}' must resolve to first-party trust"
6275+
);
6276+
}
62886277
assert_eq!(
62896278
trust_for_principal(&Some(Principal::Reserved {
62906279
module_id: "subc-mcp".to_string(),

0 commit comments

Comments
 (0)