Skip to content

Document agent pitfalls in AGENTS.md: test coverage and docs spell check#12580

Merged
bdraco merged 2 commits into
aio-libs:masterfrom
bdraco:agents-md-test-coverage
May 17, 2026
Merged

Document agent pitfalls in AGENTS.md: test coverage and docs spell check#12580
bdraco merged 2 commits into
aio-libs:masterfrom
bdraco:agents-md-test-coverage

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented May 17, 2026

What do these changes do?

Two AGENTS.md additions for failure modes agents keep hitting in
this repo:

  • Test coverage gate. New Every line in a test must be
    covered
    section under Tests, explaining that the CI test
    runs use --cov=aiohttp/ --cov=tests/ so uncovered lines in
    tests/ show up in the codecov patch report alongside
    uncovered lines in aiohttp/. Lists the shapes agents
    commonly leave uncovered (defensive raise inside a
    monkeypatched stub, one-sided cleanup branches behind
    if had_own_attr:) and the patterns that keep tests fully
    covered. References
    aio-libs/yarl#1687
    and the corresponding
    aio-libs/yarl#1689.
  • Docs spell check. New PR rule HTTP pipelining support improvements #6 Run the docs spell
    check before pushing
    , documenting that the lint CI job
    runs make doc-spelling with -W --keep-going and reads
    every CHANGES/*.rst fragment, so an unknown technical word
    in a news fragment fails CI before a human sees the PR.
    Adds codecov to docs/spelling_wordlist.txt for the new
    fragment. Mirrors the equivalent
    aio-libs/multidict#1345
    addition.

Renumbers the surrounding PR rule (Commit hygiene becomes #7)
and extends Things-not-to-do with matching bullets.

Are there changes in behavior for the user?

No. Docs-only change to the agent-facing contributor notes,
plus one wordlist entry.

Is it a substantial burden for the maintainers to support this?

No. Both rules are already enforced (by the codecov patch
report and by the docs spelling step in CI); this just writes
them down where agents will read them.

Related issue number

N/A.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist (N/A, docs only)
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt (N/A, already listed)
  • Add a new news fragment into the CHANGES/ folder

Drafted with Claude Opus 4.7; reviewed by @bdraco.

Agent run details (optional, for reviewers)

Docs-only change, no test suite to run. Verification:

  • pre-commit run --files AGENTS.md CHANGES/12580.contrib.rst docs/spelling_wordlist.txt passed.
  • make doc-spelling flagged codecov before the wordlist entry was added; after adding it, the only remaining warnings are two pre-existing words (accessor from CHANGES/10665.feature.rst, flakey from CHANGES/12571.contrib.rst), unrelated to this PR.

The CI test runs use `--cov=aiohttp/ --cov=tests/`, so uncovered
lines in `tests/` show up in the codecov patch report alongside
uncovered lines in `aiohttp/`. Spell out the common shapes that
trip agents up (defensive `raise` inside a monkeypatched stub,
one-sided cleanup branches behind `if had_own_attr:`) and the
patterns that keep tests fully covered, with a pointer to
yarl#1687 as the canonical example of the failure mode.
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label May 17, 2026
CI runs `make doc-spelling` under `-W --keep-going` and treats
unknown words as hard failures, including every `CHANGES/*.rst`
fragment in the build. Spell out the pre-push step and the
wordlist policy so a missing technical word does not burn a CI
run. Adds `codecov` to `docs/spelling_wordlist.txt` for the
fragment from the previous commit.
@bdraco bdraco changed the title Document in AGENTS.md that the coverage report covers tests Document agent pitfalls in AGENTS.md: test coverage and docs spell check May 17, 2026
@bdraco bdraco marked this pull request as ready for review May 17, 2026 04:14
@bdraco bdraco requested review from asvetlov and webknjaz as code owners May 17, 2026 04:14
@bdraco bdraco enabled auto-merge (squash) May 17, 2026 04:15
@bdraco bdraco added the backport:skip Skip backport bot label May 17, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.94%. Comparing base (5edd76f) to head (ed635cd).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12580   +/-   ##
=======================================
  Coverage   98.94%   98.94%           
=======================================
  Files         131      131           
  Lines       46683    46683           
  Branches     2421     2421           
=======================================
  Hits        46189    46189           
  Misses        369      369           
  Partials      125      125           
Flag Coverage Δ
Autobahn 22.45% <ø> (ø)
CI-GHA 98.90% <ø> (ø)
OS-Linux 98.66% <ø> (ø)
OS-Windows 97.02% <ø> (ø)
OS-macOS 97.92% <ø> (ø)
Py-3.10.11 97.41% <ø> (+<0.01%) ⬆️
Py-3.10.20 97.90% <ø> (ø)
Py-3.11.15 98.15% <ø> (-0.01%) ⬇️
Py-3.11.9 97.67% <ø> (ø)
Py-3.12.10 97.76% <ø> (ø)
Py-3.12.13 98.24% <ø> (ø)
Py-3.13.13 98.45% <ø> (-0.01%) ⬇️
Py-3.14.4 97.69% <ø> (ø)
Py-3.14.5 98.20% <ø> (+<0.01%) ⬆️
Py-3.14.5t 97.54% <ø> (-0.01%) ⬇️
Py-pypy3.11.15-7.3.22 97.40% <ø> (-0.02%) ⬇️
VM-macos 97.92% <ø> (ø)
VM-ubuntu 98.66% <ø> (ø)
VM-windows 97.02% <ø> (ø)
cython-coverage 37.91% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco bdraco disabled auto-merge May 17, 2026 04:40
@bdraco bdraco merged commit ac79b7b into aio-libs:master May 17, 2026
42 of 43 checks passed
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 17, 2026

Merging this PR will improve performance by 12.45%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 13 improved benchmarks
✅ 59 untouched benchmarks
⏩ 69 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
test_resolve_root_route_with_many_fixed_routes 1,078.4 µs 951.8 µs +13.3%
test_resolve_dynamic_resource_url_with_many_dynamic_routes 4 ms 3.7 ms +8.56%
test_resolve_dynamic_resource_url_with_many_dynamic_routes_with_common_prefix 293.3 ms 252.9 ms +16%
test_resolve_dynamic_resource_url_with_many_static_routes 4 ms 3.7 ms +8.15%
test_resolve_gitapi 338.3 ms 301.7 ms +12.12%
test_resolve_gitapi_root 2.5 ms 2.2 ms +14.63%
test_resolve_gitapi_subapps 340.9 ms 302.8 ms +12.59%
test_resolve_multiple_fixed_url_with_many_routes 2.7 ms 2.4 ms +13.49%
test_resolve_multiple_level_fixed_url_with_many_routes 10.6 ms 9.2 ms +14.76%
test_resolve_prefix_resources_many_prefix_many_plain 5.4 ms 4.9 ms +9.38%
test_resolve_root_route 1,075.5 µs 942.7 µs +14.09%
test_resolve_single_fixed_url_with_many_routes 1,081.6 µs 955.9 µs +13.15%
test_resolve_static_root_route 1.2 ms 1.1 ms +11.9%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing bdraco:agents-md-test-coverage (ed635cd) with master (5edd76f)

Open in CodSpeed

Footnotes

  1. 69 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip Skip backport bot bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant