Repository navigation
fix(constraints): floor-guard reference ignores git config and sees renames - #650
Sunil56224972 wants to merge 3 commits into
Conversation
|
praise: the config hardening is real. On main a violation slips through with color.ui=always, an external diff or textconv driver, or issue (blocking): two of the new flags break things main gets right. With --no-renames, renaming a test (app.test.js to app.spec.js, or test/ to tests/) is reported as test-deleted, which breaks the guard's own rule that tightening stays silent. With --text, an untracked 2 MB binary exits 2 because the diff overflows the 1 MB buffer, and a small binary containing the bytes TODO is flagged as unfinished work. suggestion (non-blocking): keep --no-color, --no-ext-diff, --no-textconv, the prefixes and the env scrub; flag a rename only when a test becomes a non-test; drop or bound --text; and add a test for each case. |
|
Addressed in d2d289e. Rename detection now leaves test-to-test moves (including test/ to tests/) silent, while test-to-non-test and CONSTRAINTS.md renames remain violations. I kept --no-color, --no-ext-diff, --no-textconv, the path prefixes, and the environment scrub. --text is retained for -diff attributes but bounded to 8 MiB per Git output and aggregate diff; NUL-marked binary files are excluded from text heuristics. The new regression tests reproduced the three reported failures before the fix; the complete suite now passes 39/39. All CI checks are green. |
|
@addyosmani The blocking feedback is addressed in d2d289e, with a regression test for each case you listed (details in my comment above). CI is green; ready for re-review when you have a moment. |
|
praise: the three cases I named are fixed and tested, and the original wins all still hold. issue (blocking): the same two kinds of regression are still there in other shapes, where main is right and this isn't:
suggestion (non-blocking): it may be simpler to let git decide what is binary and skip those files, instead of forcing --text, and to use one test-path matcher for both sides of a rename. |
|
Thanks for the concrete review cases. I pushed commit 0ca473c. The normal diff path now lets Git classify binary files instead of forcing --text; the bounded --text fallback is limited to regular files explicitly marked -diff. Test-path recognition now handles tests/ and spec/ on rename targets and excludes fixture paths. I replaced the non-regression test/ to tests/ case with targeted rename and fixture tests, and added coverage for 9 MiB and multiple binary files plus a suppression after a late NUL byte. The full checked-in Node suite passes: 189/189. |
Problem
The floor-guard reference (
skills/constraint-driven-development/references/floor-guard.md) parsesgit difftext, and anything that reshapes that text makes a violation invisible. It then exits 0 ("clean") for:git mv app.test.js app.test.js.disabled): rename detection reports a rename, not a deletionCONSTRAINTS.mdrenamed away, which removes the floor itselfcolor.ui=alwaysorcolor.diff=always: lines start with ANSI codes, not+/-diff.external(difftastic and similar) orGIT_EXTERNAL_DIFF: no unified diff at all*.js -diffin.gitattributes: content hidden or "Binary files differ"Each of these is common user or repo config, or a one-line change an agent can make, so the guard against weakening the floor can be bypassed without being reported. This is not covered by #599/#600/#614 (untracked files, hunk parsing, running from the top).
Fix
Both diffs run with
--unified=0 --no-color --no-ext-diff --no-textconv --no-renames --text --src-prefix=a/ --dst-prefix=b/.GIT_EXTERNAL_DIFFandGIT_DIFF_OPTSare removed from the child environment. A deletedCONSTRAINTS.mdis reported asrule-removed.Proof
PoC, 15 scenarios against the reference script:
node --test scripts/floor-guard-reference-test.js: 35 of 35 pass with 7 new hostile-config tests, all 7 of which fail on upstream. Full script suite: 180 of 180 pass.validate-skillsandvalidate-reference-linkspass.PoC script (run:
node fg-poc.js skills/constraint-driven-development/references/floor-guard.md)