pub fn link(
unit: IntentWorkUnit,
intents: &Intents,
plan: &Plan,
) -> IntentRealizedWorkExpand description
Join one unit of work to the intents, through the plan.
The candidate issues are, strongest first: those its words cite, those a recorded event shows
it moving, the one its branch names. Only when none of those exists are the open issues whose
scope overlaps its scope taken, and they are marked inferred. Each issue is followed to its
milestone and the milestone to the intents naming it, keeping the strongest link per issue.
use majordomus_cli::intent::Intents;
use majordomus_cli::intent_realization::{link, IntentWorkKind, IntentWorkUnit};
let intents = Intents { intents: vec![], findings: vec![] };
let w = link(IntentWorkUnit::new(IntentWorkKind::Task, "t-1"), &intents, &plan);
// nothing to follow is itself the answer, and it says why
assert!(w.links.is_empty());
assert!(w.unlinked.unwrap().contains("names no issue"));