pub(super) const FOR_CAPTAIN: [&str; 1] = ["solo"];
pub(super) const FOR_A_WORKTREE: [&str; 1] = ["copy"];
pub(super) const FOR_ROLES: [&str; 7] = [
"lead",
"leader",
"coordinator",
"drafter",
"drafters",
"owner",
"owners",
];
pub(super) const FOR_WHAT_ROLES_DO: [&str; 4] = ["lead", "leads", "coordinate", "coordinates"];
pub(super) const SAY_HOW: [&str; 4] = ["solo", "drafters", "copy", "coordinator"];
#[cfg(test)]
mod tests {
use super::super::roster::Roster;
use super::super::words::{Stance, stance, turned_around};
use super::super::{CHECKOUT_CUES, captain_stance, might_say_how, names_a_role, worktree_cues};
#[test]
fn a_request_may_say_them_for_captain_and_a_worktree() {
assert_eq!(captain_stance("do it solo"), Stance::For);
assert_eq!(captain_stance("not solo, use the crew"), Stance::Against);
let worktree = |says| stance(says, &worktree_cues(), &CHECKOUT_CUES);
assert_eq!(worktree("check it in a copy first"), Stance::For);
assert_eq!(worktree("no copy, work in my files"), Stance::Against);
}
#[test]
fn a_request_may_say_them_for_roles_and_what_they_do() {
for who in [
"the lead",
"leader",
"a coordinator",
"drafters",
"the owners",
] {
assert!(names_a_role(who), "{who}");
}
assert!(!names_a_role("the codex one"));
for says in [
"codex shouldn't lead",
"claude never leads",
"don't have codex coordinate",
"gemini never coordinates",
] {
assert!(turned_around(says, &[]), "{says}");
}
assert!(!turned_around("codex leads and gemini coordinates", &[]));
}
#[test]
fn some_alone_may_say_how_to_run() {
let nobody = Roster { agents: Vec::new() };
for said in [
"do it solo",
"three drafters",
"in a copy",
"codex as coordinator",
] {
assert!(might_say_how(said, &nobody), "{said}");
}
assert!(!might_say_how("this may lead to a crash", &nobody));
}
}