> ## Documentation Index
> Fetch the complete documentation index at: https://wuweism.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Structural Causal Models

> The formal causal graphs that ground every Wu-Weism analysis — and how the platform loads the right one for your domain automatically.

A **Structural Causal Model (SCM)** is a precise, formal representation of a causal system. Where a statistical model asks "what patterns exist in the data?", an SCM asks "what causes what, and how?" Every causal analysis in Wu-Weism is grounded in an SCM — a graph of variables, directed causal edges, and the constraints governing how those variables interact.

You do not need to build SCMs yourself. Wu-Weism ships a registry of domain-specific models and loads the right one automatically based on your query.

## What an SCM contains

An SCM has three components: **variables** (the nodes), **causal relationships** (the edges), and **constraints** (the laws those relationships must obey).

### Nodes — the variables in your domain

Every variable in the model is represented as a node. Wu-Weism classifies nodes into four types:

| Node type      | Description                                                        | Examples                                                       |
| -------------- | ------------------------------------------------------------------ | -------------------------------------------------------------- |
| `observable`   | Variables you can measure directly                                 | Heart rate, test score, unemployment rate                      |
| `latent`       | Variables that influence outcomes but cannot be directly observed  | Immune response, cognitive load, systemic bias                 |
| `exogenous`    | Variables whose causes lie outside the model boundary              | Random noise, unmeasured background conditions                 |
| `intervention` | Variables that represent a forced assignment — a `do(·)` operation | Prescribed drug dosage, policy mandate, experimental condition |

Knowing which type a variable is tells you what kind of reasoning is valid. Latent variables, for example, introduce unobserved confounding, which limits identifiability of causal effects.

### Edges — the causal relationships

A directed edge from variable A to variable B means "A is a direct cause of B in this model." Edges are not neutral — each carries a **constraint type** that specifies what kind of physical or logical law governs the relationship:

| Constraint type | Meaning                                                         | Domain examples                          |
| --------------- | --------------------------------------------------------------- | ---------------------------------------- |
| `conservation`  | A quantity is preserved across the relationship                 | Energy, mass, probability mass           |
| `entropy`       | The relationship is subject to thermodynamic direction          | Information flow, irreversible processes |
| `causality`     | The cause precedes the effect in time                           | Any temporal causal chain                |
| `locality`      | The cause can only directly affect spatially adjacent variables | Physical propagation, network effects    |

These constraint types are not metadata — they are enforced during reasoning. A response that would require energy to be created from nothing, or an effect to precede its cause, will be blocked by the constraint system.

### Constraints — laws that cannot be violated

Constraints are the hardest part of the SCM. They come in two tiers:

**Tier 1 — Universal constraints** apply to every domain and every query. They encode laws of physics and logic: conservation of energy, entropy, temporal causality, and locality. No response in Wu-Weism can violate a Tier 1 constraint. These constraints are always active and cannot be disabled.

**Tier 2 — Domain constraints** are specific to a field of study. In neuroscience, constraints on neural propagation speed apply. In legal causation, the but-for standard constrains what can be claimed as a cause. In ecology, population dynamics follow specific equilibrium rules. Tier 2 constraints are loaded with the domain SCM.

<Warning>
  Tier 1 constraints are absolute. If your question requires an answer that would violate a universal law — for example, a causal effect propagating backward in time — Wu-Weism will refuse to generate that answer and explain the constraint that was violated.
</Warning>

## The SCM Registry

Wu-Weism ships a built-in registry of domain models, covering:

* **Alignment** — AI safety, value specification, corrigibility, mesa-optimization
* **Consciousness** — integrated information, global workspace, phenomenal binding
* **Neuroscience** — neural circuits, synaptic plasticity, cognitive processes
* **Legal causation** — but-for causation, proximate cause, legal attribution
* **Education** — learning mechanisms, intervention effects, assessment validity
* **Ecology** — population dynamics, trophic cascades, environmental interventions

Each entry in the registry includes the full causal graph, constraint specifications, and a set of pre-validated identifiable queries.

<Info>
  The registry is updated as new domain models are validated and added. To see which models are currently available, query the SCM API at `GET /api/scm/models`.
</Info>

## Truth Cartridges — automatic model loading

When you submit a query, Wu-Weism analyzes the subject domain and loads the appropriate SCM automatically. This is called the **Truth Cartridge** system: the right causal model is "loaded" for your query, grounding the response in domain-appropriate causal structure.

You do not need to select a model or configure a graph. The classification happens before the model generates a response, and the loaded SCM constrains what the response can claim.

<Steps>
  <Step title="Query received">
    Your question enters the Wu-Weism pipeline.
  </Step>

  <Step title="Domain classification">
    The system identifies the subject domain — for example, neuroscience, legal causation, or ecology.
  </Step>

  <Step title="SCM retrieved">
    The matching Structural Causal Model is loaded from the registry. If multiple domains are relevant, the most specific model is selected.
  </Step>

  <Step title="Constraints injected">
    Tier 1 universal constraints are applied first, followed by Tier 2 domain constraints from the loaded model.
  </Step>

  <Step title="Constrained generation">
    The AI generates a response within the boundaries defined by the SCM. Claims that would violate any constraint are suppressed.
  </Step>
</Steps>

## Seeing which SCM was loaded

After each query, the workbench emits an `scm_loaded` event that shows:

* The model name (e.g., `neuroscience-v2`, `legal-causation-v1`)
* The version of the model
* The active Tier 1 and Tier 2 constraints
* Whether any constraints were invoked to suppress or modify the response

Look for the **SCM** label in the response metadata panel to see the model name and active constraints.

## Variable types in the workbench

When you view a causal graph in the workbench, nodes are color-coded by type:

```
observable    → filled circle     (measured variables)
latent        → dashed circle     (unobserved variables)
exogenous     → square            (external noise/background)
intervention  → diamond           (do(·) target variables)
```

Hovering a node shows its type, any constraints that apply to its incoming or outgoing edges, and whether it is part of the current query's adjustment set.

## The SCM API

You can query the SCM Registry directly to see available models and their specifications.

```bash theme={null}
GET /api/scm/models
```

This returns the list of available domain models, including the model key, version, domain, constraint types, and the node and edge counts.

The SCM engine also supports three query types programmatically:

<AccordionGroup>
  <Accordion title="D-Separation queries">
    D-separation checks whether two variables are conditionally independent given a set of observed variables. This tells you whether a statistical association between two variables could be explained by a common cause or a mediating path — and whether controlling for a third variable would block or open that path.

    Use d-separation queries to understand which variables need to be measured and controlled in your study design.
  </Accordion>

  <Accordion title="Identifiability queries">
    Identifiability checks whether a causal effect *P(Y | do(X))* can be computed from observational data given the causal graph. A causal effect is identifiable if every backdoor path from the treatment to the outcome can be blocked by adjusting for observable variables.

    Wu-Weism runs an identifiability check automatically before executing any Rung 2 intervention. If the effect is not identifiable, the response is downgraded to Rung 1 and you are told which confounders are missing.
  </Accordion>

  <Accordion title="Intervention queries">
    Intervention queries compute *P(Y | do(X = v))* — the distribution of the outcome if the treatment variable were forced to a specific value, regardless of its natural causes. These implement Pearl's do-calculus and form the basis of all Rung 2 answers in Wu-Weism.
  </Accordion>
</AccordionGroup>

## Related concepts

<CardGroup cols={3}>
  <Card title="Pearl's causal ladder" icon="stairs" href="/concepts/causal-ladder">
    How SCMs power all three rungs of causal reasoning.
  </Card>

  <Card title="Counterfactual reasoning" icon="code-branch" href="/concepts/counterfactuals">
    How identifiability checks protect the validity of interventions.
  </Card>

  <Card title="Claim Ledger" icon="clipboard-list" href="/concepts/claim-ledger">
    How claims are audited against the SCM that produced them.
  </Card>
</CardGroup>
