Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wuweism.com/llms.txt

Use this file to discover all available pages before exploring further.

A counterfactual trace is a structured audit record created each time Wu-Weism evaluates a counterfactual query — “what would have happened to outcome had variable been set to value?” Traces capture the full provenance of that reasoning: the SCM used, the intervention applied, the adjustment set, the causal assumptions, and the AI provider that executed the analysis. Traces are immutable once created. You can retrieve them by traceId to inspect past reasoning, attach them to claims, or audit your causal workflow.

Get a counterfactual trace

GET /api/scm/counterfactual-traces/{traceId}
This endpoint requires authentication. Include your session token in the Authorization header.

Path parameters

traceId
string
required
UUID of the counterfactual trace to retrieve. Trace IDs are returned when counterfactual analyses are run through the causal chat or hybrid synthesize pipelines.

Response fields

traceId
string
required
UUID of the trace. Matches the traceId supplied in the request path.
modelRef
object
required
Reference to the SCM used for this counterfactual evaluation.
intervention
object
required
The causal intervention that was evaluated.
outcome
string
required
The outcome variable evaluated under the intervention.
method
string
required
The algorithmic method used to compute the counterfactual. Currently "deterministic_graph_diff" for all traces — this method computes the counterfactual by propagating the intervention through the SCM’s directed acyclic graph and diffing the resulting outcome distribution against the factual.
assumptions
string[]
required
List of causal assumptions that were active during evaluation (e.g., "acyclicity", "no unmeasured confounding", "stable unit treatment value assumption").
adjustmentSet
string[]
required
Variables conditioned on to satisfy the identifiability criterion. Corresponds to the confirmed adjustment set from intervention validation.
metadata
object
required
Execution metadata for the trace.

Example

curl --request GET \
  --url https://wuweism.com/api/scm/counterfactual-traces/b3f1c2d4-88ae-4e1a-9c3b-7f2a0d5e6b19 \
  --header 'Authorization: Bearer <token>'
{
  "traceId": "b3f1c2d4-88ae-4e1a-9c3b-7f2a0d5e6b19",
  "modelRef": {
    "modelKey": "neural_topology_v1",
    "version": "1.0.0"
  },
  "intervention": {
    "variable": "cortisol_level",
    "value": "high"
  },
  "outcome": "hippocampal_volume",
  "method": "deterministic_graph_diff",
  "assumptions": [
    "acyclicity",
    "no unmeasured confounding given adjustment set",
    "stable unit treatment value assumption (SUTVA)",
    "faithfulness"
  ],
  "adjustmentSet": ["stress_exposure"],
  "metadata": {
    "providerId": "anthropic",
    "timestamp": "2026-03-12T14:22:05Z"
  }
}
Traces are scoped to your account. You can only retrieve traces created within your own sessions. Attempting to access another user’s trace returns 404 Not Found.