Repository navigation
Description
Problem or Motivation
The owner rule of 2026-11-11 says that each inner time limit ends before the limit around it, so that the inner limit exits with a diagnostic (row < step < job).
- The
Static Analysis Quality Gatestep has a limit of 3 minutes in a job of 6 minutes (.github/workflows/ci.yml:44and:82). Thedevops cirows of the step have a limit of 1,800 s (DEFAULT_SUBPROCESS_TIMEOUT_SECONDS,src/devops_cli/config/defaults.py). Thus the step limit ends a hung row, not an inner limit. - No test compares a row limit with the step limit.
test_every_job_has_a_limit_and_each_step_limit_is_under_it(tests/invariants/test_workflow_contracts.py) checks only that a step limit is less than its job limit. - The step took 76 s to 104 s in the last 8 successful runs on
main(2026-11-12). The median was about 97 s. - No measurement shows that the step limit of GitHub Actions stops the rows and prints the
(stopped after <time>)lines. - This is the
ci.ymlpart of feat(ci): devops ci ends each row at a time limit #4775. PR feat(ci): devops ci stops its rows when timeout ends it #5031 delivers the other parts of feat(ci): devops ci ends each row at a time limit #4775: with it,devops cistops each running row on SIGTERM, prints(stopped after <time>)for the row, and exits 130. - fix(ci): give the test row and the index build own timeouts #4683 gives a limit only to the test row of a
--shardrun. feat(ci): Static Analysis runs the commit hygiene hooks #4779 adds ahooksrow to this step and takes its limit from this item.
Proposed Solution & Architectural Design
- Run the gate step under coreutils
timeoutin its default mode, which sends the signal to the process group:timeout <N> uv run devops ci --check --no-cache --skip test,outdated,actionlint. N plus the stop time of the rows must be less than 180 s. The stop takes at most 9 s (three steps ofDEFAULT_SHELL_STOP_GRACE_SECONDS), so N = 160 fits. Choose N from the step times at the time of the change. - Add a structural test to
tests/invariants/test_workflow_contracts.py. It reads.github/workflows/ci.ymland finds the Static Analysis gate step. It fails when therunline has notimeout <N>prefix, or when N plus the stop time is not less than the step limit. - fix(ci): give the test row and the index build own timeouts #4683 owns the limit of the test step of a
--shardrun. - The CI audit work owns
.github/workflows/*.
Target Subsystem
SDLC, Git & PR Governance (.github/workflows/ci.yml, tests/invariants/test_workflow_contracts.py).
Existing Tool Considered
coreutils timeout, as the pre-push hooks of PR #5031 use it. No new option and no new setting. Cost (estimate): about 40,000 tokens and 1 hour to build, near 0 to keep.
Acceptance Criteria
- The Static Analysis gate step runs under
timeout <N>, and N plus the stop time is less than the step limit. - The structural test fails for a gate step with no
timeoutprefix and fortimeout 900in a step of 15 minutes. It passes on the newci.yml. - Static Analysis passes with the new value.
Dependencies
PR #5031 (#4775): with it, a SIGTERM from timeout stops each row and names it. Related: #4683, #4779.
Source: #4775
Alternatives check of 2026-11-27: covers.
Tool: coreutils/coreutils (https://github.com/coreutils/coreutils), GPL-3.0, last activity 2026-11-27, maintained.
Reason: Searches and the repository facts show coreutils timeout sends SIGTERM to the whole process group, which stops the gate and its devops ci rows; the issue already uses it in the pre-push hooks, so it covers the need.
Covers:
- Outer time limit on the gate step command
- Default mode signals the whole process group
- SIGTERM reaches uv and the devops ci rows
- Already used around devops ci in pre-push hooks
Lacks:
- No per-row limit; rows keep the 1,800 s default
- No structural test tying N to the step limit
- No computed N or step-limit check
- No per-row stopped-after line of its own
Proposed design
Problem statement
The Static Analysis Quality Gate step has a 3-minute limit inside a 6-minute job. Its devops ci rows keep the 1,800 s default, so the step limit ends a hung row and prints no per-row diagnostic. That breaks the rule that each inner limit ends before the limit around it. The change runs the gate step under coreutils timeout 160 and adds a structural test that holds N plus the row stop time below the step limit.
Acceptance criteria
Requirement: The workflow stays valid with the timeout prefix
.github/workflows/ci.yml SHALL pass the static workflow validators with the timeout 160 prefix on the gate step.
Scenario: The workflow validators on the change
- WHEN a maintainer runs
uv run devops ci --check --only actionlint,zizmor - THEN actionlint and zizmor pass and report no problem with
.github/workflows/ci.yml
Requirement: The gate step runs under an outer timeout
The Static Analysis Quality Gate step of .github/workflows/ci.yml SHALL run its command as timeout 160 uv run devops ci --check --no-cache --skip test,outdated,actionlint.
Scenario: The gate step of a pull request
- WHEN the
Static Analysisjob runs on a pull request that changes.github/workflows/ci.yml - THEN the log of the
Static Analysis Quality Gatestep shows the commandtimeout 160 uv run devops ci --check --no-cache --skip test,outdated,actionlintand the step exits 0 inside its 3-minute limit
Requirement: The check refuses a gate step with no timeout prefix
The structural check in tests/invariants/test_workflow_contracts.py MUST report a problem when the run line of the Static Analysis gate step has no timeout <N> prefix.
Scenario: A gate step with no timeout prefix
- WHEN the test
test_static_analysis_gate_timeoutpasses the check a workflow text whose gate steprunline has notimeout <N>prefix, and a maintainer runsuv run pytest tests/invariants/test_workflow_contracts.py -k static_analysis_gate_timeout - THEN the check returns a problem that names the gate step and the missing timeout prefix, and the test passes
Requirement: The check refuses a timeout that leaves no room
The structural check MUST report a problem when N plus three times DEFAULT_SHELL_STOP_GRACE_SECONDS is not less than the step limit in seconds.
Scenario: A timeout equal to the step limit
- WHEN the test passes the check a gate step of
timeout 900in a step oftimeout-minutes: 15, and a maintainer runsuv run pytest tests/invariants/test_workflow_contracts.py -k static_analysis_gate_timeout - THEN the check returns a problem that names the step limit of 900 s, and the test passes
Requirement: The check accepts a timeout with room
The structural check MUST report no problem when N plus three times DEFAULT_SHELL_STOP_GRACE_SECONDS is less than the step limit in seconds.
Scenario: A timeout with room under the step limit
- WHEN the test passes the check a gate step of
timeout 160in a step oftimeout-minutes: 3, and a maintainer runsuv run pytest tests/invariants/test_workflow_contracts.py -k static_analysis_gate_timeout - THEN the check returns no problem, and the test passes
Requirement: The real workflow passes the check
The structural test MUST run the check on .github/workflows/ci.yml and report no problem for the Static Analysis gate step.
Scenario: The gate step of the repository
- WHEN a maintainer runs
uv run pytest tests/invariants/test_workflow_contracts.py -k static_analysis_gate_timeout - THEN the test passes and reports no problem for the gate step
Existing Tool Considered
coreutils timeout, verdict covers; the alternatives check in the issue body states what it covers and lacks. It lacks a per-row limit, the structural test that ties N to the step limit, a per-row (stopped after <time>) line of its own, and a computed N. The change adds the timeout 160 prefix on the gate step and the structural test in tests/invariants/test_workflow_contracts.py; devops ci prints the per-row line. The issue body estimates about 40,000 tokens and 1 hour to build, and near 0 to keep.
Key questions
- The alternatives check found that coreutils/coreutils covers this item. Adopt the tool, or keep the item and give the reason?: Adopt coreutils
timeoutin its default mode around the gate step, as the person decided on the issue. AGENTS.md rule 3 requires an open tool before code that the project builds, the project already runsdevops ciundertimeoutin its pre-push hooks, and no ADR or AGENTS.md rule rejects the tool. (best practice) [sources: AGENTS.md, .pre-commit-config.yaml, .github/workflows/ci.yml]- Chosen: Adopt coreutils
timeout. The person adopted it, AGENTS.md rule 3 requires it, and the pre-push hooks already use it arounddevops ci. - Rejected: Keep the item and give the reason. No ADR or AGENTS.md rule rejects the tool, and the step limit as the outer limit leaves the broken nested limit.
- Chosen: Adopt coreutils
- What limits hold the Static Analysis Quality Gate step and its job?: The gate step has
timeout-minutes: 3, which is 180 s. Its job hastimeout-minutes: 6, which is 360 s. N plus the row stop time must stay below 180 s, and the step limit stays below 360 s. [sources: .github/workflows/ci.yml, tests/invariants/test_workflow_contracts.py:46] - What limit do the
devops cirows of the gate step keep?: Each row keepsDEFAULT_SUBPROCESS_TIMEOUT_SECONDS, which is 1,800 s, because a check sets no bound of its own. That row limit is far above the 180 s step limit, so the step limit is the outer limit today. [sources: src/devops_cli/config/defaults.py:408, src/devops_cli/commands/ci.py] - Which N does the
timeoutwrapper use?: N = 160. Three grace steps ofDEFAULT_SHELL_STOP_GRACE_SECONDStake at most 9 s, so 160 s plus 9 s is 169 s, below the 180 s step limit. It also leaves 56 s above the slowest of the last 8 runs onmain, which took 104 s. (best practice) [sources: .github/workflows/ci.yml, src/devops_cli/config/defaults.py:1413, src/devops_cli/core/process.py]- Chosen: N = 160. 160 s plus the 9 s stop is 169 s, below the 180 s step limit, with 56 s of room above the slowest measured run.
- Rejected: N = 170. 170 s plus the 9 s stop is 179 s, only 1 s below the step limit, so a slow stop passes the limit.
- Rejected: N = 150. 150 s fits, but it gives less room for a slower runner and no benefit.
- How does the structural check get the row stop margin?: The check imports
DEFAULT_SHELL_STOP_GRACE_SECONDSand uses three times its value, so a change of the constant moves the check with it. (best practice) [sources: src/devops_cli/config/defaults.py:1413, src/devops_cli/core/process.py]- Chosen: Import
DEFAULT_SHELL_STOP_GRACE_SECONDS. The check follows a change of the constant and never states a stale 9 s. - Rejected: Hard-code 9 s in the check. It drifts from the constant and passes a stop that got longer.
- Chosen: Import
- In which mode does the gate step run coreutils
timeout?: The default mode, with no option. The default mode puts the command in its own process group and signals the whole group, so the SIGTERM reaches the gate run and its rows. (best practice) [sources: .pre-commit-config.yaml, .github/workflows/ci.yml]- Chosen: Default mode,
timeout <N>. It signals the whole process group, the same form the pre-push hooks use, and it needs no extra option. - Rejected:
timeout --foreground <N>. It signals onlyuvand depends on uv forwarding the signal. - Rejected:
timeout --kill-after=<M> <N>.devops cialready escalates to SIGKILL within its own stop, and the extra M must fit in the same 180 s margin.
- Chosen: Default mode,
- Where does the new structural test live?: It joins
tests/invariants/test_workflow_contracts.py, beside the step-limit test and theSUITE_STEP_LIMIT_MINUTESmap. That file already holds the workflow loading helpers and theTIMEOUT_LIMITpattern at line 441, so the new test reuses them. (best practice) [sources: tests/invariants/test_workflow_contracts.py:46, tests/invariants/test_workflow_contracts.py:441]- Chosen: Add to
tests/invariants/test_workflow_contracts.py. It reuses the workflow loading helpers and sits beside the step-limit test. - Rejected: Add a new test file. It duplicates the workflow loading helpers and the step-limit map.
- Chosen: Add to
- Does the item depend on an open change that stops each row on SIGTERM?: No.
mainholds the behavior of PR feat(ci): devops ci stops its rows when timeout ends it #5031:devops cistops each running row on SIGTERM, prints(stopped after <time>)for the row, and exits 130. The item therefore has no open dependency. [sources: src/devops_cli/commands/ci.py, src/devops_cli/core/process.py, CHANGELOG.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both enforce the owner rule that inner limits end before outer limits in CI, but #4683 targets the test row and index build while this targets the Static Analysis gate step.feat(ci): devops ci stops its rows when timeout ends it (#5031)
devops-cli-service commentedon Nov 15, 2026
Alternatives check: covers
Reason: The searches and the facts of coreutils/coreutils show that GNU coreutils
timeoutalready provides exactly the wall-clock guard the issue asks for: it runs a command with a limit and, in its default mode, sends the signal to the command's process group, so a hungdevops cirow and its children end before the step limit. The issue itself names it as the existing tool, already used by the pre-push hooks, and no ADR rejects it.Tool: coreutils/coreutils (https://github.com/coreutils/coreutils)
Covers:
devops cirun and its child rows get the SIGTERMLacks:
tests/invariants/test_workflow_contracts.pythat checks thetimeout <N>prefix and N plus the stop time against the step limit(stopped after <time>)diagnostics; that comes from thedevops ciSIGTERM handling of PR feat(ci): devops ci stops its rows when timeout ends it #5031timeout-minutes, so N must be chosen by hand at the time of the change--shardrun, which fix(ci): give the test row and the index build own timeouts #4683 ownsTools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Owner question: The alternatives check found that
https://github.com/coreutils/coreutilscovers this item. Adopt the tool, or keep the item and give the reason. (a person decides)Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 24, 2026
Adopt the tool: coreutils timeout. AGENTS.md rule 3 requires using an open tool before building.
devops-cli-service commentedon Nov 24, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.