idea_world_labDEV JOURNAL
Monday, July 13, 2026

Qwen Validation Debugger Prompt Application Structure

Date: July 13, 2026

Document Purpose

This document organizes the prompts actually applied in tools/qwen-validation-debugger.

It records only which function creates which prompt, which API it is sent to, and what response format is expected, without adding any interpretation.

Target Files

File Content Covered in This Document
tools/qwen-validation-debugger/core.js Prompt generation function used in actual Qwen requests
tools/qwen-validation-debugger/server.js Routing that receives the prompt and sends it to the Qwen/OpenAI‑compatible API
tools/qwen-validation-debugger/public/app.js Which button/action calls which API and prompt

Common Structure of API Calls

The callQwen() function in server.js transmits all prompts in the same manner.

{
  model,
  messages: [{ role: 'user', content: prompt }],
  temperature: 0
}
Value Source
endpoint Browser input qwenEndpoint
model Browser input qwenModel
apiKey Browser input qwenApiKey
prompt Return value of the prompt‑generation function in core.js

The API key is sent from the browser to the server in the request body, but it is not stored in localStorage.

Prompt Call Path

Screen Action Browser Function Server API core.js Prompt Function Response Processing Functions
Item labeling classifyItem() POST /api/classify-item buildClassificationPrompt() extractJsonObject(), normalizeClassification()
Code generation generateCode() POST /api/generate-code buildCodePrompt() extractJsonObject(), normalizeGeneratedCode()
JSONL generation generateJsonl() POST /api/generate-jsonl buildJsonlPrompt() extractJsonObject()
JSONL verification verifyJsonl() POST /api/verify-jsonl buildVerificationPrompt() normalizeYesNo()
JSONL prompt preview renderSlot() No API call buildJsonlPromptPreview() For display only

Table Definitions

The table definitions used in prompts are located in core.js as TABLE_DEFINITIONS.

docs_chunks

Item Value
label docs_chunks
purpose Checks whether the explanatory evidence from official documentation directly matches the code chunk.
directFields content, code_blocks, api_symbols, heading, symbol

schema:

chunk_id
doc_version
source_url
source_file
source_sha256
doc_type
symbol
section_path
heading
content
code_blocks
language_tags
godot_version_tags
api_symbols
token_count
metadata

api_mapping

Item Value
label api_mapping
purpose Verify that the evidence of how names, classes, functions, and symbols change from Godot 3 to Godot 4 directly matches the code chunks.
directFields source_api, target_api, match_terms, notes

schema:

mapping_id
source_api
target_api
change_type
godot_from
godot_to
confidence
evidence_chunk_ids
match_terms
notes
negative_patterns

label_prototypes

Item Value
label label_prototypes
purpose Verify that the example, which involves a complete change in function usage, argument composition, and call pattern—not just a simple name change—directly matches the code chunk.
directFields input_pattern, expected_finding, recommended_action, validator_rules.required_when_seen_in_code, validator_rules.before_code, validator_rules.after_code

schema:

prototype_id
label
task_type
input_pattern
expected_finding
recommended_action
evidence_mapping_ids
evidence_chunk_ids
severity
validator_rules

Slot Case Definition

getSlotCase({ tableName, versionKey, expectation }) determines the goal, generationRule, and expectedAnswer that go into the JSONL generation prompt.

Condition label expectedAnswer goal generationRule
docs_chunks + positive Explanation evidence JSONL Yes Create an official‑document‑style JSONL that directly explains the SOURCE_CODE. At least one of the description/code/symbol fields in the JSONL must directly match the actual string/API call inside the SOURCE_CODE.
docs_chunks + negative Other code explanation JSONL No The JSONL may look like a search candidate because some APIs/topics overlap with the SOURCE_CODE, but it actually explains a different piece of code in an official‑document style. The JSONL may share some APIs or topics like a search candidate, but it must not directly describe the core purpose, target object, or final action/result of the SOURCE_CODE.
expectation === negative + versionKey === migration Irrelevant conversion JSONL No Create an irrelevant 3→4 conversion/pattern JSONL that should not be applied to either Godot 3 code or Godot 4 code. The JSONL should be written in a 3→4 conversion format, but must not directly address the pre‑change rationale of GODOT3_SOURCE_CODE nor the post‑change rationale of GODOT4_TARGET_CODE.
expectation === negative + not migration Irrelevant conversion JSONL No Create an irrelevant conversion/pattern JSONL that should not be applied to the SOURCE_CODE. The JSONL must deal with different APIs, nodes, or call patterns and must not serve as a source justification for converting the SOURCE_CODE.
versionKey === migration + positive 3→4 conversion evidence JSONL Godot 3 Yes / Godot 4 No Create a 3→4 conversion evidence JSONL that transforms the pre‑change pattern of Godot 3 code into the post‑change form of Godot 4 code. The JSONL’s source_api, source_pattern, match_terms, input_pattern, before_code, required_when_seen_in_code must directly match the actual pre‑change strings/API calls in GODOT3_SOURCE_CODE, and target_api, after_code, recommended_action must describe the post‑change form in GODOT4_TARGET_CODE.
versionKey === godot3 + positive Conversion needed JSONL Yes Create a JSONL that shows the Godot 3 / source‑side API or call pattern inside the SOURCE_CODE needs to be changed to Godot 4. At least one of source_api, source_pattern, match_terms, input_pattern, before_code, required_when_seen_in_code must directly match the actual conversion‑source string/API call inside the SOURCE_CODE.
versionKey === godot4 + positive Already applied JSONL No Create a JSONL that should not be judged as additional migration evidence because the SOURCE_CODE is already in the Godot 4 target form. The JSONL should convey that it is already applied or no conversion is needed, using fields like target_api, after_code, signature_stable, no_change, common syntax, and must not cause the SOURCE_CODE to be judged as a conversion source.
Other positive Common/unnecessary JSONL No Create a JSONL that should not be judged as migration evidence for api_mapping or label_prototypes because the SOURCE_CODE uses common syntax. The JSONL should convey that it is already applied or no conversion is needed, using fields like target_api, after_code, signature_stable, no_change, common syntax, and must not cause the SOURCE_CODE to be judged as a conversion source.

1. Labeling Prompt

Call Location

Item Value
Browser function classifyItem(itemId)
Server API POST /api/classify-item
core function buildClassificationPrompt({ itemTitle })
Input value itemTitle
Response JSON syntax_scope, label, reason, godot3_focus, godot4_focus

Prompt Original Text

You are a Godot code test item classifier.

Determine whether the TEST_ITEM below can be tested with the same syntax/code chunk in both Godot 3 and Godot 4, or whether separate code for Godot 3 and Godot 4 must be created.

Judgment criteria:
- If it is an item that can be naturally explained in both Godot 3/4 with the same GDScript syntax and the same API calls, it is "common."
- If the API/syntax meaningfully changes by version, such as class names, function names, signatures, node names, or call styles, it is "separate."
- If ambiguous, treat it as "separate." It is better to create more safe tests.
- The answer must output **exactly one** JSON object.

JSON format:
{
  "syntax_scope": "common or separate",
  "label": "short Korean label",
  "reason": "one or two sentences explaining why",
  "godot3_focus": "points to consider when generating Godot 3 code",
  "godot4_focus": "points to consider when generating Godot 4 code"
}

TEST_ITEM:
${itemTitle}

Response Normalization

normalizeClassification(parsed) stores the following.

Internal Field Source
syntaxScope parsed.syntax_scope
label parsed.label
reason parsed.reason
godot3Focus parsed.godot3_focus
godot4Focus parsed.godot4_focus

syntax_scope only passes common or separate.

2. Code Generation Prompt

Call Location

Item Value
Browser Function generateCode(itemId, versionKey)
Server API POST /api/generate-code
core Function buildCodePrompt({ itemTitle, syntaxScope, targetVersion })
Input Values itemTitle, syntaxScope, targetVersion
Response JSON godot_version, syntax_scope, source_code, notes

versionInstruction Branch

targetVersion versionInstruction
common Write a GDScript code chunk that can be seen commonly in both Godot 3 and Godot 4.
godot3 Write a GDScript code chunk that shows differences specific to Godot 3.x.
godot4 Write a GDScript code chunk that shows differences specific to Godot 4.x.

Prompt Original Text

You are a Godot test code chunk generator.

${versionInstruction}

Requirements:
- Write it as a function-level or small code block rather than the entire project.
- Include only the code directly related to the test item.
- The API/syntax needed for version detection must be visible in the code.
- The response must output exactly one JSON object.
- Do not use Markdown code fences.

JSON format:
{
  "godot_version": "${targetVersion}",
  "syntax_scope": "${syntaxScope}",
  "source_code": "GDScript code chunk",
  "notes": "Key points to verify in the code"
}

TEST_ITEM:
${itemTitle}

Response Normalization

normalizeGeneratedCode(parsed) stores the following.

Internal Field Source
godotVersion parsed.godot_version
syntaxScope parsed.syntax_scope
sourceCode parsed.source_code
notes parsed.notes

If source_code is empty, handle as a failure.

3. JSONL Generation Prompt

Call Location

Item Value
Browser function generateJsonl(itemId, slotId)
Server API POST /api/generate-jsonl
Core function buildJsonlPrompt({ itemTitle, tableName, expectation, versionKey, versionLabel, sourceCode, targetCode })
Input values itemTitle, tableName, expectation, versionKey, versionLabel, sourceCode, targetCode
Response JSON object

sourceCode / targetCode Selection

app.js's getJsonlGenerationCodes(detail, slot) determines the code to put into the JSONL generation prompt.

slot.versionKey SOURCE Input
migration GODOT3_SOURCE_CODE receives detail.codes.godot3.sourceCode, GODOT4_TARGET_CODE receives detail.codes.godot4.sourceCode
common SOURCE_CODE receives detail.codes.common.sourceCode
godot3 SOURCE_CODE receives detail.codes.godot3.sourceCode
godot4 SOURCE_CODE receives detail.codes.godot4.sourceCode

Prompt Original Text

You are a Godot RAG test JSONL generator.

Goal:
${slotCase.goal}

Target table:
${table.label}

Table purpose:
${table.purpose}

Field list:
${table.schema.map((field) => `- ${field}`).join('\n')}

Fields important for direct matching judgment:
${table.directFields.map((field) => `- ${field}`).join('\n')}

Generation rules:
- The answer must output exactly one JSON object.
- Do not use a Markdown code fence.
- ${slotCase.generationRule}
- docs_chunks is explanation evidence matching, and api_mapping and label_prototypes are migration source evidence matching.
- Code already applied in Godot 4 target form or common syntax is not a "transformation needed" evidence for api_mapping/label_prototypes.
- negative_patterns and reject_when_seen_in_code are rejection conditions. Strings placed in these fields should be interpreted as "no" evidence, not "yes" evidence.
- Do not match only broad keywords; make relevance/irrelevance depend on actual strings/API calls.
- Do not arbitrarily add fields that deviate from the table purpose.
- source_url, source_file, *_id values should be written naturally for testing.

TEST_ITEM:
${itemTitle}

CODE_VERSION:
${versionLabel}

${isMigrationPair ? `GODOT3_SOURCE_CODE:
${sourceCode}

GODOT4_TARGET_CODE:
${targetCode}` : `SOURCE_CODE:
${sourceCode}`}

Values Included with Server Response

POST /api/generate-jsonl response includes the following.

Response Field Description
prompt The prompt sent to the actual model
rawResponse The original model response
jsonl Object parsed with extractJsonObject()
jsonlText Result of JSON.stringify(parsed)
expectedAnswer Result of expectedAnswerForSlot()

4. JSONL Verification Prompt

Call Location

Item Value
Browser function verifyJsonl(itemId, slotId, targetVersionKey)
Server API POST /api/verify-jsonl
core function buildVerificationPrompt({ tableName, sourceVersionKey, targetVersionKey, sourceCode, jsonlText })
Input values tableName, sourceVersionKey, targetVersionKey, sourceCode, jsonlText
Model output Yes or No

question Branch

tableName question
docs_chunks Determine whether the JSONL below is an official‑document style evidence that directly explains the SOURCE_CODE.
api_mapping, label_prototypes Determine whether the JSONL below provides evidence that a migration should be applied to the current SOURCE_CODE.

firstRule Branch

tableName firstRule
docs_chunks In docs_chunks, the JSONL is “Yes” only when it directly explains the actual string of SOURCE_CODE, API calls, code purpose, target of application, and results.
api_mapping, label_prototypes In api_mapping and label_prototypes, the JSONL is “Yes” only when it explains the pre‑change pattern that should now be applied to the current SOURCE_CODE.

docs_chunks tableRules

- In docs_chunks, "yes" is allowed only when the JSONL directly describes the core operation of SOURCE_CODE.  
- The core operation includes not just a simple API name but also what the code computes, what target it applies to, and ultimately what state/result it produces.  
- Even if the same API or method appears, if the JSONL describes a different purpose, different target object, or different result, it is only a search candidate and not a direct justification, so the answer is "no".  
- If the JSONL provides only a generic description of the same API and does not explain the specific resources, branches, loops, or state changes of the SOURCE_CODE, it is not a direct justification, so the answer is "no".  
- If the SOURCE_CODE involves repeated execution, single execution, state transition, or resource replacement, and the JSONL’s flow differs, the answer is "no".  
- Functions that appear together in the same file or game flow can be search candidates for each other. Even in this case, it is "yes" only when the final purpose, target, and result of the SOURCE_CODE match those described by the JSONL.  
- Even if api_symbols or headings contain part of a call name from the SOURCE_CODE, if the content/code_blocks describe a different workflow, it is not a direct justification.  
- Repeated contextual clues across multiple code files, such as lifecycle functions, common types, or generic property names, are not direct justifications on their own.  
- If the JSONL’s code_blocks describe example code that differs from the SOURCE_CODE, it is "no" even if some APIs are the same.  
- Do not infer that different APIs with similar meanings or similar use cases are equivalent based on your knowledge. The JSONL must directly reveal the current SOURCE_CODE’s purpose/target/result.  
- If JSONL_GENERATED_FROM_CODE_VERSION and VERIFY_TARGET_CODE_VERSION differ, first verify whether the JSONL explains the behavior of the code version currently under verification.  
- Even if the versions differ, it can be "yes" if common APIs/common operations are explicitly described; however, if the JSONL’s code_blocks/api_symbols differ from the actual syntax/API calls in the current SOURCE_CODE, it is "no" even if they appear to perform the same function.

api_mapping / label_prototypes tableRules

- The question of api_mapping and label_prototypes is not “Is there any relation between JSONL and the code?” but rather “Based on this JSONL, should we now change the current SOURCE_CODE?”
- First, determine whether the current SOURCE_CODE, according to the JSONL, falls into pre‑change code, already changed code, irrelevant code, or code that does not need conversion.
- “Yes” is allowed only when the current SOURCE_CODE is pre‑change code and the conversion described by the JSONL should be applied now.
- The 3→4 integrated JSONL was created by looking at both the Godot 3 pre‑change code and the Godot 4 post‑change code. During verification, separate whether the current SOURCE_CODE is the pre‑change code or the post‑change code.
- If the current SOURCE_CODE is already in the Godot 4 target form, even if the JSONL appears related to migration instructions, it is considered “already applied,” so the answer is “No.”
- The “conversion needed” judgment in label_prototypes is “Yes” only when the current SOURCE_CODE actually contains the pre‑change usage, argument composition, and call pattern described.
- An irrelevant‑conversion JSONL is “No” even if the verification target is Godot 3 code, as long as the conversion does not apply to the current SOURCE_CODE.
- Content under source/before/required is read as evidence of pre‑change code; content under target/after/recommended is read as the post‑change form; content under negative/reject is read as conditions under which the conversion must not be applied to the current code.
- Even if the function name is the same, the pre‑change pattern described by the JSONL (such as call arguments, return‑value handling, inherited node, surrounding code structure) must be directly present in the SOURCE_CODE for the answer to be “Yes.”
- source_api and target_api may share the same name or contain source/target terms in match_terms. A match on a single function name or a broad match_terms alone does not constitute “Yes.”
- Features that appear together in the same file or game flow can be search candidates for each other. Still, if the pre‑change pattern to be applied is not directly present in the current SOURCE_CODE, the answer is “No.”
- If JSONL_GENERATED_FROM_CODE_VERSION and VERIFY_TARGET_CODE_VERSION differ, first distinguish whether the current SOURCE_CODE is the pre‑change code or already the post‑change code from the JSONL.
- If JSONL_GENERATED_FROM_CODE_VERSION is a single version slot that is not a migration, the answer is “Yes” only when the source/before/required pattern is directly present in the current verification target code.
- If the current SOURCE_CODE matches or is newer than the JSONL’s target/after/recommended form, it is already applied, so the answer is “No.”
- When the verification target version is Godot 4 or common and the SOURCE_CODE is already in the target/after form, the answer is “No” even if the JSONL contains correct migration knowledge.
- If change_type is signature_stable, no_change, common, etc., indicating that no conversion is needed, the answer is “No.”
- Even if a migration JSONL is attached to Godot 4 code or common‑syntax code, the answer is “No” when no additional conversion is required.

decisionRules

- Before judging, capture the core operation of SOURCE_CODE in one sentence, also capture the core rationale described by JSONL in one sentence, and compare the two.  
- Consider it direct evidence only when the target objects, call purpose, input/argument flow, and final result are aligned in the same direction.  
- Even if it looks like a similar search candidate, if it does not explain the current SOURCE_CODE or provide a basis for applying to the current SOURCE_CODE, it is “No.”

Prompt Original

You are a JSONL evidence matching judge.

${question}

Table:
${table.label}

Table purpose:
${table.purpose}

Decision criteria:
- ${firstRule}
- JSONL fields to review: ${table.directFields.join(', ')}
- ${tableRules.join('\n- ')}
- ${decisionRules.join('\n- ')}
- If only broad words such as Godot, Godot3, Godot4, migration, 2D, physics are the same, it is not relevant.
- Content in JSONL that is mentioned negatively, such as "does not describe", "not related", "unrelated", "does not apply", is not recognized as relevant evidence.
- If the JSONL is about a different API, different node, or different system, it is "No".
- Do not use your own Godot knowledge; use only the string evidence written in the JSONL.
- The answer must output only "Yes" or "No".

JSONL_GENERATED_FROM_CODE_VERSION:
${sourceVersionKey}

VERIFY_TARGET_CODE_VERSION:
${targetVersionKey}

SOURCE_CODE:
${sourceCode}

JSONL:
${jsonlText}

Response Normalization

normalizeYesNo(text) only accepts the following responses as values.

Input Form Internal Value
yes
아니오 아니오
no 아니오
value inside a code fence corresponding value
value on the first line corresponding value
otherwise empty string

5. JSONL Prompt Preview

app.js's buildJsonlPromptPreview() is not a function sent to the model but a preview displayed on the screen.

Call Location

Item Value
Browser function renderSlot()
API call None
Purpose Display the JSONL generation prompt details area inside the slot

Original Preview

You are a JSONL generator for Godot RAG testing.

Goal: ${slotCase.goal}
Target Table: ${table.label}
Table Purpose: ${table.purpose}
Direct Matching Fields: ${table.directFields.join(', ')}

TEST_ITEM: ${itemTitle}
CODE_VERSION: ${versionLabel}

${isMigrationPair ? `GODOT3_SOURCE_CODE:
${sourceCode || '(Automatically filled after generating Godot 3 code)'}

GODOT4_TARGET_CODE:
${targetCode || '(Automatically filled after generating Godot 4 code)'}` : `SOURCE_CODE:
${sourceCode || '(Automatically filled after code generation)'}`}

slot creation rules

app.js's getSlotSpecs(detail) creates slots according to the classification result.

common

If the classification is common, the following slots are created.

versionKey tableName expectation
common docs_chunks positive
common docs_chunks negative
common api_mapping positive
common api_mapping negative
common label_prototypes positive
common label_prototypes negative

separate

If the classification is separate, the following slots are created.

versionKey tableName expectation
godot3 docs_chunks positive
godot3 docs_chunks negative
godot4 docs_chunks positive
godot4 docs_chunks negative
migration api_mapping positive
migration api_mapping negative
migration label_prototypes positive
migration label_prototypes negative

expectedAnswer calculation

expectedAnswer for JSONL generation response

expectedAnswerForSlot({ tableName, versionKey, expectation }) returns the expectedAnswer of getSlotCase().

expectedAnswer for verification result comparison

The rules for expectedAnswerForVerification({ tableName, sourceVersionKey, targetVersionKey, expectation }) are as follows.

Condition expectedAnswer
expectation === negative No
tableName === docs_chunks and sourceVersionKey === targetVersionKey Yes
tableName === docs_chunks and sourceVersionKey !== targetVersionKey No
tableName is api_mapping or label_prototypes and sourceVersionKey === migration, targetVersionKey === godot3 Yes
tableName is api_mapping or label_prototypes and sourceVersionKey === migration, targetVersionKey !== godot3 No
tableName is api_mapping or label_prototypes and sourceVersionKey === godot3, targetVersionKey === godot3 Yes
Otherwise No

Prompt change log table

When the prompt is modified later, continue adding entries to the table below.

Date Function Text/Rule before change Text/Rule after change Verification result
2026-07-13 All Prompt structure based on current code Baseline documentation Recorded
buildClassificationPrompt()
buildCodePrompt()
buildJsonlPrompt()
buildVerificationPrompt()