feat: reorganize document categories with intuitive structure
- Add 'Advanced Topics' category for value pluralism & deep dives - Rename Value Pluralism FAQ to 'Understanding Value Pluralism' - Restore research documents from archives (Research Foundations, Organizational Theory, etc.) - Set most categories to collapsed by default for cleaner UX - Restore Executive Brief to Business & Leadership - Archive PoC session summaries - Create comprehensive migration script for recategorization
This commit is contained in:
parent
80aa88dc35
commit
7f3e4802d0
2 changed files with 405 additions and 26 deletions
|
|
@ -32,36 +32,36 @@ const CATEGORIES = {
|
|||
collapsed: false
|
||||
},
|
||||
'research-theory': {
|
||||
label: '🔬 Research & Theory',
|
||||
label: '🔬 Theory & Research',
|
||||
icon: '🔬',
|
||||
description: 'Research papers, theoretical foundations',
|
||||
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: false
|
||||
collapsed: true
|
||||
},
|
||||
'advanced-topics': {
|
||||
label: '🎓 Advanced Topics',
|
||||
icon: '🎓',
|
||||
description: 'Value pluralism, deep dives, comparative analysis',
|
||||
order: 4,
|
||||
color: 'teal',
|
||||
bgColor: 'bg-teal-50',
|
||||
borderColor: 'border-l-4 border-teal-500',
|
||||
textColor: 'text-teal-700',
|
||||
collapsed: true
|
||||
},
|
||||
'case-studies': {
|
||||
label: '📊 Case Studies',
|
||||
icon: '📊',
|
||||
description: 'Real-world examples, failure modes, success stories',
|
||||
order: 4,
|
||||
order: 5,
|
||||
color: 'amber',
|
||||
bgColor: 'bg-amber-50',
|
||||
borderColor: 'border-l-4 border-amber-500',
|
||||
textColor: 'text-amber-700',
|
||||
collapsed: false
|
||||
},
|
||||
'deployment-operations': {
|
||||
label: '⚙️ Deployment & Operations',
|
||||
icon: '⚙️',
|
||||
description: 'Deployment guides, architecture, troubleshooting',
|
||||
order: 5,
|
||||
color: 'indigo',
|
||||
bgColor: 'bg-indigo-50',
|
||||
borderColor: 'border-l-4 border-indigo-500',
|
||||
textColor: 'text-indigo-700',
|
||||
collapsed: true
|
||||
},
|
||||
'business-leadership': {
|
||||
|
|
@ -74,17 +74,6 @@ const CATEGORIES = {
|
|||
borderColor: 'border-l-4 border-pink-500',
|
||||
textColor: 'text-pink-700',
|
||||
collapsed: true
|
||||
},
|
||||
'downloads-resources': {
|
||||
label: '📥 Downloads & Resources',
|
||||
icon: '📥',
|
||||
description: 'PDFs, sample configs, external resources',
|
||||
order: 7,
|
||||
color: 'gray',
|
||||
bgColor: 'bg-gray-50',
|
||||
borderColor: 'border-l-4 border-gray-400',
|
||||
textColor: 'text-gray-700',
|
||||
collapsed: true
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
390
scripts/migrate-document-categorization.js
Executable file
390
scripts/migrate-document-categorization.js
Executable file
|
|
@ -0,0 +1,390 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Migration: Comprehensive Document Recategorization
|
||||
*
|
||||
* This migration:
|
||||
* 1. Renames "Value Pluralism FAQ" to "Understanding Value Pluralism"
|
||||
* 2. Recategorizes all documents into proper categories
|
||||
* 3. Restores relevant archived documents to public visibility
|
||||
* 4. Assigns proper order values for intuitive sidebar organization
|
||||
*/
|
||||
|
||||
require('dotenv').config();
|
||||
const { MongoClient } = require('mongodb');
|
||||
|
||||
const MONGO_URI = process.env.MONGODB_URI || process.env.MONGO_URI || 'mongodb://localhost:27017';
|
||||
const DB_NAME = process.env.MONGODB_DB || process.env.MONGO_DB || 'tractatus_dev';
|
||||
|
||||
// Document updates: { slug, updates }
|
||||
const DOCUMENT_UPDATES = [
|
||||
// ========================================
|
||||
// GETTING STARTED
|
||||
// ========================================
|
||||
{
|
||||
slug: 'introduction-to-the-tractatus-framework',
|
||||
updates: {
|
||||
category: 'getting-started',
|
||||
visibility: 'public',
|
||||
order: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'architectural-overview-and-research-status',
|
||||
updates: {
|
||||
category: 'getting-started',
|
||||
visibility: 'public',
|
||||
order: 2
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'core-concepts-of-the-tractatus-framework',
|
||||
updates: {
|
||||
category: 'getting-started',
|
||||
visibility: 'public',
|
||||
order: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'tractatus-ai-safety-framework-core-values-and-principles',
|
||||
updates: {
|
||||
category: 'getting-started',
|
||||
visibility: 'public',
|
||||
order: 4
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'tractatus-agentic-governance-system-glossary-of-terms',
|
||||
updates: {
|
||||
category: 'getting-started',
|
||||
visibility: 'public',
|
||||
order: 5
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================
|
||||
// TECHNICAL REFERENCE
|
||||
// ========================================
|
||||
{
|
||||
slug: 'technical-architecture',
|
||||
updates: {
|
||||
category: 'technical-reference',
|
||||
visibility: 'public',
|
||||
order: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'implementation-guide',
|
||||
updates: {
|
||||
category: 'technical-reference',
|
||||
visibility: 'public',
|
||||
order: 2
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'tractatus-framework-implementation-guide',
|
||||
updates: {
|
||||
category: 'technical-reference',
|
||||
visibility: 'public',
|
||||
order: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'api-reference-complete',
|
||||
updates: {
|
||||
category: 'technical-reference',
|
||||
visibility: 'public',
|
||||
order: 4
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'api-javascript-examples',
|
||||
updates: {
|
||||
category: 'technical-reference',
|
||||
visibility: 'public',
|
||||
order: 5
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'api-python-examples',
|
||||
updates: {
|
||||
category: 'technical-reference',
|
||||
visibility: 'public',
|
||||
order: 6
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'openapi-specification',
|
||||
updates: {
|
||||
category: 'technical-reference',
|
||||
visibility: 'public',
|
||||
order: 7
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================
|
||||
// THEORY & RESEARCH
|
||||
// ========================================
|
||||
{
|
||||
slug: 'research-foundations-scholarly-review-and-context',
|
||||
updates: {
|
||||
category: 'research-theory',
|
||||
visibility: 'public',
|
||||
order: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'organizational-theory-foundations-of-the-tractatus-framework',
|
||||
updates: {
|
||||
category: 'research-theory',
|
||||
visibility: 'public',
|
||||
order: 2
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'pluralistic-values-research-foundations',
|
||||
updates: {
|
||||
category: 'research-theory',
|
||||
visibility: 'public',
|
||||
order: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'research-topic-rule-proliferation-and-transactional-overhead-in-ai-governance',
|
||||
updates: {
|
||||
category: 'research-theory',
|
||||
visibility: 'public',
|
||||
order: 4
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'research-topic-concurrent-session-architecture-limitations-in-claude-code-governance',
|
||||
updates: {
|
||||
category: 'research-theory',
|
||||
visibility: 'public',
|
||||
order: 5
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================
|
||||
// ADVANCED TOPICS
|
||||
// ========================================
|
||||
{
|
||||
slug: 'value-pluralism-faq',
|
||||
updates: {
|
||||
title: 'Understanding Value Pluralism in Tractatus',
|
||||
category: 'advanced-topics',
|
||||
visibility: 'public',
|
||||
order: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'pluralistic-values-deliberation-plan-v2',
|
||||
updates: {
|
||||
category: 'advanced-topics',
|
||||
visibility: 'public',
|
||||
order: 2
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'comparison-matrix-claude-code-claudemd-and-tractatus-framework',
|
||||
updates: {
|
||||
category: 'advanced-topics',
|
||||
visibility: 'public',
|
||||
order: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'research-scope-feasibility-of-llm-integrated-tractatus-framework',
|
||||
updates: {
|
||||
category: 'advanced-topics',
|
||||
visibility: 'public',
|
||||
order: 4
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================
|
||||
// CASE STUDIES
|
||||
// ========================================
|
||||
{
|
||||
slug: 'the-27027-incident-a-case-study-in-pattern-recognition-bias',
|
||||
updates: {
|
||||
category: 'case-studies',
|
||||
visibility: 'public',
|
||||
order: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'when-frameworks-fail-and-why-thats-ok',
|
||||
updates: {
|
||||
category: 'case-studies',
|
||||
visibility: 'public',
|
||||
order: 2
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'our-framework-in-action-detecting-and-correcting-ai-fabrications',
|
||||
updates: {
|
||||
category: 'case-studies',
|
||||
visibility: 'public',
|
||||
order: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'real-world-ai-governance-a-case-study-in-framework-failure-and-recovery',
|
||||
updates: {
|
||||
category: 'case-studies',
|
||||
visibility: 'public',
|
||||
order: 4
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'framework-governance-in-action-pre-publication-security-audit',
|
||||
updates: {
|
||||
category: 'case-studies',
|
||||
visibility: 'public',
|
||||
order: 5
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'case-studies-real-world-llm-failure-modes',
|
||||
updates: {
|
||||
category: 'case-studies',
|
||||
visibility: 'public',
|
||||
order: 6
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================
|
||||
// BUSINESS & LEADERSHIP
|
||||
// ========================================
|
||||
{
|
||||
slug: 'executive-brief-tractatus-based-llm-architecture-for-ai-safety',
|
||||
updates: {
|
||||
category: 'business-leadership',
|
||||
visibility: 'public',
|
||||
order: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'ai-governance-business-case-template-tractatus-framework',
|
||||
updates: {
|
||||
category: 'business-leadership',
|
||||
visibility: 'public',
|
||||
order: 2
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'implementation-roadmap-24-month-deployment-plan',
|
||||
updates: {
|
||||
category: 'business-leadership',
|
||||
visibility: 'public',
|
||||
order: 3
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================
|
||||
// ARCHIVE (outdated/superseded)
|
||||
// ========================================
|
||||
{
|
||||
slug: 'phase-5-poc-session-1-summary',
|
||||
updates: {
|
||||
category: 'archived',
|
||||
visibility: 'archived',
|
||||
order: 999
|
||||
}
|
||||
},
|
||||
{
|
||||
slug: 'phase-5-poc-session-2-summary',
|
||||
updates: {
|
||||
category: 'archived',
|
||||
visibility: 'archived',
|
||||
order: 999
|
||||
}
|
||||
},
|
||||
|
||||
// All other Phase 2 documents - stay archived
|
||||
// All session handoffs - stay archived
|
||||
// Test reports - stay archived
|
||||
// Blog outlines - stay archived
|
||||
// Duplicate/superseded documents - stay archived
|
||||
];
|
||||
|
||||
async function migrate() {
|
||||
console.log('🔧 Starting comprehensive document categorization migration...');
|
||||
console.log(` Database: ${DB_NAME}`);
|
||||
console.log('');
|
||||
|
||||
const client = new MongoClient(MONGO_URI);
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const db = client.db(DB_NAME);
|
||||
const collection = db.collection('documents');
|
||||
|
||||
let updated = 0;
|
||||
let notFound = 0;
|
||||
let unchanged = 0;
|
||||
|
||||
for (const { slug, updates } of DOCUMENT_UPDATES) {
|
||||
const result = await collection.updateOne(
|
||||
{ slug },
|
||||
{ $set: updates }
|
||||
);
|
||||
|
||||
if (result.matchedCount === 0) {
|
||||
console.log(` ⚠️ Document not found: ${slug}`);
|
||||
notFound++;
|
||||
} else if (result.modifiedCount === 0) {
|
||||
console.log(` ℹ️ Already up to date: ${slug}`);
|
||||
unchanged++;
|
||||
} else {
|
||||
console.log(` ✅ Updated: ${slug}`);
|
||||
if (updates.title) {
|
||||
console.log(` - title: ${updates.title}`);
|
||||
}
|
||||
console.log(` - category: ${updates.category}`);
|
||||
console.log(` - visibility: ${updates.visibility}`);
|
||||
console.log(` - order: ${updates.order}`);
|
||||
updated++;
|
||||
}
|
||||
}
|
||||
|
||||
console.log('');
|
||||
console.log('📊 Migration Summary:');
|
||||
console.log(` ✅ Updated: ${updated}`);
|
||||
console.log(` ℹ️ Unchanged: ${unchanged}`);
|
||||
console.log(` ⚠️ Not found: ${notFound}`);
|
||||
console.log('');
|
||||
|
||||
// Verification by category
|
||||
console.log('🔍 Verification - Documents by Category:');
|
||||
const publicDocs = await collection.find({ visibility: 'public' }).sort({ category: 1, order: 1 }).toArray();
|
||||
|
||||
const byCategory = {};
|
||||
publicDocs.forEach(doc => {
|
||||
if (!byCategory[doc.category]) {
|
||||
byCategory[doc.category] = [];
|
||||
}
|
||||
byCategory[doc.category].push(doc);
|
||||
});
|
||||
|
||||
Object.keys(byCategory).sort().forEach(cat => {
|
||||
console.log(`\n ${cat}:`);
|
||||
byCategory[cat].forEach(doc => {
|
||||
console.log(` [${doc.order}] ${doc.title}`);
|
||||
});
|
||||
});
|
||||
|
||||
console.log('');
|
||||
console.log('✨ Migration complete!');
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ Migration failed:', error);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
}
|
||||
|
||||
migrate();
|
||||
Loading…
Add table
Reference in a new issue