Repository navigation
Description
Owner decision, 2026-10-27
The owner chose the direction of #2356 for the coverage floor: a lower global floor (85%) and a gate on the changed lines. So the rise of fail_under to the measured total is dropped from this issue, and the three places that asked for it are struck through below. Do not raise fail_under here.
What stays: the measurement of branches and the upload of .data/coverage.xml as an artifact. Both are independent of the floor. The measurement of branches adds job time, and #2356 wants the Tests & Coverage job at or below 240 s, so the time check below (the average after the change stays under 300 s) is a minimum, and the pull request also reports the average against 240 s.
Problem
The coverage gate measures less than it can, and CI keeps no record of what it measured.
- Branch coverage is off:
[tool.coverage.run]sets nobranch = true. A guard such asif a or b: raisecounts as covered when one side runs. Line coverage cannot show that the other side has no test. fail_under = 90, while the suite measures 92.66% of lines in CI at f4d7066. A change can drop about 2.6 points of coverage and still pass.- CI writes
.data/coverage.xmlfor diff-cover and then discards it. No artifact keeps it, so a reviewer cannot see the per-file figures of a run without a new run.
Proposed solution
[tool.coverage.run]setsbranch = true. Coverage 7.16.1 on Python 3.14.7 measures branches withsys.monitoring.(Dropped: perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356.)fail_underrises to the whole percentage that CI measures with branches on, and never below 90. The owner's rule allows a raise and forbids a drop.- The
Tests & Coveragejob uploads.data/coverage.xmlwithactions/upload-artifact, pinned by commit SHA, with a short retention.
Feasibility and time
- The
Tests & Coveragejob took 245-307 s in the last 8 successful runs ofci.ymlon main (2026-10-24, runs 40108255492 to 40125840892), 284.5 s on average. Two runs were above 300 s. A job that averages more than 5 minutes is a P0 bug. - The pull request measures the job over 5 CI runs before and after the change. If branch measurement takes the average to 300 s or more, the item waits for a change that makes the suite faster, such as the git fake of test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146, and does not drop a check.
The total with branches can be lower than the line total. If it is below 90, the item waits for the coverage issues of the same audit and does not lower(Dropped: perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356.)fail_under.
Existing tool considered
coverage.py and pytest-cov, which the project already uses, measure branches. actions/upload-artifact keeps the report. Nothing is built.
Evidence
At b170358:
pyproject.toml:197-202:[tool.coverage.run]holdsdata_fileandparallel, andfail_under = 90..github/workflows/ci.yml:80-120: the job runs the gate and diff-cover, and uploads no coverage artifact..data/agent/scratch/audit-coverage/ci-test-job.log: the CI coverage total of 92.66% at f4d7066.
Acceptance criteria
-
pyproject.tomlsetsbranch = true. [ ](Dropped: perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356.)fail_underis the whole percentage that CI measures with branches, and at least 90. The pull request gives the measured figure.- The
Tests & Coveragejob uploads.data/coverage.xmlas an artifact. The step passeszizmorandactionlint. - The pull request gives the job time of 5 runs before and 5 runs after. The average after is under 300 s.
- diff-cover still reads
.data/coverage.xml(perf(ci): the local gate writes coverage XML only where CI reads it, and the cleanup keeps the combined data #1743 keeps it in CI). -
uv run devops cipasses.
Related: #1743 (the local gate stops writing the XML report; CI keeps it).
Source: #1743
Alternatives check of 2026-11-02: not-applicable.
Class: ci, no search.
Tool: none found.
Proposed design
Problem statement
The coverage gate measures lines only, so an untested branch passes. CI writes .data/coverage.xml for diff-cover and discards it, so a reviewer cannot see the per-file figures of a run. This change turns branch measurement on and keeps the report as an artifact. It changes no coverage floor.
Acceptance criteria
Requirement: Branch coverage is measured
The [tool.coverage.run] table in pyproject.toml SHALL set branch = true.
Scenario: The coverage configuration enables branch measurement
- WHEN a test reads the
[tool.coverage.run]table ofpyproject.toml - THEN the table sets
branch = trueand still setsdata_file = ".data/.coverage"andparallel = true.
Requirement: The coverage XML is an artifact
The Tests & Coverage job SHALL upload .data/coverage.xml with actions/upload-artifact after the step that writes the report.
Scenario: The aggregate job uploads the report
- WHEN a test reads the steps of the
Tests & Coveragejob in.github/workflows/ci.yml - THEN one step after the report step uses
actions/upload-artifactwithpath: .data/coverage.xml,retention-days: 7and a pin by full commit SHA.
Requirement: The report survives a failed gate
The upload step MUST run when an earlier step of the job fails.
Scenario: The coverage gate fails
- WHEN the step that applies the coverage floor fails
- THEN the upload step has
if: always()andif-no-files-found: warn, so it runs and a missing report warns.
Requirement: The workflow lints clean
The new step SHALL pass zizmor and actionlint.
Scenario: The workflow lints
- WHEN
zizmorandactionlintrun over.github/workflows/ci.yml - THEN both report no finding.
Requirement: diff-cover reads the same report
diff-cover SHALL still read .data/coverage.xml that the aggregate job writes.
Scenario: Changed-line coverage runs
- WHEN the
Changed-Line Coveragestep runs in theTests & Coveragejob - THEN it reads
.data/coverage.xmland reports the coverage of the changed lines.
Requirement: The local gate passes
The full local gate MUST pass with branch measurement on.
Scenario: The local gate runs
- WHEN
uv run devops ciruns - THEN it exits 0 and the combined line and branch total is at or above
fail_under.
Existing Tool Considered
The alternatives check of 2026-11-02 gives not-applicable: class ci, no search, no tool. Tools that the project already uses cover the need. coverage.py, through pytest-cov, measures branches when [tool.coverage.run] sets branch = true. actions/upload-artifact keeps .data/coverage.xml with a short retention. Nothing is built.
Key questions
- Does
[tool.coverage.run]inpyproject.tomlmeasure branches today?: No. The table setsdata_fileandparallel, and it sets nobranchkey, so coverage measures lines only. [sources: pyproject.toml:232] - Where does CI write
.data/coverage.xml, and does any step upload it?: The aggregateTests & Coveragejob combines the shard data, runscoverage reportand theChanged-Line Coveragestep, and writes.data/coverage.xmlfor diff-cover. No step uploads the file. [sources: .github/workflows/ci.yml:241, .github/workflows/ci.yml:250, docs/SDLC.md:219] - Which job uploads the coverage XML artifact?: The aggregate
Tests & Coveragejob uploads the file, in a step after the step that writes.data/coverage.xml. (best practice) [sources: .github/workflows/ci.yml:250, docs/SDLC.md:219, openspec/changes/archive/2026-10-29-1743-coverage-xml-in-ci/proposal.md:40]- Chosen: The aggregate
Tests & Coveragejob. The shards write no XML report, so the file exists only in the aggregate job, and one upload gives one artifact per run. - Rejected: Each shard job. A shard writes no XML report, so the path would match nothing, and four uploads would name one file.
- Rejected: A new job that downloads the data. It needs a second download of the coverage data and adds job time for no new report.
- Chosen: The aggregate
- Which action keeps the report, and how is it pinned?:
actions/upload-artifactkeeps the file. The step pins the action by the full commit SHA of its latest v4 release and puts the release tag in a trailing comment. (best practice) [sources: .github/workflows/ci.yml, tests/invariants/test_workflow_contracts.py]- Chosen: Pin
actions/upload-artifactby full commit SHA. Everyuses:in the workflows pins a full commit SHA with the version in a comment, and a tag can move. - Rejected: Pin by the
v4tag. A tag is mutable, so the step could run different code, and the pin invariant fails. - Rejected: Upload the file with
ghorcurl. It builds a script that the action provides and needs a token.
- Chosen: Pin
- Which retention does the artifact use, and how does the step behave when the report is missing?: The step sets
retention-days: 7. It runs withif: always()andif-no-files-found: warn. (best practice) [sources: .github/workflows/ci.yml, docs/adr/0004-ci-is-the-authoritative-gate.md]- Chosen: 7 days,
if: always(),if-no-files-found: warn. A reviewer reads the report while the pull request is open, and a failed gate must not hide it; a missing file warns and adds no second failure. - Rejected: The default 90 days. It keeps every run's report for a quarter and grows storage for no reader.
- Rejected: 1 day. A review after a weekend finds no artifact.
- Rejected:
if-no-files-found: error. A gate that fails before the XML step would turn one failure into two.
- Chosen: 7 days,
- Does the change raise, keep or lower
fail_under?: The change keepsfail_underat 85. The owner decision of 2026-10-27 drops the raise, and perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356 owns the floor. If the combined line and branch total falls below 85, the item waits on perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356 and does not lower the floor. (best practice) [sources: CONTRIBUTING.md:28, pyproject.toml]- Chosen: Keep
fail_underat 85. The owner decision of 2026-10-27 drops the raise from this issue, and the rule forbids a drop. - Rejected: Raise it to the measured total. Dropped by the owner decision; perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356 owns the floor.
- Rejected: Lower it. The owner's rule forbids a drop.
- Chosen: Keep
- How does the pull request check the job time budget?: The pull request reports the average
Tests & Coveragejob time of 5 runs before and 5 runs after the change. The average after stays under 300 s, and the pull request also gives it against the 240 s target of perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356. The sharded test row of perf(ci): the Tests & Coverage check averages 7 minutes, over the 5 minute bound #3050 keeps the job well under both figures. If the average reaches 300 s, the item waits for a faster suite, such as the git fake of test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146. (best practice) [sources: .github/workflows/ci.yml, AGENTS.md, docs/SDLC.md:219]- Chosen: Measure 5 runs before and 5 after in the pull request. The runner speed varies, so the budget is an average over real runs, and the sharded test row keeps the job under it.
- Rejected: Assert the time in a test. A time assertion fails on a slow runner and reports a defect that is not there.
- Rejected: Skip the check. The 300 s budget of AGENTS.md rule 5 is a P0 concern, and branch measurement adds job time.
- Does the local gate
uv run devops ciread the coverage settings inpyproject.toml?: Yes.devops ciappliesfail_underfrompyproject.toml, so it reads the coverage tables there.branch = trueturns branch measurement on for the local gate and CI together. [sources: CONTRIBUTING.md:28, pyproject.toml, src/devops_cli/commands/ci.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 24, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The change involves CI configuration and coverage tooling which falls under infrastructure.The change improves coverage accuracy and CI artifact retention but is not critical to core functionality.Improving coverage accuracy helps detect potential issues in code changes.The effort involves updating configuration files and CI job steps, which requires moderate development work.Both items relate to coverage but the candidate adds branch measurement while the related item focuses on redundant test files.[-]ci(coverage): coverage measures branches, fail_under rises to the measured total, and ci keeps the coverage xml as an artifact[/-][+]ci(coverage): coverage measures branches and ci keeps the coverage xml as an artifact[/+]dan-petty commentedon Oct 27, 2026
The owner decided on 2026-10-27 that the coverage floor follows #2356: a lower global floor (85%) and a gate on the changed lines. So this issue no longer raises
fail_under.ci(coverage): coverage measures branches, fail_under rises to the measured total, and ci keeps the coverage xml as an artifact..data/coverage.xmlstay. They do not depend on the floor.Tests & Coveragejob at or below 240 s, so the pull request of this issue reports the average against 240 s as well as against 300 s. Whether branch coverage is still worth its time is a question for the owner when perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356 has its data.dan-petty commentedon Oct 28, 2026
Status set to Ready at bb46660 (see proposed design in issue body).
24 remaining items
devops-cli-service commentedon Nov 7, 2026
Stopped at group 2.
Failed check:
uv run devops ci --check --only actionlint,zizmor.Failure class:
lint.Action taken: none.
Action left:
repair: give the failure to a fix step.uv run devops ci --check --only actionlint,zizmorReason:
Last message of the agent (a claim that no check verified): Changed
.github/workflows/ci.yml: added the stepUpload Coverage XMLto the jobtest, directly afterChanged-Line Coverage, withif: always() && github.event_name == 'pull_request' && steps.changes.outputs.outside_plan != 'false',actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2, and the inputscoverage-xml/.data/coverage.xml/include-hidden-files: true/if-no-files-found: warn/retention-days: 7, plus a comment that says the step keeps the report thatcoverage xmlwrites and that a run with no report warns. Ticked task 2.1 in the change'stasks.md. Verification: -uv run devops ci --check --only actionlint,zizmor: zizmor passes; actionlint cannot run on this host. Noactionlintis on PATH, GitHub egress is blocked so the digest-pinnedkjanat/actionlint:1.17.0image cannot be fetched, and the only installable build (PyPIactionlint-py, upstream 1.7.12) rejects theubuntu-26.04runner label that the unchangedci.ymlandrelease.ymlalready use. With that build,ci.ymlgave no finding other than the unknown runner label, so the new step has no syntax or schema error. The pinned 1.17.0 in the devcontainer and CI knows the label. -uv run devops ci test tests/invariants/test_workflow_contracts.py: 113 passed. -uv run devops ci test tests/commands/test_ci.py tests/invariants/test_architectural_invariants.py tests/core/test_third_party_telemetry.py: 205 passed. - A structural probe confirmed the stThe job discarded this work. Read it before you retry:
The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.devops-cli-service commentedon Nov 7, 2026
The runner Job devops-cli-runner-20261107-174351-6cb0 ended: succeeded.
Image digest: sha256:4d5736e08610d02798275b12570912b0bff1fe3a5c64e30b95ccb1af7499be9d
The last lines of its log:
ci(coverage): upload coverage xml report and state branch coverage (#…
dan-petty commentedon Nov 8, 2026
Branch coverage cost measured per issue #2373:
taskset -c 0-3),-n 4, 3 interleaved rounds.coverage combine+coverage report --show-missing): 18.7 s wall time (3.4% of shard wall time; exceeds the 15 s budget threshold).Full measurement tables and method recorded in
docs/TESTING.mdvia PR #4163.fix(roadmap): Check the CI job-time premise before staging (#5765)