#![allow(
dead_code,
reason = "consumed by relation engine + command modules in PHASE-02/03"
)]
pub(crate) const SL: &str = "SL";
pub(crate) const PRD: &str = "PRD";
pub(crate) const SPEC: &str = "SPEC";
pub(crate) const CM: &str = "CM";
pub(crate) const REQ: &str = "REQ";
pub(crate) const ADR: &str = "ADR";
pub(crate) const POL: &str = "POL";
pub(crate) const STD: &str = "STD";
pub(crate) const RV: &str = "RV";
pub(crate) const REC: &str = "REC";
pub(crate) const REV: &str = "REV";
pub(crate) const RFC: &str = "RFC";
pub(crate) const ISS: &str = "ISS";
pub(crate) const IMP: &str = "IMP";
pub(crate) const CHR: &str = "CHR";
pub(crate) const RSK: &str = "RSK";
pub(crate) const IDE: &str = "IDE";
pub(crate) const ASM: &str = "ASM";
pub(crate) const DEC: &str = "DEC";
pub(crate) const QUE: &str = "QUE";
pub(crate) const CON: &str = "CON";
pub(crate) const EVD: &str = "EVD";
pub(crate) const HYP: &str = "HYP";
pub(crate) const GOV: &[&str] = &[ADR, POL, STD];
pub(crate) const BACKLOG: &[&str] = &[ISS, IMP, CHR, RSK, IDE];
pub(crate) const RECORD: &[&str] = &[ASM, DEC, QUE, CON, EVD, HYP];
pub(crate) const VALUE_BEARING: &[&str] = &[SL, ISS, IMP, CHR, RSK, IDE];
pub(crate) fn is_value_bearing(prefix: &str) -> bool {
VALUE_BEARING.contains(&prefix)
}
pub(crate) fn is_record(prefix: &str) -> bool {
RECORD.contains(&prefix)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn groupings_match_documented_membership() {
assert_eq!(GOV, &[ADR, POL, STD]);
assert_eq!(BACKLOG, &[ISS, IMP, CHR, RSK, IDE]);
assert_eq!(RECORD, &[ASM, DEC, QUE, CON, EVD, HYP]);
}
#[test]
fn value_bearing_is_sl_plus_backlog_strict_subset_of_work_like() {
let expected: &[&str] = &[SL, ISS, IMP, CHR, RSK, IDE];
assert_eq!(VALUE_BEARING, expected);
let work_like: &[&str] = &["SL", "ISS", "IMP", "CHR", "RSK", "IDE", "REV"];
for &prefix in VALUE_BEARING {
assert!(work_like.contains(&prefix), "{prefix} must be work-like");
}
assert!(
!VALUE_BEARING.contains(&"REV"),
"REV is work-like for dep/seq but NOT value-bearing"
);
for &prefix in &[ADR, POL, STD, ASM, DEC, QUE, CON, EVD, HYP] {
assert!(
!is_value_bearing(prefix),
"{prefix} must NOT be value-bearing"
);
}
}
}