{"record":{"id":"59ced9ad5fc33ca4","repo":"santifer/career-ops","slug":"unrecognized-shared-md-section-sectionname","errorCode":null,"errorMessage":"⚠️  Unrecognized _shared.md section \"${sectionName}\" → defaulting to P${DEFAULT_PRIORITY} (compressible). Update SECTION_PRIORITY in lib/context-budget.mjs if this section is evaluation-critical.","messagePattern":"⚠️  Unrecognized _shared\\.md section \"(.+?)\" → defaulting to P(.+?) \\(compressible\\)\\. Update SECTION_PRIORITY in lib/context-budget\\.mjs if this section is evaluation-critical\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/context-budget.mjs","lineNumber":153,"sourceCode":"\n/**\n * Look up the priority of a section by its header name.\n *\n * Emits a warning when a section falls through to DEFAULT_PRIORITY so drift\n * between _shared.md headings and SECTION_PRIORITY is observable.\n *\n * @param {string} sectionName - The section header text (e.g., \"Scoring System\").\n * @returns {number} 0 (P0), 1 (P1), or 2 (P2 / default).\n */\nfunction getPriority(sectionName) {\n  const key = sectionName.toLowerCase()\n    // Strip parenthetical suffixes like \"(Block G)\" or \"(writing guardrail)\"\n    .replace(/\\s*\\([^)]*\\)\\s*/g, ' ')\n    .replace(/\\s+/g, ' ')\n    .trim();\n  if (!(key in SECTION_PRIORITY) && !_warnedSections.has(key)) {\n    _warnedSections.add(key);\n    console.warn(`⚠️  Unrecognized _shared.md section \"${sectionName}\" → defaulting to P${DEFAULT_PRIORITY} (compressible). Update SECTION_PRIORITY in lib/context-budget.mjs if this section is evaluation-critical.`);\n  }\n  return SECTION_PRIORITY[key] ?? DEFAULT_PRIORITY;\n}\n\n// ---------------------------------------------------------------------------\n// Compression\n// ---------------------------------------------------------------------------\n\n/**\n * Compress _shared.md content by removing lower-priority sections.\n *\n * Sections are identified by `## Section Name` headers and removed in\n * priority order (P2 first, then P1) until the target token reduction\n * is met or no more removable sections remain.\n *\n * P0 sections (scoring, archetypes, legitimacy, global rules) are never removed.\n *\n * @param {string} sharedContent - Raw _shared.md content.","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/lib/context-budget.mjs#L135-L171","documentation":"lib/context-budget.mjs maps _shared.md section names to compression priorities (SECTION_PRIORITY). getPriority() normalizes a section name (stripping suffixes like '(Block G)') and, if the key is unknown, warns once per section and falls back to DEFAULT_PRIORITY — meaning the section is treated as compressible. If the section is actually evaluation-critical, compression may drop content the agent needed.","triggerScenarios":"Calling getPriority() (directly or via context-budget compression) with a _shared.md section heading that is not a key in SECTION_PRIORITY — typically after adding or renaming a section in modes/_shared.md or a market mode file.","commonSituations":"Contributors adding a new section to modes/_shared.md (e.g. '## New Guardrail') without updating SECTION_PRIORITY; renaming a heading; market mode dirs introducing locally-named sections.","solutions":["Add the normalized section name as a key in SECTION_PRIORITY in lib/context-budget.mjs with its correct priority","Or rename the section heading in the _shared.md file to match an existing SECTION_PRIORITY key","If the section genuinely is not evaluation-critical, no action is needed — the default P priority is intentionally compressible","Silence per-section is once-only (_warnedSections), so fix at the source rather than ignoring repeats across runs"],"exampleFix":"// before (lib/context-budget.mjs)\nconst SECTION_PRIORITY = { \"Core Rules\": 1 };\n// after\nconst SECTION_PRIORITY = { \"Core Rules\": 1, \"New Guardrail\": 2 };","handlingStrategy":"validation","validationCode":"// before running context-budget tooling, verify all _shared.md headings are known\nconst known = Object.keys(SECTION_PRIORITY);\nconst headings = sharedMd.match(/^##\\s+(.*)$/gm).map(h => h.replace(/^##\\s+/, '').replace(/\\s*\\([^)]*\\)/g, '').trim());\nconst unknown = headings.filter(h => !known.includes(h));\nif (unknown.length) console.error('Add to SECTION_PRIORITY:', unknown);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whenever you add or rename a section in modes/_shared.md, update SECTION_PRIORITY in the same PR","Grep the codebase for SECTION_PRIORITY after any _shared.md edit","Treat this warning once per section as a signal to fix config, never to ignore"],"tags":["configuration","context-budget","compression","unknown-section"],"backgroundTag":"missing-config-key","analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}