Repository navigation
refactor(ci): align Justfile check with CI workflow gate catalog - #196
Conversation
`just check` is documented as "Everything CI gates on, minus the builds", but the gate catalog was restated independently with divergent contents: * Justfile `check` ran tools/factory_contract.py and tools/validate.py; * .github/workflows/validate.yml ran those two plus pytest; * the prepare job of .github/workflows/rebuild-rpms.yml ran tools/check_workflow_quoting.py, tools/runtime_contract.py --check, and unittest. tools/check_workflow_quoting.py and tools/runtime_contract.py were absent from the documented local gate, leading to local vs CI discrepancies. Justfile: `check` now runs all five gates (factory-check, validate, workflow-quoting, runtime-contract, test), and each gate gets its own named recipe. tests/test_gate_catalog.py: structural consistency test that derives gates from validate.yml and rebuild-rpms.yml (prepare validation step) and asserts bidirectional agreement with reachable commands from `just check`. Avoids false positives on pipeline steps (rebuild_matrix.py, source_pipeline.py) and enforces that runtime_contract.py retains --check mode. docs/architecture.md, AGENTS.md, README.md, docs/contributing.md: update documentation to reflect all five gates run by `just check`. Assisted-by: Gemini 3.8 Flash via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
castrojo
left a comment
There was a problem hiding this comment.
Reviewed: Aligns just check with the complete CI gate catalog and introduces tests/test_gate_catalog.py to enforce alignment bidirectionally. Clean trial merge and passes all local validation gates. Awaiting second independent review to satisfy merge policy.
|
The red preflight/prepare/rebuild checks on this PR are not failures from the change. Every non-green check run on the current head has the conclusion "cancelled": the build workflow cancels sibling PR runs when a newer one starts, and this morning's batch of pushes cancelled these mid-run. Since #191 merged, pull requests only run "Validate factory configuration" (which is green here), and factory builds happen on the scheduled main run instead. Pushing any new commit, a rebase onto main being the natural one, will replace the cancelled runs with the current, smaller check set. |
There was a problem hiding this comment.
intent-alignment
- The body says "Closes #126" but implements only Part A. Part B —
check_workflow_quoting.pyhaving no pull-request-wide trigger, the shell-safety gap that motivated the issue — is explicitly deferred ("requires workflow file edits reserved for human maintainers"). Merging as written auto-closes #126 with its security-relevant half unfixed and untracked. Suggest rewording to "Part of #126" (or filing a follow-up for Part B before merge).
Verified at head 82b893a: tests/test_gate_catalog.py passes (4 tests, 10 subtests); its gate recogniser correctly extracts all five gates from validate.yml and the Validate factory policy and tests step of rebuild-rpms.yml:131-136, and correctly skips the pip install steps and parameterised pipeline tools. Justfile:7 reaches all five via named recipes; docs updated consistently across AGENTS.md, README.md, docs/architecture.md, docs/contributing.md.
No findings from: correctness, security, style, docs-currency.
— hive: agent=reviewer backend=copilot model=claude-fable-5
Danathar
left a comment
There was a problem hiding this comment.
Reviewed at 82b893a (clean merge with main). Justfile's check recipe now runs all five gates CI enforces (factory-check, validate, workflow-quoting, runtime-contract, test), and tests/test_gate_catalog.py asserts that bidirectionally against validate.yml and rebuild-rpms.yml so the two can't drift again. Ran tests/test_gate_catalog.py locally: 4 passed. hivecommons-hive flagged that the PR body said 'Closes #126' while only doing part of it; the current body already reads 'Part of #126 ... this PR does not auto-close the issue' and explains Part B is deliberately deferred, so that's resolved. No open correctness/security findings. Same cancelled-not-failed CI caveat as the other two PRs in this batch: rebuild-rpms.yml no longer runs on PRs since #191.
…ide trigger (#282) Part B of #126. The factory gate catalog is now owned by the Justfile (Part A, #196), but two gates -- tools/check_workflow_quoting.py and tools/runtime_contract.py --check -- still ran only inside rebuild-rpms.yml's prepare job, which is filtered by paths: and skips 8 of the repository's 10 workflows. A pull request that only touched one of those 8 workflows ran the shell-quoting linter zero times. validate.yml has no paths: filter, so it already runs on every pull request. Add workflow-quoting and runtime-contract as jobs there, alongside the existing factory-contract and validate jobs. Nothing existing is removed or changed; this is additive coverage only. Both commands already pass on main, and tests/test_gate_catalog.py accepts the change as-is since both gates are already in the recognised gate set from rebuild-rpms.yml. Also updates docs/architecture.md's gate table to list validate.yml as an enforcement point for both gates. Not addressed here: the prepare job's own paths: filter is left as is, since rebuild-rpms.yml still needs to gate builds on config/ and packages/ changes specifically; only its blind spot for the other 8 workflows is closed here. Hive-Run: #126 Hive-Plan: Part B -- validate.yml PR-wide trigger for orphaned gates Hive-Spec: architecture-finding#126-part-b Signed-off-by: buggtb <tom@spicule.co.uk>
Summary
Part of #126 (Part A only — see note below; this PR does not auto-close the issue). Rebased follow-up to #163 now that #178 full-factory baseline has merged.
The factory gate catalog was restated independently across
Justfile,.github/workflows/validate.yml, and thepreparejob of.github/workflows/rebuild-rpms.yml, leading to drift wheretools/check_workflow_quoting.pyandtools/runtime_contract.py ... --checkwere omitted fromjust check.Changes
Justfile:checknow runs all five gates:factory-check:python3 tools/factory_contract.pyvalidate:python3 tools/validate.pyworkflow-quoting:python3 tools/check_workflow_quoting.pyruntime-contract:python3 tools/runtime_contract.py config/bluefin-packages.toml config/runtime-contract.toml --checktest:python3 -m pytest tests -qEach gate is also runnable individually via its own named recipe.
tests/test_gate_catalog.py: New structural consistency test:validate.ymland theValidate factory policy and testsstep ofrebuild-rpms.yml(plus any step in other workflows explicitly marked with# gate). This prevents false positives on pipeline steps such astools/rebuild_matrix.pyandtools/source_pipeline.py.pytestandunittest discoveras equivalent test suite runs).just checkruns every gate CI enforces and runs no gate that CI does not enforce.runtime_contract.pyis invoked with--check.Documentation:
docs/architecture.mdto detail all five gates and reflect thatjust checkruns the entire catalog locally.AGENTS.md,README.md, anddocs/contributing.mdcomments describingjust check.Note:
.pre-commit-config.yamlremains a separate hook configuration for pre-commit linting. Part B from #126 (adding the missing jobs tovalidate.yml, i.e. givingcheck_workflow_quoting.pya pull-request-wide trigger) is not addressed here: it requires workflow file edits reserved for human maintainers or agents withworkflowsscope. #126 must stay open to track that shell-safety work.— hive: backend=copilot model=gemini-3.8-flash
🐝 Hive Agent:
contributor| SHA:82b893a