{"record":{"id":"466f8e0e87913faa","repo":"flipped-aurora/gin-vue-admin","slug":"d-abbreviation","errorCode":null,"errorMessage":"模块 %d 的 abbreviation 不能为空","messagePattern":"模块 (.+?) 的 abbreviation 不能为空","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/mcp/gva_execute.go","lineNumber":338,"sourceCode":"\t\tif len(plan.ModulesInfo) == 0 {\n\t\t\treturn errors.New(\"当 needCreatedModules=true 时，modulesInfo 不能为空\")\n\t\t}\n\n\t\tfor moduleIndex, moduleInfo := range plan.ModulesInfo {\n\t\t\tif moduleInfo.Package == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 package 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.StructName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 structName 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.TableName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 tableName 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.Description == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 description 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.Abbreviation == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 abbreviation 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.PackageName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 packageName 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.HumpPackageName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 humpPackageName 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif len(moduleInfo.Fields) == 0 {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 fields 不能为空，至少需要一个字段\", moduleIndex+1)\n\t\t\t}\n\n\t\t\tfor i, field := range moduleInfo.Fields {\n\t\t\t\tif field.FieldName == \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"模块 %d 字段 %d 的 fieldName 不能为空\", moduleIndex+1, i+1)\n\t\t\t\t}\n\t\t\t\tif len(field.FieldName) > 0 {\n\t\t\t\t\tfirstChar := string(field.FieldName[0])\n\t\t\t\t\tif firstChar >= \"a\" && firstChar <= \"z\" {","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/flipped-aurora/gin-vue-admin/blob/3136500ef380842b0eb6c4daa87c3f8a47fcf9e0/server/mcp/gva_execute.go#L320-L356","documentation":"Each module in an execution plan must provide an Abbreviation (short name used for generated route prefixes, API paths, and variable names). validateExecutionPlan rejects the plan with this error when modules[i].abbreviation is empty. It runs inside Handle before generation begins.","triggerScenarios":"Calling gva_execute with a plan where modules[i].abbreviation is missing or \"\". Typically the Nth validation failure after earlier required fields were filled in.","commonSituations":"Plans authored by models unaware that abbreviation is mandatory; users who thought abbreviation was an optional alias; templates that omit it for single-module plans.","solutions":["Add a short lowercase abbreviation (e.g. \"art\" for article) to the module entry","Keep it URL/router friendly since it feeds generated path prefixes","Re-run gva_execute with the corrected plan"],"exampleFix":"// before\n{\"modules\":[{\"packageName\":\"article\",\"structName\":\"Article\",\"tableName\":\"article\",\"description\":\"article management\"}]}\n// after\n{\"modules\":[{\"packageName\":\"article\",\"structName\":\"Article\",\"tableName\":\"article\",\"description\":\"article management\",\"abbreviation\":\"art\"}]}","handlingStrategy":"validation","validationCode":"for i, m := range plan.Modules {\n  if m.Abbreviation == \"\" {\n    return fmt.Errorf(\"modules[%d].abbreviation is required\", i)\n  }\n}","typeGuard":"func hasAbbreviation(m Module) bool { return m.Abbreviation != \"\" }","tryCatchPattern":null,"preventionTips":["Keep a short abbreviation as part of your module naming convention","Generate abbreviation programmatically (first syllable/short form of the package name)","Check plans with a pre-flight script covering all required fields"],"tags":["mcp","code-generation","validation","config"],"backgroundTag":"missing-required-field","analyzedSha":"3136500ef380842b0eb6c4daa87c3f8a47fcf9e0","analyzedAt":"2026-08-31T13:50:02.721Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}