fix: make verify:data pass on Windows checkouts (#540)

* fix: pin relevance-fingerprinted files to LF

evaluate-relevance.py hashes the raw bytes of core.py, design_system.py, reasoning_contract.py, relevance_metrics.py, itself, relevance-cases.json and every CSV under src/ui-ux-pro-max/data, including data/stacks. On a Windows checkout with core.autocrlf=true these become CRLF (data/stacks/*.csv is not matched by the existing data/*.csv pin) and the gate fails with 'runtimeFingerprint does not match' on a clean tree. Pin the missing files to LF, as is already done for the catalog data (#462/#478).

* fix(cli): quote the test:python pattern so it runs on Windows

The single-quoted -p 'test_*.py' is passed literally by cmd.exe, so unittest discovers nothing and exits with 'NO TESTS RAN', which stops verify:data on Windows. Double quotes work in both cmd.exe and POSIX shells.
This commit is contained in:
Elvin Novruzov 2026-10-23 02:08:59 +04:00 committed by GitHub
parent 076a2b3a31
commit 04cfb449bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

12
.gitattributes vendored
View File

@ -4,3 +4,15 @@
# Pin these files to LF so the snapshot is reproducible everywhere.
src/ui-ux-pro-max/data/*.csv text eol=lf
src/ui-ux-pro-max/data/*.json text eol=lf
src/ui-ux-pro-max/data/stacks/*.csv text eol=lf
# scripts/evaluate-relevance.py fingerprints the raw bytes of these files, and
# the committed thresholds manifest records that hash. A CRLF checkout (for
# example core.autocrlf=true on Windows) changes the bytes, so the relevance
# gate fails with "runtimeFingerprint does not match" on a clean tree.
src/ui-ux-pro-max/scripts/core.py text eol=lf
src/ui-ux-pro-max/scripts/design_system.py text eol=lf
src/ui-ux-pro-max/scripts/reasoning_contract.py text eol=lf
src/ui-ux-pro-max/scripts/tests/fixtures/relevance-cases.json text eol=lf
scripts/evaluate-relevance.py text eol=lf
scripts/relevance_metrics.py text eol=lf

View File

@ -19,7 +19,7 @@
"validate:semantic": "cd .. && node cli/scripts/run-python.mjs src/ui-ux-pro-max/scripts/validate_data.py",
"validate:agent-guide": "cd .. && node cli/scripts/run-python.mjs scripts/validate-agent-guide.py",
"validate:catalog-summary": "cd .. && node cli/scripts/run-python.mjs scripts/generate-catalog-summary.py --check",
"test:python": "cd .. && node cli/scripts/run-python.mjs -m unittest discover -s src/ui-ux-pro-max/scripts/tests -p 'test_*.py'",
"test:python": "cd .. && node cli/scripts/run-python.mjs -m unittest discover -s src/ui-ux-pro-max/scripts/tests -p \"test_*.py\"",
"evaluate:relevance": "cd .. && node cli/scripts/run-python.mjs scripts/evaluate-relevance.py",
"evaluate:relevance:calibration": "cd .. && node cli/scripts/run-python.mjs scripts/evaluate-relevance.py --split calibration",
"evaluate:relevance:held-out": "cd .. && node cli/scripts/run-python.mjs scripts/evaluate-relevance.py --split held_out",