Skip to content

[infra] Add AGENTS.md version freshness check#903

Merged
wenjin272 merged 1 commit into
apache:mainfrom
weiqingy:agents-md-freshness-check
Jul 15, 2026
Merged

[infra] Add AGENTS.md version freshness check#903
wenjin272 merged 1 commit into
apache:mainfrom
weiqingy:agents-md-freshness-check

Conversation

@weiqingy

Copy link
Copy Markdown
Collaborator

Linked issue: #894

Purpose of change

AGENTS.md quotes version facts that live authoritatively somewhere else: the supported Python range and the Ruff line length come from python/pyproject.toml, and the Java version comes from the root pom.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 if AGENTS.md no longer quotes it, and runs it as one step in the existing lint job. The script is regex-only and dependency-free, so it needs no build and adds no measurable CI time.

AGENTS.md is accurate on main today — 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-python upper bound <3.13 to <3.14 — fails, expecting 3.10 through 3.13.
  • Ruff line-length 88 to 100 — fails, expecting 100-character line length.
  • target.java.version 11 to 17 — fails, expecting Java 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-needed
  • doc-not-needed
  • doc-included

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.
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs fixVersion/0.4.0 priority/major Default priority of the PR or issue. labels Jul 14, 2026

@wenjin272 wenjin272 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenjin272 wenjin272 merged commit 640d47a into apache:main Jul 15, 2026
53 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs fixVersion/0.4.0 priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants