mirror of
https://github.com/addyosmani/agent-skills.git
synced 2026-10-26 15:05:04 +00:00
The reference guard in constraint-driven-development promised to include untracked files, catch deleted test files and weakened thresholds, and stay silent when constraints tighten. Run unchanged, it did none of those for ordinary local git changes: - `git diff --no-index /dev/null <file>` exits 1 whenever the sides differ, and the shared git() wrapper turned every nonzero exit into null, so every untracked file diffed as empty and no added-line rule could see it. - The filename came from the `+++` header only, so a deletion (`+++ /dev/null`) sliced to `ev/null` and matched nothing; there was no deletion rule, and staging did not help. - A number going down was treated as weaker, which is right for a minimum (coverage) and inverted for a maximum (size, latency, error budget). - A removed floor bullet was never reported, although the comment said it was. The wrapper now keeps stdout on the expected exit 1 and every other failure exits 2 rather than reading as clean; both diff headers name the file and a deleted test file is its own finding; each threshold carries a direction read from the words around it (>=, at least, must not fall; <=, at most, under, must not grow), a number with no readable direction is reported when it changes; a removed floor bullet or table row is reported, except an Exceptions row, whose removal tightens. The three language patterns are unchanged. scripts/floor-guard-reference-test.js extracts the fenced block and runs it with real git against fourteen fixtures plus three edge cases; eight of them fail on the previous reference and all pass now. The workflow runs it beside the other script tests.