FA-12666 / Causal analysis data contracts / Open access
Exposure mapping includes the focal unit as its own peer · case 01
Exposure mapping includes the focal unit as its own peer.
ROOT CAUSE
Own assignment is mixed into the prespecified peer exposure.
VERIFIED REPAIR
Count unique treated neighbors excluding the focal unit.
Unsuccessful approach: Removing self still double-counts repeated neighbor edges.
Case contract
Assignment maps unit names to 0/1; neighbors may repeat and contain self. Return [own arm, number of unique treated other neighbors]. All names exist.
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(unit, neighbors, assignment):
return [assignment[unit], sum(assignment[n] for n in neighbors)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('self exposure', solve('a', ['a'], {'a':1}), [1,0])
check('duplicate peers', solve('a', ['b']*(N+1), {'a':0,'b':1}), [0,1])
check('untreated peer', solve('a', ['b'], {'a':1,'b':0}), [1,0])
check('empty peers', solve('a', [], {'a':0}), [0,0])
check('mixed', solve('a', ['a','b','b','c'], {'a':1,'b':1,'c':0}), [1,1])
check('two peers', solve('a', ['b','c'], {'a':0,'b':1,'c':1}), [0,2])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| self exposure | [1, 1] | [1, 0] | Failed |
| duplicate peers | [0, 2] | [0, 1] | Failed |
| untreated peer | [1, 0] | [1, 0] | Passed |
| empty peers | [0, 0] | [0, 0] | Passed |
| mixed | [1, 3] | [1, 1] | Failed |
| two peers | [0, 2] | [0, 2] | Passed |
SHA-256 / e2f3ea4fdcb278490fc8f9fab0946765ae3fb59cde37b39f3d9f373884058360
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(unit, neighbors, assignment):
return [assignment[unit], sum(assignment[n] for n in neighbors if n != unit)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('self exposure', solve('a', ['a'], {'a':1}), [1,0])
check('duplicate peers', solve('a', ['b']*(N+1), {'a':0,'b':1}), [0,1])
check('untreated peer', solve('a', ['b'], {'a':1,'b':0}), [1,0])
check('empty peers', solve('a', [], {'a':0}), [0,0])
check('mixed', solve('a', ['a','b','b','c'], {'a':1,'b':1,'c':0}), [1,1])
check('two peers', solve('a', ['b','c'], {'a':0,'b':1,'c':1}), [0,2])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| self exposure | [1, 0] | [1, 0] | Passed |
| duplicate peers | [0, 2] | [0, 1] | Failed |
| untreated peer | [1, 0] | [1, 0] | Passed |
| empty peers | [0, 0] | [0, 0] | Passed |
| mixed | [1, 2] | [1, 1] | Failed |
| two peers | [0, 2] | [0, 2] | Passed |
SHA-256 / 8d3951921435bb6cc6d43013c5892521cca4a6b7780549612d866e38bd4a4a80
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(unit, neighbors, assignment):
return [assignment[unit], sum(assignment[n] for n in set(neighbors)-{unit})]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('self exposure', solve('a', ['a'], {'a':1}), [1,0])
check('duplicate peers', solve('a', ['b']*(N+1), {'a':0,'b':1}), [0,1])
check('untreated peer', solve('a', ['b'], {'a':1,'b':0}), [1,0])
check('empty peers', solve('a', [], {'a':0}), [0,0])
check('mixed', solve('a', ['a','b','b','c'], {'a':1,'b':1,'c':0}), [1,1])
check('two peers', solve('a', ['b','c'], {'a':0,'b':1,'c':1}), [0,2])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| self exposure | [1, 0] | [1, 0] | Passed |
| duplicate peers | [0, 1] | [0, 1] | Passed |
| untreated peer | [1, 0] | [1, 0] | Passed |
| empty peers | [0, 0] | [0, 0] | Passed |
| mixed | [1, 1] | [1, 1] | Passed |
| two peers | [0, 2] | [0, 2] | Passed |
SHA-256 / cc571f0cffac9c34c74d22867c17e762cd7d1ffbe2987cac9773d4ddba3ce3e9
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:58.969214+00:00.
Case digest / 252303c4f2bfb6abe8676cb00b99e84eefa69da8097918e370cd7cbe8e14ce9f