From 0c6deccf342527100fed79349dda5307c875fd9b Mon Sep 17 00:00:00 2001 From: tier940 Date: Thu, 6 Aug 2026 13:35:18 +0900 Subject: [PATCH 1/2] chore: add CodeRabbit config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Successor to the removed Gemini Code Assist / Claude PR review setups. - knowledge_base.mcp.usage: enabled — 'auto' disables MCP for public repositories, which would prevent the DeepWiki MCP server from being used as review context. - reviews.path_instructions: give the reviewer the GTCEu context it needs. This repo is a GregTech CE: Unofficial add-on, and reviews are imprecise without knowledge of the GTCEu codebase, the 1.12.2/Java 8 platform constraints, and the mixin targets. --- .coderabbit.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..61ccaad8 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,44 @@ +knowledge_base: + mcp: + # "auto" disables MCP for public repositories, so set it explicitly. + # This is what allows the DeepWiki MCP server to be used as review context. + usage: enabled + +reviews: + path_instructions: + - path: "src/main/java/**/*.java" + instructions: | + Minecraft 1.12.2 Forge mod (GTExpert-Core), an add-on for + GregTech CE: Unofficial (GTCEu, https://github.com/GregTechCEu/GregTech). + Hard dependency: `gregtech:gregtech:2.8.10-beta`. + + GTCEu context — use DeepWiki (GregTechCEu/GregTech) to verify: + - Confirm GTCEu APIs, registries and helper classes are used correctly, and that + referenced methods/fields actually exist in the pinned GTCEu version. + - Flag use of GTCEu internals that are not part of its public API when a public + equivalent exists. + - Recipe registration, material/OrePrefix usage and MetaTileEntity registration + must follow GTCEu conventions. Check ID collisions where relevant. + + Platform constraints (1.12.2 / Java 8 bytecode): + - Do NOT suggest Java APIs or language features unavailable on this platform + (e.g. `List.of`, `var` in this codebase, records, switch expressions, text blocks). + - Do NOT suggest modern Minecraft/Forge APIs; this is the 1.12.2 Forge line. + + Side boundary: + - Flag client-only types or `@SideOnly(Side.CLIENT)` members referenced from + common/server code paths — this crashes a dedicated server. + + Mixins (`core/mixins/`, configs `mixins.gtexpert.*.json`): + - Verify the target class, method signature and descriptor plausibly exist in the + targeted mod (gregtech, gcym, draconicevolution, draconicadditions). + - Injection points must be specific enough not to break on minor upstream changes. + - Any new mixin must be registered in the matching `mixins.gtexpert.*.json`. + + Integration modules (`integration/`, `modules/`): + - Optional mod integrations must be gated (`Loader.isModLoaded()` or the module + system's `modDependencies`) so a missing optional mod cannot crash the game. + + Build: + - `build.gradle` is auto-generated. Never edit it + (configure via `buildscript.properties` / `dependencies.gradle`). From 041241d0a94c24873aa0e9ad18a356fc4360d234 Mon Sep 17 00:00:00 2001 From: tier940 Date: Thu, 6 Aug 2026 14:29:48 +0900 Subject: [PATCH 2/2] chore: add ASM class transformer guidance to path_instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GTECoreMod (IFMLLoadingPlugin) registers NAE2PatchTransformer, an IClassTransformer that rewrites bytecode directly via the ASM tree API. This is a different and riskier mechanism than the existing Mixin guidance — a wrong field/method name fails silently or crashes at class-load time instead of compile time. Call it out explicitly. --- .coderabbit.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 61ccaad8..cb5da171 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -35,6 +35,19 @@ reviews: - Injection points must be specific enough not to break on minor upstream changes. - Any new mixin must be registered in the matching `mixins.gtexpert.*.json`. + ASM class transformers (`core/GTECoreMod.java` as `IFMLLoadingPlugin`, + `getASMTransformerClass()`, and `IClassTransformer` implementations such as + `NAE2PatchTransformer`): + - These patch bytecode directly (ASM tree API), with no compile-time check against + the target class — a wrong field/method name or descriptor fails silently or + crashes at class-load time instead of at compile time. Review changes here with + extra scrutiny. + - Confirm the transformer only touches the intended target class name and that any + new transformer is registered in `getASMTransformerClass()`. + - Flag any transformer logic that assumes a target field/method exists without a + null/absence check, since upstream mods can rename or remove members between + versions (this is literally why `NAE2PatchTransformer` exists). + Integration modules (`integration/`, `modules/`): - Optional mod integrations must be gated (`Loader.isModLoaded()` or the module system's `modDependencies`) so a missing optional mod cannot crash the game.