Skip to content

feat: add validate_access_transformer tool#15

Merged
GhostTypes merged 4 commits into
mainfrom
feat/access-transformer-support
Jul 2, 2026
Merged

feat: add validate_access_transformer tool#15
GhostTypes merged 4 commits into
mainfrom
feat/access-transformer-support

Conversation

@GhostTypes

Copy link
Copy Markdown
Contributor

No description provided.

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.
gemini-code-assist[bot]

This comment was marked as resolved.

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.
@GhostTypes GhostTypes self-assigned this Jul 2, 2026
@GhostTypes GhostTypes added the enhancement New feature or request label Jul 2, 2026
@GhostTypes
GhostTypes merged commit 56f08cf into main Jul 2, 2026
1 check passed
@GhostTypes
GhostTypes deleted the feat/access-transformer-support branch July 2, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant