Skip to content

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

Merged
aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
milk4sale:fix/ignore-rpfpreview-index-cache
Nov 25, 2026
Merged

aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
milk4sale:fix/ignore-rpfpreview-index-cache

Conversation

@milk4sale

Copy link
Copy Markdown
Contributor

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

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 <noreply@anthropic.com>

@abnalstlll-byte abnalstlll-byte 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.

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 abnalstlll-byte 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.

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

Brings the branch up to date with main 68d1331. 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 ProjectLeonida#930).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@aslan2142
aslan2142 merged commit 5a5df8e into ProjectLeonida:main Nov 25, 2026
2 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator

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

  • Claim: claiming: REPO-RPFPREVIEW-CACHE-IGNORE in Coordinating who works on what #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).

@milk4sale

Copy link
Copy Markdown
Contributor Author

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).

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.

3 participants