Skip to content

docs(agents): the MuJoCo GL pin is cited by the name the test defines - #3653

Merged
cagataycali merged 2 commits into
strands-labs:mainfrom
cagataycali:fix/agents-md-test-citations-resolve
Sep 15, 2026
Merged

cagataycali merged 2 commits into
strands-labs:mainfrom
cagataycali:fix/agents-md-test-citations-resolve

Conversation

@cagataycali

Copy link
Copy Markdown
Member

What

Two citations of test_no_module_scope_windowed_gl_default - the Pinned by line in AGENTS.md and a :func: role in tests/test_examples_mujoco_gl.py's own module docstring - now spell the name the file defines, test_no_module_scope_platform_bound_gl_default. A new grader, tests/test_agents_md_pinned_by_citations_resolve.py, holds every path::Name coordinate in AGENTS.md to that rule.

Why

The test was renamed when its rule was widened from the windowed pair (cgl, glfw) to every platform-bound backend, and the two citations were not. The Pinned by coordinate is what a reader copies into pytest to run the pin, so as it stood the rule read as enforced while the pin it named could not be run:

$ pytest tests/test_examples_mujoco_gl.py::test_no_module_scope_windowed_gl_default
ERROR: not found: .../tests/test_examples_mujoco_gl.py::test_no_module_scope_windowed_gl_default

Measured over AGENTS.md at 0b93bc2a: 16 path::Name coordinates, 15 resolving and this one not.

The bare :func: role in the test module is out of scope for tests/test_docstring_xref_roles_resolve.py by that grader's own design (a bare name has no decidable target in general - measured here, 566 of 4199 bare roles across the graded trees name a sibling class's method or a cross-module class, so widening it would be noise). A path::Name pair is decidable, because the path names the file to read, which is why the pin lives in a separate grader rather than in that one.

How the pin works

  • The graded set is derived from AGENTS.md itself (regex over <path>.py::<Name>), so a coordinate added later is graded without editing the test.
  • Resolution reads the cited file's AST rather than importing it, so a pin whose module needs an optional extra is still graded.
  • A dotted Class.method resolves segment by segment through direct bodies; a single segment is accepted at any depth, because AGENTS.md also cites a nested function (simulation.py::_job) as a reading coordinate.
  • Reports the line, the coordinate, and which half failed (missing file / no such definition / file does not parse).

Verification

  • New grader: 18 passed. Mutation: reverting the AGENTS.md fix fails test_every_citation_resolves naming line 2288 and the stale name; planting a nonexistent file and a nonexistent name fails naming each.
  • Whole-tree graders (scripts/check_whole_tree_graders.py roster, 145 modules) run on this branch and on main in the same environment: 61 failed / 4310 passed / 151 errors on both, identical failure sets - all absent-extra (lerobot, mujoco), none attributable to this change.
  • ruff check, ruff format --check, mypy clean on the touched files.
  • Intake: check_merge_base_overlap.py --paths reports no open pull request editing a behaviour-bearing path in this set (fix(simulation/isaac): Isaac Sim backend #3343 shares AGENTS.md as prose only, +1 line elsewhere in the file).

Review rounds

  • Round 0: opened as draft; fragment pushed before marking ready (AGENTS.md PR Workflow step 3).

strands-robots added 2 commits September 15, 2026 01:59
AGENTS.md closes its module-scope MUJOCO_GL rule with a Pinned by line
naming tests/test_examples_mujoco_gl.py::test_no_module_scope_windowed_gl_default,
and that test module's own docstring names the same function in a :func:
role. Neither resolves: the test was renamed
test_no_module_scope_platform_bound_gl_default when its rule was widened
from the windowed pair to every platform-bound backend, and the two
citations were not. A reader who copies the coordinate into pytest gets
"not found"; a reader who greps the docstring's name finds nothing.

Both citations now spell the name the file defines.

Measured over AGENTS.md at 0b93bc2: 16 path::Name coordinates, 15
resolving and this one not. The new grader derives that set from
AGENTS.md itself and resolves each against the cited file's AST - no
import, so a pin whose module needs an optional extra is still graded -
and reports the line, the coordinate and which half failed. The bare
:func: role is out of scope for tests/test_docstring_xref_roles_resolve.py
by design (a bare name has no decidable target in general); a path::Name
pair does, because the path names the file to read.

Whole-tree graders: 61 failed / 4310 passed / 151 errors on both this
branch and main in the same environment, identical failure sets (all
absent-extra: lerobot, mujoco). ruff, ruff format and mypy clean on the
touched files.
@cagataycali
cagataycali marked this pull request as ready for review September 15, 2026 02:00

@yinsong1986 yinsong1986 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.

Summary

Fixes a stale test citation in two places - the Pinned by line in AGENTS.md and the :func: role in tests/test_examples_mujoco_gl.py's module docstring - both of which named test_no_module_scope_windowed_gl_default after the test had been renamed test_no_module_scope_platform_bound_gl_default, and adds tests/test_agents_md_pinned_by_citations_resolve.py to hold every path::Name coordinate in AGENTS.md to resolvability. Verified against the head commit: the renamed test exists at tests/test_examples_mujoco_gl.py:270, no other citation of the old name survives outside provenance notes, the new grader passes on the head tree (18 passed), and its regex sweep collects all 16 path::Name coordinates in AGENTS.md with every one resolving - including the nested-function (simulation.py::_job) and dotted-class cases the resolver claims to handle.

What's good

  • The graded set is derived from AGENTS.md itself, so a coordinate added later is graded without editing the test (the derived-roster convention from PR Workflow step 2).
  • Resolution reads the cited file's AST rather than importing it, so pins whose modules need optional extras are still graded, and test_the_graded_set_is_not_empty guards against the regex silently matching nothing.
  • Test names describe behaviour rather than provenance, new files are ASCII-only, and the changelog fragment landed in the same push as the diff (step 3's timing rule).

@cagataycali
cagataycali enabled auto-merge (squash) September 15, 2026 02:11
@cagataycali
cagataycali merged commit aa7569e into strands-labs:main Sep 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants