docs(agents): the MuJoCo GL pin is cited by the name the test defines - #3653
cagataycali merged 2 commits into
Conversation
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.
yinsong1986
left a comment
There was a problem hiding this comment.
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.mditself, 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_emptyguards 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).
What
Two citations of
test_no_module_scope_windowed_gl_default- thePinned byline inAGENTS.mdand a:func:role intests/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 everypath::Namecoordinate inAGENTS.mdto 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. ThePinned bycoordinate is what a reader copies intopytestto run the pin, so as it stood the rule read as enforced while the pin it named could not be run:Measured over
AGENTS.mdat0b93bc2a: 16path::Namecoordinates, 15 resolving and this one not.The bare
:func:role in the test module is out of scope fortests/test_docstring_xref_roles_resolve.pyby 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). Apath::Namepair 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
AGENTS.mditself (regex over<path>.py::<Name>), so a coordinate added later is graded without editing the test.Class.methodresolves segment by segment through direct bodies; a single segment is accepted at any depth, becauseAGENTS.mdalso cites a nested function (simulation.py::_job) as a reading coordinate.Verification
AGENTS.mdfix failstest_every_citation_resolvesnaming line 2288 and the stale name; planting a nonexistent file and a nonexistent name fails naming each.scripts/check_whole_tree_graders.pyroster, 145 modules) run on this branch and onmainin 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,mypyclean on the touched files.check_merge_base_overlap.py --pathsreports no open pull request editing a behaviour-bearing path in this set (fix(simulation/isaac): Isaac Sim backend #3343 sharesAGENTS.mdas prose only, +1 line elsewhere in the file).Review rounds