#![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 DISPATCH_REF_PREFIX: &str = "refs/heads/dispatch/";
pub(crate) const PHASE_REF_PREFIX: &str = "refs/heads/phase/";
pub(crate) const REVIEW_REF_PREFIX: &str = "refs/heads/review/";
pub(crate) const CANDIDATE_REF_PREFIX: &str = "refs/heads/candidate/";
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 SEARCH_DEFAULT: &[&str] = &[
SL, ADR, PRD, SPEC, RFC, ISS, IMP, CHR, RSK, IDE, ASM, DEC, QUE, CON, EVD, HYP,
];
pub(crate) const ALL_KINDS: &[&str] = &[
SL, ADR, POL, STD, PRD, SPEC, REQ, ISS, IMP, CHR, RSK, IDE, RV, REC, ASM, DEC, QUE, CON, EVD,
HYP, CM, REV, RFC,
];
pub(crate) const TAGGABLE: &[&str] = &[
SL, ADR, POL, STD, RFC, ISS, IMP, CHR, RSK, IDE, ASM, CM, DEC, QUE, CON, EVD, HYP, PRD, SPEC,
REQ, REC, REV, RV,
];
pub(crate) const WORK_LIKE: &[&str] = &[SL, ISS, IMP, CHR, RSK, IDE, REV];
pub(crate) const ADMISSIBLE_DEP_TARGETS: &[&str] = &[
SL, ISS, IMP, CHR, RSK, IDE, REV, 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 combined_constants_cover_record() {
for c in [SEARCH_DEFAULT, ALL_KINDS, TAGGABLE, ADMISSIBLE_DEP_TARGETS] {
for &r in RECORD {
assert!(c.contains(&r), "{r} missing from combined constant");
}
}
}
#[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"
);
}
}
}