INFRASTRUCTURE COMPLETE (22 public documents from 129 total): CATEGORY CONSOLIDATION (12 → 5): - Eliminated chaotic category proliferation - Defined 5 canonical categories with icons, descriptions - Updated frontend sidebar (public/js/docs-app.js) - Categories: getting-started, research-theory, technical-reference, advanced-topics, business-leadership SCRIPTS CREATED: - comprehensive-document-audit.js: Systematic audit of all 129 docs - generate-public-pdfs.js: Puppeteer-based PDF generation (22 PDFs) - migrate-documents-final.js: DB migration (22 updated, 104 archived) - export-for-production.js: Export 22 docs for production - import-from-export.js: Import documents to production DB - analyze-categories.js: Category analysis tool - prepare-public-docs.js: Document preparation validator AUDIT RESULTS: - docs/DOCUMENT_AUDIT_REPORT.json: Full analysis with recommendations - 22 documents recommended for public visibility - 104 documents to archive (internal/obsolete/poor quality) REMAINING WORK: - Fix inst_016/017/018 violations in 22 public documents (85 violations) • inst_016: Statistics need citations or [NEEDS VERIFICATION] • inst_017: Replace absolute assurance terms with evidence-based language • inst_018: Remove maturity claims or add documented evidence - Regenerate PDFs after content fixes - Regenerate production export file (compliant version) - Deploy to production Database migration already executed in dev (22 updated, 104 archived). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.5 KiB
JavaScript
45 lines
1.5 KiB
JavaScript
const mongoose = require('mongoose');
|
|
const Document = require('../src/models/Document.model');
|
|
|
|
mongoose.connect('mongodb://localhost:27017/tractatus_dev')
|
|
.then(async () => {
|
|
// Get all documents
|
|
const publicDocs = await Document.find({ visibility: 'public' }).sort({ category: 1, order: 1 });
|
|
const archivedDocs = await Document.find({ visibility: 'archived' }).sort({ category: 1, order: 1 });
|
|
|
|
// Group by category
|
|
const categories = {};
|
|
publicDocs.forEach(d => {
|
|
const cat = d.category || 'uncategorized';
|
|
if (!categories[cat]) categories[cat] = [];
|
|
categories[cat].push({
|
|
title: d.title,
|
|
slug: d.slug,
|
|
order: d.order,
|
|
hasSections: d.sections && d.sections.length > 0
|
|
});
|
|
});
|
|
|
|
console.log('=== CURRENT DATABASE CATEGORIES ===\n');
|
|
Object.keys(categories).sort().forEach(cat => {
|
|
console.log(`${cat} (${categories[cat].length} documents):`);
|
|
categories[cat].forEach(d => {
|
|
const sections = d.hasSections ? ' [HAS SECTIONS]' : '';
|
|
console.log(` [order:${d.order}] ${d.title}${sections}`);
|
|
});
|
|
console.log('');
|
|
});
|
|
|
|
console.log('\n=== ARCHIVED DOCUMENTS ===');
|
|
console.log('Count:', archivedDocs.length);
|
|
archivedDocs.forEach(d => {
|
|
console.log(` - ${d.title} (${d.category})`);
|
|
});
|
|
|
|
await mongoose.connection.close();
|
|
process.exit(0);
|
|
})
|
|
.catch(err => {
|
|
console.error('Error:', err);
|
|
process.exit(1);
|
|
});
|