Summary
Add precise Bedrock Scripting API version pinning to the system prompt used in PortKit's LangGraph conversion pipeline. Without this constraint, the model may generate Bedrock code targeting multiple API versions simultaneously — mixing @minecraft/server 1.x and 2.x patterns — producing output that fails validation against any single version.
Problem
The LangGraph pipeline (PR #1311) replaced CrewAI but the system prompt for the conversion LLM call likely lacks version-specific API constraints. The Bedrock Scripting API has breaking changes between versions (e.g., 1.x vs 2.x event names, property API changes, block/item identifier changes). A model without explicit version constraints will mix API patterns from training data across multiple versions.
This is directly analogous to the documented best practice:
"Use precise System Prompts to force the model into specific API versions (e.g., 'Fabric version 1.21 using Mojmap')."
What to do
-
Locate the system prompt(s) used in the LangGraph conversion graph. Expected locations:
ai_engine/agents/ or ai_engine/graphs/ (post-LangGraph migration)
- Any
SystemMessage or system= parameter passed to the LLM call in the conversion nodes
-
Update the system prompt to include explicit version pinning:
You are PortKit, an expert Minecraft mod converter. When generating Bedrock Add-on output:
- Target Bedrock Scripting API version 2.x (@minecraft/server ^2.0.0)
- Use Mojmap-compatible class/method references for any Java source analysis
- manifest.json must use format_version 2 with min_engine_version [1, 21, 0]
- All scripting imports must use @minecraft/server and @minecraft/server-ui only
- Do NOT mix API 1.x and 2.x patterns in the same output
-
Add a version check to the Bedrock output validation step: parse the manifest.json min_engine_version field and flag outputs that target engine versions below [1, 21, 0].
-
Update MMSD generation prompt (ai_engine/mmsd/synthesis_pairs.jsonl generation config) to use the same version pinning for future dataset expansion runs.
Why this is a quick win
This is a configuration change, not a code change. It can be merged in under an hour and immediately improves conversion output consistency for all users in production.
Acceptance Criteria
References
Summary
Add precise Bedrock Scripting API version pinning to the system prompt used in PortKit's LangGraph conversion pipeline. Without this constraint, the model may generate Bedrock code targeting multiple API versions simultaneously — mixing
@minecraft/server1.x and 2.x patterns — producing output that fails validation against any single version.Problem
The LangGraph pipeline (PR #1311) replaced CrewAI but the system prompt for the conversion LLM call likely lacks version-specific API constraints. The Bedrock Scripting API has breaking changes between versions (e.g.,
1.xvs2.xevent names, property API changes, block/item identifier changes). A model without explicit version constraints will mix API patterns from training data across multiple versions.This is directly analogous to the documented best practice:
What to do
Locate the system prompt(s) used in the LangGraph conversion graph. Expected locations:
ai_engine/agents/orai_engine/graphs/(post-LangGraph migration)SystemMessageorsystem=parameter passed to the LLM call in the conversion nodesUpdate the system prompt to include explicit version pinning:
Add a version check to the Bedrock output validation step: parse the
manifest.jsonmin_engine_versionfield and flag outputs that target engine versions below[1, 21, 0].Update MMSD generation prompt (
ai_engine/mmsd/synthesis_pairs.jsonlgeneration config) to use the same version pinning for future dataset expansion runs.Why this is a quick win
This is a configuration change, not a code change. It can be merged in under an hour and immediately improves conversion output consistency for all users in production.
Acceptance Criteria
min_engine_version [1,21,0]constraintsmanifest.jsonengine versionReferences