Repository navigation
Description
Problem
Three places define the checks of this repository in different ways: the commit hooks, the devops ci rows of the push hooks, and the jobs of ci.yml. A local result and a CI result can differ. Many rows run custom Python from tests/gate/ that is brittle and works only here.
Owner decisions (2026-12-01)
- pre-commit holds each static check. Make targets run the tests and the builds. GitHub CI runs the same hooks and targets.
- A custom check of
tests/gate/stays only when a standard tool (ruff, ast-grep, kube-linter, kubeconform or a similar tool) expresses it. The pull request lists each rule that it drops.
Acceptance criteria
.pre-commit-config.yamlis the one definition of each static check. CI runspre-commit run --all-filesfor the stages that hold them.- The Makefile has targets for install, lint, test and build, and CI calls them.
- No hook and no workflow calls
devops ci. tests/gate/is deleted. The pull request lists each dropped rule.- Each check stays inside the 5 minute limit of AGENTS.md rule 5.
- No threshold is lower than before.
Order
Independent of #8039 and #8040.
Alternatives check of 2026-12-01: not-applicable.
Class: ci, no model call.
Tool: none found.
Proposed design
Problem statement
Three places define the checks of this repository: the pre-commit hooks, the devops ci rows of the push hooks, and the jobs of .github/workflows/ci.yml. A local result can differ from a CI result. Many rows run custom Python from tests/gate/, which is brittle and works only in this repository. The change makes .pre-commit-config.yaml the one definition of each static check. It adds Makefile targets for install, lint, test and build, and CI calls the same hooks and targets. The change deletes tests/gate/ and lists each dropped rule.
Acceptance criteria
Requirement: pre-commit holds each static check
Each static check of the repository SHALL run as a hook of .pre-commit-config.yaml.
Scenario: Each static stage passes
- WHEN A person runs
pre-commit run --all-files --hook-stage pre-commit, thenpre-commit run --all-files --hook-stage pre-push, thenpre-commit run --all-files --hook-stage manual. - THEN Each command exits 0 and its log names the hook of each static check.
Requirement: No hook calls devops ci
No hook of .pre-commit-config.yaml SHALL call devops ci.
Scenario: The push hooks name their tools
- WHEN A person runs
pre-commit run --all-files --hook-stage pre-push. - THEN The log names the tool of each hook and holds no
devops cicommand.
Requirement: The OpenSpec hook runs the gate directly
The openspec-gate hook SHALL call the openspec tool directly and SHALL set no time limit shorter than the 5 minute limit of AGENTS.md rule 5.
Scenario: The OpenSpec hook passes on a loaded host
- WHEN A person runs
pre-commit run openspec-gate --all-files --hook-stage pre-commit. - THEN The command exits 0 and its log holds no
devops cicommand and no exit 124.
Requirement: The Makefile holds the four targets
The Makefile SHALL hold an install, a lint, a test and a build target.
Scenario: Each target runs on the tree
- WHEN A person runs
make install, thenmake lint, thenmake test, thenmake build. - THEN Each command exits 0 and its log names the tool that it runs.
Requirement: The check jobs of CI run the hooks and the targets
Each check job of .github/workflows/ci.yml SHALL run pre-commit run --all-files or a Makefile target, and SHALL run no devops ci row.
Scenario: The check jobs of the pull request show the hooks and the targets
- WHEN A person opens the run of
.github/workflows/ci.ymlon the pull request of the change. - THEN The
Static Analysisjob log showspre-commit run --all-files, the test and build jobs showmake testandmake build, and no log shows adevops cirow.
Requirement: tests/gate/ is deleted
The change SHALL delete each file of tests/gate/.
Scenario: The directory holds no tracked file
- WHEN A person runs
git ls-files tests/gate. - THEN The command prints no path.
Requirement: The change lists each dropped rule
The change SHALL list each rule of tests/gate/ that it drops, with the reason that no standard tool expresses the rule.
Scenario: The list names each dropped rule
- WHEN A person reads the
Dropped rulessection of the pull request body of the change. - THEN The section names each rule that the change drops and gives the reason for each rule.
Requirement: Each check stays inside the 5 minute limit
Each check that the change runs SHALL end within 5 minutes, as AGENTS.md rule 5 requires.
Scenario: The jobs of the pull request end in time
- WHEN A person opens the run of
.github/workflows/ci.ymlon the pull request of the change. - THEN GitHub shows each job with a duration under 5 minutes and a passing conclusion.
Requirement: No threshold is lower than before
The change SHALL keep each threshold at or above its value before the change.
Scenario: The Ruff caps stay
- WHEN A person runs
uv run pytest tests/commands/test_ruff_complexity_cap.py. - THEN The command exits 0, and
pyproject.tomlholdsmax-complexity = 10andmax-nested-blocks = 4.
Existing Tool Considered
The alternatives check of 2026-12-01 in the issue body gives the verdict not-applicable for the class ci and names no tool. pre-commit covers the need of one definition of each static check: .pre-commit-config.yaml pins it at minimum version 4.4.0, it runs one hook per check in the stage that the manifest sets, and CI runs the same hooks with --all-files. GNU make covers the install, lint, test and build targets. pre-commit lacks a test runner, a build step and a shard matrix; the Makefile holds them, and make test takes SHARD=<n>/6. The change adds no new checker and no wrapper script.
Key questions
- Which hooks of
.pre-commit-config.yamlcalldevops citoday?: Three hooks calluv run devops ci:openspec-gatein thepre-commitstage, anddevops-ci-pre-pushanddevops-ci-workflows-pre-pushin thepre-pushstage. Each hook setspass_filenames: false. [sources: .pre-commit-config.yaml] - What does the
openspecrow ofdevops cicheck?: The OpenSpec gate of ADR 0010 checks the change folders and the committed skills. It needs Node and the openspec thatnpm ci --ignore-scriptsinstalls frompackage-lock.json. When a committed skill differs from what the pinned openspec writes, its regeneration gets the skills of the release from github.com with Git. [sources: .pre-commit-config.yaml] - How does the
openspec-gatehook run the OpenSpec gate?: The hook runs the openspec tool directly, with nodevops cicall and no short time limit. The reply of 2026-12-01 gives the evidence:timeout 90 uv run devops ci --only openspecstopped 3 commits of refactor(ci): check commit and PR titles with commitizen #8045 with exit 124 after about 85 s under a load of 15 to 35. The entry keeps the two gates of the row, the plans and the committed skills, and sets no limit shorter than the 5 minute limit of AGENTS.md rule 5. (best practice) [sources: .pre-commit-config.yaml, AGENTS.md]- Chosen: The hook calls the openspec tool directly, with no short time limit. The reply of 2026-12-01 shows that
timeout 90stopped 3 commits of refactor(ci): check commit and PR titles with commitizen #8045 with exit 124 under load, and it asks for a direct call. - Rejected: Keep
timeout 90 uv run devops ci --only openspec. The short limit fails a commit under load, and the hook keeps adevops cicall that the owner decision excludes. - Rejected: Keep
devops ciin the hook and raise its limit. The hook still callsdevops ci, so the repository keeps two definitions of the same gate.
- Chosen: The hook calls the openspec tool directly, with no short time limit. The reply of 2026-12-01 shows that
- What does AGENTS.md rule 5 require of a check?: A check must average under 5 minutes plus 1 minute of tolerance. A check over that limit is a P0 bug. A threshold never goes lower unless the owner allows it. [sources: AGENTS.md]
- Where does each static check live?: In
.pre-commit-config.yaml, as one hook. CI runs the same hooks with--all-files. (best practice) [sources: .pre-commit-config.yaml, AGENTS.md]- Chosen: A hook of
.pre-commit-config.yaml. The owner decision of 2026-12-01 makes pre-commit the one definition, and CI then runs the same hooks. - Rejected: A row of
devops cicalled from a hook. It keeps a second definition and the custom Python oftests/gate/. - Rejected: A shell script per check. It builds code that pre-commit already provides.
- Chosen: A hook of
- Which stage holds a check?: A check runs in the stage that fits its cost:
pre-commitfor a fast per-file check,pre-pushfor a fast check of the whole tree, andmanualfor a slow check that only CI runs. (best practice) [sources: .pre-commit-config.yaml, AGENTS.md]- Chosen: The stage that fits the cost of the check. A slow check never makes a commit or a push wait.
- Rejected: Every check in the
pre-commitstage. A slow check at commit makes a commit wait over the limit of rule 5. - Rejected: Every check in the
manualstage. A defect reaches the push and CI before a hook finds it.
- How does a check that reads the whole tree run as a hook?: The hook sets
pass_filenames: falseandalways_run: true, and itsentrywraps the tool in coreutilstimeout. Thebranch-currenthook shows the form. (best practice) [sources: .pre-commit-config.yaml]- Chosen:
pass_filenames: falsewithalways_run: true. pre-commit then gives the hook no file list and runs it on each push. - Rejected: A wrapper script under
tests/. It builds code that the hook entry already expresses. - Rejected: A Make target only. CI would then run a different command from the hook.
- Chosen:
- What does each Makefile target run?:
installrunsuv syncandnpm ci --ignore-scripts.lintrunspre-commit run --all-filesfor each stage.testruns the pytest suite, andSHARD=<n>/6selects one shard.buildrunsuv build. (best practice) [sources: .pre-commit-config.yaml, openspec/specs/ci-test-shards/spec.md]- Chosen: Make targets that call the tools directly. CI and a person run the same command, and the workflow keeps its shard matrix.
- Rejected: A single
make checktarget. CI cannot then run the test and the build as separate jobs. - Rejected: No Makefile, and the commands live in the workflow. A person then repeats the workflow commands by hand.
- What happens to
devops ciand the custom rows oftests/gate/?: Each static row moves to a hook or to a Make target. A custom row that no standard tool expresses is dropped, and the pull request lists it. Thedevops cicommand stays for the rows that read GitHub state, and no hook and no check job ofci.ymlcalls it. (best practice) [sources: AGENTS.md, .pre-commit-config.yaml, openspec/specs/ci-job-time/spec.md]- Chosen: Move each static row to a hook, drop the rest, and list each drop. The owner decision of 2026-12-01 allows the drop and asks for the list.
- Rejected: Keep every custom row as a hook. It keeps the brittle Python that the issue removes.
- Rejected: Delete
devops ciwithtests/gate/. The rows that read GitHub state stay and have no hook form.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Dec 1, 2026
Both make pre-commit the runner of static checks in CI, but the candidate also adds Makefile targets, deletes tests/gate/, and removes all devops ci calls.devops-cli-service commentedon Dec 1, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
dan-petty commentedon Dec 1, 2026
Evidence for the move of the OpenSpec check: the hook
openspec-gaterunstimeout 90 uv run devops ci --only openspec. On 2026-12-01, in a 16-core devcontainer with a load of 15 to 35 from other test runs, 3 commits of #8045 failed in this hook with exit 124 (stopped after about 85 s), and the other hooks did not report a failure. Runopenspec validatedirectly from the hook, with no short time limit.devops-cli-service commentedon Dec 1, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.