Skip to main content

extract_error_signatures

Function extract_error_signatures 

Source
pub fn extract_error_signatures(output: &str) -> Vec<String>
Expand description

Extract up to 5 distinctive diagnostic lines from a failed bash/tool output for use as a multi-signature “error anchor” (P0 #5). Selection rule: longest lines first. Rationale — status noise (Checking v0.1.0 (/path), Blocking waiting for file lock) is almost always shorter than real diagnostic content (error[E0425]: cannot find function \foo` in this scope`, full compiler traces). Sorting by length pushes ambient status to the back of the queue without hardcoding tool names.

Tech-neutral: no keyword matching on “error”/“failed”/“panic” etc. The caller uses majority-absent semantics (≥3 of 5 disappear on success → fire nudge) so lingering overlap on one or two status lines doesn’t suppress the detection.