[infra] Add AGENTS.md version freshness check#903
Merged
Conversation
AGENTS.md quotes the supported Python range, the Ruff line length, and the Java version. Those facts live authoritatively in python/pyproject.toml and the root pom.xml, so the guide can drift silently when they are bumped. Add tools/check-agents-md.py, which derives each fact from its source and fails if AGENTS.md no longer quotes it, and run it in the existing lint job. The script is regex-only and dependency-free, so it needs no build step. AGENTS.md is accurate on main today; this prevents future drift rather than fixing a current mismatch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue: #894
Purpose of change
AGENTS.mdquotes version facts that live authoritatively somewhere else: the supported Python range and the Ruff line length come frompython/pyproject.toml, and the Java version comes from the rootpom.xml. Nothing ties the prose to those sources, so a routine bump can leave the guide quietly wrong, and a stale guide is worse than no guide because agents act on it.This adds
tools/check-agents-md.py, which derives each fact from its source and fails ifAGENTS.mdno longer quotes it, and runs it as one step in the existinglintjob. The script is regex-only and dependency-free, so it needs no build and adds no measurable CI time.AGENTS.mdis accurate onmaintoday — this prevents future drift rather than fixing a current mismatch.Tests
Run against current
main: passes.Each of the three facts was then bumped in isolation to confirm the check is actually load-bearing rather than passing vacuously:
requires-pythonupper bound<3.13to<3.14— fails, expecting3.10 through 3.13.line-length88to100— fails, expecting100-character line length.target.java.version11to17— fails, expectingJava 17.The script also exits non-zero if a source pattern cannot be found at all, so a future rename of the underlying option surfaces as a failure instead of a silent pass.
API
No. Tooling and CI only; no production code is touched.
Documentation
doc-neededdoc-not-neededdoc-included