docs: AGENTS.md, the repository guidelines for AI coding assistants #820

Merged
abilliontokens merged 1 commit from upstream-pr/820 into main 2026-11-29 08:16:58 +00:00
abilliontokens commented 2026-11-28 07:02:56 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by abilliontokens on 2026-11-28T07:02:56Z.


What this adds

AGENTS.md at the root, titled "Repository Guidelines" (109 lines, documentation only): what an AI coding assistant needs before changing this tree — what the project is, how the crates fit together, the commands CI runs, the code conventions, the tooling constraints, the tests, and the asset policy as it meets a change. No source, manifest or lockfile is touched.

Why it says what it says

It is written for what an assistant would otherwise get wrong, not for what the directory listing already shows:

  • console "objects" are function-table structs, not COM objects (victory-gpu/src/object.rs);
  • VICTORY_* switches are read through toggled!/asked_for! and cached once per process (victory-gpu/src/switch.rs);
  • there is no cargo fmt gate and the tree is far from rustfmt-clean (3777 diff hunks), so a reflexive format buries a change;
  • cargo test --workspace never compiles victory-gpu/tests/replay*.rs (they need the diagnostics feature);
  • a Cargo.lock change empties every user's shader cache (VICTORY_TRANSLATOR);
  • adding a console import is hle_export! in the module's module(), and registering nothing is what routes an import to the host, a title DLL or a stub.

How it was checked

Seven parallel read-only passes over the tree (GPU object model, GPU host runtime, shader translator and formats, loader/HLE/CLI, tests, build and policy, scripts and docs), every claim tied to path:line. Before opening this PR, the line references, function names, counts and the HLE recipe were checked against the sources they cite. That corrected four statements that were wrong (the number of mod.rs files, the HLE function signature, the name of the host-failure function, the ShaderError derivation), three line references that were off, and a few phrased more strongly than the code supports.

The figures were measured on 63b902f, each with its command in the file:

Figure Command Result
distinct VICTORY_* names grep -rhoE 'VICTORY_[A-Z0-9_]+' crates apps --include='*.rs' | sort -u | wc -l 482
#[test] functions grep -rh '#\[test\]' crates apps xtask --include='*.rs' | wc -l 1233
// SAFETY: comments grep -rc '// SAFETY:' crates apps --include='*.rs' 2444
rustfmt diff hunks cargo fmt --all -- --check 3777
asset policy cargo xtask policy 295 files ok

Not run

The clippy and test gates were not run locally for this change: nothing they inspect changed. CI runs them here as on any pull request.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5537691073 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/820). Originally posted by [abilliontokens](https://github.com/abilliontokens) on 2026-11-28T07:02:56Z. --- ## What this adds `AGENTS.md` at the root, titled "Repository Guidelines" (109 lines, documentation only): what an AI coding assistant needs before changing this tree — what the project is, how the crates fit together, the commands CI runs, the code conventions, the tooling constraints, the tests, and the asset policy as it meets a change. No source, manifest or lockfile is touched. ## Why it says what it says It is written for what an assistant would otherwise get wrong, not for what the directory listing already shows: - console "objects" are function-table structs, not COM objects (`victory-gpu/src/object.rs`); - `VICTORY_*` switches are read through `toggled!`/`asked_for!` and cached once per process (`victory-gpu/src/switch.rs`); - there is no `cargo fmt` gate and the tree is far from rustfmt-clean (3777 diff hunks), so a reflexive format buries a change; - `cargo test --workspace` never compiles `victory-gpu/tests/replay*.rs` (they need the `diagnostics` feature); - a `Cargo.lock` change empties every user's shader cache (`VICTORY_TRANSLATOR`); - adding a console import is `hle_export!` in the module's `module()`, and registering nothing is what routes an import to the host, a title DLL or a stub. ## How it was checked Seven parallel read-only passes over the tree (GPU object model, GPU host runtime, shader translator and formats, loader/HLE/CLI, tests, build and policy, scripts and docs), every claim tied to `path:line`. Before opening this PR, the line references, function names, counts and the HLE recipe were checked against the sources they cite. That corrected four statements that were wrong (the number of `mod.rs` files, the HLE function signature, the name of the host-failure function, the `ShaderError` derivation), three line references that were off, and a few phrased more strongly than the code supports. The figures were measured on `63b902f`, each with its command in the file: | Figure | Command | Result | |---|---|---| | distinct `VICTORY_*` names | `grep -rhoE 'VICTORY_[A-Z0-9_]+' crates apps --include='*.rs' \| sort -u \| wc -l` | 482 | | `#[test]` functions | `grep -rh '#\[test\]' crates apps xtask --include='*.rs' \| wc -l` | 1233 | | `// SAFETY:` comments | `grep -rc '// SAFETY:' crates apps --include='*.rs'` | 2444 | | rustfmt diff hunks | `cargo fmt --all -- --check` | 3777 | | asset policy | `cargo xtask policy` | 295 files ok | ## Not run The clippy and test gates were not run locally for this change: nothing they inspect changed. CI runs them here as on any pull request.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!820
No description provided.