Repository navigation
fix(eval): référentiel remis à jour, et npm test aussi strict que la CI #89
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: audit-selftest | |
| # Continuous deterministic audit: grades the analyzer against the labeled | |
| # fixtures and proves the CI gate passes a clean page and fails a defective one. | |
| # This is the deterministic half of /audit running on every push. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: audit-selftest-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| selftest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: "20" | |
| - name: Analyzer eval (correctness + drift) | |
| run: node tools/audit/eval.mjs --strict | |
| - name: Gate passes a clean fixture | |
| run: node tools/audit/gate.mjs tests/eval/fixtures/clean-pass.html --min-score 90 | |
| - name: Gate fails a defective fixture (below score threshold) | |
| run: | | |
| if node tools/audit/gate.mjs tests/eval/fixtures/contrast-fail-grey.html --min-score 90; then | |
| echo "::error::gate should have failed the low-scoring defective fixture" | |
| exit 1 | |
| fi | |
| echo "gate correctly failed the defective fixture on the score threshold" | |
| - name: Gate blocks a critical defect (robots) | |
| run: | | |
| if node tools/audit/gate.mjs --report tests/eval/fixtures/critical-report.json; then | |
| echo "::error::gate should have failed on a critical check FAIL" | |
| exit 1 | |
| fi | |
| echo "gate correctly blocked the critical defect" | |
| - name: Gate JSON report round-trips | |
| run: | | |
| node tools/audit/analyze.mjs tests/eval/fixtures/clean-pass.html --out /tmp/sa.json | |
| node tools/audit/gate.mjs --report /tmp/sa.json --min-score 90 |