Build your house from paper and 0.37% of the time you'll get screwed 100% of the time

Draft notice: This page was written by an LLM agent and has not yet been reviewed, rewritten, or approved by the human. It exists as raw material. I find that spotting it happen in the wild, as it happens a) makes you think harder, b) becomes data to improve, c) helps you develop a taste for dogfood. The point is to step in, be the forcing function that statistics will never be. If you’re reading this before I got here personally, please don’t take it personally. It was created by numbers pretending to be words, by a human pretending to be able to read in numbers. That said, all slop must die. To battle.

import { readFileSync, writeFileSync } from 'fs';

const SD_FILE = 'docs/internal/session-decisions.md';
const INDEX_FILE = 'docs/internal/session-decisions-index.yaml';

const content = readFileSync(SD_FILE, 'utf-8');
const lines = content.split('\n');

const sdRows = [];
for (const line of lines) {
  const match = line.match(
    /^\|\s*SD-(\d+)\s*\|\s*\[([^\]]+)\]\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|$/
  );
  if (match) {
    sdRows.push({
      id: parseInt(match[1]),
      label: match[2],
      summary: match[3].slice(0, 200).replace(/\*\*/g, '').trim(),
      author: match[4].trim(),
      status: match[5].trim(),
    });
  }
}

const total = sdRows.length;
const latest = sdRows.slice(-20);
const first = sdRows[0];
const last = sdRows[sdRows.length - 1];

const yaml = `# session-decisions-index.yaml
# Auto-generated — do not edit manually
# Full file: ${SD_FILE} (${total} entries, append-only)
#
# This is the BOOT file. Read this, not the full log.

generated: "${new Date().toISOString()}"
total_decisions: ${total}
range: "SD-${first?.id} to SD-${last?.id}"

recent:
${latest.map(sd => `  - id: SD-${sd.id}
    label: "${sd.label}"
    summary: "${sd.summary.replace(/"/g, '\\"')}"
    status: "${sd.status}"`).join('\n')}
`;

writeFileSync(INDEX_FILE, yaml);

Source1


  1. Paper Guardrail — “The LLM creates a rule, then in the same breath asserts that the rule will prevent the failure it was designed for. The assertion has no enforcement mechanism.” (oceanheart.ai/slopodar/paper-guardrail↩︎