{"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":152,"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":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/santifer/career-ops/blob/1696bec4d021768e7359f9aad6b329cba883da20/lib/context-budget.mjs#L134-L170","documentation":"getPriority in lib/context-budget.mjs maps _shared.md section names to compression priorities via a hardcoded SECTION_PRIORITY table. When it meets a section name not in the table, it warns once per key and falls back to DEFAULT_PRIORITY, meaning the section is treated as compressible (low priority) and may be dropped or shrunk in context-budgeted output. The warning is a maintenance signal: the table needs updating or evaluation-critical content may be silently compressed.","triggerScenarios":"Adding or renaming a section heading in modes/_shared.md (or any file routed through getPriority) without adding the matching key to SECTION_PRIORITY in lib/context-budget.mjs; parenthetical suffixes are stripped, so only the base name matters. Repeats for the same section are suppressed via _warnedSections.","commonSituations":"A career-ops update introduces new _shared.md sections while the local lib/context-budget.mjs is older; a user hand-edits _shared.md adding custom sections; a typo in a heading ('Evalution') that no longer matches any key.","solutions":["Open lib/context-budget.mjs and add the new section name to SECTION_PRIORITY with an appropriate priority (high/non-compressible if evaluation-critical)","Check whether modes/_shared.md was hand-edited or renamed; revert the heading name or register the new name","Update career-ops system files (node update-system.mjs apply) if the warning appeared after a partial update left lib/ and modes/ out of sync","Verify the behavior you want: if defaulting to P (compressible) is actually fine for that section, the warning can be ignored, but prefer explicit registration"],"exampleFix":"// before (lib/context-budget.mjs)\nconst SECTION_PRIORITY = { 'Evaluation Blocks': 1, 'Risk Summary': 2 };\n// _shared.md gained a 'Machine Summary' section → warning\n// after\nconst SECTION_PRIORITY = { 'Evaluation Blocks': 1, 'Risk Summary': 2, 'Machine Summary': 3 };","handlingStrategy":"validation","validationCode":"// Before running budget-sensitive pipelines, check every _shared.md section is registered:\nimport { SECTION_PRIORITY } from './lib/context-budget.mjs';\nconst sections = parseSectionNames(readFileSync('modes/_shared.md', 'utf-8'));\nconst unregistered = sections.filter(s => !(normalizeKey(s) in SECTION_PRIORITY));\nif (unregistered.length) console.warn('Register in SECTION_PRIORITY:', unregistered);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a test asserting every _shared.md heading exists in SECTION_PRIORITY","Keep modes/_shared.md and lib/context-budget.mjs updated together (system layer updates in lockstep)","Strip parenthetical suffixes the same way getPriority does when adding keys","On seeing the warning, decide the priority explicitly instead of accepting the compressible default"],"tags":["configuration","fallback","context-budget","maintenance"],"backgroundTag":"unknown-config-key-fallback","analyzedSha":"1696bec4d021768e7359f9aad6b329cba883da20","analyzedAt":"2026-09-01T19:19:23.111Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}