mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 20:28:04 +01:00
Remove dead directories the codebase has been carrying: - docs/archives/ — 41 historical audits and completed implementation plans, superseded by current code - .agents/locks/ — 2 stale Sept 2025 lock files from an abandoned ML-model project, unrelated to current work - .env-backups/ — 4 stale .env.local snapshots (not tracked, gitignored; removed from filesystem) - browser-screenshots/ — empty filesystem dir (gitignored) Also drop the now-dead `docs/archives/**` exclusion patterns from docs-frontmatter-check.js and docs-slop-scan.js. 12,043 lines removed. 0 runtime impact (no code references any deleted path; the two scripts only excluded archives as a scan-skip). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
60 lines
1.5 KiB
JavaScript
60 lines
1.5 KiB
JavaScript
#!/usr/bin/env node
|
|
/*
|
|
docs-frontmatter-check.js
|
|
Ensures active docs have frontmatter with required fields.
|
|
*/
|
|
|
|
const { glob } = require('glob');
|
|
const fs = require('fs');
|
|
|
|
function parseFrontmatter(text) {
|
|
if (!text.startsWith('---')) return null;
|
|
const end = text.indexOf('\n---', 3);
|
|
if (end === -1) return null;
|
|
const fm = text.slice(3, end).trim();
|
|
const body = text.slice(end + 4);
|
|
const obj = {};
|
|
fm.split(/\r?\n/).forEach(line => {
|
|
const m = line.match(/^([a-zA-Z0-9_\-]+):\s*(.*)$/);
|
|
if (m) obj[m[1]] = m[2];
|
|
});
|
|
return { data: obj, body };
|
|
}
|
|
|
|
async function main() {
|
|
const files = await glob('docs/**/*.md', { ignore: [
|
|
'**/node_modules/**',
|
|
] });
|
|
|
|
const required = ['created_date', 'last_modified_date', 'last_modified_summary'];
|
|
const failures = [];
|
|
|
|
for (const file of files) {
|
|
const text = fs.readFileSync(file, 'utf8');
|
|
const fm = parseFrontmatter(text);
|
|
if (!fm) {
|
|
failures.push({ file, reason: 'Missing frontmatter' });
|
|
continue;
|
|
}
|
|
for (const key of required) {
|
|
if (!fm.data[key]) {
|
|
failures.push({ file, reason: `Missing field: ${key}` });
|
|
}
|
|
}
|
|
}
|
|
|
|
if (failures.length) {
|
|
console.log('Frontmatter issues detected:');
|
|
failures.slice(0, 100).forEach(f => console.log(`- ${f.file}: ${f.reason}`));
|
|
process.exitCode = 1;
|
|
} else {
|
|
console.log('All active docs have required frontmatter.');
|
|
}
|
|
}
|
|
|
|
main().catch(err => {
|
|
console.error(err);
|
|
process.exitCode = 1;
|
|
});
|
|
|