tractatus/scripts/seed-first-blog-post.js
TheFlow a4db3e62ec
Some checks are pending
CI / Run Tests (push) Waiting to run
CI / Lint Code (push) Waiting to run
CI / CSP Compliance Check (push) Waiting to run
chore(vendor-policy): sweep project-self GitHub URLs to Codeberg (partial)
Addresses the documentation-layer gap after Phase A/B moved the git REMOTE from
GitHub to Codeberg but left ~100 project-self GitHub URLs embedded in markdown,
HTML, JS, and Python files. The remote-layer migration was generalised as
"GitHub is gone from the codebase" without verifying the content layer.

22 files swept in this commit. 27 additional files hold pre-existing inst_016/017/018
or inst_084 debt that would transfer on touch (hook whole-file scan). Those
await a companion hygiene-first commit before their GitHub->Codeberg flip
can land cleanly.

Sweep scope this commit:
  - README.md, SECURITY.md
  - 3 For-Claude-Web bundle files (GitHub URLs noted as "separate concern" in
    today's earlier licence-swap commits)
  - docs/markdown/deployment-guide.md
  - docs/AUTOMATED_SYNC_SETUP, PLURALISM_CHECKLIST, github/AGENT_LIGHTNING_README
  - docs/business-intelligence/governance-bi-tools
  - docs/outreach/EXECUTIVE-BRIEF-BI-GOVERNANCE (+ v2)
  - docs/research/ARCHITECTURAL-SAFEGUARDS-*
  - email-templates/README.md, base-template.html
  - 3 scripts/seed-*-blog-post.js (blog-seeding scripts)
  - scripts/upload-document.js
  - SESSION_HANDOFF_2025-10-23_FRAMEWORK_ANALYSIS.md
  - SECURITY_INCIDENT_POST_MORTEM_2025-10-21.md

Pattern swaps (longest-first):
  github.com/AgenticGovernance/tractatus-framework/issues -> codeberg.org/mysovereignty/tractatus-framework/issues
  github.com/AgenticGovernance/tractatus-framework/discussions -> .../issues (Codeberg has no discussions feature)
  github.com/AgenticGovernance/tractatus-framework.git -> codeberg.org/mysovereignty/tractatus-framework.git
  github.com/AgenticGovernance/tractatus-framework -> codeberg.org/mysovereignty/tractatus-framework
  git@github.com:AgenticGovernance/... -> git@codeberg.org:mysovereignty/...
  github.com/AgenticGovernance/tractatus (old org/repo path) -> codeberg.org/mysovereignty/tractatus-framework
  AgenticGovernance/tractatus-framework (bare) -> mysovereignty/tractatus-framework

Hook validator update (scripts/hook-validators/validate-credentials.js):
  PROTECTED_VALUES.github_org:  'AgenticGovernance'  -> 'mysovereignty'
  PROTECTED_VALUES.license:     'Apache License 2.0' -> EUPL-1.2 long form
  URL detection regex:          /github\.com\/.../   -> /codeberg\.org\/.../
  Placeholder checks + error messages updated to reflect Codeberg as
  authoritative post-migration host. Key names (e.g. `github_org`) retained
  for backward compatibility with validate-file-edit.js.

Held back from this commit (27 files total, documented reasons):

  11 historical session handoffs / closedown docs / incident reports
    (2025-10 through 2026-02) — modifying them rewrites the record to contain
    URLs that did not exist at the time of writing, AND ownership of their
    pre-existing inst_084 exposures transfers on touch.

  8 live-content docs with pre-existing inst_084 debt (port/API-endpoint/
    file-path exposures): docs/markdown/case-studies.md, technical-architecture,
    introduction-to-the-tractatus-framework, implementation-guide-v1.1,
    docs/plans/integrated-implementation-roadmap-2025, docs/governance/*,
    docs/ANTHROPIC_*, docs/GOVERNANCE_SERVICE_*, docs/RESEARCH_DOCUMENTATION_*,
    deployment-quickstart/*.

  8 live-content docs with pre-existing inst_016/017/018 debt:
    CHANGELOG.md, CONTRIBUTING.md, docs/LAUNCH_ANNOUNCEMENT, LAUNCH_CHECKLIST,
    PHASE_4_REPOSITORY_ANALYSIS, PHASE_6_SUMMARY, docs/plans/research-enhancement-
    roadmap-2025, docs/case-studies/pre-publication-audit-oct-2025.

  Also NOT in this commit (separate concerns):
  - scripts/add-inst-084-github-url-protection.js (detection-rule logic needs
    framework-level decision on post-migration semantics).
  - .claude/* (framework state).
  - docs/PRODUCTION_DOCUMENTS_EXPORT.json (DB dump).
  - package-lock.json (npm sponsor URLs, third-party).
  - .git/config embedded credentials (requires out-of-band rotation on both
    remote hosts + auth-strategy decision; user-action task).

Context: today's EUPL-1.2 sweep closed the licence-text-content layer
(5c386d0d / 6d49bfbf / ab0a6af4 / 4c1a26e8). This commit starts closing the
matching vendor-URL-content layer. Next: hygiene-first pass on the 16
live-content docs held back, then a second URL-flip pass on them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 10:53:13 +12:00

195 lines
7.5 KiB
JavaScript

/**
* Seed First Blog Post - Framework Overview
* Creates the inaugural blog post introducing the Tractatus framework
*/
const { getCollection, connect, close } = require('../src/utils/db.util');
const BLOG_POST = {
title: 'Introducing the Tractatus Framework: Architectural Safety for Production AI',
slug: 'introducing-tractatus-framework',
author: {
type: 'human',
name: 'John Stroh'
},
content: `Tractatus is an architectural governance framework for production AI systems using large language models like Claude Code. It enforces safety constraints through six mandatory services that work together to prevent common failure modes in AI deployments.
## The Core Problem
Current AI safety approaches rely on aspirational prompts, documentation files, and trust that the AI will "remember" to follow guidelines. This breaks down under context pressure, session continuations, and real-world complexity. We've seen this failure mode repeatedly in production deployments.
## The Tractatus Solution
Instead of asking AI to remember governance rules, **Tractatus enforces them architecturally**. The framework consists of six mandatory services that operate continuously:
### 1. **BoundaryEnforcer**
Blocks decisions that cross into values territory before they're executed. AI systems should never autonomously decide questions of ethics, user agency, or irreversible consequences.
### 2. **InstructionPersistenceClassifier**
Classifies every explicit instruction by:
- **Quadrant**: Strategic, Operational, Tactical, System, or Stochastic
- **Persistence level**: HIGH, MEDIUM, LOW, or VARIABLE
- **Temporal scope**: Project-wide, phase-specific, or session-only
Only instructions with high explicitness scores (≥0.6) are stored persistently.
### 3. **CrossReferenceValidator**
Checks proposed changes against the persistent instruction database before execution. Prevents pattern bias and instruction conflicts.
### 4. **ContextPressureMonitor**
Tracks token budget usage and context window pressure. Warns before degradation occurs, runs at 25% intervals (50k tokens).
### 5. **MetacognitiveVerifier**
For complex operations (>3 files, >5 steps, architecture changes), verifies:
- Alignment with goals
- Coherence across components
- Completeness of implementation
- Safety considerations
- Alternative approaches
### 6. **PluralisticDeliberationOrchestrator**
When values decisions are unavoidable, facilitates multi-stakeholder deliberation without imposing hierarchy. Ensures affected communities have voice in governance.
## Why This Matters
The Tractatus framework represents a fundamental shift in AI governance:
**From:** "We hope the AI remembers to ask"
**To:** "The architecture prevents unauthorized decisions"
**From:** "Prompts as documentation"
**To:** "Enforcement at the architectural layer"
**From:** "Trust but don't verify"
**To:** "Systematic validation and auditing"
## Validated in Production
The framework was developed and validated through 6 months of real-world deployment on the Tractatus website project (~500 sessions with Claude Code). It successfully:
- Prevented pattern bias incidents that previously caused production issues
- Maintained governance across session continuations
- Escalated all values decisions to human approval
- Detected framework fade before it caused problems
This validation occurred in a controlled, single-project context. We're now expanding to broader testing with diverse deployment scenarios.
## Target Deployments
Tractatus is designed for production AI systems where safety matters:
- **Claude Code deployments** (primary target)
- **Agentic AI systems** with autonomous decision-making
- **High-stakes applications** where errors have real consequences
- **Regulated industries** requiring audit trails and governance
The framework is conceptually portable to other LLMs (GPT-4, Gemini, local models) but currently optimized for Claude Code's architecture.
## Getting Started
**For Researchers:** Explore our [comprehensive documentation](/docs.html) including theoretical foundations, validation methodology, and research papers.
**For Implementers:** Download the [quickstart package](/downloads/tractatus-quickstart.tar.gz) with Docker deployment, configuration templates, and integration guides.
**For Leaders:** Read our [business case](/leader.html) explaining ROI, risk mitigation, and organizational benefits.
## What's Next
We're committed to transparent, community-driven development:
- **Open source** under Apache 2.0 license
- **Public roadmap** with quarterly milestones
- **Research partnerships** with academic institutions
- **Case study contributions** from real deployments
The Tractatus framework is early-stage research, not production-scale validation. We're honest about what we know, what we don't know, and what we're actively investigating.
## Join the Community
- 📖 [Read the full documentation](/docs.html)
- 🔬 [Browse our research papers](/downloads/structural-governance-for-agentic-ai-tractatus-inflection-point.pdf)
- 💬 [Join the discussion on GitHub](https://codeberg.org/mysovereignty/tractatus-framework)
- 📧 [Contact us](/media-inquiry.html) with questions or collaboration inquiries
---
*This post introduces the Tractatus framework at a conceptual level. For technical implementation details, see our [Technical Architecture](/docs.html) documentation.*`,
excerpt: 'Introducing Tractatus: an architectural governance framework for production AI that enforces safety through six mandatory services, not aspirational prompts.',
category: 'Framework Updates',
status: 'published',
published_at: new Date(),
moderation: {
ai_analysis: null,
human_reviewer: 'John Stroh',
review_notes: 'Inaugural blog post - framework introduction',
approved_at: new Date()
},
tractatus_classification: {
quadrant: 'STRATEGIC',
values_sensitive: false,
requires_strategic_review: false
},
tags: [
'framework',
'introduction',
'ai-safety',
'governance',
'architecture',
'claude-code',
'production-ai'
],
view_count: 0,
engagement: {
shares: 0,
comments: 0
}
};
async function seedBlogPost() {
try {
console.log('🌱 Seeding first blog post...');
await connect();
const collection = await getCollection('blog_posts');
// Check if post already exists
const existing = await collection.findOne({ slug: BLOG_POST.slug });
if (existing) {
console.log('📝 Blog post already exists:', BLOG_POST.slug);
console.log(' To update, delete it first or change the slug');
return;
}
// Insert the blog post
const result = await collection.insertOne(BLOG_POST);
console.log('✅ Blog post created successfully');
console.log(' ID:', result.insertedId);
console.log(' Slug:', BLOG_POST.slug);
console.log(' Title:', BLOG_POST.title);
console.log(' Status:', BLOG_POST.status);
console.log(' Tags:', BLOG_POST.tags.join(', '));
console.log('');
console.log('📍 View at: http://localhost:9000/blog-post.html?slug=' + BLOG_POST.slug);
} catch (error) {
console.error('❌ Error seeding blog post:', error);
throw error;
} finally {
await close();
}
}
// Run if called directly
if (require.main === module) {
seedBlogPost()
.then(() => {
console.log('\n✨ Seeding complete');
process.exit(0);
})
.catch(error => {
console.error('\n💥 Seeding failed:', error);
process.exit(1);
});
}
module.exports = { seedBlogPost, BLOG_POST };