/** * Seed Scaling Blog Post * "How to Scale Tractatus: Breaking the Chicken-and-Egg Problem" */ const { getCollection, connect, close } = require('../src/utils/db.util'); const fs = require('fs'); const path = require('path'); // Read the markdown content const markdown = fs.readFileSync( path.join(__dirname, '../docs/outreach/Blog-Article-Scaling-Tractatus.md'), 'utf8' ); // Extract content (skip frontmatter-style metadata at top) const contentStart = markdown.indexOf('---', markdown.indexOf('---') + 3) + 3; const content = markdown.substring(contentStart).trim(); const BLOG_POST = { title: 'How to Scale Tractatus: Breaking the Chicken-and-Egg Problem', slug: 'scaling-tractatus-roadmap', author: { type: 'human', name: 'John Stroh' }, content: content, excerpt: 'Every governance framework faces the same chicken-and-egg problem: need deployments to validate, need validation to deploy. Here\'s our staged roadmap for breaking the cycle and scaling Tractatus from proof-of-concept to industry adoption.', category: 'Implementation', status: 'published', published_at: new Date('2025-10-20'), moderation: { ai_analysis: null, human_reviewer: 'John Stroh', review_notes: 'Scaling roadmap and pilot partner call-to-action', approved_at: new Date() }, tractatus_classification: { quadrant: 'STRATEGIC', values_sensitive: false, requires_strategic_review: false }, tags: [ 'scaling', 'roadmap', 'implementation', 'enterprise', 'governance', 'pilot-partners', 'stage-2', 'chicken-and-egg' ], view_count: 0, engagement: { shares: 0, comments: 0 } }; async function seedBlogPost() { try { console.log('🌱 Seeding scaling blog post...'); await connect(); const collection = await getCollection('blog_posts'); // Check if post already exists const existing = await collection.findOne({ slug: BLOG_POST.slug }); if (existing) { console.log('šŸ“ Blog post already exists:', BLOG_POST.slug); console.log(' Deleting existing post and creating new one...'); await collection.deleteOne({ slug: BLOG_POST.slug }); } // Insert the blog post const result = await collection.insertOne(BLOG_POST); console.log('āœ… Blog post created successfully'); console.log(' ID:', result.insertedId); console.log(' Slug:', BLOG_POST.slug); console.log(' Title:', BLOG_POST.title); console.log(' Status:', BLOG_POST.status); console.log(' Category:', BLOG_POST.category); console.log(' Tags:', BLOG_POST.tags.join(', ')); console.log(''); console.log('šŸ“ View at: http://localhost:9000/blog-post.html?slug=' + BLOG_POST.slug); console.log('šŸ“ Blog list: http://localhost:9000/blog.html'); } catch (error) { console.error('āŒ Error seeding blog post:', error); throw error; } finally { await close(); } } // Run if called directly if (require.main === module) { seedBlogPost() .then(() => { console.log('\n✨ Seeding complete'); process.exit(0); }) .catch(error => { console.error('\nšŸ’„ Seeding failed:', error); process.exit(1); }); } module.exports = { seedBlogPost, BLOG_POST };