{"record":{"id":"b913b1c8ac8e9b9d","repo":"santifer/career-ops","slug":"hired-md-is-missing-its-entries-markers","errorCode":null,"errorMessage":"HIRED.md is missing its <!-- ENTRIES --> markers","messagePattern":"HIRED\\.md is missing its <!-- ENTRIES --> markers","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"hired-wall-build.mjs","lineNumber":108,"sourceCode":"  return [\n    `### Hire #${e.n}`,\n    '',\n    `> ${e.story ? esc(e.story) : ''}`,\n    '',\n    `${who} · ${meta} · [story →](${e.link})`,\n  ].join('\\n');\n}\n\n/**\n * Rebuild HIRED.md's entries section from its own ledger lines. Everything\n * between the ENTRIES markers is generated; prose outside them is\n * hand-written and never touched. Stories live IN the ledger section as a\n * quoted line right under each comment (kept verbatim on rebuild).\n */\nexport function rebuildWall(text) {\n  const start = text.indexOf('<!-- ENTRIES -->');\n  const end = text.indexOf('<!-- /ENTRIES -->');\n  if (start === -1 || end === -1 || end < start) throw new Error('HIRED.md is missing its <!-- ENTRIES --> markers');\n  const section = text.slice(start, end);\n  const entries = [];\n  const lines = section.split('\\n');\n  for (let i = 0; i < lines.length; i++) {\n    const m = lines[i].match(LEDGER_RE);\n    if (!m) continue;\n    const e = parseLedger(lines[i])[0];\n    // The story is the first quoted line following the ledger comment.\n    for (let j = i + 1; j < lines.length && !lines[j].match(LEDGER_RE); j++) {\n      const q = lines[j].match(/^> (.+)$/);\n      if (q) { e.story = q[1]; break; }\n    }\n    entries.push(e);\n  }\n  entries.sort((a, b) => b.n - a.n);\n  const body = entries.map((e) => `${ledgerLine(e)}\\n${renderCard(e)}`).join('\\n\\n');\n  const rebuilt = `${text.slice(0, start)}<!-- ENTRIES -->\\n\\n${body}\\n\\n${text.slice(end)}`;\n  return { text: rebuilt, entries };","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/hired-wall-build.mjs#L90-L126","documentation":"rebuildWall() regenerates the Hired Wall from HIRED.md by locating the <!-- ENTRIES --> ... <!-- /ENTRIES --> machine-managed section; stories inside are preserved verbatim while the surrounding hand-written text is untouched. It throws when either marker is missing or the closing marker appears before the opening one, because the ledger section cannot be located.","triggerScenarios":"Calling rebuildWall(text) with HIRED.md content where '<!-- ENTRIES -->' or '<!-- /ENTRIES -->' was deleted, renamed, reordered (end < start), or where the file was created fresh without the template scaffold.","commonSituations":"Manual edits to HIRED.md that stripped HTML comments (some editors/markdown minifiers drop them); recreating the file from scratch; a botched merge conflict resolution that dropped a marker.","solutions":["Restore both markers: add '<!-- ENTRIES -->' before the ledger and '<!-- /ENTRIES -->' after it, in that order.","Copy the scaffold from a fresh checkout of HIRED.md's template and re-insert your stories between the markers.","Check git history (`git log -p HIRED.md`) to find the edit that removed a marker and revert it."],"exampleFix":"// before (broken file)\n# Hired Wall\n\n- story one\n// after\n# Hired Wall\n\n<!-- ENTRIES -->\n<!-- / hire comment -->\n- story one\n<!-- /ENTRIES -->","handlingStrategy":"validation","validationCode":"function hasWallMarkers(text) {\n  const s = text.indexOf('<!-- ENTRIES -->');\n  const e = text.indexOf('<!-- /ENTRIES -->');\n  return s !== -1 && e !== -1 && e > s;\n}\nif (!hasWallMarkers(fs.readFileSync('HIRED.md', 'utf8'))) throw new Error('fix HIRED.md markers first');","typeGuard":null,"tryCatchPattern":"try {\n  rebuildWall(text);\n} catch (err) {\n  if (err.message.includes('ENTRIES')) {\n    console.error('HIRED.md lost its machine section markers; restore from git before rebuilding.');\n  } else throw err;\n}","preventionTips":["Never delete HTML comments in HIRED.md even if they look like leftovers.","Disable editor/markdown plugins that strip HTML comments.","Commit HIRED.md so git history can restore markers after a bad edit."],"tags":["hired-wall","markers","parsing","file-structure"],"backgroundTag":"schema-validation-failed","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"}