Skip to content

Commit e508d2b

Browse files
committed
docs: document patched-JAR design + CI suite in CLAUDE.md
1 parent 7cde663 commit e508d2b

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,25 @@ Tests the entire pipeline end-to-end:
208208
npm test # Runs all integration tests
209209
```
210210

211+
### Patched-JAR Suite (`__tests__/manual/patched/`)
212+
213+
Env-driven E2E suite that exercises the full patched-MC pipeline (decompile/extract → get_minecraft_source → search → index → vanilla-vs-patched compare → force re-run). Skips cleanly when `PATCHED_JAR_PATH` is unset.
214+
215+
CI generates real patched JARs via `.github/workflows/patched-jars.yml`:
216+
- NeoForge matrix (1.20.4, 1.21.1, 1.21.4) via NeoFormRuntime (`nfrt run --dist joined --neoforge ...:userdev`)
217+
- Forge 1.20.1 via a tiny ForgeGradle 6 fixture project (`gradle eclipse` triggers lazy materialization — FG6 has no equivalent of FG5's `setupDecompWorkspace`)
218+
219+
Triggered on `workflow_dispatch` and on main pushes that touch the patched-JAR surface. Out of default PR CI to keep it fast.
220+
221+
Local run against your own JAR:
222+
```bash
223+
PATCHED_JAR_PATH=/path/to/patched.jar \
224+
PATCHED_VERSION=1.21.1-neoforge-21.1.72 \
225+
PATCHED_MC_VERSION=1.21.1 \
226+
PATCHED_LOADER=neoforge \
227+
npm run test:manual:patched
228+
```
229+
211230
## Common Tasks
212231

213232
### Adding Support for a New Mapping Type
@@ -270,6 +289,12 @@ The code should work automatically, but be aware:
270289
- Compact and efficient
271290
- Well-supported by tools
272291

292+
### Patched MC JARs (Forge/NeoForge) — opaque version key
293+
For `decompile_minecraft_version` with `jarPath`, the `version` parameter is treated as an opaque cache-key string (convention: `<mc>-<loader>-<loaderVersion>`). No parsing — the same key flows unchanged through `getDecompiledPath`, the cache DB, the FTS5 index, and every downstream tool. This is why patched MC slots into the existing `decompiled/{version}/{mapping}/` layout with zero new code paths in search/index/compare. `find_mapping` is the one exception: it strips the loader suffix via `stripPatchedVersion` so tinyfile lookups still resolve to the vanilla MC's mapping data.
294+
295+
### Sources-vs-compiled detection (`src/utils/jar-inspector.ts`)
296+
Deterministic central-directory scan: any `.class` entry → decompile via VineFlower; else any `.java` → extract directly (NFRT/ForgeGradle `-sources.jar` fast path); else error. Mixed JARs always decompile (any `.class` wins). Avoids filename heuristics, which Forge/NeoForge dev artifacts don't reliably follow.
297+
273298
## Troubleshooting
274299

275300
### "Class not found" errors during registry extraction

0 commit comments

Comments
 (0)