The Go module supports parse + print + GetObject + InstallRecipes + Reset over RPC. All 15 integration tests pass (helloWorld, structs, slices, interfaces, for/range loops, switch, channels, maps, etc.). The recipe bundle resolver infrastructure (GolangRecipeBundleResolver/GolangRecipeBundleReader) is wired up on the Java side with stub handling on the Go side.
The Go RPC server needs to handle GetMarketplace requests so Java can discover what recipes the Go process has available. Python/JS servers return a GetMarketplaceResponse containing recipe descriptors organized by category.
Handle PrepareRecipe requests to instantiate a recipe with options. This is how the Java host asks the Go process to create a configured recipe instance ready for execution.
Handle Visit requests — the core recipe execution path. Java sends a tree ID and a prepared recipe ID; the Go server applies the visitor and returns the modified tree. This requires bidirectional RPC (Go calls back to Java's GetObject to fetch the tree, applies the visitor, then Java calls GetObject to get the result).
Handle Generate requests for recipes that create new source files rather than modifying existing ones.
Handle ParseProject for bulk project parsing. Java sends a project directory path; Go discovers and parses all .go files, resolving the module structure (go.mod). Python/JS have 3 overloads supporting exclusion patterns and relative path configuration.
Handle TraceGetObject to toggle verbose RPC message tracing for debugging.
The current InstallRecipes handler is a stub. It needs to:
- For local paths: discover and load Go recipe plugins from a local module
- For package specs: fetch a Go module from a Git repository, build it, and load its recipes
- Return accurate
recipesInstalledcount and resolvedversion
Build the Go-side recipe/visitor infrastructure so Go recipes can be authored:
- Recipe interface/struct (name, description, options, visitor factory)
- Visitor base types for Go AST traversal
- Recipe registration/discovery mechanism
- Marketplace integration (expose registered recipes via GetMarketplace)
Add parseProject() methods to GoRewriteRpc (following Python's 3 overloads pattern) that send ParseProject RPC requests and return parsed source files with appropriate markers.
Add builder options to GoRewriteRpc.Builder:
environment(Map<String, String>)— environment variables for the Go subprocessworkingDirectory(Path)— working directory for the Go subprocessmetricsCsv(Path)— metrics outputrecipeInstallDir(Path)— where installed recipe modules live
Add static resetCurrent() convenience method (mirrors Python/JS pattern).
The most impactful order for enabling end-to-end recipe execution:
- Go Recipe Framework (#8) — foundation for everything else
- GetMarketplace (#1) + PrepareRecipe (#2) — recipe discovery
- Visit (#3) — recipe execution
- InstallRecipes actual impl (#7) — load recipes from Git
- parseProject (#5, #9) — project-level tooling
- Generate (#4) — new file generation
- Builder/client polish (#10, #11, #6) — ergonomics