Explaining a matcher's rejections without duplicating its rules
To explain why a constraint-based matcher rejected each option, export its per-leg feasibility function and call it again with one constraint loosened at a time (no limit and no deadline = structurally impossible; no deadline = late; earlier ready time = waiting issue; otherwise over the limit). Doing this avoids a second copy of the maths that could drift from the real one. Guard it with a test that the explainer's feasible set equals the matcher's candidate set in both directions on many seeded random cases. One catch when reviewing: diagnostic code like this often evaluates branches the real matcher short-circuits (e.g. the second leg of a relay when the first already failed). Those extra calls can throw on missing lookup data where the matcher would not, so callers should catch the error for each request.