← All examples
08

Canonical Grid model

Truth Inspector Demo

Canonical model for demonstrating typed values, WHY lineage, AS_OF history, sensitivity drivers, confidence bands, and runtime profile.

Scale
Small
Source
08-truth-inspector.grid
Length
48 lines
Collection
Explainability & trust
Level
Intermediate
Runtime
History-aware
Version
1.0.0

Watch it in Grid

See this model in motion.

Watch the model respond in the product, then inspect the exact source and checkpoints on this page.

Companion film

Ask WHY

Select a result, reveal its formula, and trace the evaluated lineage behind the number.

17 secGrid 0.61.0
Open film page

What this model gives you

A unit-safe margin decision with a traceable dependency cone, saved-history seam, and uncertainty band.

25 min to study · Source reviewed 2026-08-24

Continue with guided practice

What to notice

  • Why lineage
  • Previous revisions
  • Sensitivity drivers
  • Uncertainty propagation

Requirements

  • History for AS_OF
  • Inspector or equivalent Why action
  • No network

Expected checkpoint

A known state for this walkthrough.

After loading the canonical source with its authored starting values.

Revenue
170,360 USDB2
Profit
90,623.20 USDC1
Margin
53.20%C2, rounded
Status
healthy-marginC3
01 · Translate

Dimensions protect the arithmetic

Euro revenue is translated before it joins domestic revenue, keeping the path unit-safe and inspectable.

02 · Explain

Why walks evaluated state

The inspector can connect the status through margin and profit to the exact inputs that moved.

03 · Compare

History and uncertainty remain explicit

Saved revisions answer what changed; the uncertainty result answers how much confidence surrounds the point estimate.

08-truth-inspector.grid
Get Grid
MODEL "Truth Inspector Demo"
DESCRIPTION "Canonical model for demonstrating typed values, WHY lineage, AS_OF history, sensitivity drivers, confidence bands, and runtime profile."
VERSION "1.0.0"
AUTHOR "Grid Team"
TAGS "canonical", "truth-inspector", "dimensions", "provenance", "sensitivity"
dimensions strict

# Inputs
input A1 = 125000USD          # domestic revenue
input A2 = 42000EUR           # euro revenue before translation
fx_rate A3 = EUR/USD
input A3 = 1.08               # explicit USD/EUR rate keeps the sensitivity cone smooth
input A4 = 0.62               # gross margin ratio
input A5 = 15000USD           # fixed operating cost
input A6 = 0.08               # margin ratio uncertainty for the inspector
input A7 = 5000USD            # cost uncertainty for the inspector

# Unit-safe translation
B1 = A2 * A3
B2 = A1 + B1

# Smooth output cone: d(C1)/d(A4)=B2 and d(C1)/d(A5)=-1
C1 = B2 * A4 - A5
C2 = C1 / B2
C3 = C2 > 0.45 THEN "healthy-margin" ELSE "watch-margin"
C4 = `profit={C1} margin={C2} status={C3}`

# First-order confidence band inputs for the inspector API
D1 = A6 * A6
D2 = A7 * A7
D3 = PROPAGATE_UNCERTAINTY([B2, -1], [A6, A7])
D4 = `profit_sd={D3}`

# WHY / AS_OF / attribution demo cells
E1 = NOW()
E2 = `as_of_ready={E1}`

WHEN C2 < 0.45 THEN
  F1 = "margin-escalation"
  F2 = NOW()
END

EVERY duration"PT15M" SKIP MISSED THEN
  G1 = G1 + 1
  G2 = NOW()
END

END MODEL