santifer/career-ops · error · Error

HIRED.md is missing its <!-- ENTRIES --> markers

Error message

HIRED.md is missing its <!-- ENTRIES --> markers

What it means

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.

Solutions

  1. Restore both markers: add '<!-- ENTRIES -->' before the ledger and '<!-- /ENTRIES -->' after it, in that order.
  2. Copy the scaffold from a fresh checkout of HIRED.md's template and re-insert your stories between the markers.
  3. Check git history (`git log -p HIRED.md`) to find the edit that removed a marker and revert it.

Example fix

// before (broken file)
# Hired Wall

- story one
// after
# Hired Wall

<!-- ENTRIES -->
<!-- / hire comment -->
- story one
<!-- /ENTRIES -->
Defensive patterns

Strategy: validation

Validate before calling

function hasWallMarkers(text) {
  const s = text.indexOf('<!-- ENTRIES -->');
  const e = text.indexOf('<!-- /ENTRIES -->');
  return s !== -1 && e !== -1 && e > s;
}
if (!hasWallMarkers(fs.readFileSync('HIRED.md', 'utf8'))) throw new Error('fix HIRED.md markers first');

Try / catch

try {
  rebuildWall(text);
} catch (err) {
  if (err.message.includes('ENTRIES')) {
    console.error('HIRED.md lost its machine section markers; restore from git before rebuilding.');
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16). Data as JSON: /api/errors/b913b1c8ac8e9b9d. Report an issue: GitHub.

Appendix: source

Thrown at hired-wall-build.mjs:108

  return [
    `### Hire #${e.n}`,
    '',
    `> ${e.story ? esc(e.story) : ''}`,
    '',
    `${who} · ${meta} · [story →](${e.link})`,
  ].join('\n');
}

/**
 * Rebuild HIRED.md's entries section from its own ledger lines. Everything
 * between the ENTRIES markers is generated; prose outside them is
 * hand-written and never touched. Stories live IN the ledger section as a
 * quoted line right under each comment (kept verbatim on rebuild).
 */
export function rebuildWall(text) {
  const start = text.indexOf('<!-- ENTRIES -->');
  const end = text.indexOf('<!-- /ENTRIES -->');
  if (start === -1 || end === -1 || end < start) throw new Error('HIRED.md is missing its <!-- ENTRIES --> markers');
  const section = text.slice(start, end);
  const entries = [];
  const lines = section.split('\n');
  for (let i = 0; i < lines.length; i++) {
    const m = lines[i].match(LEDGER_RE);
    if (!m) continue;
    const e = parseLedger(lines[i])[0];
    // The story is the first quoted line following the ledger comment.
    for (let j = i + 1; j < lines.length && !lines[j].match(LEDGER_RE); j++) {
      const q = lines[j].match(/^> (.+)$/);
      if (q) { e.story = q[1]; break; }
    }
    entries.push(e);
  }
  entries.sort((a, b) => b.n - a.n);
  const body = entries.map((e) => `${ledgerLine(e)}\n${renderCard(e)}`).join('\n\n');
  const rebuilt = `${text.slice(0, start)}<!-- ENTRIES -->\n\n${body}\n\n${text.slice(end)}`;
  return { text: rebuilt, entries };

View on GitHub (pinned to aac998c7ed)