diff --git a/docs/DOCUMENT_AUDIT_REPORT.json b/docs/DOCUMENT_AUDIT_REPORT.json new file mode 100644 index 00000000..04bf3f57 --- /dev/null +++ b/docs/DOCUMENT_AUDIT_REPORT.json @@ -0,0 +1,2337 @@ +{ + "timestamp": "2025-10-25T08:01:52.900Z", + "totalDocuments": 129, + "recommendations": { + "PUBLIC": [ + { + "title": "Understanding Value Pluralism in Tractatus", + "slug": "value-pluralism-faq", + "category": "advanced-topics", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 9, + "recommendation": "PUBLIC", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "Well-structured (9 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Research Scope: Feasibility of LLM-Integrated Tractatus Framework", + "slug": "llm-integration-feasibility-research-scope", + "category": "archives", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 20, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (20 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Implementation Guide: Python Code Examples", + "slug": "implementation-guide-python-examples", + "category": "archives", + "order": 3, + "visibility": "archived", + "hasSections": true, + "sectionCount": 10, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (10 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Research Topic: Concurrent Session Architecture Limitations in Claude Code Governance", + "slug": "research-topic-concurrent-session-architecture", + "category": "archives", + "order": 5, + "visibility": "archived", + "hasSections": true, + "sectionCount": 16, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (16 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Research Topic: Rule Proliferation and Transactional Overhead in AI Governance", + "slug": "research-topic-rule-proliferation-transactional-overhead", + "category": "archives", + "order": 6, + "visibility": "archived", + "hasSections": true, + "sectionCount": 15, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (15 sections)" + ], + "quality": "HIGH" + }, + { + "title": "AI Governance Business Case Template - Tractatus Framework", + "slug": "business-case-tractatus-framework", + "category": "business-leadership", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 19, + "recommendation": "PUBLIC", + "suggestedCategory": "business-leadership", + "reasoning": [ + "Public-suitable (BUSINESS)", + "Well-structured (19 sections)" + ], + "quality": "HIGH" + }, + { + "title": "The 27027 Incident: A Case Study in Pattern Recognition Bias", + "slug": "the-27027-incident-a-case-study-in-pattern-recognition-bias", + "category": "case-studies", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 12, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (12 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Real-World AI Governance: A Case Study in Framework Failure and Recovery", + "slug": "real-world-ai-governance-a-case-study-in-framework-failure-and-recovery", + "category": "case-studies", + "order": 4, + "visibility": "public", + "hasSections": true, + "sectionCount": 14, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (14 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Implementation Guide", + "slug": "implementation-guide", + "category": "framework", + "order": 2, + "visibility": "public", + "hasSections": true, + "sectionCount": 11, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (11 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Tractatus AI Safety Framework - Core Values and Principles", + "slug": "tractatus-ai-safety-framework-core-values-and-principles", + "category": "framework", + "order": 4, + "visibility": "public", + "hasSections": true, + "sectionCount": 13, + "recommendation": "PUBLIC", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "Well-structured (13 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Introduction to the Tractatus Framework", + "slug": "introduction", + "category": "getting-started", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 15, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (15 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Core Concepts of the Tractatus Framework", + "slug": "core-concepts", + "category": "getting-started", + "order": 2, + "visibility": "public", + "hasSections": true, + "sectionCount": 13, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (13 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Technical Architecture", + "slug": "technical-architecture", + "category": "governance", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 12, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Well-structured (12 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Executive Brief: Tractatus-Based LLM Architecture for AI Safety", + "slug": "executive-summary-tractatus-inflection-point", + "category": "research-theory", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 14, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (14 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Organizational Theory Foundations of the Tractatus Framework", + "slug": "organizational-theory-foundations", + "category": "research-theory", + "order": 3, + "visibility": "public", + "hasSections": true, + "sectionCount": 8, + "recommendation": "PUBLIC", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "Well-structured (8 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Pluralistic Values: Research Foundations", + "slug": "pluralistic-values-research-foundations", + "category": "research-theory", + "order": 4, + "visibility": "public", + "hasSections": true, + "sectionCount": 12, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (12 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Tractatus Framework Implementation Guide", + "slug": "implementation-guide-v1.1", + "category": "technical-reference", + "order": 3, + "visibility": "public", + "hasSections": true, + "sectionCount": 13, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (13 sections)" + ], + "quality": "HIGH" + }, + { + "title": "API Reference: Complete Endpoint Documentation", + "slug": "api-reference-complete", + "category": "technical-reference", + "order": 7, + "visibility": "public", + "hasSections": true, + "sectionCount": 3, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Structured (3 sections)" + ], + "quality": "MEDIUM" + }, + { + "title": "JavaScript API Integration Examples", + "slug": "api-javascript-examples", + "category": "technical-reference", + "order": 8, + "visibility": "public", + "hasSections": true, + "sectionCount": 8, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Well-structured (8 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Python API Integration Examples", + "slug": "api-python-examples", + "category": "technical-reference", + "order": 9, + "visibility": "public", + "hasSections": true, + "sectionCount": 10, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Well-structured (10 sections)" + ], + "quality": "HIGH" + }, + { + "title": "OpenAPI 3.0 Specification", + "slug": "openapi-specification", + "category": "technical-reference", + "order": 10, + "visibility": "public", + "hasSections": true, + "sectionCount": 4, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Structured (4 sections)" + ], + "quality": "MEDIUM" + } + ], + "REVISE": [ + { + "title": "Research Case Study: Return on Investment of AI Governance Frameworks", + "slug": "research-case-study-return-on-investment-of-ai-governance-frameworks", + "category": "case-studies", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "No sections (may need revision)", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "AI Governance Business Case Template - Tractatus Framework", + "slug": "ai-governance-business-case-template-tractatus-framework", + "category": "framework", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "business-leadership", + "reasoning": [ + "Public-suitable (BUSINESS)", + "No sections (may need revision)", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Core Concepts of the Tractatus Framework", + "slug": "core-concepts-of-the-tractatus-framework", + "category": "framework", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "No sections (may need revision)", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Introduction to the Tractatus Framework", + "slug": "introduction-to-the-tractatus-framework", + "category": "framework", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "No sections (may need revision)", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Research Scope: Feasibility of LLM-Integrated Tractatus Framework", + "slug": "research-scope-feasibility-of-llm-integrated-tractatus-framework", + "category": "governance", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "No sections (may need revision)", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Tractatus Framework Implementation Guide", + "slug": "tractatus-framework-implementation-guide", + "category": "governance", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "No sections (may need revision)", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Organizational Theory Foundations of the Tractatus Framework", + "slug": "organizational-theory-foundations-of-the-tractatus-framework", + "category": "governance", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "No sections (may need revision)", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Framework Performance Analysis & Optimization Strategy", + "slug": "framework-performance-analysis-optimization-strategy", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Phase 2 Cost Estimates: Hosting + API Usage", + "slug": "phase-2-cost-estimates-hosting-api-usage", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Phase 2 Migration API Error - Root Cause Analysis", + "slug": "phase-2-migration-api-error-root-cause-analysis", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Projects & Variables API Documentation", + "slug": "projects-variables-api-documentation", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Rules Management API", + "slug": "rules-management-api", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "JavaScript API Examples", + "slug": "javascript-api-examples", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Python API Examples", + "slug": "python-api-examples", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Phase 3: Project Context Awareness - Architecture Diagram", + "slug": "phase-3-project-context-awareness-architecture-diagram", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Tractatus Original Vision - Gap Analysis 2025", + "slug": "tractatus-original-vision-gap-analysis-2025", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "pluralistic-values-additions", + "slug": "pluralistic-values-additions", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + }, + { + "title": "Value Pluralism in Tractatus: Frequently Asked Questions", + "slug": "value-pluralism-in-tractatus-frequently-asked-questions", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "REVISE", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)", + "Needs content improvement before public" + ], + "quality": "LOW" + } + ], + "ARCHIVE": [ + { + "title": "Pluralistic Values Deliberation Enhancement Plan", + "slug": "pluralistic-values-deliberation-plan-v2", + "category": "advanced-topics", + "order": 2, + "visibility": "public", + "hasSections": true, + "sectionCount": 24, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Appendix B: Case Studies - Real-World LLM Failure Modes", + "slug": "case-studies-real-world-llm-failure-modes-appendix", + "category": "archives", + "order": 2, + "visibility": "archived", + "hasSections": true, + "sectionCount": 12, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (12 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Tractatus Framework Enforcement for Claude Code", + "slug": "tractatus-framework-enforcement-claude-code", + "category": "archives", + "order": 4, + "visibility": "archived", + "hasSections": true, + "sectionCount": 15, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (15 sections)" + ], + "quality": "HIGH" + }, + { + "title": "When Frameworks Fail (And Why That's OK)", + "slug": "when-frameworks-fail-and-why-thats-ok", + "category": "case-studies", + "order": 2, + "visibility": "public", + "hasSections": true, + "sectionCount": 14, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (14 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Our Framework in Action: Detecting and Correcting AI Fabrications", + "slug": "our-framework-in-action-detecting-and-correcting-ai-fabrications", + "category": "case-studies", + "order": 3, + "visibility": "public", + "hasSections": true, + "sectionCount": 8, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (8 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Case Studies - Real-World LLM Failure Modes", + "slug": "case-studies-real-world-llm-failure-modes", + "category": "case-study", + "order": 5, + "visibility": "public", + "hasSections": true, + "sectionCount": 12, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (12 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Tractatus Framework Enforcement for Claude Code", + "slug": "tractatus-framework-enforcement-for-claude-code", + "category": "downloads-resources", + "order": 999, + "visibility": "archived", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Architectural Safeguards Against LLM Hierarchical Dominance", + "slug": "architectural-safeguards-against-llm-hierarchical-dominance-prose", + "category": "getting-started", + "order": 3, + "visibility": "public", + "hasSections": true, + "sectionCount": 17, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (17 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Phase 5 PoC - Session 1 Summary", + "slug": "phase-5-poc-session-1-summary", + "category": "governance", + "order": 7, + "visibility": "public", + "hasSections": true, + "sectionCount": 14, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (DEVELOPMENT)" + ], + "quality": "N/A" + }, + { + "title": "Phase 5 PoC - Session 2 Summary", + "slug": "phase-5-poc-session-2-summary", + "category": "governance", + "order": 8, + "visibility": "public", + "hasSections": true, + "sectionCount": 15, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (DEVELOPMENT)" + ], + "quality": "N/A" + }, + { + "title": "Comparison Matrix: Claude Code, CLAUDE.md, and Tractatus Framework", + "slug": "comparison-matrix-claude-code-claudemd-and-tractatus-framework", + "category": "governance", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Tractatus Agentic Governance Framework", + "slug": "tractatus-agentic-governance-framework", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "The Tractatus Inflection Point: When Governance Frameworks Outperform Instructions", + "slug": "the-tractatus-inflection-point-when-governance-frameworks-outperform-instructions", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "📊 Anthropic Memory API Integration Assessment", + "slug": "-anthropic-memory-api-integration-assessment", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Phase 5 PoC - Integration Roadmap", + "slug": "phase-5-poc-integration-roadmap", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Phase 5 Memory Tool PoC - API Capabilities Assessment", + "slug": "phase-5-memory-tool-poc-api-capabilities-assessment", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Phase 5 PoC - Session 3 Summary", + "slug": "phase-5-poc-session-3-summary", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (DEVELOPMENT)" + ], + "quality": "N/A" + }, + { + "title": "Phase 5 Week 1 Implementation Log", + "slug": "phase-5-week-1-implementation-log", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (DEVELOPMENT)" + ], + "quality": "N/A" + }, + { + "title": "Phase 5 PoC - Week 2 Summary", + "slug": "phase-5-poc-week-2-summary", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (DEVELOPMENT)" + ], + "quality": "N/A" + }, + { + "title": "Phase 5 PoC - Week 3 Summary", + "slug": "phase-5-poc-week-3-summary", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (DEVELOPMENT)" + ], + "quality": "N/A" + }, + { + "title": "Structural Governance for Agentic AI: The Tractatus Inflection Point", + "slug": "structural-governance-for-agentic-ai-the-tractatus-inflection-point", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Automated Public Documentation Sync - Setup Guide", + "slug": "automated-public-documentation-sync-setup-guide", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (INTERNAL_TECH)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Framework - Benchmark Suite Results", + "slug": "tractatus-framework-benchmark-suite-results", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (INTERNAL_TECH)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Blog Post Outlines", + "slug": "tractatus-blog-post-outlines", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Blog Curation Workflow Documentation", + "slug": "blog-curation-workflow-documentation", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Blog Implementation Validation Report", + "slug": "blog-implementation-validation-report", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Continuous Flow Workflow - Remaining 34 Documents", + "slug": "continuous-flow-workflow-remaining-34-documents", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Documentation Audit & Reorganization Plan", + "slug": "tractatus-documentation-audit-reorganization-plan", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Document Optimization Workflow", + "slug": "document-optimization-workflow", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Documentation Reorganization Summary", + "slug": "tractatus-documentation-reorganization-summary", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Document Security Governance Controls", + "slug": "document-security-governance-controls", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Feature-Rich UI Implementation Plan", + "slug": "feature-rich-ui-implementation-plan", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "CRITICAL FRAMEWORK FAILURE - 2025-10-09", + "slug": "critical-framework-failure-2025-10-09", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Tractatus Framework - Governance Rule Library", + "slug": "tractatus-framework-governance-rule-library", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Tractatus Project - Implementation Progress Report", + "slug": "tractatus-project-implementation-progress-report", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Koha Donation System - Security Audit Report", + "slug": "koha-donation-system-security-audit-report", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (INTERNAL_TECH)" + ], + "quality": "N/A" + }, + { + "title": "Koha Production Deployment Guide", + "slug": "koha-production-deployment-guide", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (INTERNAL_TECH)" + ], + "quality": "N/A" + }, + { + "title": "Koha Donation System - Stripe Setup Guide", + "slug": "koha-donation-system-stripe-setup-guide", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (INTERNAL_TECH)" + ], + "quality": "N/A" + }, + { + "title": "Multi-Project Governance System - Implementation Plan", + "slug": "multi-project-governance-system-implementation-plan", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Phase 2 Deployment Guide - Granular Task Instructions", + "slug": "phase-2-deployment-guide-granular-task-instructions", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (INTERNAL_TECH)" + ], + "quality": "N/A" + }, + { + "title": "Phase 2 Soft Launch Email Templates", + "slug": "phase-2-soft-launch-email-templates", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Phase 2 Infrastructure Plan", + "slug": "phase-2-infrastructure-plan", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Phase 2 Kickoff Checklist", + "slug": "phase-2-kickoff-checklist", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Phase 2 Preparation Advisory", + "slug": "phase-2-preparation-advisory", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Phase 2: Production Deployment & AI Features", + "slug": "phase-2-production-deployment-ai-features", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Phase 2 Progress Report - Week 5", + "slug": "phase-2-progress-report-week-5", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Phase 2 Roadmap: Production Deployment & AI-Powered Features", + "slug": "phase-2-roadmap-production-deployment-ai-powered-features", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Production Deployment Checklist", + "slug": "production-deployment-checklist", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Production Monitoring Setup", + "slug": "production-monitoring-setup", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Security Audit Report", + "slug": "security-audit-report", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (INTERNAL_TECH)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Security Audit Report", + "slug": "tractatus-security-audit-report", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (INTERNAL_TECH)" + ], + "quality": "N/A" + }, + { + "title": "AI Features Implementation Session - 2025-10-07", + "slug": "ai-features-implementation-session-2025-10-07", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Session Handoff Document", + "slug": "session-handoff-document", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: October 11, 2025", + "slug": "session-handoff-october-11-2025", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: October 11, 2025 (Priorities 3 & 4)", + "slug": "session-handoff-october-11-2025-priorities-3-4", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Init API Memory Audit & Optimization Plan", + "slug": "session-init-api-memory-audit-optimization-plan", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Production - Comprehensive Testing Checklist", + "slug": "tractatus-production-comprehensive-testing-checklist", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Production - Testing Results", + "slug": "tractatus-production-testing-results", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Multi-Project Governance - User Guide", + "slug": "multi-project-governance-user-guide", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Rule Manager - User Guide", + "slug": "rule-manager-user-guide", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Document Optimization Workflow Refinements", + "slug": "document-optimization-workflow-refinements", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PROCESS)" + ], + "quality": "N/A" + }, + { + "title": "Accessibility Improvements - October 2025", + "slug": "accessibility-improvements-october-2025", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Coding Best Practices - Governance Rules Summary", + "slug": "coding-best-practices-governance-rules-summary", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Monthly Review Schedule - Tractatus Governance", + "slug": "monthly-review-schedule-tractatus-governance", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Privacy-Preserving Analytics Implementation Plan", + "slug": "privacy-preserving-analytics-implementation-plan", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Phase 3: Project Context Awareness - Implementation Plan", + "slug": "phase-3-project-context-awareness-implementation-plan", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Phase 3 Session 1: Backend Foundation - Summary", + "slug": "phase-3-session-1-backend-foundation-summary", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Phase 3: Project Context Awareness - Quick Reference", + "slug": "phase-3-project-context-awareness-quick-reference", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Translation Approach for Task 19: Te Reo Māori & Multilanguage Support", + "slug": "translation-approach-for-task-19-te-reo-mori-multilanguage-support", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Integrated Implementation Roadmap 2025", + "slug": "integrated-implementation-roadmap-2025", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Research Enhancement Roadmap 2025", + "slug": "research-enhancement-roadmap-2025", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Pluralistic Values Deliberation Enhancement Plan", + "slug": "pluralistic-values-deliberation-enhancement-plan", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Governance Framework - Test Suite Improvement Session Part 2", + "slug": "tractatus-governance-framework-test-suite-improvement-session-part-2", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: CrossReferenceValidator Debugging", + "slug": "session-handoff-crossreferencevalidator-debugging", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff - 2025-10-07 Part 4: Governance Active & Progress Review", + "slug": "session-handoff-2025-10-07-part-4-governance-active-progress-review", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: Tractatus Framework Activation", + "slug": "session-handoff-tractatus-framework-activation", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff - 2025-10-07", + "slug": "session-handoff-2025-10-07", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: Value Pluralism - Production Ready 🎉", + "slug": "session-handoff-value-pluralism-prod-ready-", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: Value Pluralism Implementation COMPLETE", + "slug": "session-handoff-value-pluralism-implementation-complete", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: Database Investigation and Introduction Fix ✅", + "slug": "session-handoff-database-investigation-and-introduction-fix-", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: Value Pluralism Deployment Complete ✅", + "slug": "session-handoff-value-pluralism-deployment-complete-", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: UI Fixes and Security Remediation ✅", + "slug": "session-handoff-ui-fixes-and-security-remediation-", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Session Handoff: Value Pluralism Test Validation", + "slug": "session-handoff-value-pluralism-test-validation", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (SESSIONS)" + ], + "quality": "N/A" + }, + { + "title": "Phase 2: AI Rule Optimizer & CLAUDE.md Analyzer - Test Results", + "slug": "phase-2-ai-rule-optimizer-claudemd-analyzer-test-results", + "category": "none", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Uncategorized", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Tractatus Agentic Governance System - Glossary of Terms", + "slug": "tractatus-agentic-governance-system-glossary-of-terms", + "category": "reference", + "order": 999, + "visibility": "public", + "sectionCount": 0, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "No sections (may need revision)", + "⚠️ Default order (not prioritized)" + ], + "quality": "LOW" + }, + { + "title": "Tractatus: Architectural Enforcement for AI Development Governance", + "slug": "tractatus-framework-research", + "category": "research-theory", + "order": 0, + "visibility": "public", + "hasSections": true, + "sectionCount": 14, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (14 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Tractatus Agentic Governance Framework", + "slug": "architectural-overview-and-research-status", + "category": "research-theory", + "order": 2, + "visibility": "public", + "hasSections": true, + "sectionCount": 18, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (18 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Implementation Roadmap: 24-Month Deployment Plan", + "slug": "implementation-roadmap-24-month-deployment-plan", + "category": "technical-reference", + "order": 4, + "visibility": "public", + "hasSections": true, + "sectionCount": 10, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Internal document (PLANNING)" + ], + "quality": "N/A" + }, + { + "title": "Tractatus Agentic Governance System - Glossary of Terms", + "slug": "GLOSSARY", + "category": "technical-reference", + "order": 5, + "visibility": "public", + "hasSections": true, + "sectionCount": 16, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (16 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Comparison Matrix: Claude Code, CLAUDE.md, and Tractatus Framework", + "slug": "comparison-matrix", + "category": "technical-reference", + "order": 6, + "visibility": "public", + "hasSections": true, + "sectionCount": 12, + "recommendation": "ARCHIVE", + "suggestedCategory": null, + "reasoning": [ + "Well-structured (12 sections)" + ], + "quality": "HIGH" + } + ], + "REMOVE": [] + }, + "categorySuggestions": { + "advanced-topics": [ + { + "title": "Understanding Value Pluralism in Tractatus", + "slug": "value-pluralism-faq", + "category": "advanced-topics", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 9, + "recommendation": "PUBLIC", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "Well-structured (9 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Tractatus AI Safety Framework - Core Values and Principles", + "slug": "tractatus-ai-safety-framework-core-values-and-principles", + "category": "framework", + "order": 4, + "visibility": "public", + "hasSections": true, + "sectionCount": 13, + "recommendation": "PUBLIC", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "Well-structured (13 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Organizational Theory Foundations of the Tractatus Framework", + "slug": "organizational-theory-foundations", + "category": "research-theory", + "order": 3, + "visibility": "public", + "hasSections": true, + "sectionCount": 8, + "recommendation": "PUBLIC", + "suggestedCategory": "advanced-topics", + "reasoning": [ + "Public-suitable (EDUCATIONAL)", + "Well-structured (8 sections)" + ], + "quality": "HIGH" + } + ], + "research-theory": [ + { + "title": "Research Scope: Feasibility of LLM-Integrated Tractatus Framework", + "slug": "llm-integration-feasibility-research-scope", + "category": "archives", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 20, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (20 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Research Topic: Concurrent Session Architecture Limitations in Claude Code Governance", + "slug": "research-topic-concurrent-session-architecture", + "category": "archives", + "order": 5, + "visibility": "archived", + "hasSections": true, + "sectionCount": 16, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (16 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Research Topic: Rule Proliferation and Transactional Overhead in AI Governance", + "slug": "research-topic-rule-proliferation-transactional-overhead", + "category": "archives", + "order": 6, + "visibility": "archived", + "hasSections": true, + "sectionCount": 15, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (15 sections)" + ], + "quality": "HIGH" + }, + { + "title": "The 27027 Incident: A Case Study in Pattern Recognition Bias", + "slug": "the-27027-incident-a-case-study-in-pattern-recognition-bias", + "category": "case-studies", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 12, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (12 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Real-World AI Governance: A Case Study in Framework Failure and Recovery", + "slug": "real-world-ai-governance-a-case-study-in-framework-failure-and-recovery", + "category": "case-studies", + "order": 4, + "visibility": "public", + "hasSections": true, + "sectionCount": 14, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (14 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Pluralistic Values: Research Foundations", + "slug": "pluralistic-values-research-foundations", + "category": "research-theory", + "order": 4, + "visibility": "public", + "hasSections": true, + "sectionCount": 12, + "recommendation": "PUBLIC", + "suggestedCategory": "research-theory", + "reasoning": [ + "Public-suitable (RESEARCH)", + "Well-structured (12 sections)" + ], + "quality": "HIGH" + } + ], + "getting-started": [ + { + "title": "Implementation Guide: Python Code Examples", + "slug": "implementation-guide-python-examples", + "category": "archives", + "order": 3, + "visibility": "archived", + "hasSections": true, + "sectionCount": 10, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (10 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Implementation Guide", + "slug": "implementation-guide", + "category": "framework", + "order": 2, + "visibility": "public", + "hasSections": true, + "sectionCount": 11, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (11 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Introduction to the Tractatus Framework", + "slug": "introduction", + "category": "getting-started", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 15, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (15 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Core Concepts of the Tractatus Framework", + "slug": "core-concepts", + "category": "getting-started", + "order": 2, + "visibility": "public", + "hasSections": true, + "sectionCount": 13, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (13 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Executive Brief: Tractatus-Based LLM Architecture for AI Safety", + "slug": "executive-summary-tractatus-inflection-point", + "category": "research-theory", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 14, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (14 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Tractatus Framework Implementation Guide", + "slug": "implementation-guide-v1.1", + "category": "technical-reference", + "order": 3, + "visibility": "public", + "hasSections": true, + "sectionCount": 13, + "recommendation": "PUBLIC", + "suggestedCategory": "getting-started", + "reasoning": [ + "Public-suitable (REQUIRED)", + "Well-structured (13 sections)" + ], + "quality": "HIGH" + } + ], + "business-leadership": [ + { + "title": "AI Governance Business Case Template - Tractatus Framework", + "slug": "business-case-tractatus-framework", + "category": "business-leadership", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 19, + "recommendation": "PUBLIC", + "suggestedCategory": "business-leadership", + "reasoning": [ + "Public-suitable (BUSINESS)", + "Well-structured (19 sections)" + ], + "quality": "HIGH" + } + ], + "technical-reference": [ + { + "title": "Technical Architecture", + "slug": "technical-architecture", + "category": "governance", + "order": 1, + "visibility": "public", + "hasSections": true, + "sectionCount": 12, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Well-structured (12 sections)" + ], + "quality": "HIGH" + }, + { + "title": "API Reference: Complete Endpoint Documentation", + "slug": "api-reference-complete", + "category": "technical-reference", + "order": 7, + "visibility": "public", + "hasSections": true, + "sectionCount": 3, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Structured (3 sections)" + ], + "quality": "MEDIUM" + }, + { + "title": "JavaScript API Integration Examples", + "slug": "api-javascript-examples", + "category": "technical-reference", + "order": 8, + "visibility": "public", + "hasSections": true, + "sectionCount": 8, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Well-structured (8 sections)" + ], + "quality": "HIGH" + }, + { + "title": "Python API Integration Examples", + "slug": "api-python-examples", + "category": "technical-reference", + "order": 9, + "visibility": "public", + "hasSections": true, + "sectionCount": 10, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Well-structured (10 sections)" + ], + "quality": "HIGH" + }, + { + "title": "OpenAPI 3.0 Specification", + "slug": "openapi-specification", + "category": "technical-reference", + "order": 10, + "visibility": "public", + "hasSections": true, + "sectionCount": 4, + "recommendation": "PUBLIC", + "suggestedCategory": "technical-reference", + "reasoning": [ + "Public-suitable (TECHNICAL)", + "Structured (4 sections)" + ], + "quality": "MEDIUM" + } + ] + } +} \ No newline at end of file diff --git a/public/js/docs-app.js b/public/js/docs-app.js index 9b5ae47b..391209e9 100644 --- a/public/js/docs-app.js +++ b/public/js/docs-app.js @@ -7,12 +7,12 @@ if (typeof DocumentCards !== 'undefined') { documentCards = new DocumentCards('document-content'); } -// Document categorization - Granular categories for better organization +// Document categorization - Final 5 categories (curated for public docs) const CATEGORIES = { 'getting-started': { - label: '🚀 Getting Started', - icon: '🚀', - description: 'Introduction, core concepts, and quick start guides', + label: '📚 Getting Started', + icon: '📚', + description: 'Introduction, core concepts, and implementation guides', order: 1, color: 'blue', bgColor: 'bg-blue-50', @@ -20,32 +20,32 @@ const CATEGORIES = { textColor: 'text-blue-700', collapsed: false }, + 'research-theory': { + label: '🔬 Research & Theory', + icon: '🔬', + description: 'Research papers, case studies, theoretical foundations', + order: 2, + color: 'purple', + bgColor: 'bg-purple-50', + borderColor: 'border-l-4 border-purple-500', + textColor: 'text-purple-700', + collapsed: false // Expanded to show Working Paper v0.1 + }, 'technical-reference': { label: '🔌 Technical Reference', icon: '🔌', - description: 'API docs, implementation guides, code examples', - order: 2, + description: 'API documentation, code examples, architecture', + order: 3, color: 'green', bgColor: 'bg-green-50', borderColor: 'border-l-4 border-green-500', textColor: 'text-green-700', collapsed: true }, - 'research-theory': { - label: '🔬 Theory & Research', - icon: '🔬', - description: 'Research papers, theoretical foundations, academic content', - order: 3, - color: 'purple', - bgColor: 'bg-purple-50', - borderColor: 'border-l-4 border-purple-500', - textColor: 'text-purple-700', - collapsed: true - }, 'advanced-topics': { label: '🎓 Advanced Topics', icon: '🎓', - description: 'Value pluralism, deep dives, comparative analysis', + description: 'Value pluralism, organizational theory, advanced concepts', order: 4, color: 'teal', bgColor: 'bg-teal-50', @@ -53,22 +53,11 @@ const CATEGORIES = { textColor: 'text-teal-700', collapsed: true }, - 'case-studies': { - label: '📊 Case Studies', - icon: '📊', - description: 'Real-world examples, failure modes, success stories', - order: 5, - color: 'amber', - bgColor: 'bg-amber-50', - borderColor: 'border-l-4 border-amber-500', - textColor: 'text-amber-700', - collapsed: true - }, 'business-leadership': { label: '💼 Business & Leadership', icon: '💼', - description: 'Business cases, executive briefs, ROI analysis', - order: 6, + description: 'Business cases, ROI analysis, executive briefs', + order: 5, color: 'pink', bgColor: 'bg-pink-50', borderColor: 'border-l-4 border-pink-500', diff --git a/scripts/analyze-categories.js b/scripts/analyze-categories.js new file mode 100644 index 00000000..74d3c900 --- /dev/null +++ b/scripts/analyze-categories.js @@ -0,0 +1,45 @@ +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); + }); diff --git a/scripts/comprehensive-document-audit.js b/scripts/comprehensive-document-audit.js new file mode 100644 index 00000000..7228bb20 --- /dev/null +++ b/scripts/comprehensive-document-audit.js @@ -0,0 +1,243 @@ +/** + * Comprehensive Document Audit + * Analyzes all documents in development database for: + * 1. Public suitability + * 2. Category assignment + * 3. Quality assessment + * 4. Archive/removal recommendations + */ + +const { MongoClient } = require('mongodb'); + +// Audit criteria +const AUDIT_CRITERIA = { + PUBLIC_SUITABLE: { + // Documents that should be public-facing + REQUIRED: [ + 'Introduction', 'Getting Started', 'Core Concepts', + 'Executive Brief', 'Framework Overview', 'Implementation Guide' + ], + RESEARCH: ['Research', 'Working Paper', 'Study', 'Analysis'], + TECHNICAL: ['API', 'Technical', 'Architecture', 'Integration'], + BUSINESS: ['Business Case', 'ROI', 'Leadership'], + EDUCATIONAL: ['Case Study', 'Values', 'Pluralism', 'Theory'] + }, + + INTERNAL_ONLY: { + SESSIONS: ['Session Handoff', 'Session Init', 'Session Summary', 'Part 1', 'Part 2', 'Part 3', 'Part 4'], + PROCESS: ['Workflow', 'Process', 'Checklist', 'Progress Report'], + PLANNING: ['Plan', 'Roadmap', 'Assessment', 'Advisory'], + DEVELOPMENT: ['PoC', 'Proof of Concept', 'Week 1', 'Week 2', 'Week 3'], + INTERNAL_TECH: ['Benchmark', 'Audit Report', 'Deployment Guide', 'Setup Guide'] + }, + + QUALITY_MARKERS: { + HIGH: ['has sections', 'complete', 'published', 'reviewed'], + MEDIUM: ['draft', 'in progress'], + LOW: ['incomplete', 'obsolete', 'deprecated', 'old'] + } +}; + +async function auditDocument(doc) { + const audit = { + title: doc.title, + slug: doc.slug, + category: doc.category, + order: doc.order, + visibility: doc.visibility, + hasSections: doc.sections && doc.sections.length > 0, + sectionCount: doc.sections ? doc.sections.length : 0, + recommendation: 'ANALYZE', // PUBLIC, ARCHIVE, REMOVE, REVISE + suggestedCategory: null, + reasoning: [], + quality: 'UNKNOWN' // HIGH, MEDIUM, LOW + }; + + const titleLower = doc.title.toLowerCase(); + const slugLower = doc.slug.toLowerCase(); + + // Check if internal-only document + for (const [type, patterns] of Object.entries(AUDIT_CRITERIA.INTERNAL_ONLY)) { + if (patterns.some(p => titleLower.includes(p.toLowerCase()))) { + audit.recommendation = 'ARCHIVE'; + audit.reasoning.push(`Internal document (${type})`); + audit.quality = 'N/A'; + return audit; + } + } + + // Check if public-suitable + let isPublicSuitable = false; + + for (const [type, patterns] of Object.entries(AUDIT_CRITERIA.PUBLIC_SUITABLE)) { + if (patterns.some(p => titleLower.includes(p.toLowerCase()))) { + isPublicSuitable = true; + + // Suggest category based on type + if (type === 'REQUIRED') audit.suggestedCategory = 'getting-started'; + else if (type === 'RESEARCH') audit.suggestedCategory = 'research-theory'; + else if (type === 'TECHNICAL') audit.suggestedCategory = 'technical-reference'; + else if (type === 'BUSINESS') audit.suggestedCategory = 'business-leadership'; + else if (type === 'EDUCATIONAL') { + if (titleLower.includes('case study')) audit.suggestedCategory = 'case-studies'; + else audit.suggestedCategory = 'advanced-topics'; + } + + audit.reasoning.push(`Public-suitable (${type})`); + break; + } + } + + // Quality assessment + if (audit.hasSections && audit.sectionCount >= 5) { + audit.quality = 'HIGH'; + audit.reasoning.push(`Well-structured (${audit.sectionCount} sections)`); + } else if (audit.hasSections) { + audit.quality = 'MEDIUM'; + audit.reasoning.push(`Structured (${audit.sectionCount} sections)`); + } else { + audit.quality = 'LOW'; + audit.reasoning.push('No sections (may need revision)'); + } + + // Check current category + if (doc.category === 'none' || !doc.category) { + audit.reasoning.push('⚠️ Uncategorized'); + } + + if (doc.order === 999) { + audit.reasoning.push('⚠️ Default order (not prioritized)'); + } + + // Final recommendation + if (isPublicSuitable && audit.quality !== 'LOW') { + audit.recommendation = 'PUBLIC'; + } else if (isPublicSuitable && audit.quality === 'LOW') { + audit.recommendation = 'REVISE'; + audit.reasoning.push('Needs content improvement before public'); + } else if (!isPublicSuitable) { + audit.recommendation = 'ARCHIVE'; + } + + return audit; +} + +async function run() { + const client = new MongoClient('mongodb://localhost:27017'); + + try { + await client.connect(); + const db = client.db('tractatus_dev'); + const collection = db.collection('documents'); + + const allDocs = await collection.find({}).sort({ category: 1, order: 1 }).toArray(); + + console.log('═══════════════════════════════════════════════════════════'); + console.log(' COMPREHENSIVE DOCUMENT AUDIT'); + console.log('═══════════════════════════════════════════════════════════\n'); + console.log(`Total documents: ${allDocs.length}\n`); + + const audits = []; + for (const doc of allDocs) { + const audit = await auditDocument(doc); + audits.push(audit); + } + + // Group by recommendation + const byRecommendation = { + PUBLIC: audits.filter(a => a.recommendation === 'PUBLIC'), + REVISE: audits.filter(a => a.recommendation === 'REVISE'), + ARCHIVE: audits.filter(a => a.recommendation === 'ARCHIVE'), + REMOVE: audits.filter(a => a.recommendation === 'REMOVE') + }; + + // Summary + console.log('═══════════════════════════════════════════════════════════'); + console.log(' SUMMARY'); + console.log('═══════════════════════════════════════════════════════════\n'); + console.log(`PUBLIC (should be on /docs.html): ${byRecommendation.PUBLIC.length}`); + console.log(`REVISE (needs work before public): ${byRecommendation.REVISE.length}`); + console.log(`ARCHIVE (internal, keep but hide): ${byRecommendation.ARCHIVE.length}`); + console.log(`REMOVE (obsolete, delete): ${byRecommendation.REMOVE.length}\n`); + + // Detailed recommendations + console.log('═══════════════════════════════════════════════════════════'); + console.log(' 1. RECOMMENDED FOR PUBLIC (/docs.html)'); + console.log('═══════════════════════════════════════════════════════════\n'); + + const byCategory = {}; + byRecommendation.PUBLIC.forEach(a => { + const cat = a.suggestedCategory || a.category || 'uncategorized'; + if (!byCategory[cat]) byCategory[cat] = []; + byCategory[cat].push(a); + }); + + Object.keys(byCategory).sort().forEach(cat => { + console.log(`\n${cat.toUpperCase()} (${byCategory[cat].length} documents):`); + byCategory[cat].forEach(a => { + console.log(` ✓ ${a.title}`); + console.log(` Quality: ${a.quality} | Sections: ${a.sectionCount}`); + if (a.category !== a.suggestedCategory && a.suggestedCategory) { + console.log(` ⚠️ Move from "${a.category}" to "${a.suggestedCategory}"`); + } + }); + }); + + console.log('\n\n═══════════════════════════════════════════════════════════'); + console.log(' 2. NEEDS REVISION BEFORE PUBLIC'); + console.log('═══════════════════════════════════════════════════════════\n'); + byRecommendation.REVISE.forEach(a => { + console.log(` ⚠️ ${a.title}`); + console.log(` Current: ${a.category} | Suggested: ${a.suggestedCategory}`); + console.log(` Reason: ${a.reasoning.join(', ')}\n`); + }); + + console.log('\n═══════════════════════════════════════════════════════════'); + console.log(' 3. RECOMMENDED FOR ARCHIVE'); + console.log('═══════════════════════════════════════════════════════════\n'); + + const archiveGroups = {}; + byRecommendation.ARCHIVE.forEach(a => { + const reason = a.reasoning[0] || 'Other'; + if (!archiveGroups[reason]) archiveGroups[reason] = []; + archiveGroups[reason].push(a.title); + }); + + Object.keys(archiveGroups).forEach(reason => { + console.log(`\n${reason} (${archiveGroups[reason].length}):`); + archiveGroups[reason].slice(0, 5).forEach(title => { + console.log(` - ${title}`); + }); + if (archiveGroups[reason].length > 5) { + console.log(` ... and ${archiveGroups[reason].length - 5} more`); + } + }); + + // Save detailed audit to file + const fs = require('fs'); + const auditReport = { + timestamp: new Date().toISOString(), + totalDocuments: allDocs.length, + recommendations: byRecommendation, + categorySuggestions: byCategory + }; + + fs.writeFileSync( + 'docs/DOCUMENT_AUDIT_REPORT.json', + JSON.stringify(auditReport, null, 2) + ); + + console.log('\n\n═══════════════════════════════════════════════════════════'); + console.log(' Full audit report saved to: docs/DOCUMENT_AUDIT_REPORT.json'); + console.log('═══════════════════════════════════════════════════════════\n'); + + await client.close(); + process.exit(0); + } catch (error) { + console.error('Error:', error); + await client.close(); + process.exit(1); + } +} + +run(); diff --git a/scripts/export-for-production.js b/scripts/export-for-production.js new file mode 100644 index 00000000..fece14b0 --- /dev/null +++ b/scripts/export-for-production.js @@ -0,0 +1,121 @@ +/** + * Export Curated Documents for Production + * + * Exports the 22 curated public documents (with PDFs and sections) + * for import into production database + * + * Usage: node scripts/export-for-production.js + */ + +const { MongoClient } = require('mongodb'); +const fs = require('fs').promises; +const path = require('path'); + +// 22 curated public documents +const PUBLIC_SLUGS = [ + // Getting Started (6) + 'introduction', + 'core-concepts', + 'executive-summary-tractatus-inflection-point', + 'implementation-guide-v1.1', + 'implementation-guide', + 'implementation-guide-python-examples', + + // Research & Theory (7) + 'tractatus-framework-research', // Working Paper v0.1 - CRITICAL + 'pluralistic-values-research-foundations', + 'the-27027-incident-a-case-study-in-pattern-recognition-bias', + 'real-world-ai-governance-a-case-study-in-framework-failure-and-recovery', + 'llm-integration-feasibility-research-scope', + 'research-topic-concurrent-session-architecture', + 'research-topic-rule-proliferation-transactional-overhead', + + // Technical Reference (5) + 'technical-architecture', + 'api-reference-complete', + 'api-javascript-examples', + 'api-python-examples', + 'openapi-specification', + + // Advanced Topics (3) + 'value-pluralism-faq', + 'tractatus-ai-safety-framework-core-values-and-principles', + 'organizational-theory-foundations', + + // Business Leadership (1) + 'business-case-tractatus-framework' +]; + +async function run() { + const client = new MongoClient('mongodb://localhost:27017'); + + try { + await client.connect(); + const db = client.db('tractatus_dev'); + const collection = db.collection('documents'); + + console.log('═══════════════════════════════════════════════════════════'); + console.log(' EXPORTING DOCUMENTS FOR PRODUCTION'); + console.log('═══════════════════════════════════════════════════════════\n'); + console.log(`Target documents: ${PUBLIC_SLUGS.length}\n`); + + const documents = []; + const notFound = []; + + for (const slug of PUBLIC_SLUGS) { + const doc = await collection.findOne({ slug }); + + if (!doc) { + console.log(` ⚠️ NOT FOUND: ${slug}`); + notFound.push(slug); + continue; + } + + // Remove MongoDB _id for clean import + delete doc._id; + + // Ensure updated_at is set + doc.updated_at = new Date(); + + documents.push(doc); + console.log(` ✓ Exported: ${doc.title} (${doc.category}, order ${doc.order})`); + } + + // Save to file + const exportPath = path.join(__dirname, '../docs/PRODUCTION_DOCUMENTS_EXPORT.json'); + await fs.writeFile(exportPath, JSON.stringify({ + exported_at: new Date().toISOString(), + total_documents: documents.length, + documents + }, null, 2)); + + console.log('\n═══════════════════════════════════════════════════════════'); + console.log(' EXPORT SUMMARY'); + console.log('═══════════════════════════════════════════════════════════\n'); + console.log(` ✅ Exported: ${documents.length}`); + console.log(` ⚠️ Not found: ${notFound.length}`); + console.log(`\n 📄 File: ${exportPath}\n`); + + if (notFound.length > 0) { + console.log(' Not found:'); + notFound.forEach(slug => console.log(` - ${slug}`)); + console.log(''); + } + + console.log('\n Next steps:'); + console.log(' 1. Review the export file'); + console.log(' 2. Copy to production server:'); + console.log(' scp -i ~/.ssh/tractatus_deploy docs/PRODUCTION_DOCUMENTS_EXPORT.json ubuntu@vps-93a693da.vps.ovh.net:/tmp/'); + console.log(' 3. Import on production:'); + console.log(' node scripts/import-from-export.js /tmp/PRODUCTION_DOCUMENTS_EXPORT.json\n'); + + await client.close(); + process.exit(0); + } catch (error) { + console.error('Export error:', error); + await client.close(); + process.exit(1); + } +} + +run(); diff --git a/scripts/generate-public-pdfs.js b/scripts/generate-public-pdfs.js new file mode 100644 index 00000000..661f084f --- /dev/null +++ b/scripts/generate-public-pdfs.js @@ -0,0 +1,360 @@ +/** + * Generate PDFs for All Public Documents + * Creates downloadable PDFs for documents that will be visible on /docs.html + * Uses Puppeteer (headless Chrome) for PDF generation + */ + +const { MongoClient } = require('mongodb'); +const puppeteer = require('puppeteer'); +const fs = require('fs').promises; +const path = require('path'); + +// Correct slugs for public documents (verified from database) +const PUBLIC_DOCS = [ + // Getting Started (6) + 'introduction', + 'core-concepts', + 'executive-summary-tractatus-inflection-point', + 'implementation-guide-v1.1', + 'implementation-guide', + 'implementation-guide-python-examples', + + // Research & Theory (7) + 'tractatus-framework-research', // Working Paper v0.1 + 'pluralistic-values-research-foundations', + 'the-27027-incident-a-case-study-in-pattern-recognition-bias', + 'real-world-ai-governance-a-case-study-in-framework-failure-and-recovery', + 'llm-integration-feasibility-research-scope', + 'research-topic-concurrent-session-architecture', + 'research-topic-rule-proliferation-transactional-overhead', + + // Technical Reference (5) + 'technical-architecture', + 'api-reference-complete', + 'api-javascript-examples', + 'api-python-examples', + 'openapi-specification', + + // Advanced Topics (3) + 'value-pluralism-faq', + 'tractatus-ai-safety-framework-core-values-and-principles', + 'organizational-theory-foundations', + + // Business Leadership (1) + 'business-case-tractatus-framework' +]; + +function generatePdfHtml(doc) { + let contentHtml = ''; + + if (doc.sections && doc.sections.length > 0) { + // Build from sections + doc.sections.forEach(section => { + contentHtml += `

${section.title}

\n`; + if (section.content_html) { + contentHtml += section.content_html + '\n'; + } + }); + } else if (doc.content_html) { + contentHtml = doc.content_html; + } + + return ` + + + + + + ${doc.title} + + + +
+

${doc.title}

+
+

Tractatus AI Safety Framework

+

${new Date().toISOString().split('T')[0]}

+
+
+
+ ${contentHtml} +
+ +`; +} + +async function generatePDF(doc, browser) { + try { + const outputPdf = path.join(__dirname, `../public/downloads/${doc.slug}.pdf`); + + // Generate HTML + const html = generatePdfHtml(doc); + + // Create new page + const page = await browser.newPage(); + + // Set content + await page.setContent(html, { + waitUntil: 'networkidle0' + }); + + // Generate PDF + await page.pdf({ + path: outputPdf, + format: 'A4', + printBackground: true, + margin: { + top: '2cm', + right: '2cm', + bottom: '2cm', + left: '2cm' + } + }); + + await page.close(); + + console.log(` ✓ Generated: ${doc.slug}.pdf`); + return { success: true, slug: doc.slug }; + } catch (error) { + console.error(` ✗ Failed: ${doc.slug} - ${error.message}`); + return { success: false, slug: doc.slug, error: error.message }; + } +} + +async function run() { + const client = new MongoClient('mongodb://localhost:27017'); + let browser; + + try { + await client.connect(); + const db = client.db('tractatus_dev'); + const collection = db.collection('documents'); + + console.log('═══════════════════════════════════════════════════════════'); + console.log(' GENERATING PDFs FOR PUBLIC DOCUMENTS'); + console.log('═══════════════════════════════════════════════════════════\n'); + console.log(`Total documents: ${PUBLIC_DOCS.length}\n`); + + // Ensure downloads directory exists + const downloadsDir = path.join(__dirname, '../public/downloads'); + await fs.mkdir(downloadsDir, { recursive: true }); + + // Launch browser + console.log('Launching browser...\n'); + browser = await puppeteer.launch({ + headless: 'new', + args: ['--no-sandbox', '--disable-setuid-sandbox'] + }); + + const results = { + success: [], + failed: [], + notFound: [] + }; + + for (const slug of PUBLIC_DOCS) { + const doc = await collection.findOne({ slug }); + + if (!doc) { + console.log(` ⚠️ Not found: ${slug}`); + results.notFound.push(slug); + continue; + } + + const result = await generatePDF(doc, browser); + + if (result.success) { + results.success.push(slug); + + // Update database with PDF path + await collection.updateOne( + { slug }, + { + $set: { + 'download_formats.pdf': `/downloads/${slug}.pdf`, + updated_at: new Date() + } + } + ); + } else { + results.failed.push({ slug, error: result.error }); + } + } + + console.log('\n═══════════════════════════════════════════════════════════'); + console.log(' SUMMARY'); + console.log('═══════════════════════════════════════════════════════════\n'); + console.log(`✅ Successfully generated: ${results.success.length}`); + console.log(`✗ Failed: ${results.failed.length}`); + console.log(`⚠️ Not found: ${results.notFound.length}\n`); + + if (results.failed.length > 0) { + console.log('Failed PDFs:'); + results.failed.forEach(f => console.log(` - ${f.slug}: ${f.error}`)); + } + + if (browser) await browser.close(); + await client.close(); + process.exit(0); + } catch (error) { + console.error('Error:', error); + if (browser) await browser.close(); + await client.close(); + process.exit(1); + } +} + +run(); diff --git a/scripts/import-from-export.js b/scripts/import-from-export.js new file mode 100644 index 00000000..1ca8d577 --- /dev/null +++ b/scripts/import-from-export.js @@ -0,0 +1,99 @@ +/** + * Import Documents from Export File + * + * Imports curated documents into production database + * Handles upsert (insert or update) based on slug + * + * Usage: node scripts/import-from-export.js + */ + +const { MongoClient } = require('mongodb'); +const fs = require('fs').promises; + +const PROD_URI = 'mongodb://localhost:27017'; +const PROD_DB = 'tractatus_production'; + +async function run() { + const args = process.argv.slice(2); + + if (args.length === 0) { + console.error('Usage: node scripts/import-from-export.js '); + process.exit(1); + } + + const exportFile = args[0]; + + try { + // Read export file + const content = await fs.readFile(exportFile, 'utf8'); + const exportData = JSON.parse(content); + + console.log('═══════════════════════════════════════════════════════════'); + console.log(' IMPORTING DOCUMENTS TO PRODUCTION'); + console.log('═══════════════════════════════════════════════════════════\n'); + console.log(` Source: ${exportFile}`); + console.log(` Exported: ${exportData.exported_at}`); + console.log(` Documents: ${exportData.total_documents}\n`); + + const client = new MongoClient(PROD_URI); + await client.connect(); + + const db = client.db(PROD_DB); + const collection = db.collection('documents'); + + const stats = { + inserted: 0, + updated: 0, + errors: [] + }; + + for (const doc of exportData.documents) { + try { + const result = await collection.replaceOne( + { slug: doc.slug }, + doc, + { upsert: true } + ); + + if (result.upsertedCount > 0) { + console.log(` ✓ Inserted: ${doc.title}`); + stats.inserted++; + } else if (result.modifiedCount > 0) { + console.log(` ✓ Updated: ${doc.title}`); + stats.updated++; + } else { + console.log(` - No change: ${doc.title}`); + } + } catch (error) { + console.error(` ✗ Error importing ${doc.slug}: ${error.message}`); + stats.errors.push({ slug: doc.slug, error: error.message }); + } + } + + console.log('\n═══════════════════════════════════════════════════════════'); + console.log(' IMPORT SUMMARY'); + console.log('═══════════════════════════════════════════════════════════\n'); + console.log(` ✅ Inserted: ${stats.inserted}`); + console.log(` ✅ Updated: ${stats.updated}`); + console.log(` ✗ Errors: ${stats.errors.length}\n`); + + if (stats.errors.length > 0) { + console.log(' Errors:'); + stats.errors.forEach(e => console.log(` - ${e.slug}: ${e.error}`)); + console.log(''); + } + + console.log(' Next steps:'); + console.log(' 1. Verify documents in production database'); + console.log(' 2. Restart production server to pick up changes'); + console.log(' 3. Test https://agenticgovernance.digital/docs.html\n'); + + await client.close(); + process.exit(0); + } catch (error) { + console.error('Import error:', error); + process.exit(1); + } +} + +run(); diff --git a/scripts/migrate-documents-final.js b/scripts/migrate-documents-final.js new file mode 100644 index 00000000..a228eec2 --- /dev/null +++ b/scripts/migrate-documents-final.js @@ -0,0 +1,229 @@ +/** + * Final Document Migration Script + * + * Migrates 22 curated public documents to production with: + * - Correct categories (5 total: getting-started, research-theory, technical-reference, advanced-topics, business-leadership) + * - Proper ordering (1-10 range) + * - Archives remaining documents + * - Migrates research paper to production + * + * Usage: node scripts/migrate-documents-final.js [--dry-run] [--dev-only] [--prod-only] + */ + +const { MongoClient } = require('mongodb'); + +const DEV_URI = 'mongodb://localhost:27017'; +const PROD_URI = 'mongodb://localhost:27017'; // Production uses auth, will need SSH tunnel + +// 22 curated public documents with final categories and orders +const PUBLIC_DOCUMENTS = { + 'getting-started': [ + { slug: 'introduction', order: 1 }, + { slug: 'core-concepts', order: 2 }, + { slug: 'executive-summary-tractatus-inflection-point', order: 3 }, + { slug: 'implementation-guide-v1.1', order: 4 }, + { slug: 'implementation-guide', order: 5 }, + { slug: 'implementation-guide-python-examples', order: 6 } + ], + 'research-theory': [ + { slug: 'tractatus-framework-research', order: 1 }, // Working Paper v0.1 + { slug: 'pluralistic-values-research-foundations', order: 2 }, + { slug: 'the-27027-incident-a-case-study-in-pattern-recognition-bias', order: 3 }, + { slug: 'real-world-ai-governance-a-case-study-in-framework-failure-and-recovery', order: 4 }, + { slug: 'llm-integration-feasibility-research-scope', order: 5 }, + { slug: 'research-topic-concurrent-session-architecture', order: 6 }, + { slug: 'research-topic-rule-proliferation-transactional-overhead', order: 7 } + ], + 'technical-reference': [ + { slug: 'technical-architecture', order: 1 }, + { slug: 'api-reference-complete', order: 2 }, + { slug: 'api-javascript-examples', order: 3 }, + { slug: 'api-python-examples', order: 4 }, + { slug: 'openapi-specification', order: 5 } + ], + 'advanced-topics': [ + { slug: 'value-pluralism-faq', order: 1 }, + { slug: 'tractatus-ai-safety-framework-core-values-and-principles', order: 2 }, + { slug: 'organizational-theory-foundations', order: 3 } + ], + 'business-leadership': [ + { slug: 'business-case-tractatus-framework', order: 1 } + ] +}; + +async function migrateDatabase(dbName, client, dryRun = false) { + console.log(`\n${'═'.repeat(70)}`); + console.log(` MIGRATING DATABASE: ${dbName}`); + console.log(`${'═'.repeat(70)}\n`); + + const db = client.db(dbName); + const collection = db.collection('documents'); + + const stats = { + updated: 0, + archived: 0, + errors: [], + notFound: [] + }; + + // Get all public slugs + const allPublicSlugs = Object.values(PUBLIC_DOCUMENTS).flat().map(d => d.slug); + + console.log(`Public documents to migrate: ${allPublicSlugs.length}\n`); + + // Update each public document + for (const [category, docs] of Object.entries(PUBLIC_DOCUMENTS)) { + console.log(`\n📁 Category: ${category} (${docs.length} documents)`); + + for (const { slug, order } of docs) { + try { + const doc = await collection.findOne({ slug }); + + if (!doc) { + console.log(` ⚠️ NOT FOUND: ${slug}`); + stats.notFound.push(slug); + continue; + } + + if (dryRun) { + console.log(` [DRY RUN] Would update: ${doc.title}`); + console.log(` Category: ${doc.category} → ${category}`); + console.log(` Order: ${doc.order} → ${order}`); + console.log(` Visibility: ${doc.visibility} → public`); + } else { + await collection.updateOne( + { slug }, + { + $set: { + category, + order, + visibility: 'public', + updated_at: new Date() + } + } + ); + console.log(` ✓ Updated: ${doc.title}`); + stats.updated++; + } + } catch (error) { + console.error(` ✗ Error updating ${slug}: ${error.message}`); + stats.errors.push({ slug, error: error.message }); + } + } + } + + // Archive all other documents + console.log(`\n\n📦 Archiving documents not in public list...\n`); + + try { + if (dryRun) { + const toArchive = await collection.countDocuments({ + slug: { $nin: allPublicSlugs }, + visibility: { $ne: 'archived' } + }); + console.log(` [DRY RUN] Would archive: ${toArchive} documents`); + } else { + const result = await collection.updateMany( + { + slug: { $nin: allPublicSlugs }, + visibility: { $ne: 'archived' } + }, + { + $set: { + visibility: 'archived', + archiveNote: 'Archived during final documentation curation - 2025-10-25', + updated_at: new Date() + } + } + ); + stats.archived = result.modifiedCount; + console.log(` ✓ Archived: ${stats.archived} documents`); + } + } catch (error) { + console.error(` ✗ Error archiving documents: ${error.message}`); + stats.errors.push({ task: 'archiving', error: error.message }); + } + + // Summary + console.log(`\n${'═'.repeat(70)}`); + console.log(` MIGRATION SUMMARY - ${dbName}`); + console.log(`${'═'.repeat(70)}\n`); + console.log(` ✅ Updated: ${stats.updated}`); + console.log(` 📦 Archived: ${stats.archived}`); + console.log(` ⚠️ Not found: ${stats.notFound.length}`); + console.log(` ✗ Errors: ${stats.errors.length}\n`); + + if (stats.notFound.length > 0) { + console.log(` Not found slugs:`); + stats.notFound.forEach(slug => console.log(` - ${slug}`)); + console.log(''); + } + + if (stats.errors.length > 0) { + console.log(` Errors:`); + stats.errors.forEach(e => console.log(` - ${e.slug || e.task}: ${e.error}`)); + console.log(''); + } + + return stats; +} + +async function run() { + const args = process.argv.slice(2); + const dryRun = args.includes('--dry-run'); + const devOnly = args.includes('--dev-only'); + const prodOnly = args.includes('--prod-only'); + + console.log('═'.repeat(70)); + console.log(' FINAL DOCUMENT MIGRATION'); + console.log('═'.repeat(70)); + console.log(`\nMode: ${dryRun ? 'DRY RUN (no changes)' : 'LIVE MIGRATION'}`); + console.log(`Target: ${devOnly ? 'Development only' : prodOnly ? 'Production only' : 'Both databases'}\n`); + + if (dryRun) { + console.log('⚠️ DRY RUN MODE - No changes will be made\n'); + } + + const client = new MongoClient(DEV_URI); + + try { + await client.connect(); + + // Migrate development database + if (!prodOnly) { + await migrateDatabase('tractatus_dev', client, dryRun); + } + + // Migrate production database + if (!devOnly) { + console.log('\n\n⚠️ PRODUCTION MIGRATION REQUIRES SSH TUNNEL'); + console.log('Run this command first:'); + console.log(' ssh -i ~/.ssh/tractatus_deploy -L 27018:localhost:27017 ubuntu@vps-93a693da.vps.ovh.net -N\n'); + console.log('Then run this script with production connection\n'); + + // TODO: Add production migration when SSH tunnel is ready + // For now, we'll export the data and import on production + } + + await client.close(); + + console.log('\n✅ Migration complete!\n'); + + if (!dryRun && !prodOnly) { + console.log('Next steps:'); + console.log(' 1. Review changes in development database'); + console.log(' 2. Test http://localhost:9000/docs.html'); + console.log(' 3. Export research paper for production:'); + console.log(' node scripts/export-research-paper.js'); + console.log(' 4. Deploy to production\n'); + } + + process.exit(0); + } catch (error) { + console.error('Migration error:', error); + await client.close(); + process.exit(1); + } +} + +run(); diff --git a/scripts/prepare-public-docs.js b/scripts/prepare-public-docs.js new file mode 100644 index 00000000..fedd5a8c --- /dev/null +++ b/scripts/prepare-public-docs.js @@ -0,0 +1,143 @@ +/** + * Prepare Public Documents + * 1. Verify all public docs have sections (cards) + * 2. Generate missing PDFs + * 3. Report status + */ + +const { MongoClient } = require('mongodb'); + +// Documents that should be public (from audit) +const PUBLIC_DOCS = [ + // Getting Started (6) + 'introduction-to-tractatus', + 'core-concepts-tractatus', + 'executive-summary-tractatus-inflection-point', + 'implementation-guide-tractatus', + 'implementation-guide', + 'implementation-guide-python-examples', + + // Research & Theory (7 including working paper) + 'tractatus-framework-research', // Working Paper v0.1 + 'pluralistic-values-research-foundations', + 'case-study-27027-pattern-recognition-bias', + 'case-study-framework-failure-and-recovery', + 'llm-integration-feasibility-research-scope', + 'research-topic-concurrent-session-architecture', + 'research-topic-rule-proliferation-transactional-overhead', + + // Technical Reference (5) + 'technical-architecture', + 'api-reference-complete', + 'api-javascript-examples', + 'api-python-examples', + 'openapi-specification', + + // Advanced Topics (3) + 'value-pluralism-faq', + 'tractatus-framework-core-values', + 'organizational-theory-foundations', + + // Business Leadership (1) + 'business-case-tractatus-framework' +]; + +async function run() { + const client = new MongoClient('mongodb://localhost:27017'); + + try { + await client.connect(); + const db = client.db('tractatus_dev'); + const collection = db.collection('documents'); + + console.log('═══════════════════════════════════════════════════════════'); + console.log(' PUBLIC DOCUMENTS PREPARATION'); + console.log('═══════════════════════════════════════════════════════════\n'); + + const needsSections = []; + const needsPDF = []; + const ready = []; + const notFound = []; + + for (const slug of PUBLIC_DOCS) { + const doc = await collection.findOne({ slug }); + + if (!doc) { + notFound.push(slug); + continue; + } + + const hasSections = doc.sections && doc.sections.length > 0; + const hasPDF = doc.download_formats && doc.download_formats.pdf; + + if (hasSections && hasPDF) { + ready.push({ slug, title: doc.title, sections: doc.sections.length }); + } else if (!hasSections && !hasPDF) { + needsSections.push({ slug, title: doc.title }); + needsPDF.push({ slug, title: doc.title }); + } else if (!hasSections) { + needsSections.push({ slug, title: doc.title }); + } else if (!hasPDF) { + needsPDF.push({ slug, title: doc.title }); + } + } + + console.log('SUMMARY:'); + console.log(` ✅ Ready (sections + PDF): ${ready.length}`); + console.log(` ⚠️ Needs sections: ${needsSections.length}`); + console.log(` ⚠️ Needs PDF: ${needsPDF.length}`); + console.log(` ❌ Not found: ${notFound.length}\n`); + + if (ready.length > 0) { + console.log('═══════════════════════════════════════════════════════════'); + console.log(' ✅ READY FOR PUBLIC'); + console.log('═══════════════════════════════════════════════════════════\n'); + ready.forEach(d => { + console.log(` ✓ ${d.title}`); + console.log(` Slug: ${d.slug} | Sections: ${d.sections}`); + }); + console.log(''); + } + + if (needsSections.length > 0) { + console.log('═══════════════════════════════════════════════════════════'); + console.log(' ⚠️ NEEDS SECTIONS (CARDS)'); + console.log('═══════════════════════════════════════════════════════════\n'); + needsSections.forEach(d => { + console.log(` ⚠️ ${d.title}`); + console.log(` Slug: ${d.slug}`); + }); + console.log(''); + } + + if (needsPDF.length > 0) { + console.log('═══════════════════════════════════════════════════════════'); + console.log(' ⚠️ NEEDS PDF GENERATION'); + console.log('═══════════════════════════════════════════════════════════\n'); + needsPDF.forEach(d => { + console.log(` ⚠️ ${d.title}`); + console.log(` Slug: ${d.slug}`); + }); + console.log(''); + } + + if (notFound.length > 0) { + console.log('═══════════════════════════════════════════════════════════'); + console.log(' ❌ NOT FOUND IN DATABASE'); + console.log('═══════════════════════════════════════════════════════════\n'); + notFound.forEach(slug => { + console.log(` ❌ ${slug}`); + }); + console.log(''); + } + + await client.close(); + process.exit(0); + } catch (error) { + console.error('Error:', error); + await client.close(); + process.exit(1); + } +} + +run();