Longterm Wiki

Schema Diagrams

Visual reference for how the data schema fits together. All diagrams are derived from data/schema.ts.


Entity-Relationship Overview

This ER diagram shows the core data types and how they reference each other. Primary keys are marked; foreign key references show how entities cross-link.

Loading diagram...

Entity Base Fields (Class Diagram)

Every entity shares these fields. Type-specific fields (like severity for risks or orgType for organizations) are layered on top.

Loading diagram...

Standalone Data Types

These types have their own YAML files and are separate from the entity system.

Expert & Organization

Loading diagram...

Estimate & Crux

Loading diagram...

Resource & Publication

Loading diagram...

Graph Systems

The wiki has three distinct graph systems for different purposes.

1. Cause-Effect Graphs (Entity-embedded)

Used on individual entity pages to show causal factors. Rendered with React Flow.

Loading diagram...

2. Risk Dependency Graphs (Standalone)

Used for modeling risk dependencies across the system.

Loading diagram...

3. Master Graph (Unified causal model)

A single large graph that entity pages extract subgraphs from. Supports multi-page views with per-entity highlighting.

Loading diagram...

Relationship Types (45 total)

All relationship types grouped by semantic category. "A → B" means "A [relationship] B".

CategoryTypesSemantics
Causalcauses, cause, drives, driven-by, driver, affects, amplifies, leads-to, contributes-to, shaped-byA influences or produces B
Mitigationmitigates, mitigated-by, mitigation, blocks, addressesA reduces or prevents B
Dependencyrequires, enables, prerequisite, child-of, composed-of, component, supersedesA structurally depends on or contains B
Measurementmeasures, measured-by, analyzes, analyzed-by, models, increases, decreases, supportsA quantifies or tracks B
Classificationrelated, example, mechanism, outcome, consequence, manifestation, key-factor, scenario, sub-scenario, research, vulnerable-techniqueA is categorically related to B

How relationships flow through the system:

Loading diagram...

Enum Reference

EntityType (24 canonical + 11 aliases)

Canonical types by group:

GroupTypes
Contentrisk, risk-factor, capability, concept, crux, argument, case-study
Safetysafety-agenda, approach, project, policy
People/Orgsperson, organization, funder
Analysismodel, parameter, metric, analysis, scenario
AI Transitionai-transition-model-parameter, ...metric, ...scenario, ...factor, ...subitem
Otherresource, historical, event, debate, table, diagram, insight, intelligence-paradigm

Legacy aliases (kept for backward compatibility):

AliasResolves to
researcherperson
lab, lab-frontier, lab-research, lab-startup, lab-academicorganization
safety-approachessafety-agenda
policiespolicy
conceptsconcept
eventsevent
modelsmodel

Key Enum Values

EnumValues
Confidencelow, medium, high
Importancelow, medium, high, critical
EntityStatusstub, draft, published, verified
ResearchMaturityNeglected, Emerging, Growing, Mature
OrgTypefrontier-lab, safety-org, academic, government, funder, policy
RiskCategoryaccident, misuse, structural, epistemic
Severitylow, medium, medium-high, high, critical, catastrophic
LikelihoodLevellow, medium, medium-high, high, very-high, near-certain
LikelihoodStatustheoretical, emerging, occurring, established
ResourceTypepaper, blog, report, book, talk, podcast, government, reference, web
PublicationTypeacademic_journal, preprint_server, think_tank, company_blog, government, blog_platform, news, organization, academic, code_repository, + more
Clusterai-safety, biorisks, cyber, epistemics, governance, community
Relationship Strengthweak, moderate, strong
CauseEffect Strengthweak, medium, strong
CauseEffect Effectincreases, decreases, mixed

Data Flow: Build Pipeline

How build-data.mjs transforms raw data into the runtime database.

Loading diagram...

Detailed steps within build-data.mjs:

PhaseSteps
ParseParse all YAML files, scan MDX frontmatter, auto-create entities for MDX pages without YAML
TransformAssign stable numeric IDs (E1, E2...), type and validate against Zod, compute backlinks (invert relatedEntries)
EnrichBuild tag index, build path registry, resolve computed facts (topological sort), generate search index, generate MDX stubs from YAML ContentSections
OutputWrite database.json, id-registry.json, individual JSON files, search index

Facts System

Facts are canonical, referenceable values that can be computed from expressions referencing other facts.

Loading diagram...

Example fact file (data/facts/anthropic.yaml):

entity: anthropic
facts:
  founding-year:
    value: "2021"
    numeric: 2021
    source: "Wikipedia"
  valuation:
    compute: "{anthropic.funding} * 1.5"
    format: "$%.1f billion"
    formatDivisor: 1e9

Content Freshness Tracking

MDX frontmatter can include freshness metadata to track content staleness:

reviewBy: "2026-06-26"           # When content should be reviewed
contentDependencies:              # Entity IDs that affect this content
  - deceptive-alignment
  - mesa-optimization
lastReviewed: "2025-12-26"
reviewedBy: "ozzie"
stalenessRisk: "low"             # low | medium | high

Source of truth: data/schema.ts (834 lines)