Ignore rpf9-explorer's index cache when it lands in the checkout #1089

Manually merged
github merged 2 commits from gh-pr/1089/head into gh-pr/1089/base 2026-11-26 09:37:33 +00:00
Owner

@⁠milk4sale on GitHub · 2026-11-24 18:14 UTC · original
milk4sale:fix/ignore-rpfpreview-index-cache → main · +8 −0 · 2 files · 2 commits · merged 2026-11-25 01:22 UTC

Claimed in the coordination issue as: REPO-RPFPREVIEW-CACHE-IGNORE

What and why

  • .gitignore: ignore RpfPreview/.
  • docs/design.md ("Full-scan indexes"): say where the index goes on Linux and when it lands in the current directory.

rpf9dump models and rpf9dump textures save a full-scan index through RecoveryIndexCache in third_party/rpf9-explorer. Its path starts with Environment.GetFolderPath(SpecialFolder.LocalApplicationData), and on Linux .NET returns an empty string for that when the folder does not exist. The index is then written to RpfPreview/Indexes/ under the current directory. Run from the repository root, that leaves an untracked JSON file with the archive's full path and the names of its recovered entries, which is game data under the first hard rule in AGENTS.md.

Measured on Linux x64 with .NET SDK 10.0.114 and runtime 10.0.14, rpf9dump built from main with the submodule at e2939175. The source is a 64 KiB file of zeros, so no game file is needed; the index is written with 0 entries.

Case Index written to
XDG_DATA_HOME points at a missing folder ./RpfPreview/Indexes/models-<hash>.json
XDG_DATA_HOME unset, home folder without .local/share ./RpfPreview/Indexes/models-<hash>.json
XDG_DATA_HOME points at an existing folder <that folder>/RpfPreview/Indexes/models-<hash>.json; nothing in the current directory

I first saw this with a real archive, where the index listed the recovered entry names. That file is deleted and not attached.

Neither check catches such a file today:

  • python -I scripts/check_no_game_data.py <index> exits 0. It matches format magics at the start of a file, and the index is JSON.
  • The extension list in .github/workflows/no-game-data.yml has no .json.

Follow-ups, not in this change:

  • tools/rpf9dump could create the data folder at start, so the index never lands in the current directory.
  • scripts/check_no_game_data.py could flag a tracked file that starts with {"Schema":"rpfpreview-payload-index/.

Tested

  • git check-ignore -v RpfPreview/Indexes/<name>.json matches the new rule, at the root and in a subfolder.
  • git ls-files -ci --exclude-standard is empty: no tracked file becomes ignored.
  • python -I tests/test_docs_*.py (12 files) and python -I tests/test_text_write_line_endings.py pass.
  • python -I scripts/check_no_game_data.py .gitignore docs/design.md exits 0.

GPUs tested: n/a

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a: no translator rule)

🤖 Generated with Claude Code

**@⁠milk4sale** on GitHub · 2026-11-24 18:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1089) `milk4sale:fix/ignore-rpfpreview-index-cache` → `main` · +8 −0 · 2 files · 2 commits · merged 2026-11-25 01:22 UTC Claimed in the coordination issue as: REPO-RPFPREVIEW-CACHE-IGNORE ### What and why - `.gitignore`: ignore `RpfPreview/`. - `docs/design.md` ("Full-scan indexes"): say where the index goes on Linux and when it lands in the current directory. `rpf9dump models` and `rpf9dump textures` save a full-scan index through `RecoveryIndexCache` in `third_party/rpf9-explorer`. Its path starts with `Environment.GetFolderPath(SpecialFolder.LocalApplicationData)`, and on Linux .NET returns an empty string for that when the folder does not exist. The index is then written to `RpfPreview/Indexes/` under the current directory. Run from the repository root, that leaves an untracked JSON file with the archive's full path and the names of its recovered entries, which is game data under the first hard rule in `AGENTS.md`. Measured on Linux x64 with .NET SDK 10.0.114 and runtime 10.0.14, `rpf9dump` built from `main` with the submodule at `e2939175`. The source is a 64 KiB file of zeros, so no game file is needed; the index is written with 0 entries. | Case | Index written to | |---|---| | `XDG_DATA_HOME` points at a missing folder | `./RpfPreview/Indexes/models-<hash>.json` | | `XDG_DATA_HOME` unset, home folder without `.local/share` | `./RpfPreview/Indexes/models-<hash>.json` | | `XDG_DATA_HOME` points at an existing folder | `<that folder>/RpfPreview/Indexes/models-<hash>.json`; nothing in the current directory | I first saw this with a real archive, where the index listed the recovered entry names. That file is deleted and not attached. Neither check catches such a file today: - `python -I scripts/check_no_game_data.py <index>` exits 0. It matches format magics at the start of a file, and the index is JSON. - The extension list in `.github/workflows/no-game-data.yml` has no `.json`. Follow-ups, not in this change: - `tools/rpf9dump` could create the data folder at start, so the index never lands in the current directory. - `scripts/check_no_game_data.py` could flag a tracked file that starts with `{"Schema":"rpfpreview-payload-index/`. ### Tested - `git check-ignore -v RpfPreview/Indexes/<name>.json` matches the new rule, at the root and in a subfolder. - `git ls-files -ci --exclude-standard` is empty: no tracked file becomes ignored. - `python -I tests/test_docs_*.py` (12 files) and `python -I tests/test_text_write_line_endings.py` pass. - `python -I scripts/check_no_game_data.py .gitignore docs/design.md` exits 0. GPUs tested: n/a AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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. (n/a: no translator rule) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
rpf9dump models and rpf9dump textures save a full-scan index through
RecoveryIndexCache in third_party/rpf9-explorer. On Linux, when the local
application-data folder does not exist, .NET returns an empty path for it
and the index is written to RpfPreview/Indexes under the current directory.
The index holds the archive's full path and the names of its recovered
entries, so from the repository root it is untracked game data.

Ignore RpfPreview/ and say in docs/design.md where the index goes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Brings the branch up to date with main 68d1331e5. No conflicts; the merged tree was tested before the push (every standalone
test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since #930).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:37:31 +00:00
github manually merged commit 271d72bf20 into gh-pr/1089/base 2026-11-26 09:37:33 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 18:42 UTC · original · approved these changes

Audited and verified. Adds RpfPreview/ to .gitignore and documents Linux fallback path behavior in docs/design.md, preventing accidental git staging of cached archive listings and entry names. Approved.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 18:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1089#pullrequestreview-6045231583) · **approved these changes** Audited and verified. Adds RpfPreview/ to .gitignore and documents Linux fallback path behavior in docs/design.md, preventing accidental git staging of cached archive listings and entry names. Approved.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 18:50 UTC · original · approved these changes

Clean-Room Audit — PR #1089 (.gitignore RpfPreview/)

Essential clean-room safeguard: ignoring RpfPreview/ prevents accidental commits of rpf9-explorer's full-scan index cache (which records full archive paths and entry names), and documenting $XDG_DATA_HOME behavior in docs/design.md helps Linux contributors keep caches out of the checkout.

Verdict: APPROVED

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 18:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1089#pullrequestreview-6045347797) · **approved these changes** ### Clean-Room Audit — PR #1089 (`.gitignore` `RpfPreview/`) Essential clean-room safeguard: ignoring `RpfPreview/` prevents accidental commits of `rpf9-explorer`'s full-scan index cache (which records full archive paths and entry names), and documenting `$XDG_DATA_HOME` behavior in `docs/design.md` helps Linux contributors keep caches out of the checkout. **Verdict: APPROVED**
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 01:22 UTC · original

Merged. Thank you, @⁠milk4sale: this keeps a game-derived index out of git status.

  • Claim: claiming: REPO-RPFPREVIEW-CACHE-IGNORE in #14 at 18:13:49 UTC, before this PR opened at 18:14:18, by the author and unedited: valid. No other claim or open PR for it.
  • Where the file comes from: RecoveryIndexCache.CachePath in rpf9-explorer at e2939175 builds the path from LocalApplicationData, which .NET returns as an empty string on Linux when that folder is missing, so the index lands in ./RpfPreview/Indexes/ under the current directory.
  • The pattern: RpfPreview/ matches that directory at any depth (checked with git check-ignore -v), and not RpfPreview.* files or other casings. Any depth is right, since the current directory can be anywhere in the checkout.
  • No tracked file hidden: git ls-files -i --exclude-standard -c on the merge is empty, and no tracked path contains RpfPreview.
  • docs/design.md: the lines sit in "Full-scan indexes" and say why the index is game data.
  • Checked on main cc22b7d4f + 271d72bf2: the semantic suite passes (476 files, 6,223 tests, 0 files failed); the 14 docs and writer tests pass; check_no_game_data.py is clean on the 2 changed files.
  • CI had not finished on this head.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 01:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1089#issuecomment-7149478484) Merged. Thank you, @⁠milk4sale: this keeps a game-derived index out of `git status`. - **Claim:** `claiming: REPO-RPFPREVIEW-CACHE-IGNORE` in #14 at 18:13:49 UTC, before this PR opened at 18:14:18, by the author and unedited: valid. No other claim or open PR for it. - **Where the file comes from:** `RecoveryIndexCache.CachePath` in `rpf9-explorer` at `e2939175` builds the path from `LocalApplicationData`, which .NET returns as an empty string on Linux when that folder is missing, so the index lands in `./RpfPreview/Indexes/` under the current directory. - **The pattern:** `RpfPreview/` matches that directory at any depth (checked with `git check-ignore -v`), and not `RpfPreview.*` files or other casings. Any depth is right, since the current directory can be anywhere in the checkout. - **No tracked file hidden:** `git ls-files -i --exclude-standard -c` on the merge is empty, and no tracked path contains `RpfPreview`. - **`docs/design.md`:** the lines sit in "Full-scan indexes" and say why the index is game data. - **Checked on `main` `cc22b7d4f` + `271d72bf2`:** the semantic suite passes (476 files, 6,223 tests, 0 files failed); the 14 docs and writer tests pass; `check_no_game_data.py` is clean on the 2 changed files. - **CI had not finished on this head.** AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠milk4sale on GitHub · 2026-11-25 02:55 UTC · original

Local stand-in for this pull request's CI, which has been queued here since 22:31 UTC (about 580 runs waiting).

Tested: 271d72bf2 merged with main b4b7756e8 (2026-11-25 01:13 UTC), in one tree together with #1087, #1090, #1114, #413, next to main alone. The trees came from git merge-tree, and nothing was pushed. Each job used the workflow's own selection from ci.yml and runtime.yml.

Job main + the five pull requests main alone
check steps: compileall, make_game.py --help pass pass
stdlib-tests-linux (every standalone file, run to the end) 492 of 492 pass 491 of 491 pass
translator-tests (pytest files) 1,890 pass, 2 fail 1,886 pass, the same 2 fail
viewer-tests pass pass
semantic-tests 477 files, 6,231 tests, 0 failed
linux-gpu-tools: ctest 76 of 76 pass
linux-gpu-tools: run_gpu_tests.py, plain, LEONIDA_W64_EMULATE=1 --filter cs_, LEONIDA_BARY_FALLBACK=1 0 failures on lavapipe, 0 on the RTX 4070 Ti
no-game-data: scripts/check_no_game_data.py on this pull request's files clean

The .gitignore and docs/design.md change: every standalone file passes, tests/test_docs_*.py included.

The two pytest failures are main's: tests/test_translate.py on the text-only fixture cs_dpp_cmp.asm (test_gpu_samples_translate_and_validate, test_wave64_emulate_uses_no_subgroup_ops). With #1375 applied, both pass.

Not covered: the Windows and macOS jobs.

Setup: Linux (CachyOS), Python 3.14.10 (CI uses 3.12), llvm-mc 23.1.4 (CI uses 19), Node 26.13.1. GPU suite on lavapipe from Mesa 26.2.6 with GALLIUM_OVERRIDE_CPU_CAPS=avx, the code path of CI's runners, which lack AVX-512; and on an RTX 4070 Ti, NVIDIA 620.70.06.

AI-assisted (Claude Code).

**@⁠milk4sale** on GitHub · 2026-11-25 02:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1089#issuecomment-7151356086) Local stand-in for this pull request's CI, which has been queued here since 22:31 UTC (about 580 runs waiting). Tested: `271d72bf2` merged with `main` `b4b7756e8` (2026-11-25 01:13 UTC), in one tree together with #1087, #1090, #1114, #413, next to `main` alone. The trees came from `git merge-tree`, and nothing was pushed. Each job used the workflow's own selection from `ci.yml` and `runtime.yml`. | Job | `main` + the five pull requests | `main` alone | |---|---|---| | `check` steps: compileall, `make_game.py --help` | pass | pass | | `stdlib-tests-linux` (every standalone file, run to the end) | 492 of 492 pass | 491 of 491 pass | | `translator-tests` (pytest files) | 1,890 pass, 2 fail | 1,886 pass, the same 2 fail | | `viewer-tests` | pass | pass | | `semantic-tests` | 477 files, 6,231 tests, 0 failed | | | `linux-gpu-tools`: ctest | 76 of 76 pass | | | `linux-gpu-tools`: `run_gpu_tests.py`, plain, `LEONIDA_W64_EMULATE=1 --filter cs_`, `LEONIDA_BARY_FALLBACK=1` | 0 failures on lavapipe, 0 on the RTX 4070 Ti | | | `no-game-data`: `scripts/check_no_game_data.py` on this pull request's files | clean | | The `.gitignore` and `docs/design.md` change: every standalone file passes, `tests/test_docs_*.py` included. The two pytest failures are `main`'s: `tests/test_translate.py` on the text-only fixture `cs_dpp_cmp.asm` (`test_gpu_samples_translate_and_validate`, `test_wave64_emulate_uses_no_subgroup_ops`). With #1375 applied, both pass. Not covered: the Windows and macOS jobs. Setup: Linux (CachyOS), Python 3.14.10 (CI uses 3.12), llvm-mc 23.1.4 (CI uses 19), Node 26.13.1. GPU suite on lavapipe from Mesa 26.2.6 with `GALLIUM_OVERRIDE_CPU_CAPS=avx`, the code path of CI's runners, which lack AVX-512; and on an RTX 4070 Ti, NVIDIA 620.70.06. AI-assisted (Claude Code).
This discussion has been locked. Commenting is limited to contributors.
No description provided.