Skip to content

ci(gate): required status checks gate the merge and the pre-push hook runs the fast static checks - #2118

Merged
dan-petty merged 1 commit into
mainfrom
ci/2110-pre-push-runs-fast-static-checks
Oct 24, 2026
Merged

dan-petty merged 1 commit into
mainfrom
ci/2110-pre-push-runs-fast-static-checks

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

The pre-push hook runs only the fast static checks. The required checks of CI gate the merge, and the full uv run devops ci is a manual run. This carries out the owner's decision of 2026-10-22 in #1752, which ADR 0014 records.

  • The hook. devops-ci-pre-push in .pre-commit-config.yaml runs uv run devops ci --check --only lint,format,actionlint,zizmor. --only takes a comma-separated list of check names, so one hook runs the four checks. --check makes the hook examine the pushed tree and change no file, as the Static Analysis job does. One devops ci --only hook runs the same commands as Static Analysis, so the hook and CI cannot disagree. Four separate pre-commit hooks were rejected for this reason (design.md).
  • The test. test_the_pre_push_hook_runs_only_the_fast_static_checks in tests/test_workflow_contracts.py resolves each pre-push hook against the devops ci check table. It holds the hooks to exactly lint, format, actionlint and zizmor, in check-only mode. It fails on the base: the old hook resolves to all 17 rows. test_every_devops_command_the_workflows_actions_and_hooks_run_resolves still finds and resolves the hook's devops command.
  • The documents. AGENTS.md rule 5 says what runs where: the fast static checks before a push (never --no-verify), the required checks of CI before a merge, and the full uv run devops ci by hand. The rule does not name the three checks, because with the names AGENTS.md has 6,505 characters, and the cap is 6,500. docs/SDLC.md Phase 6 names them, and the router sends the move from draft to merge there. CONTRIBUTING.md, docs/SDLC.md (the lifecycle diagram, Phase 4 and Phase 6), docs/TESTING.md, docs/ROUTINE_TASKS.md, docs/SELF_IMPROVEMENT.md, the apply guidance of openspec/config.yaml and three knowledge base documents say the same. Where a document says what gates a merge, it says: the three required checks pass on the pull request, and the release pull request runs the same checks on each new main. No document says that a branch must hold the current main.
  • The guard. The deleted-process check in tests/test_agents_md_claims.py also finds five phrases that say the pre-push hook runs the full gate. It failed on the base for AGENTS.md, CONTRIBUTING.md, docs/SDLC.md, docs/TESTING.md and two knowledge base documents.
  • Other text. The chat invariant of devops ai chat (DEFAULT_CHAT_INVARIANTS) said "Never push before uv run devops ci passes locally". It now says "Never push with --no-verify or before the pre-push hook passes". Comments in constants.py, ci.yml and the openspec-gate hook, the docstring of compute_workspace_fingerprint and five test docstrings no longer say that the hook runs the full gate.

No devops command, option, help text or output changes, so the change sets skip_specs: true. devops docs generate --sync-readme changes no file.

Timing of uv run pre-commit run --hook-stage pre-push --all-files

Host: 16 CPUs. The environment was synced before each run.

Tree Hook Time Load (1 min)
base, 02fee43 uv run devops ci 285.3 s 22, with one other full gate on the host
this change uv run devops ci --check --only lint,format,actionlint,zizmor 9.0 s, 9.1 s, 8.7 s 4 to 5 (quiet)
this change, rebased on 35b5632 same 22.8 s 45

On the base, the slowest rows were test (4 min 17 s), typecheck (3 min 49 s) and security (3 min 39 s). With the change, the rows took: lint 1.0 s, format 1.9 s, actionlint 3.1 s and zizmor 5.7 s, in parallel. The hook changed no file. The acceptance criterion is less than 1 minute on a quiet host: the result is 9 s.

Evidence

  • uv run devops gh api repos/dan-petty/devops-cli/rulesets/21466414 (2026-10-24): the main ruleset requires Static Analysis, Tests & Coverage and Semantic PR title, so the condition of docs(adr): decide required checks, a merge queue and what the local gate runs before a push #1752 holds.
  • .github/workflows/ci.yml: Static Analysis runs devops ci --check --no-cache --skip test,outdated, and Tests & Coverage runs devops ci --check --no-cache --only test. Each check that the hook drops, except the advisory outdated report of the scheduled Dependency Freshness job, runs in a required check.

Checks run

  • uv run devops ci test over tests/test_workflow_contracts.py, tests/test_agents_md_claims.py, tests/test_openspec_scaffold.py, tests/test_agent_invariants.py, tests/test_ai_cmd.py, tests/test_ci.py, tests/test_ci_cache.py, tests/test_ci_cache_fingerprint.py, tests/test_test_module_independence.py, tests/test_test_selection.py, tests/test_architectural_invariants.py, tests/test_ruff_complexity_cap.py, tests/test_instruction_generator.py, tests/test_kb.py, tests/test_kb_manuals_metadata.py, tests/test_docs_knowledge_base_argv.py and tests/test_docs.py: all pass.

  • uv run ruff check, uv run ruff format --check and uv run mypy on the changed files, uv run devops docs check and uv run devops openspec check: all pass.

  • docs/adr/0004-ci-is-the-authoritative-gate.md: the amendment line that docs(adr): decide required checks, a merge queue and what the local gate runs before a push #2115 added said "with the strict policy". It now says that the strict policy is off and that the release pull request shows a defect on main, as ADR 0014 records.

Item

Closes #2110

Change: openspec/changes/archive/2026-10-24-2110-pre-push-fast-static-checks/

… runs the fast static checks

The pre-push hook devops-ci-pre-push runs only the fast static checks, uv run devops ci --check --only lint,format,actionlint,zizmor, in check-only mode (#1752). The required checks of CI gate the merge, and the full uv run devops ci is a manual run. AGENTS.md rule 5 and the documents say what runs where, and a test holds the hook to the four checks.

Closes #2110
@dan-petty
dan-petty marked this pull request as ready for review October 24, 2026 15:26
@dan-petty
dan-petty merged commit 9b53ea2 into main Oct 24, 2026
17 checks passed
@dan-petty
dan-petty deleted the ci/2110-pre-push-runs-fast-static-checks branch October 24, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(gate): required status checks gate the merge and the pre-push hook runs the fast static checks

1 participant