Repository navigation
Description
Problem or Motivation
Documents hold hand copies of quality limits: the coverage floor 85 (fail_under in pyproject.toml), the changed-line floor 90 (--fail-under 90 in ci.yml), C901 10, PLR1702 4, line length 100 and CONST_AGENTS_MD_MAX_CHARS 6,500. The standards pass fixed the coverage and nesting values by hand, and the knowledge base once said 90 for the coverage floor (#3904). A copied-constant rule cannot see these values, because pyproject.toml values have no CONST_ name.
Proposed Solution & Architectural Design
- Use the named marker-block function of feat(docs): generated pages name their source and stay complete #4889 to write a "quality-limits" block in
CONTRIBUTING.md. Values come frompyproject.toml(tomllib) and the constants. - Move the changed-line floor into
[tool.diff_cover] fail_underinpyproject.toml. Makeci.ymlrun diff-cover with--config-file pyproject.tomland no number. - The docs row compares the block.
- Other documents link to the block and copy no number.
CONTRIBUTING.mdstates the rule: name the source and link to it, do not copy a value. - Delete the per-fact coverage tests that the block replaces.
No cogapp: cog runs Python from documents, and the generator already has a marker-block function.
Target Subsystem
SDLC, Git & PR Governance (CONTRIBUTING.md, pyproject.toml, .github/workflows/ci.yml, the docs generator).
Existing Tool Considered
diff-cover reads fail_under from pyproject.toml; tomllib reads the values. Cost: about 80 lines plus tests, about 60k tokens and 1.5 h.
Acceptance Criteria
- A change of
fail_underinpyproject.tomlmakes the docs row fail untiluv run devops docs generateruns. ci.ymlholds no coverage number.- A test finds no copy of the 6 limits in the hand-written classes outside the block.
Dependencies
Source: #4880
Alternatives check of 2026-11-21: rejected.
Rejected by ADR 0025. A newer fact can change an ADR.
Tool: cogapp (https://pypi.org/project/cogapp), MIT, last activity 2026-11-15, maintained.
Reason: cogapp writes marker-delimited blocks in Markdown and can fail a check run when they are stale, so it covers the generation and the guard; ADR 0025 rejects it, and it does not cover the rest of the issue.
Covers:
- Marker-delimited generated blocks inside a Markdown file
- Check run that fails when the block is stale
- Python in the block can read pyproject.toml values
Lacks:
- No move of the changed-line floor into pyproject.toml
- No scan that documents only link to the block
- Runs Python written inside the document
- No deletion of the per-fact coverage tests
Proposed design
Problem statement
Documents copy six quality limits by hand. The copies become different from pyproject.toml and the constants. One generated quality-limits block in CONTRIBUTING.md gives each value and its source. The docs row fails when the block is stale.
Acceptance criteria
Requirement: Generated quality-limits block
The docs generator SHALL write a quality-limits block in CONTRIBUTING.md from pyproject.toml and the constants.
Scenario: The generator writes all six limits
- WHEN uv run devops docs generate runs with no change to the six limits
- THEN The block lists the coverage floor 85, the changed-line floor 90, C901 10, PLR1702 4, line length 100 and CONST_AGENTS_MD_MAX_CHARS 6,500, each with its source.
Requirement: Stale block fails the docs row
The docs row SHALL fail when the quality-limits block differs from its generated form.
Scenario: A changed coverage floor leaves the block stale
- WHEN fail_under in pyproject.toml changes and uv run devops docs generate does not run
- THEN The docs row exits nonzero.
Requirement: Changed-line floor has one source
The changed-line coverage floor MUST live in [tool.diff_cover] fail_under in pyproject.toml.
Scenario: CI reads the changed-line floor from pyproject.toml
- WHEN .github/workflows/ci.yml runs diff-cover
- THEN The command uses --config-file pyproject.toml and holds no --fail-under number.
Requirement: Documents link to the block
Hand-written documents SHALL link to the quality-limits block and SHALL NOT copy one of the six limits.
Scenario: The scan accepts a link-only document
- WHEN A test scans the hand-written documents outside the quality-limits block
- THEN The test finds no copy of the six limits and passes only when each document links to the block.
Requirement: CONTRIBUTING.md states the no-copy rule
CONTRIBUTING.md SHALL state that a document names the source and links to it and does not copy a quality limit.
Scenario: The contributor reads the rule
- WHEN CONTRIBUTING.md is rendered
- THEN The quality-limits section states the no-copy rule and links to the generated block.
Requirement: Replaced coverage tests are deleted
The change SHALL delete the per-fact coverage tests that the quality-limits block replaces.
Scenario: No test asserts a copied coverage floor
- WHEN The test suite runs after the change
- THEN No test asserts a hand-copied coverage floor that the quality-limits block now checks.
Existing Tool Considered
cogapp (https://pypi.org/project/cogapp) is the open-source tool that writes marker-delimited generated blocks inside documents. ADR 0025 rejects it for generated blocks, and its last activity is 2025-09-21, so it is not maintained. It lacks the diff-cover configuration move, the link-only rule and the test deletion. The project uses its own marker-block function from #4889; the issue estimates about 80 lines plus tests, about 60k tokens and 1.5 h.
Key questions
- Which tool writes the quality-limits block?: The project marker-block function from feat(docs): generated pages name their source and stay complete #4889 writes the block. Do not use cogapp: ADR 0025 rejects it for generated blocks, and it is not maintained. (best practice) [sources: CONTRIBUTING.md]
- Chosen: Project marker-block function from feat(docs): generated pages name their source and stay complete #4889. It already writes and checks marker-delimited blocks and the project records its use.
- Rejected: cogapp. ADR 0025 rejects it, it is not maintained, and it runs Python from documents.
- Rejected: Hand-written block. It copies the values and lets them drift again.
- Where does the changed-line floor live?: In [tool.diff_cover] fail_under = 90 in pyproject.toml. ci.yml runs diff-cover with --config-file pyproject.toml and no --fail-under number. (best practice) [sources: pyproject.toml, .github/workflows/ci.yml]
- Chosen: Move to pyproject.toml. One source holds the value and diff-cover reads it.
- Rejected: Keep --fail-under 90 in ci.yml. It keeps a copied number in CI.
- How does the generator read the six limits?: Read pyproject.toml with tomllib for the coverage floor, changed-line floor, C901, PLR1702 and line length. Import CONST_AGENTS_MD_MAX_CHARS from src/devops_cli/config/constants.py. (best practice) [sources: pyproject.toml, src/devops_cli/config/constants.py:202]
- Chosen: tomllib plus the constants import. The standard library and the existing constant avoid a second copy.
- Rejected: Copy the values into the generator. It creates another copy that can drift.
- How do other documents avoid copied limits?: Each hand-written document names the source and links to the quality-limits block in CONTRIBUTING.md. CONTRIBUTING.md states the no-copy rule. (best practice) [sources: CONTRIBUTING.md]
- Chosen: Link to the block. The block holds the value and the document holds no number.
- Rejected: Repeat the values. It makes a second copy that the docs row cannot check.
- Which tests does the block replace?: Delete the per-fact coverage tests that assert the coverage floor, including the fail_under assertions in tests/commands/test_ci.py and tests/invariants/test_agents_md.py. (best practice) [sources: tests/commands/test_ci.py, tests/invariants/test_agents_md.py]
- Chosen: Delete the replaced per-fact tests. The block and its docs row check the same values.
- Rejected: Keep the tests. They assert copies that the change removes.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(docs)scope of the title gives the scope.It prevents stale documentation values but does not block a release or fix a defect.It removes hand-copied numbers from docs and prevents drift, but the toolchain still functions without it.The body estimates about 80 lines, tests, and 1.5 hours of work.Both touch diff-cover settings in pyproject.toml and ci.yml, but #850 adds the changed-line coverage gate while this candidate generates a single docs block from those values.devops-cli-service commentedon Nov 15, 2026
Alternatives check: rejected
Reason: Searches pointed to cogapp as the only open tool that writes and re-checks marker-delimited generated blocks inside documents, which is the core of the requested "quality-limits" block: Python inside the block could read
fail_underand the constants with tomllib, and check mode would fail the docs row until regeneration. It covers only that part, and ADR 0025 explicitly rejects cogapp for generated blocks (the issue says the same), so the project's own marker-block function is the intended path.Rejected by ADR 0025. A newer fact can change an ADR.
Tool: cogapp (https://pypi.org/project/cogapp)
Covers:
Lacks:
Tools 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
Refine cannot set this item to Ready at fccb781 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
dan-petty commentedon Nov 19, 2026
No check now compares the coverage floor in the documents with
pyproject.toml: #6075 deleted the two guard tests, and the generated block of this item does not exist yet. This makes the item more urgent. Step 5 is already done, and the replacement must be the generated block, not a new test.Evidence (origin/main 0d90de5, 2026-11-19)
tests/invariants/test_agents_md.py:test_the_contributor_guide_and_the_test_rules_state_the_coverage_floor_of_pyproject, which compared the floor inCONTRIBUTING.mdanddocs/TESTING.mdwithfail_under(perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups #2356).test_a_document_that_states_another_coverage_floor_is_reported, its negative control._coverage_floors_statedand the pattern_COVERAGE_FLOOR_STATEMENT.CONTRIBUTING.md:34: "Minimum 85% Code Coverage, and 90% of the Changed Lines".docs/TESTING.md:218: "The coverage floor is 85% of the lines and branches".pyproject.toml:272fail_under = 85, and.github/workflows/ci.yml:305--fail-under 90.git grepontests/finds no other test that compares a documented floor withfail_under.status/new, and refine is blocked on feat(docs): generated pages name their source and stay complete #4889 (refine comment of 2026-11-16T05:17Z).Effect on this item
tests/commands/test_ci.pyandtests/invariants/test_agents_md.py.tests/invariants/test_agents_md.pyholds nofail_underassertion now.tests/commands/test_ci.py:790still asserts"--fail-under 90" in runfor the step "Changed-Line Coverage" of.github/workflows/ci.yml. That is a test of a config value, not a test of a documented floor. Re-check which assertions remain before the build.test-treecheck that refuses a new test that reads a committed config file, andpyproject.tomlis on its list (tests/gate/tree_checks/config_values.py:50,docs/TESTING.md:62). The generated block of this item, which the docs row compares, is the correct guard.fail_underor of the diff-cover floor leaves 2 documents wrong, and no check fails.Proposed action