feat: add validate_access_transformer tool#15
Merged
Conversation
Adds the validate_access_transformer MCP tool (Phase 2 #10a) for validating Forge/NeoForge access transformer .cfg files, which is mojmap-only per the Forge/NeoForge ecosystem. New access-transformer-service.ts parses all four line forms (class/field/method/constructor), all 12 modifier forms (4 access keywords x none/-f/+f), slash-to-dot normalization, field (*) and method *() wildcards, inline # comments, and collects hard parse errors with line numbers instead of throwing. Validation runs against decompiled source via tree-sitter AST: method overload matching by descriptor (with found-overload reporting), field existence by name with close-match suggestions, constructor <init>/<clinit> handling, override-narrowing warnings, record canonical-constructor crash detection, inner-class enclosing-accessibility checks, and cross-entry conflict detection. Supporting additions: suggestions.ts (similarity matching), descriptor-utils.ts (JVM descriptor parsing), errors.ts (AccessTransformerParseError), new types in minecraft.ts, a documentation topic resource in resources.ts, and a 677-line service test suite. Updates access-widener-service.ts to share the new descriptor/suggestion utilities. Docs (CLAUDE.md, AGENTS.md) and resource/tool-count tests updated accordingly.
The test called the raw MojangDownloader, which writes the JAR file to disk but never records it in cache.db. hasVersionJar() checks cache.db, so the test only passed when the CI pre-decompile step had already populated cache.db as a side effect (cold-cache runs). On warm-cache runs the pre-decompile step is a no-op and cache.db is not restored, so hasVersionJar() read an empty DB and the test failed. Route the test through VersionManager.getVersionJar(), which owns both the download (file + SHA verify) and the cache.db bookkeeping. This makes the test deterministic regardless of cache warmth or test order.
…se modifier conflicts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.