---
name: unit-reuse-first-grep-match-is-the-echoed-fallback
description: In a ci.yml changes-job log, the FIRST UNIT_REUSE grep hit is the workflow echoing its fallback branch, not a verdict; take the LAST match.
metadata:
  type: feedback
---
doyle 2026-09-24, IR-147 acceptance: `grep UNIT_REUSE` on a `changes` log always returns first a line
`echo 'UNIT_REUSE run-unit=true reason=helper-failed'` (with ANSI color codes). GitHub echoes the
step's script inside its command group, including the `if ! python3 ...; then echo ...` fallback,
whether or not that branch ran. The real verdict line (e.g. `UNIT_REUSE run-unit=false
reason=exact-pr-proof ...`) comes after it.

**Why:** the first match reads as a helper failure plus run-unit=true on EVERY run, a confident false
positive ahead of the real line. Same class as reading a script's own text as its output.

**How to apply:** take the LAST `UNIT_REUSE` match, or anchor the grep on the timestamp followed by
`UNIT_REUSE` without `echo`. The same applies to any marker the workflow script itself contains
(`CLASSIFY` too, if a step ever echoes it). Also from the same acceptance: a pre-registered outcome
that would read the same whether or not the change shipped (unit skipped, also produced by IR-144
reuse) is not evidence. Pick a DISCRIMINATOR (the reuse verdict, the lint contrast). Kin:
[[discriminator-question]], [[a-previous-run-completing-is-not-a-box-free-signal]].
