{"record":{"id":"a8073e97f66f271f","repo":"affaan-m/ECC","slug":"docs-zh-cn-agents-md-is-missing-the-catalog-summar","errorCode":null,"errorMessage":"docs/zh-CN/AGENTS.md is missing the catalog summary line","messagePattern":"docs/zh-CN/AGENTS\\.md is missing the catalog summary line","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ci/catalog.js","lineNumber":279,"sourceCode":"    if (!match) {\n      throw new Error(`${pattern.source} is missing the ${pattern.category} entry`);\n    }\n\n    expectations.push({\n      category: pattern.category,\n      mode: pattern.mode === 'minimum' && match[2] ? 'minimum' : pattern.mode,\n      expected: Number(match[1]),\n      source: `${pattern.source} (${pattern.category})`\n    });\n  }\n\n  return expectations;\n}\n\nfunction parseZhAgentsDocExpectations(agentsContent) {\n  const summaryMatch = agentsContent.match(/提供\\s+(\\d+)\\s+个专业代理、\\s*(\\d+)(\\+)?\\s*项技能、\\s*(\\d+)\\s+条命令/i);\n  if (!summaryMatch) {\n    throw new Error('docs/zh-CN/AGENTS.md is missing the catalog summary line');\n  }\n\n  const expectations = [\n    { category: 'agents', mode: 'exact', expected: Number(summaryMatch[1]), source: 'docs/zh-CN/AGENTS.md summary' },\n    {\n      category: 'skills',\n      mode: summaryMatch[3] ? 'minimum' : 'exact',\n      expected: Number(summaryMatch[2]),\n      source: 'docs/zh-CN/AGENTS.md summary'\n    },\n    { category: 'commands', mode: 'exact', expected: Number(summaryMatch[4]), source: 'docs/zh-CN/AGENTS.md summary' }\n  ];\n\n  const structurePatterns = [\n    {\n      category: 'agents',\n      mode: 'exact',\n      regex: /^\\s*agents\\/\\s*[—–-]\\s*(\\d+)\\s+个专业子代理\\s*$/im,","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/ci/catalog.js#L261-L297","documentation":"`parseZhAgentsDocExpectations` reads `docs/zh-CN/AGENTS.md` and matches the Chinese summary `/提供\\s+(\\d+)\\s+个专业代理、\\s*(\\d+)(\\+)?\\s*项技能、\\s+(\\d+)\\s+条命令/i`. Expected form: `提供 N 个专业代理、 N(+) 项技能、 N 条命令`. The optional `+` after skills marks a minimum expectation. The throw fires when this sentence is absent or its wording drifted.","triggerScenarios":"Triggered by the catalog check when `docs/zh-CN/AGENTS.md` lacks the exact `提供 ... 个专业代理、 ... 项技能、 ... 条命令` sentence. Drift in counters (个/项/条), conjunctions (、), or the leading 提供 verb causes a match failure.","commonSituations":"A translator changes 条命令 → 个命令 for consistency, or 项技能 → 个技能, breaking the counter-specific regex. The `提供` verb is swapped for another. The `+` floor marker is removed.","solutions":["Restore the exact sentence in docs/zh-CN/AGENTS.md: `提供 68 个专业代理、284+ 项技能、94 条命令` (with `+` only if skills is a floor).","Preserve the three distinct counters: 个 (agents), 项 (skills), 条 (commands), and the ideographic comma 、.","Run `node scripts/ci/catalog.js --write` to auto-sync counts; syncZhAgents rewrites only digits.","Confirm the skills mode (exact vs minimum) matches the English AGENTS.md."],"exampleFix":"// before (docs/zh-CN/AGENTS.md, 条→个)\n提供 68 个专业代理、284+ 项技能、94 个命令\n\n// after\n提供 68 个专业代理、284+ 项技能、94 条命令","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst agents = fs.readFileSync('docs/zh-CN/AGENTS.md', 'utf8');\nconst re = /提供\\s+(\\d+)\\s+个专业代理、\\s*(\\d+)(\\+)?\\s*项技能、\\s+(\\d+)\\s+条命令/i;\nif (!re.test(agents)) {\n  console.error('docs/zh-CN/AGENTS.md missing summary line.');\n  console.error('Expected: 提供 N 个专业代理、 N(+) 项技能、 N 条命令 (counters 个/项/条).');\n  process.exit(1);\n}","typeGuard":"function hasZhAgentsSummary(agentsContent) {\n  return /提供\\s+(\\d+)\\s+个专业代理、\\s*(\\d+)(\\+)?\\s*项技能、\\s+(\\d+)\\s+条命令/i.test(agentsContent);\n}","tryCatchPattern":"try {\n  runCatalogCheck();\n} catch (error) {\n  if (/docs\\/zh-CN\\/AGENTS\\.md is missing the catalog summary/i.test(error.message)) {\n    console.error('Restore: 提供 N 个专业代理、 N(+) 项技能、 N 条命令');\n  }\n  throw error;\n}","preventionTips":["Preserve the three counters: 个 (agents), 项 (skills), 条 (commands).","Keep the ideographic comma 、 and the verb 提供.","Run `--write` to sync counts.","Validate after any Chinese AGENTS.md rewrite."],"tags":["catalog","ci","regex","i18n","chinese","agents-md","documentation-drift"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}