About This Wiki
The Longterm Wiki is a strategic intelligence platform for AI safety prioritization. It serves as a decision-support tool for funders, researchers, and policymakers asking: "Where should the next marginal dollar or researcher-hour go?"
This page documents the technical side—how the wiki is built, how content is organized, and how to contribute.
For strategic vision and goals, see:
- Project Overview — Quick summary of what LongtermWiki is
- Vision Document — Full 2-person-year scope, architecture, milestones
- Similar Projects Analysis — Lessons from Arbital, Stampy, MIT Risk Repository, and others
Content Architecture
Major Sections
| Section | Purpose | Examples |
|---|---|---|
| Knowledge Base | Core content on risks, interventions, organizations, people | Deceptive AlignmentRiskDeceptive AlignmentComprehensive analysis of deceptive alignment risk where AI systems appear aligned during training but pursue different goals when deployed. Expert probability estimates range 5-90%, with key empir...Quality: 75/100, AI Safety InstitutesPolicyAI Safety Institutes (AISIs)Analysis of government AI Safety Institutes finding they've achieved rapid institutional growth (UK: 0→100+ staff in 18 months) and secured pre-deployment access to frontier models, but face critic...Quality: 69/100 |
| Models | Analytical frameworks for understanding dynamics | Risk models, cascade models, governance models |
| Project | Public-facing documentation about LongtermWiki itself | Vision, strategy, similar projects |
| Internal | Contributor documentation, style guides, technical reference | This page, style guides, automation tools |
Content Volume
The wiki contains approximately:
- ~550 MDX pages across all sections
- ~100 structured data entities (experts, organizations, cruxes, estimates)
- ~80 analytical model pages with causal diagrams
Page Types and Templates
The wiki uses a two-level classification system.
Page Types (Validation Behavior)
| Type | Quality Scored? | Use Case |
|---|---|---|
content | Yes | All substantive knowledge base pages (default) |
stub | No | Redirects, brief profiles, placeholders |
documentation | No | Style guides, internal docs (like this page) |
overview | No (auto) | Index pages for navigation |
Page Templates (Structure)
Templates determine expected structure and applicable style guide:
| Template | Style Guide |
|---|---|
knowledge-base-risk | Knowledge Base Style GuideE763Internal style guide for wiki content creation, emphasizing flexible hierarchical structure over rigid templates, integrated arguments over sparse sections, and selective use of visualizations. Pro...Quality: 34/100 |
knowledge-base-response | Knowledge Base Style GuideE763Internal style guide for wiki content creation, emphasizing flexible hierarchical structure over rigid templates, integrated arguments over sparse sections, and selective use of visualizations. Pro...Quality: 34/100 |
knowledge-base-model | Model Style GuideE736Internal style guide prescribing dense, quantified content structure for model pages: minimum 800 words, 2+ tables (4x3+), 1+ Mermaid diagram, mathematical formulations, and <30% bullets. Requires ...Quality: 38/100 |
For complete details, see Page Type SystemE739Documents LongtermWiki's four-level page classification system (content, stub, documentation, overview) with explicit validation rules for each type, where content pages receive full quality gradin...Quality: 65/100.
Quality System
Rating Dimensions
Content pages are scored on six dimensions (0-10 scale, harsh—7+ is exceptional):
| Dimension | What It Measures |
|---|---|
| Focus | Does it answer the title's promise? |
| Novelty | Value beyond obvious sources |
| Rigor | Evidence quality and precision |
| Completeness | Thorough coverage of claimed topic |
| Concreteness | Specific vs. abstract recommendations |
| Actionability | Can readers make different decisions? |
These combine into an overall quality score (0-100).
Quality Pipeline
Quality must only be set through the grading pipeline, never manually:
# Grade a specific page
npm run crux -- content grade --page scheming --apply
# Grade all ungraded pages
node scripts/content/grade-content.mjs --skip-graded --apply
For grading criteria and workflows, see Content QualityE741This page documents LongtermWiki's content rating system, which combines LLM-graded subscores (focus, novelty, rigor, completeness, objectivity, concreteness, actionability on 0-10 scales) with aut...Quality: 48/100.
Data Layer
Structured Data Sources
The wiki maintains YAML databases in src/data/:
| File | Contents |
|---|---|
experts.yaml | AI safety researchers and their positions on cruxes |
organizations.yaml | Labs, research orgs, funders |
cruxes.yaml | Key uncertainties with expert positions |
estimates.yaml | Probability distributions for key variables |
publications.yaml | Research papers and reports |
external-links.yaml | Curated resource database |
Generated Data
Running npm run build:data generates:
| Output | Purpose |
|---|---|
database.json | All entities merged for browser use |
pathRegistry.json | Entity ID → URL path mapping |
backlinks.json | Reverse reference indices |
tagIndex.json | Searchable tag index |
Data-Aware Components
Components pull from YAML databases to display structured information. For example, EntityLink provides stable cross-references, while DataInfoBox displays expert or organization profiles from YAML.
For database details and component usage, see Content DatabaseE759Documentation for the wiki's multi-layer data storage architecture. The wiki-server PostgreSQL database stores citation content, audit results, claims, facts, and structured data accessed via Hono ...Quality: 44/100.
Cross-Linking System
Entity Links
The wiki uses stable ID-based linking that survives path reorganization:
The <EntityLink id="E274" name="scheming">scheming</EntityLink> risk relates to
<EntityLink id="E93" name="deceptive-alignment">deceptive alignment</EntityLink>.
Benefits:
- Automatic title lookup from database
- Entity type icons
- Backlink tracking
- Link validity checked during CI
Backlinks
Every page can display incoming links:
Post-Edit Linking Check
After creating or editing a page, verify cross-linking:
npm run crux -- analyze entity-links <entity-id>
This shows inbound links, missing inbound links (pages that mention but don't link), and outbound links.
Visualizations
Mermaid Diagrams
Flowcharts, sequences, and graphs for static illustrations:
See Mermaid DiagramsE735Internal style guide for creating Mermaid diagrams in the wiki, recommending vertical layouts over horizontal (max 3-4 parallel nodes), providing semantic color palette, and advocating tables over ...Quality: 37/100 for guidelines.
Cause-Effect Graphs
Interactive causal diagrams using ReactFlow for complex causal models:
<CauseEffectGraph
initialNodes={graphNodes}
initialEdges={graphEdges}
selectedNodeId="current-factor"
/>
Features: zoom, pan, minimap, node highlighting, path tracing, entity linking.
See Cause-Effect DiagramsE758Technical documentation for creating cause-effect diagrams in YAML format, covering node types (leaf/cause/intermediate/effect), edge properties (strength/confidence/effect), semantic color coding,...Quality: 44/100 for schema and examples.
Automation Tools
Unified CLI
All tools are accessible via the crux CLI:
npm run crux -- --help # Show all domains
npm run crux -- validate # Run all validators
npm run crux -- analyze # Analysis and reporting
npm run crux -- fix # Auto-fix common issues
npm run crux -- content # Page management
npm run crux -- generate # Content generation
npm run crux -- resources # External resource management
Common Workflows
| Task | Command |
|---|---|
| Validate before commit | npm run precommit |
| Full validation suite | npm run validate |
| Rebuild entity database | npm run build:data |
| Grade a specific page | npm run crux -- content grade --page <id> |
| Find unlinked mentions | npm run crux -- analyze mentions |
| Fix escaping issues | npm run crux -- fix escaping |
Validation Rules
The validation suite includes 20+ rules:
| Validator | What It Checks |
|---|---|
compile | MDX syntax and compilation |
frontmatter-schema | YAML frontmatter validity |
dollar-signs | LaTeX escaping (\$100 not $100) |
comparison-operators | JSX escaping (\<100ms not <100ms) |
entitylink-ids | All EntityLink references exist |
quality-source | Quality set by pipeline, not manually |
mermaid | Diagram syntax validation |
For complete tool reference, see Automation ToolsE757Comprehensive technical documentation for wiki maintenance automation, covering page improvement workflows (Q5 standards requiring 10+ citations, 800+ words), content grading via Claude API (~\$0.0...Quality: 41/100.
Technical Stack
Core Technologies
| Layer | Technology |
|---|---|
| Framework | Astro 5 with Starlight theme |
| Components | React 19 |
| Styling | Tailwind CSS 4 |
| Type Safety | TypeScript + Zod schemas |
| Graphs | ReactFlow (XYFlow) + Dagre/ELK layout |
| Diagrams | Mermaid 11 |
| Math | KaTeX |
| Data | YAML sources → JSON build artifacts |
Project Structure
apps/longterm/
├── src/
│ ├── content/docs/ # ~550 MDX pages
│ │ ├── knowledge-base/ # Main content (risks, responses, orgs, people)
│ │ ├── project/ # Public project documentation
│ │ └── internal/ # Contributor docs and style guides
│ ├── components/
│ │ ├── wiki/ # 50+ content components
│ │ ├── CauseEffectGraph/ # Interactive graph system
│ │ └── ui/ # shadcn components
│ ├── data/
│ │ ├── *.yaml # Source data files
│ │ └── *.json # Generated (build artifacts)
│ └── pages/ # Astro dynamic routes
├── scripts/
│ ├── crux.mjs # CLI entry point
│ ├── build-data.mjs # Data compilation pipeline
│ ├── commands/ # CLI domain handlers
│ └── validate/ # 23 validators
└── astro.config.mjs # Sidebar and site config
Key Configuration Files
| File | Purpose |
|---|---|
astro.config.mjs | Sidebar structure, Starlight setup |
src/content.config.ts | MDX frontmatter schema |
src/data/schema.ts | Entity type definitions (Zod) |
package.json | Dependencies and npm scripts |
Development Workflow
Getting Started
# Install dependencies
npm install
# Start development server (auto-runs build:data)
npm run dev
# Build for production
npm run build
After Editing Content
# After editing YAML data files
npm run build:data
# After editing any content
npm run precommit # Quick validation
npm run validate # Full validation
Creating New Content
- New pages: Follow the appropriate style guideE763Internal style guide for wiki content creation, emphasizing flexible hierarchical structure over rigid templates, integrated arguments over sparse sections, and selective use of visualizations. Pro...Quality: 34/100
- New entities: Add to relevant YAML in
src/data/, runnpm run build:data - New components: Add to
src/components/wiki/, use path aliases
For content generation workflows, see Research ReportsE748Internal style guide for deprecated research report format, specifying table-based layouts, escaped dollar signs, YAML schema, and causal factor documentation for diagram creation. Provides compreh...Quality: 36/100.
Related Documentation
Project & Strategy
- Project Overview — What LongtermWiki is, core components
- Vision Document — 2-person-year scope, architecture, milestones
- Similar Projects — Lessons from Arbital, Stampy, MIT Risk Repository
- Strategy Brainstorm — Failure modes and strategic options
Style Guides
- Knowledge Base Style GuideE763Internal style guide for wiki content creation, emphasizing flexible hierarchical structure over rigid templates, integrated arguments over sparse sections, and selective use of visualizations. Pro...Quality: 34/100 — For risk and response pages
- Model Style GuideE736Internal style guide prescribing dense, quantified content structure for model pages: minimum 800 words, 2+ tables (4x3+), 1+ Mermaid diagram, mathematical formulations, and <30% bullets. Requires ...Quality: 38/100 — For analytical model pages
- Stub Style GuideE753Internal documentation providing guidelines for creating minimal placeholder pages (stubs) in the knowledge base, including when to use them, required formatting, and when to convert them to full p...Quality: 19/100 — For minimal reference pages
Technical Documentation
- System ArchitectureE734Technical architecture of the Longterm Wiki — data pipeline, clever design patterns, and the ideas that make it work — Data flow, pipelines, design decisions
- Page Type SystemE739Documents LongtermWiki's four-level page classification system (content, stub, documentation, overview) with explicit validation rules for each type, where content pages receive full quality gradin...Quality: 65/100 — Complete classification reference
- Rating SystemE741This page documents LongtermWiki's content rating system, which combines LLM-graded subscores (focus, novelty, rigor, completeness, objectivity, concreteness, actionability on 0-10 scales) with aut...Quality: 48/100 — Quality scoring system
- Content DatabaseE759Documentation for the wiki's multi-layer data storage architecture. The wiki-server PostgreSQL database stores citation content, audit results, claims, facts, and structured data accessed via Hono ...Quality: 44/100 — Storage architecture (PostgreSQL, caching, YAML)
- Automation ToolsE757Comprehensive technical documentation for wiki maintenance automation, covering page improvement workflows (Q5 standards requiring 10+ citations, 800+ words), content grading via Claude API (~\$0.0...Quality: 41/100 — All scripts and workflows
- Cause-Effect DiagramsE758Technical documentation for creating cause-effect diagrams in YAML format, covering node types (leaf/cause/intermediate/effect), edge properties (strength/confidence/effect), semantic color coding,...Quality: 44/100 — Graph schema and examples
- Mermaid DiagramsE735Internal style guide for creating Mermaid diagrams in the wiki, recommending vertical layouts over horizontal (max 3-4 parallel nodes), providing semantic color palette, and advocating tables over ...Quality: 37/100 — Diagram guidelines
- Documentation MaintenanceE760Guidelines for keeping internal documentation accurate and up-to-date — Keeping docs updated