Skip to content

refactor(ci): align Justfile check with CI workflow gate catalog - #196

Merged
castrojo merged 1 commit into
projectbluefin:mainfrom
mrbobbytables:refactor/gate-catalog-parity
Sep 23, 2026
Merged

castrojo merged 1 commit into
projectbluefin:mainfrom
mrbobbytables:refactor/gate-catalog-parity

Conversation

@mrbobbytables

@mrbobbytables mrbobbytables commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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 the prepare job of .github/workflows/rebuild-rpms.yml, leading to drift where tools/check_workflow_quoting.py and tools/runtime_contract.py ... --check were omitted from just check.

Changes

  1. Justfile: check now runs all five gates:

    • factory-check: python3 tools/factory_contract.py
    • validate: python3 tools/validate.py
    • workflow-quoting: python3 tools/check_workflow_quoting.py
    • runtime-contract: python3 tools/runtime_contract.py config/bluefin-packages.toml config/runtime-contract.toml --check
    • test: python3 -m pytest tests -q
      Each gate is also runnable individually via its own named recipe.
  2. tests/test_gate_catalog.py: New structural consistency test:

    • Scopes workflow gate detection to validate.yml and the Validate factory policy and tests step of rebuild-rpms.yml (plus any step in other workflows explicitly marked with # gate). This prevents false positives on pipeline steps such as tools/rebuild_matrix.py and tools/source_pipeline.py.
    • Normalises gate commands (collapsing verbosity and treating pytest and unittest discover as equivalent test suite runs).
    • Bidirectionally asserts that just check runs every gate CI enforces and runs no gate that CI does not enforce.
    • Enforces that runtime_contract.py is invoked with --check.
  3. Documentation:

    • Updated docs/architecture.md to detail all five gates and reflect that just check runs the entire catalog locally.
    • Updated AGENTS.md, README.md, and docs/contributing.md comments describing just check.

Note: .pre-commit-config.yaml remains a separate hook configuration for pre-commit linting. Part B from #126 (adding the missing jobs to validate.yml, i.e. giving check_workflow_quoting.py a pull-request-wide trigger) is not addressed here: it requires workflow file edits reserved for human maintainers or agents with workflows scope. #126 must stay open to track that shell-safety work.

— hive: backend=copilot model=gemini-3.8-flash

🐝 Hive Agent: contributor | SHA: 82b893a

`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 castrojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Danathar

Copy link
Copy Markdown
Contributor

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.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intent-alignment

  • The body says "Closes #126" but implements only Part A. Part B — check_workflow_quoting.py having 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

@castrojo
castrojo requested a review from hanthor September 21, 2026 03:24

@Danathar Danathar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@castrojo
castrojo merged commit ed53459 into projectbluefin:main Sep 23, 2026
39 of 291 checks passed
castrojo pushed a commit that referenced this pull request Sep 27, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/architect Filed or owned by the architect agent.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants