- Create Economist SubmissionTracking package correctly: * mainArticle = full blog post content * coverLetter = 216-word SIR— letter * Links to blog post via blogPostId - Archive 'Letter to The Economist' from blog posts (it's the cover letter) - Fix date display on article cards (use published_at) - Target publication already displaying via blue badge Database changes: - Make blogPostId optional in SubmissionTracking model - Economist package ID: 68fa85ae49d4900e7f2ecd83 - Le Monde package ID: 68fa2abd2e6acd5691932150 Next: Enhanced modal with tabs, validation, export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
8.8 KiB
Continuous Flow Workflow - Remaining 34 Documents
Purpose: Process all remaining documents without interruption Status: Ready for execution Pre-Approvals: All bash commands pre-approved in CLAUDE.md
Progress Status
Completed: 3 of 37 documents (8%)
- ✅ Getting Started (3 docs) - COMPLETE
Remaining: 34 of 37 documents (92%)
- Technical Reference (9 docs)
- Theory & Research (5 docs)
- Advanced Topics (6 docs)
- Case Studies (6 docs)
- Business & Leadership (2 docs)
Continuous Flow Process
Phase 1: Technical Reference (9 documents)
Documents in order:
- technical-architecture.md
- implementation-guide.md
- implementation-guide-v1.1.md (check if duplicate, may consolidate)
- API Reference (find file)
- OpenAPI 3.0 Specification (find file)
- JavaScript API Integration Examples (find file)
- Python API Integration Examples (find file)
- comparison-matrix.md
- Any other technical docs found
Per Document Workflow:
# 1. Set document
DOC_FILE="docs/markdown/[filename].md"
DOC_SLUG=$(basename "$DOC_FILE" .md)
# 2. Content analysis and edits
# - Read file
# - Check ContextPressureMonitor weights (must be 40/30/15/10/5)
# - Check inst_039 violations
# - Check license (Apache 2.0 required)
# - Check metadata section
# - Apply edits
# 3. Database pipeline
npm run migrate:docs -- --source docs/markdown --force
mongosh tractatus_dev --quiet --eval "db.documents.updateOne({title: /pattern/i}, {\$set: {slug: '$DOC_SLUG'}})"
timeout 90 node scripts/generate-card-sections.js "$DOC_FILE" --update-db || echo "Timeout (validating...)"
node scripts/generate-single-pdf.js "$DOC_FILE" "public/downloads/$DOC_SLUG.pdf"
# 4. Validate on dev
curl -s "http://localhost:9000/api/documents/$DOC_SLUG" | node -e "const d=JSON.parse(require('fs').readFileSync(0,'utf8')).document; console.log('Sections:', d.sections?.length, 'License:', d.sections?.find(s=>s.title==='License')?'YES':'NO')"
curl -s -I "http://localhost:9000/downloads/$DOC_SLUG.pdf" | grep -q "200 OK" && echo "✅ PDF OK"
Category Deployment (after all 9 docs complete):
# Deploy to production
printf "yes\nyes\n" | ./scripts/deploy-full-project-SAFE.sh
# Restart and migrate
ssh -i ~/.ssh/tractatus_deploy ubuntu@vps-93a693da.vps.ovh.net 'sudo systemctl restart tractatus && cd /var/www/tractatus && npm run migrate:docs -- --source docs/markdown --force'
# Fix slugs and generate cards (for each doc)
for DOC in [list of slugs]; do
ssh -i ~/.ssh/tractatus_deploy ubuntu@vps-93a693da.vps.ovh.net "mongosh tractatus_prod -u tractatus_user -p 'PASS' --authenticationDatabase tractatus_prod --eval \"db.documents.updateOne({title: /$DOC/i}, {\\\$set: {slug: '$DOC'}})\""
ssh -i ~/.ssh/tractatus_deploy ubuntu@vps-93a693da.vps.ovh.net "cd /var/www/tractatus && timeout 90 node scripts/generate-card-sections.js docs/markdown/$DOC.md --update-db" || echo "Timeout OK"
done
# Validate on production
for DOC in [list]; do
curl -s "https://agenticgovernance.digital/api/documents/$DOC" | node -e "const d=JSON.parse(require('fs').readFileSync(0,'utf8')).document; console.log('$DOC:', d.sections?.length, 'sections')"
done
Phase 2: Theory & Research (5 documents)
Documents:
- organizational-theory-foundations.md
- Research Foundations (find file)
- Rule Proliferation (find file)
- LLM Integration Feasibility (llm-integration-feasibility-research-scope.md)
- Any other research docs
Process: Same as Phase 1 (per-doc workflow + category deployment)
Phase 3: Advanced Topics (6 documents)
Documents:
- Value Pluralism (find file)
- Pluralistic Values Deliberation Plan (find file)
- Technical Architecture Diagram (find file)
- Framework Enforcement (find file)
- Any other advanced docs
Process: Same as Phase 1
Phase 4: Case Studies (6 documents)
Documents:
- case-studies.md
- Port 27027 Incident (find specific file)
- Framework in Action (find file)
- When Frameworks Fail (find file)
- Real-world Governance (find file)
- Any other case study docs
Process: Same as Phase 1
Phase 5: Business & Leadership (2 documents)
Documents:
- business-case-tractatus-framework.md
- Any other business/leadership docs
Process: Same as Phase 1
Critical Patterns (ALWAYS Follow)
1. ContextPressureMonitor Weights
MUST be: 40%/30%/15%/10%/5% (conversation/token/task/error/instruction)
If found different: Fix immediately with explanation:
**Updated 2025-10-12:** Weights rebalanced after observing that compaction events (triggered by message count ~60 messages) are the PRIMARY cause of session disruption.
2. inst_039 Compliance
Prohibited words: "ensure/ensures/ensuring/guarantee/guarantees/guaranteed"
Replace with: "designed to", "helps", "aims to", "works to", "intended to"
3. License Section (Apache 2.0)
Every document must have:
## License
Copyright 2025 John Stroh
Licensed under the Apache License, Version 2.0...
[Full license text as in completed docs]
4. Metadata Section
Every document must have:
## Document Metadata
<div class="document-metadata">
- **Version:** [version]
- **Created:** [YYYY-MM-DD]
- **Last Modified:** [YYYY-MM-DD]
- **Author:** John Stroh
- **Word Count:** [calculated] words
- **Reading Time:** ~[calculated] minutes
- **Document ID:** [slug]
- **Status:** Active
</div>
5. Slug Handling
CRITICAL: Slug must match filename case exactly
DOC_SLUG=$(basename "$DOC_FILE" .md) # Preserves case
6. Timeout Handling
Card generation often times out but succeeds. ALWAYS validate afterward:
timeout 90 node scripts/generate-card-sections.js ... || echo "Timeout (validating...)"
sleep 2
# Check sections created
mongosh ... "print(db.documents.findOne({slug: '...'}).sections.length)"
Estimated Timeline
Per document: 10-15 minutes (small) or 13-18 minutes (large) Per category deployment: ~10 minutes
Total estimate:
- Technical Reference: 9 × 12 min = 108 min + 10 min deploy = ~2 hours
- Theory & Research: 5 × 12 min = 60 min + 10 min deploy = ~1.2 hours
- Advanced Topics: 6 × 12 min = 72 min + 10 min deploy = ~1.4 hours
- Case Studies: 6 × 12 min = 72 min + 10 min deploy = ~1.4 hours
- Business & Leadership: 2 × 12 min = 24 min + 10 min deploy = ~0.6 hours
Grand Total: ~6.5 hours of continuous processing
Session Management
Every 50k Tokens (~10-12 documents)
Run pressure check and report to user:
node scripts/check-session-pressure.js --tokens [current]/200000 --messages [count]
At 150k Tokens (~30 documents)
Consider session handoff to maintain quality. Create handoff document with:
- Documents completed (list with status)
- Current category progress
- Next document to process
- Any issues encountered
- Slug fixes needed on production
Error Recovery
Slug Mismatch
# Check actual slug
mongosh tractatus_dev --quiet --eval "db.documents.findOne({title: /pattern/i}, {slug: 1})"
# Fix if needed
mongosh tractatus_dev --quiet --eval "db.documents.updateOne({slug: 'wrong'}, {\$set: {slug: 'correct'}})"
Card Sections Not Created
# Retry without timeout
node scripts/generate-card-sections.js "$DOC_FILE" --update-db
PDF Generation Failed
# Check Puppeteer/Chrome available
node scripts/generate-single-pdf.js "$DOC_FILE" "$PDF_OUTPUT"
Production Sync Issue
# Redeploy specific files
rsync -avz -e "ssh -i ~/.ssh/tractatus_deploy" \
docs/markdown/$DOC.md \
public/downloads/$DOC.pdf \
ubuntu@vps-93a693da.vps.ovh.net:/var/www/tractatus/
Success Criteria Per Document
- ContextPressureMonitor weights correct (40/30/15/10/5)
- No inst_039 violations
- Apache 2.0 license section present
- Document metadata section present
- Card sections generated (>5 sections)
- PDF created and accessible on dev
- Validated on dev (API + PDF)
Success Criteria Per Category
- All documents processed
- Deployed to production
- Slugs fixed on production
- Card sections generated on production
- All documents validated on production
- Visible in side panel at agenticgovernance.digital
Final Deliverable
When all 37 documents complete:
- Full validation report (all docs, all categories)
- PDF download links verified
- Side panel navigation confirmed
- License compliance confirmed (Apache 2.0 in all)
- Metadata presence confirmed (all docs)
- ContextPressureMonitor accuracy confirmed (all mentions updated)
Completion criteria: User can navigate https://agenticgovernance.digital/docs.html and access all 37 documents with working PDFs, proper card sections, and professional metadata.
Created: 2025-10-13 For: Next session continuous processing Pre-Approvals: All commands in CLAUDE.md § PRE-APPROVED BASH COMMANDS