fix(decision): add CJK punctuation support in fixMissingQuotes

Critical discovery: AI can output different types of "fullwidth" brackets:
- Fullwidth: []{}(U+FF3B/FF3D/FF5B/FF5D) ← Already handled
- CJK: 【】〔〕(U+3010/3011/3014/3015) ← Was missing!

Root cause of persistent errors:
User reported: "JSON 必须以【{开头"
The 【 character (U+3010) is NOT the same as [ (U+FF3B)!

Added CJK punctuation replacements:
- 【 → [ (U+3010 Left Black Lenticular Bracket)
- 】 → ] (U+3011 Right Black Lenticular Bracket)
- 〔 → [ (U+3014 Left Tortoise Shell Bracket)
- 〕 → ] (U+3015 Right Tortoise Shell Bracket)
- 、 → , (U+3001 Ideographic Comma)

Why this was missed:
AI uses different characters in different contexts. CJK brackets (U+3010-3017)
are distinct from Fullwidth Forms (U+FF00-FFEF) in Unicode.

Test case:
Input:  【{"symbol":"BTCUSDT"】
Output: [{"symbol":"BTCUSDT"}]

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZhouYongyou
2025-11-04 23:10:32 +08:00
parent 3ff3b5dde3
commit ccbad7b646

View File

@@ -550,6 +550,13 @@ func fixMissingQuotes(jsonStr string) string {
jsonStr = strings.ReplaceAll(jsonStr, "", ":") // 全角冒号 U+FF1A
jsonStr = strings.ReplaceAll(jsonStr, "", ",") // 全角逗号 U+FF0C
// ⚠️ 替换CJK标点符号AI在中文上下文中也可能输出这些
jsonStr = strings.ReplaceAll(jsonStr, "【", "[") // CJK左方头括号 U+3010
jsonStr = strings.ReplaceAll(jsonStr, "】", "]") // CJK右方头括号 U+3011
jsonStr = strings.ReplaceAll(jsonStr, "", "[") // CJK左龟壳括号 U+3014
jsonStr = strings.ReplaceAll(jsonStr, "", "]") // CJK右龟壳括号 U+3015
jsonStr = strings.ReplaceAll(jsonStr, "、", ",") // CJK顿号 U+3001
return jsonStr
}