tractatus/scripts/inspect-overview-cards.js
TheFlow 043d14a499 feat(quality): add document quality audit and resequencing scripts
- audit-inflection-point.js: Identify fictional content in research paper
- fix-inflection-point-fiction.js: Remove fabricated statistics
- audit-all-card-sequences.js: Check card sequence quality
- audit-card-category-sequences.js: Analyze pedagogical flow
- resequence-cards-pedagogically.js: Reorder cards for better learning flow
- apply-production-fixes.js: Production deployment script
- inspect-*: Helper scripts for analysis

Quality improvements:
- Removed fictional content from Inflection Point document (3 sections)
- Resequenced 21 documents pedagogically (22-67% jumpiness reduction)
- Implemented proper learning flow: concepts → warnings → technical → reference
2025-10-25 22:40:36 +13:00

57 lines
2 KiB
JavaScript

/**
* Inspect the "Overview" cards to understand their content
* so we can create better titles
*/
const { MongoClient } = require('mongodb');
const DOCS_WITH_OVERVIEW = ['core-concepts', 'implementation-guide-v1.1', 'technical-architecture'];
async function run() {
const client = new MongoClient('mongodb://localhost:27017');
await client.connect();
const db = client.db('tractatus_dev');
const collection = db.collection('documents');
console.log('═══════════════════════════════════════════════════════════');
console.log(' INSPECTING OVERVIEW CARDS');
console.log('═══════════════════════════════════════════════════════════\n');
for (const slug of DOCS_WITH_OVERVIEW) {
const doc = await collection.findOne({ slug });
if (!doc) {
console.log(`⚠️ NOT FOUND: ${slug}\n`);
continue;
}
console.log(`\n📄 ${doc.title}`);
console.log(` Slug: ${slug}`);
const overviewCard = doc.sections?.find(s => s.title === 'Overview');
if (overviewCard) {
console.log(`\n Card #${overviewCard.number}: "${overviewCard.title}"`);
console.log(` Category: ${overviewCard.category}`);
console.log(`\n Excerpt:`);
console.log(` ${overviewCard.excerpt}\n`);
console.log(` Content preview (first 300 chars):`);
const textContent = overviewCard.content_html
.replace(/<[^>]+>/g, ' ')
.replace(/\s+/g, ' ')
.trim();
console.log(` ${textContent.substring(0, 300)}...\n`);
console.log(` Full content length: ${overviewCard.content_html.length} chars\n`);
} else {
console.log(` ❌ No "Overview" card found!\n`);
}
console.log(' ---');
}
await client.close();
}
run().catch(console.error);