Skip to content

AGENTS.md: the translator suite's real runtime, the ctest step, and the rules an agent breaks - #6732

Merged
shayderrr merged 1 commit into
ItsNotRexed:mainfrom
phish32786:agents-doc-fixes
Nov 23, 2026
Merged

shayderrr merged 1 commit into
ItsNotRexed:mainfrom
phish32786:agents-doc-fixes

Conversation

@phish32786

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: no item ID — claimed as "AGENTS.md - real timings for the translator suite, the
runtime build/test commands aligned with CONTRIBUTING.md, which test files need pytest rather than python -I, the
newline="\n" writer rule" in
#6414 (comment)

Depends on: none. #6482 edits the viewer/ line of the same file, which this deliberately leaves alone; #4901 adds a
## Delegation and context section at the end, so whichever lands second has a small context conflict in
## Conventions.

What and why

AGENTS.md tells an agent what to run before it changes anything, so a wrong line there costs everyone's time:

  • "These need no game files and run in seconds" covers python -I scripts/run_semantic_tests.py tests/semantic,
    which is 433 files and 5 821 tests: 224 s with 16 jobs here. An agent that expects seconds treats a slow run as a
    hang, and one that expects the whole suite to be cheap runs it after every edit. The section now says what takes how
    long, and adds the one-file form
    python -m unittest discover -s tests/semantic -p test_<name>.py so iterating does not need the whole suite.
  • The runtime lines disagreed with CONTRIBUTING.md: AGENTS.md had
    cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo; cmake --build runtime/build,
    CONTRIBUTING.md has no generator plus --config RelWithDebInfo and a ctest run, which is what actually executes
    the tests. The ctest line was missing from AGENTS.md altogether. Added with the two facts an agent needs next to
    it: the retail-package tests print SKIP when LEONIDA_GAME_DIR is unset (so a green run may have tested nothing),
    Linux and macOS configure only the portable subset, and loader_test writes small PEs to
    %TEMP%\leonida_loader_test which antivirus can block.
  • "For pytest-based tests" did not say which tests those are. CONTRIBUTING.md does (files with import pytest, or
    no __main__ block — they fail to import under python -I), so it is one clause now instead of a guess.
  • The first hard rule had no tool: scripts/check_no_game_data.py matches the magics of the package's formats, so
    it catches a renamed file the extension check in .github/workflows/no-game-data.yml misses. One line points at it.
  • scripts/run_semantic_tests.py was not in the folder map; the claim lookup now has a fallback for when gh has no
    auth (an unauthenticated gh issue list prints a login hint and no issues, which reads as "nothing claimed"), and
    the newline="\n" writer rule that tests/test_text_write_line_endings.py enforces is restated in Conventions,
    since editing any tool's output writer is a common way to break it.

Docs-only: no code, no test, no runtime change.

Tested

Windows 11, Python 3.14, no GPU or driver needed, no game files, on origin/main at 1cc6e3c12 with this change
applied:

python -I tests/test_docs_cli_flags.py   -> Ran 3 tests, OK   (checks the gh/python/cmake/ctest flags the docs quote)
python -I tests/test_docs_links.py       -> Ran 7 tests, OK
python -I tests/test_docs_list_items.py  -> Ran 3 tests, OK
python -I tests/test_docs_python_deps.py -> Ran 3 tests, OK
python -I tests/test_docs_repo_paths.py  -> Ran 3 tests, OK
python -I tests/test_docs_pr_template.py -> Ran 2 tests, OK
python -I scripts/check_no_game_data.py AGENTS.md  -> clean
python -m compileall -q make_game.py tools tests   -> clean
git diff --check                                   -> clean

The timing in the new sentence is measured, not copied:
python -I scripts/run_semantic_tests.py tests/semantic on 1cc6e3c12 ->
433 files, 5821 tests, 0 files failed in 224 s with 16 jobs.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. — not applicable,
    no translator change.

AI-assisted: yes (Claude, driven by a coding-agent harness; every command above was run and its output checked).

… agent breaks

- "run in seconds" was wrong for the translator suite: 433 files and 5 821 tests
  take 224 s on 16 cores, so run one file while iterating and the suite once before
  the pull request. Add the one-file form with unittest discover -p.
- The runtime lines now match CONTRIBUTING.md: no -G Ninja, --config RelWithDebInfo,
  and the ctest run. Add the LEONIDA_GAME_DIR SKIP behaviour, the portable subset on
  Linux and macOS, and loader_test's %TEMP% folder that antivirus can block.
- Say which test files need pytest rather than python -I.
- Point at scripts/check_no_game_data.py from the no-game-data rule, name
  run_semantic_tests.py in the folder map, give a fallback for the claim lookup when
  gh has no auth, and restate the newline="\n" writer rule.

Leaves the viewer/ line to ItsNotRexed#6482.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

AGENTS.md refresh: lists run_semantic_tests.py and check_no_game_data.py under scripts/, documents the byte-sniffing no-game-data check and the no-gh-auth fallback, corrects build commands (cmake -S runtime -B runtime/build; cmake --build ... --config RelWithDebInfo; ctest ...), records the translator suite's real runtime (~224 s, 433 files, 5,821 tests) with a one-file example, and adds the newline-\n text-write rule.

Why merge

Agents following the old guidance would use stale cmake flags and badly underestimate suite time; the update makes contributor instructions match the repository.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

AGENTS.md refresh: lists run_semantic_tests.py and check_no_game_data.py under scripts/, documents the byte-sniffing no-game-data check and the no-gh-auth fallback, corrects build commands (cmake -S runtime -B runtime/build; cmake --build ... --config RelWithDebInfo; ctest ...), records the translator suite's real runtime (~224 s, 433 files, 5,821 tests) with a one-file example, and adds the newline-\n text-write rule.

Why merge

Agents following the old guidance would use stale cmake flags and badly underestimate suite time; the update makes contributor instructions match the repository.

Verdict: Approve

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