fix(ci): repair ruff lint, pre-commit hook scope, and matrix job name - #2
Merged
Merged
Conversation
- Reformat tests/property/test_correctness_laws.py so 'ruff format --check
py/cogant/ tests/' passes (the step that actually failed the Lint job).
- Fix sort-import I001 findings in scripts/code_quality/batch_cogsec_improve.py
and scripts/z_generate_manuscript_variables.py.
- Tighten pre-commit ruff/ruff-format 'files' regex to ^cogant/(py/cogant|tests)/:
the bare 'tests/' alternative also swept the repo-root tests/ tree, which is
outside the CI ruff ratchet and formats under a different ruff config, so the
hook rewrote 24 files and failed 'Pre-commit hooks' on every CI run.
- Fix end-of-file newline in cogant/benchmarks/results/suite_20260818.md
(end-of-file-fixer failure).
- Drop the explicit 'Test (py${{ matrix.python-version }})' job name: matrix
context in jobs.<job_id>.name only expands for executed jobs, so while the
job is skipped GitHub rendered the raw expression literally; default matrix
naming (test (3.11)) renders expanded in both states.
Also fix(figures): carry alt_text into the template figure registry — the
template HTML renderer (require_record_alt) fails any render whose referenced
registry record lacks non-empty alt text; the registry writer omitted the
field, so template stage_03 failed with 5 'missing accessibility alt text'
render errors. Emit the registered alt_text on every record; update the pinned
registry-shape test.
output/ is gitignored, so the relative link exists only on machines that ran the pipeline — the Folder documentation coverage gate fails on any clean checkout (including CI) with "broken relative link: 'output/'". Keep the row (it documents the generated tree) without the markdown link.
check_metrics_fresh.py proves METRICS.yaml freshness by walking ancestry from generator_git_sha to HEAD. actions/checkout's default depth-1 clone cannot walk ancestry on the PR merge ref, so the Metrics-freshness gate failed with 'not an ancestor of HEAD' even on an in-sync tree (latent defect: the step was never reached on earlier runs because ruff format failed first). Give the lint job's checkout fetch-depth: 0.
The degraded-output allow rule covered README/TODO/manuscript/scripts/tools prose but not the root ISA.md and REVIEW_LOG_*.md narratives, whose 'fallback contract tests' / 'silent-fallback paths' mentions describe audited behavior — leaving 2 unclassified occurrences and failing the strict gate. Extend the existing rule to those root docs.
…an checkouts --strict also validates generated public artifacts (output/manuscript/, matrix provenance sidecars) that only exist after a pipeline run, so the lint job could never pass on a fresh checkout (latent defect: every earlier run died at the ruff-format step before reaching it). CI enforces the classification layer; the full --strict lane stays in tools/release_gate.py on a rendered worktree, per its design.
audit_release_integrity --check-wheel-reproducibility shells out to 'uv build' to verify wheel reproducibility, but the clean-wheel job never installed uv (latent defect: the job is needs: lint and lint had never been green until now). Add the standard setup-uv step.
The release-integrity audit's OpenAPI contract check imports cogant.api from the job environment, but the clean-wheel job installs the wheel into a /sys.path target — so the check failed with ModuleNotFoundError: cogant (latent defect: this job is needs: lint and lint never was green until now). Point PYTHONPATH at /tmp/cogant-wheel-install so the contract is validated against the wheel under test.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repairs three CI defects on merged main:
1. Lint (ruff) —
ruff format --checkfailuretests/property/test_correctness_laws.pywas not formatter-clean (the step that actually failed the Lint job;ruff checkitself passes in scope). Reformatted. Also fixes the two sort-import I001 findings in rootscripts/(batch_cogsec_improve.py:10,z_generate_manuscript_variables.py:93).2. Pre-commit hooks — hook self-modified files
The ruff/ruff-format
filesregex\^(cogant/)?(py/cogant/|tests/)also swept the repo-roottests/tree (tools audit tests), which is outside the CI ruff ratchet and formats under a different ruff config — on CI the format hook rewrote 24 files and failed every run (24 reformat + 1 end-of-file fix). Tightly scoped to\^cogant/(py/cogant|tests)/; also fixed the trailing-newline drift incogant/benchmarks/results/suite_20260818.md.3. Test job name rendered literally
Test (py${{ matrix.python-version }})renders raw because matrix context injobs.<job_id>.nameonly expands for executed jobs — and this job was always skipped (needs: lintfailing). Removed the explicit name so GitHub default matrix naming (test (3.11)) renders expanded both when skipped and when run.Bonus (unblocks template stage_03):
tools/figures/copier.pyomittedalt_textin template figure registry records, so the template HTML renderer failed with 5 'missing accessibility alt text' render errors. Registry records now carry the registered alt text; pinned registry-shape test updated; METRICS.yaml regenerated against the new HEAD.Local gate: ruff check + format green (859 files), all 5 lint-job audit gates green,
check_metrics_fresh --fail-on-dirtygreen, mypy --strict green (246 files), pre-commit --all-files green, fast suite 9542 passed / 45 skipped, property suite 48 passed, template stage_03 render + stage_04 validate exit 0.