The pins catch what the agent's tests missed
builds on: Refactors that quietly change behavior, What makes a test able to fail
The agent's rewrite (below) returns `[]` for any falsy input, then sorts a set comprehension of the cleaned tags. Running old and new code:
| input | old | new | test |
|---|---|---|---|
| `"a,b"` | `[a,b]` | `[a,b]` | agent's: green |
| `"b,A,a"` | `[b,a]` | `[a,b]` | pin: **RED** |
| `None` | AttributeError | `[]` | pin: **RED** |
Ask the agent to restore first-seen order and remove the `None` guard. Change the behaviour later, on purpose.
// Python
def parse_tags(raw):
if not raw: return []
return sorted({t.strip().lower()
for t in raw.split(",") if t.strip()})