diff --git a/src/plan.rs b/src/plan.rs index 683114c..5b7b12f 100644 --- a/src/plan.rs +++ b/src/plan.rs @@ -84,7 +84,10 @@ needs: # aggregates.yaml already has, so its records keep replaying attended_by: > # ONLY for a stage no desk button moves: the automation that does what moves it, in a sentence - max_fields: 4 # how many required fields THIS person will tolerate, from what + max_fields: 4 # decide this BEFORE writing collects, from what the intake + # says about the person; a budget that equals the form's size + # is counted, not decided, and is reported as such + # how many required fields THIS person will tolerate, from what # the intake says about them: someone on a phone with gloves # on gets 3, a first enquiry 4 to 6, a firm's paperwork 5 to 6 collects: # the form; name is snake_case ASCII, type one of @@ -225,6 +228,19 @@ pub fn run(argv: &[String]) -> anyhow::Result<()> { if !strangers.is_empty() { eprintln!(" {} persona(s) name a need this plan does not have; set their `need:` to one of the ids above before building:\n {}", strangers.len(), strangers.join("\n ")); } + // A budget that equals the form is the tell of a model + // that counted the form and called it the person's + // tolerance. One such need is a form that uses its + // room; most of them is the number being invented. + let tight: Vec<&str> = plan + .needs + .iter() + .filter(|n| n.collects.iter().filter(|f| !f.optional).count() == n.max_fields) + .map(|n| n.id.as_str()) + .collect(); + if tight.len() * 2 > plan.needs.len() && tight.len() > 1 { + eprintln!(" {} of {} need(s) have max_fields equal to their required fields ({}): check each against what the intake says about that person, not the form", tight.len(), plan.needs.len(), tight.join(", ")); + } println!( "plan written to {}; read it before building from it", out.join("plan.yaml").display()