Skip to content
Longterm Wiki
Updated 2026-04-12HistoryData
Page StatusDocumentation
Edited 3 weeks ago1.3k words4 backlinksUpdated monthlyDue in 1 weeks
55QualityAdequate11.5ImportancePeripheral9ResearchMinimal
Content6/13
SummaryScheduleEntityEdit history2Overview
Tables11/ ~5Diagrams2/ ~1Int. links30/ ~10Ext. links0/ ~6Footnotes0/ ~4References0/ ~4Quotes0Accuracy0RatingsN:2 R:6.5 A:6 C:8Backlinks4
Change History2
Add PageStatus and info boxes to internal pages#1853 months ago

Enabled PageStatus rendering, Data links, and Feedback widgets on internal pages by removing the `isInternal` guards in the wiki page renderer. Added `evergreen`, `update_frequency`, and `lastEdited` frontmatter to all ~40 internal pages so update schedules and staleness indicators are visible.

Internal pages entity infrastructure#1423 months ago

Added full entity infrastructure to internal pages (style guides, architecture docs, research reports, schema docs). Internal pages now have the `internal` entity type, get auto-assigned E* numeric IDs (E698-E731), are included in the search index, and participate in backlinks/related graph computation. Includes review fixes: filtering internal pages from public explore/home, converting all 7 remaining .md files, adding `internal` to data/schema.ts, and updating all `shouldSkipValidation`/`pageType === 'documentation'` checks.

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:


Content Architecture

Major Sections

SectionPurposeExamples
Knowledge BaseCore content on risks, interventions, organizations, peopleDeceptive Alignment, AI Safety Institutes
ModelsAnalytical frameworks for understanding dynamicsRisk models, cascade models, governance models
ProjectPublic-facing documentation about LongtermWiki itselfVision, strategy, similar projects
InternalContributor documentation, style guides, technical referenceThis page, style guides, automation tools

Content Volume

The wiki contains approximately:

  • ~700 MDX pages across all sections
  • Hundreds of structured data entities (organizations, people, AI models, legislation, grants, projects)
  • Analytical model pages with causal diagrams

Page Types and Templates

The wiki uses a two-level classification system.

Page Types (Validation Behavior)

TypeQuality Scored?Use Case
contentYesAll substantive knowledge base pages (default)
stubNoRedirects, brief profiles, placeholders
documentationNoStyle guides, internal docs (like this page)
overviewNo (auto)Index pages for navigation

Page Templates (Structure)

Templates determine expected structure and applicable style guide:

TemplateStyle Guide
knowledge-base-riskKnowledge Base Style Guide
knowledge-base-responseKnowledge Base Style Guide
knowledge-base-modelModel Style Guide

For complete details, see Page Type System.


Quality System

Rating Dimensions

Content pages are scored on six dimensions (0-10 scale, harsh—7+ is exceptional):

DimensionWhat It Measures
FocusDoes it answer the title's promise?
NoveltyValue beyond obvious sources
RigorEvidence quality and precision
CompletenessThorough coverage of claimed topic
ConcretenessSpecific vs. abstract recommendations
ActionabilityCan 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:

# Improve a specific page (includes grading)
pnpm crux w improve <page-id> --tier=standard --apply

For grading criteria and workflows, see Content Quality.


Data Layer

Three Bases

The wiki is organized around three complementary data layers:

BaseWhat it storesWhere it lives
TableBaseTyped relational records (entities, grants, publications, etc.)data/entities/*.yaml and PG-primary tables
FactBaseStructured triples with temporal data and provenancepackages/factbase/data/fb-entities/*.yaml
WikiBaseLong-form prose MDX articlescontent/docs/**/*.mdx

YAML and MDX are the source of truth; Postgres (via the wiki-server) keeps read mirrors for querying.

Structured Data Sources

Legacy YAML catalogs live under data/:

File or directoryContents
data/entities/*.yamlLightweight entity catalog (orgs, people, concepts, projects)
data/experts.yamlAI safety researchers and their positions on cruxes
data/organizations.yamlLabs, research orgs, funders
data/estimates.yamlProbability distributions for key variables
data/publications.yamlResearch papers and reports
data/external-links.yamlCurated resource database

Generated Data

Running pnpm build-data:content (or pnpm build, which runs it first) compiles YAML + MDX into:

OutputPurpose
database.jsonAll entities + page metadata merged for build-time use
factbase-data.jsonCompiled FactBase triples with provenance

The Next.js app reads these JSON artifacts directly at build time—content pages make zero runtime API calls.

Data-Aware Components

React components pull from the generated JSON to display structured information. For example, EntityLink provides stable cross-references, <FBF> and <Calc> render FactBase facts, and DataInfoBox displays entity profiles.

For database details and component usage, see Content Database.


Cross-Linking System

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 by the gate

Post-Edit Linking Check

After creating or editing a page, verify cross-linking with the validation gate:

pnpm crux w validate gate --scope=content --fix

This runs link integrity, EntityLink resolution, and related checks in ~15 seconds.


Visualizations

Mermaid Diagrams

Flowcharts, sequences, and graphs for static illustrations:

Diagram (loading…)
flowchart LR
  A[Training] --> B[Alignment Techniques]
  B --> C{Robust?}
  C -->|Yes| D[Safe AI]
  C -->|No| E[Misalignment Risk]

See Mermaid Diagrams 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 Diagrams for schema and examples.


Automation Tools

Unified CLI

All tools are accessible via the crux CLI, organized into groups by data layer:

pnpm crux --help            # Full CLI reference
pnpm crux w --help          # Wiki (content) commands
pnpm crux fb --help         # FactBase commands
pnpm crux tb --help         # TableBase commands
pnpm crux linear --help     # Linear issue tracker
pnpm crux gh --help         # GitHub (PRs, CI, deploy tasks)
pnpm crux sys --help        # System / agent tools

Common Workflows

TaskCommand
Create a new pagepnpm crux w create "Title" --tier=standard
Improve an existing pagepnpm crux w improve <id> --tier=standard --apply
Pre-push validation gatepnpm crux w validate gate --fix
Fast content-only gatepnpm crux w validate gate --scope=content --fix
Fix escaping issuespnpm crux w fix escaping
Fix markdown issuespnpm crux w fix markdown
Full-text searchpnpm crux query search "topic"
Rebuild content JSONpnpm build-data:content

Validation Rules

The gate check runs 50+ validators in parallel. CI-blocking rules include:

ValidatorWhat It Checks
mdx-compileMDX syntax and compilation
frontmatter-schemaYAML frontmatter validity
dollar-signsLaTeX escaping (\$100 not $100)
comparison-operatorsJSX escaping (\<100ms not <100ms)
entity-linksAll EntityLink references resolve
wiki-id-integrityPage wikiIds are unique and well-formed
factbase-entity-idsFactBase ↔ TableBase entity ID consistency
kb-entity-slugsFactBase refs have matching entity registry entries

For complete tool reference, see Automation Tools.


Technical Stack

Core Technologies

LayerTechnology
FrameworkNext.js 15 with App Router
ComponentsReact 19 + next-mdx-remote
StylingTailwind CSS v4 + shadcn/ui
Type SafetyTypeScript + Zod schemas
GraphsReactFlow (XYFlow) + Dagre layout
DiagramsMermaid 11
MathKaTeX
SearchPostgreSQL full-text search (wiki-server)
CLICrux (custom multi-domain CLI)
DataYAML sources + FactBase → JSON build artifacts
Package managerpnpm workspaces

Project Structure

longterm-wiki/
├── apps/
│   ├── web/                    # Next.js 15 frontend (longterm-next)
│   │   ├── src/
│   │   │   ├── app/            # App Router pages and API routes
│   │   │   ├── components/     # React components (wiki/, ui/, ...)
│   │   │   ├── data/           # Data-layer modules (tablebase, factbase)
│   │   │   └── lib/            # Shared utilities
│   │   └── scripts/
│   │       ├── build-data.mjs  # Data compilation pipeline
│   │       └── assign-ids.mjs  # Wiki ID allocation
│   ├── wiki-server/            # Hono API server (Postgres, Drizzle ORM)
│   ├── discord-bot/            # Discord integration
│   └── groundskeeper/          # Background maintenance jobs
├── packages/
│   ├── factbase/               # FactBase types, YAML loading, serialization
│   │   └── data/fb-entities/   # FactBase entity YAML (authoritative)
│   └── id-utils/               # Stable ID helpers (sid_ prefix)
├── content/
│   └── docs/                   # ~700 MDX pages
│       ├── knowledge-base/     # Risks, responses, organizations, people
│       ├── project/            # Public project documentation
│       └── internal/           # Contributor docs and style guides
├── data/
│   ├── entities/               # Lightweight entity YAML catalog
│   ├── *.yaml                  # Legacy YAML data sources
│   └── schema.ts               # Shared data schema
└── crux/                       # Crux CLI + 50+ validators
    ├── commands/               # CLI command handlers (w, fb, tb, linear, ...)
    ├── validate/               # Validators (gate, data, daily)
    └── crux.mjs                # CLI entry point

Key Configuration Files

FilePurpose
package.jsonWorkspace root: dependencies, scripts
pnpm-workspace.yamlWorkspace package list
apps/web/next.config.tsNext.js configuration
apps/wiki-server/drizzle.config.tsDrizzle ORM schema config
crux/lib/rules/frontmatter-schema.tsMDX frontmatter Zod schema
data/schema.tsLegacy YAML entity schema (Zod)

Development Workflow

Getting Started

# Install dependencies (pnpm is required)
pnpm install

# First-time setup: install + build data
pnpm setup:quick

# Start development server on port 3001
pnpm dev

# Build for production
pnpm build

After Editing Content

# After editing any page, clean up formatting
pnpm crux w fix escaping
pnpm crux w fix markdown

# Run the pre-push gate (CI-blocking checks)
pnpm crux w validate gate --fix

# For content-only edits, use the faster content scope (~15s)
pnpm crux w validate gate --scope=content --fix

Creating New Content

  1. New pages: use the Crux content pipeline — pnpm crux w create "Title" --tier=standard — rather than writing MDX by hand. It handles frontmatter, IDs, citations, and EntityLink validation.
  2. New entities: add a YAML file to data/entities/ (lightweight) or allocate a wiki entity ID with pnpm crux tb ids allocate <slug> for entities that deserve their own page.
  3. New components: add to apps/web/src/components/wiki/ and reference via the @components/wiki path alias.

For content generation workflows, see Research Reports.


Project & Strategy

Style Guides

  • Knowledge Base Style Guide — For risk and response pages
  • Model Style Guide — For analytical model pages
  • Stub Style Guide — For minimal reference pages

Technical Documentation

  • System Architecture — Data flow, pipelines, design decisions
  • Page Type System — Complete classification reference
  • Rating System — Quality scoring system
  • Content Database — Storage architecture (PostgreSQL, caching, YAML)
  • Automation Tools — All scripts and workflows
  • Cause-Effect Diagrams — Graph schema and examples
  • Mermaid Diagrams — Diagram guidelines
  • Documentation Maintenance — Keeping docs updated