Repository navigation
Closed
Labels
priority/p0-criticalPriority P0: a release blocker or a critical defectscope/cliCore CLI framework, Typer subcommands, options, and tablesscope/docsDocuments, guides, ADRs and generated referencestype/docsType docs: a change to the documents
Milestone
Description
Problem
The owner settled the test design on 2026-10-07 (#1307). Its vocabulary is drafted in docs/TESTING.md and its decision in docs/adr/0005-tests-double-only-process-edges.md, both untracked on release/v0.2.28. The rules agents and contributors read today are scattered copies, and several contradict the decisions:
- AGENTS.md states test rules in six places:
- the tuple-assert mandate [code: AGENTS.md:15-16]. Its premise is false: ruff C901 does not count asserts, and a function of 15 linear asserts scores 1 [measured:
ruff check --select C901, 2026-10-07]; - "tests ... with structural tuple equality assertions" [code: AGENTS.md:103];
- one test file per submodule (
tests/test_<submodule>.pyortests/<submodule>/test_<feature>.py), with the work-namedtests/test_consolidation_dry_run_decorator.pygiven as a canonical file [code: AGENTS.md:158-161]; - isolation "using mocks (
unittest.mock,pytest-mock)" [code: AGENTS.md:434]; - provider protocols under
providers/with mock implementations [code: AGENTS.md:444], although the legacyai/providers/{anthropic,openai,ollama,copilot}.pylayer has no production caller; - test helpers in
src/devops_clithat declare__test__ = False[code: AGENTS.md:446], although fakes are not to ship in the wheel.
- the tuple-assert mandate [code: AGENTS.md:15-16]. Its premise is false: ruff C901 does not count asserts, and a function of 15 linear asserts scores 1 [measured:
- Other copies:
- docs/SDLC.md "Test Architecture & Standards", with pytest-mock isolation and
__test__ = False[code: docs/SDLC.md:103-107]; - CONTRIBUTING.md's
tests/test_<feature>.py[code: CONTRIBUTING.md:45-49]; - docs/ROUTINE_TASKS.md's "Create or update
tests/test_<feature>.py... and mocks" [code: docs/ROUTINE_TASKS.md:114]; .devops/review.md's tuple-comparison exemption [code: .devops/review.md:91-92];- docs/SELF_IMPROVEMENT.md's headroom step that turns linear asserts into tuples, and its flat canonical test files [code: docs/SELF_IMPROVEMENT.md:211-214, :577];
- the shipped knowledge base's "All test modules must be named
tests/test_<feature>.py" [code: src/devops_cli/ai/knowledge_base/it_domains/tools/ruff_mypy_pytest.md:90].
- docs/SDLC.md "Test Architecture & Standards", with pytest-mock isolation and
- The AGENTS.md generator carries none of these rules.
generate_agents_md[code: ai/instruction_generator.py:163] has no tuple mandate and no test-layout rule at 5c45b1e. Its only test guidance is the build-command block and the test-first remediation steps.
Acceptance criteria
docs/TESTING.md
- It keeps the drafted vocabulary and adds a Conventions section, written in those terms, that states every decision of 2026-10-07 recorded in test(cli): tests double only process edges and mirror the source tree #1307 as a rule. Its headings:
- Doubles: the faked and real edges, one seam per edge, fakes in
tests/support/fakes/<edge>.py, a contract suite for every fake, stdlib patching as a fallback for stdlib edges only, and no patching of devops-cli and no imports of its private names. - Layout: the mirror at full depth with a
conftest.pyper package; one file per behaviour, named after it (tests/roadmap/test_descoping.py);tests/invariants/as the only place for test files outside the mirror, one file per subject (test_source_tree.py,test_agents_md.py, …); andtests/support/for fakes, builders and shared fixtures. - Names and assertions: behaviour in CONTEXT.md glossary terms (
test_stalled_item_is_treated_as_not_started); whole-value comparisons, with tuple equality only to pick fields out of objects with noisy fields. - CLI tests (the
clifixture; parsing, wiring, output and exit code only; domain rules tested once, through the domain package) and Config (theconfigfixture; no patching ofload_settings,CONFIG_PATHorget_settings). - Test data: builders named after glossary terms, in
tests/support/builders.py; syrupy snapshots only where the whole text is the contract, updated with--snapshot-file-lockand the reason (syrupy issue 1237: an update under xdist loses data). - Property tests, Clock (time-machine and the libraries' own sleep and clock parameters, no freezegun) and Coverage (unreachable lines are deleted; the 90% gate stays).
- Floor and ratchets, and Until the migration ends: which mechanisms exist yet. A new test follows the conventions wherever they exist, and the ratchets stop it from adding internal patches or private imports.
- Doubles: the faked and real edges, one seam per edge, fakes in
ADR
- The drafted ADR is committed as drafted under the next free number in
docs/adr/at merge time: 0005, or 0006 if feat(review): devops review score scores saved review sessions against a label file offline and reproduces the S11 and loop baselines #1138's ADR merged first, with every link to it updated.
Pointers
- AGENTS.md links TESTING.md from §2 (Test-First Development Cycle) and from §4. It drops :15-16, the tuple phrase at :103, :158-161, :434, :444 and :446. The test-first steps and the
example.comrule (:35) stay. - docs/SDLC.md:103-107, CONTRIBUTING.md:45-49, docs/ROUTINE_TASKS.md:114,
.devops/review.md:91-92, docs/SELF_IMPROVEMENT.md:211-214 and :577, andai/knowledge_base/it_domains/tools/ruff_mypy_pytest.md:90point to TESTING.md instead of restating its rules. CONTEXT.md does not change. - A test checks that AGENTS.md and each of the six other documents above link
docs/TESTING.md, and that every relative link in TESTING.md and the ADR resolves. It goes intests/test_agents_md_claims.py, the file test(cli): every test file sits in the directory mirroring the package it tests or in tests/invariants/, and the root conftest holds only the hermetic floor #1313 moves totests/invariants/and test(cli): Convert ratchets to bans and merge invariant tests #1336 merges into the subject filetests/invariants/test_agents_md.py(Q13); this PR adds no invariant file of its own. - The PR leaves these unchanged and names who owns each:
- refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150 deletes the verifier's tuple-equality guard and its catalog entry [code: ai/review/verification.py:1171; ai/review/common_hallucinations.json:731] and rewrites VISION item 16 [code: docs/VISION.md:22];
- test(cli): retire the tuple-assert mandate and detect opaque tuple asserts and presence-only tests #851 keeps the AST check and the site rewrites.
ai/instruction_generator.pycarries no mandate at 5c45b1e, so test(cli): retire the tuple-assert mandate and detect opaque tuple asserts and presence-only tests #851 has nothing to remove there.
-
changelog.d/<n>.mdrecords the change;CHANGELOG.mdanddocs/ROADMAP.mdare not edited. -
uv run devops cipasses.
Key questions
- Where do the conventions live? Decided 2026-10-07: in
docs/TESTING.md. AGENTS.md links it and drops its scattered copies, and CONTEXT.md stays a domain glossary only. - Who removes the tuple mandate? Decided 2026-10-07: this item removes the AGENTS.md text together with the other test rules, and test(cli): retire the tuple-assert mandate and detect opaque tuple asserts and presence-only tests #851 retires the rest of the mandate (
instruction_generator.py, the AST check and the site rewrites). At 5c45b1e the generator carries no mandate, so that part of test(cli): retire the tuple-assert mandate and detect opaque tuple asserts and presence-only tests #851 has nothing left to remove. The verifier's guard and catalog entry that treat tuple asserts as mandatory are refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150's, which deletes the whole hallucination catalog. - ADR number? Decided 2026-10-07: ADR 0005 records "tests double only process edges". feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 also names
docs/adr/0005-review-findings-come-from-tools-not-models.mdfor feat(review): devops review score scores saved review sessions against a label file offline and reproduces the S11 and loop baselines #1138. (proposed) Whichever ADR merges second takes the next free number and updates its links; this PR checksdocs/adr/before it merges. - Is the knowledge-base line in scope? (proposed) Yes. It ships in the wheel and states this repository's old layout as a rule.
- Does TESTING.md cite issue numbers? (proposed) No. It states rules, and test(cli): tests double only process edges and mirror the source tree #1307 tracks the items that bring the code to them.
Strategic alignment
- Milestone: none; the roadmap tooling places it. Depends on: none. Blocks: test(cli): Convert ratchets to bans and merge invariant tests #1336. Related: test(cli): retire the tuple-assert mandate and detect opaque tuple asserts and presence-only tests #851 (the AST check and site rewrites for tuple asserts), test(cli): ratchets hold internal patches, private imports and test accommodations in src at today's counts and name each site that would raise one #1309 (the ratchets TESTING.md describes), test(cli): tests find the repository root and fixtures from any depth, import no other test module and build test data with shared builders, and devops test maps a change to its mirror directory #1312 (creates
tests/support/builders.pyand adds syrupy, both of which TESTING.md documents), feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 and feat(review): devops review score scores saved review sessions against a label file offline and reproduces the S11 and loop baselines #1138 (the other planned ADR 0005), refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150 (deletes the verifier's tuple guard and catalog entry). - Parent: test(cli): tests double only process edges and mirror the source tree #1307 (phase A).
Metadata
Metadata
Assignees
Labels
priority/p0-criticalPriority P0: a release blocker or a critical defectscope/cliCore CLI framework, Typer subcommands, options, and tablesscope/docsDocuments, guides, ADRs and generated referencestype/docsType docs: a change to the documents
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 8, 2026
Linked: #841, which cuts AGENTS.md to a budget with a mapping table; the test rules this item moves count toward it. Found by the 2026-10-08 backlog review.
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
Scattered and contradictory test rules mislead agents and contributors but do not block a release or break functionality.Consistent, single-source test conventions reduce agent errors and contributor confusion across the project.Requires writing a new Conventions section in docs/TESTING.md and editing at least seven existing files to remove or redirect contradictory rules.dan-petty commentedon Oct 18, 2026
Closed as a duplicate of #851:
The candidate overlaps significantly with issue #851 which also addresses the tuple-assert mandate in test conventions, making it a duplicate.If it is not a duplicate, reopen it: intake then places it without the duplicate check.
dan-petty commentedon Oct 18, 2026
Reopened: this is not a duplicate of #851. Intake closed it on 2026-10-18 with the reason "overlaps significantly with issue #851 which also addresses the tuple-assert mandate in test conventions". #851 retires one convention (the tuple-assert mandate) and adds detectors. This item writes docs/TESTING.md, records ADR 0005 (tests double only process edges), and points AGENTS.md and the contributor docs at them.
It is P0 under the owner's blocker rule: #983's last pull request waits on it, with #1312. A read-only
--planan hour earlier placed it normally, so the duplicate verdict is the model's call, not a settled finding. That intake can close a person-planned item as a duplicate is drafted as an intake defect.docs(cli): docs/TESTING.md holds the test conventions, ADR 0007 recor…
dan-petty commentedon Oct 19, 2026
What changed
#1694, merged into
release/v0.2.37as 5ab8a1e.16 file(s) changed.
How it was verified
Check runs at 16bbbac:
Acceptance Criteria of
docs/agent/tasks/task-1308-test-conventions.md:docs/TESTING.mdkeeps the drafted vocabulary and states every decision of 2026-10-07 as a convention, marks what later items deliver as (target), and marks none oftests/support/, the shared paths or feat(test): devops test and devops ci test choose tests through one selector, and a change that reaches every test runs the suite #1693's selection rules, which exist.#fragmentincluded (tests/test_agents_md_claims.py::test_every_relative_link_in_the_test_conventions_and_their_pointers_resolves, which fails at the base onAGENTS.md's link to the missingdocs/TESTING.md).docs/TESTING.md(test_every_document_that_stated_test_rules_links_testing_md), and a negative control pins the link check, a link to a heading with letters outside ASCII included (test_a_link_to_a_missing_file_or_heading_is_broken).tests/test_agents_md_claims.pyalready made hold on the new tree: the issue templates AGENTS.md names exist, the personas indocs/SELF_IMPROVEMENT.mdare thePersonavalues, the instruction stubs match the generator, and AGENTS.md stays within its character budget.__test__ = False.changelog.d/1308.mdrecords the change;CHANGELOG.mdanddocs/ROADMAP.mdare not edited.feat(release): v0.2.37 (#1720)