FAILURE MAP
← Case archive

FA-12676 / Causal analysis data contracts / Open access

A two-period design subtracts levels instead of changes · case 01

A two-period design subtracts levels instead of changes.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The treated post-period contrast ignores baseline imbalance.

THE FAILURE

The treated post-period contrast ignores baseline imbalance.

Unsuccessful approach: Treated before-after change leaves the common period shock intact.

Case contract

Input [treated_pre,treated_post,control_pre,control_post] defines a synthetic two-period contrast. Return (treated_post-treated_pre)-(control_post-control_pre); this arithmetic alone does not assert parallel trends.

Why this case matters

A deterministic synthetic study model isolates this data-contract defect; outputs alone establish no real-world causal identification.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cells):
    return cells[1]-cells[3]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('baseline imbalance', solve([10*N,15*N,2*N,5*N]), 2*N)
check('common shock', solve([N,3*N,0,2*N]), 0)
check('no change', solve([N,N,0,0]), 0)
check('negative effect', solve([0,N,0,3*N]), -2*N)
check('no control change', solve([0,N,2*N,2*N]), N)
check('all zero', solve([0,0,0,0]), 0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
baseline imbalance102Failed
common shock10Failed
no change10Failed
negative effect-2-2Passed
no control change-11Failed
all zero00Passed

SHA-256 / f57f9034a41ec09c3dc3679c8da6b451c55f6f120597924b31f30d7ea375e8c0

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cells):
    return cells[1]-cells[0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('baseline imbalance', solve([10*N,15*N,2*N,5*N]), 2*N)
check('common shock', solve([N,3*N,0,2*N]), 0)
check('no change', solve([N,N,0,0]), 0)
check('negative effect', solve([0,N,0,3*N]), -2*N)
check('no control change', solve([0,N,2*N,2*N]), N)
check('all zero', solve([0,0,0,0]), 0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
baseline imbalance52Failed
common shock20Failed
no change00Passed
negative effect1-2Failed
no control change11Passed
all zero00Passed

SHA-256 / e470c8175b4f14c8d57d882e463ba1450954b4a6a47d76e57ec41eb862d8f2c4

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Finite, fully specified synthetic data only; identification assumptions are supplied by the fixture design, not inferred from observations. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:59.138619+00:00.

Case digest / fda2863f69d87c7f37d351a5eebc32120b3c5a68f80d89e4a182797a06947afd