FA-9456 / Dependency resolution / Open access
Peer dependency diagnostics: Missing optional peers become errors · case 01
Missing optional peers become errors.
ROOT CAUSE
The implementation substitutes if True: for if not optional:, so missing optional peers become errors.
VERIFIED REPAIR
Report missing peers only when required.
Unsuccessful approach: The attempted repair substitutes if optional:. Fixture 2 still yields [] instead of [('a', 'missing')].
Case contract
For each peer in declaration order, ignore missing optional peers, report missing required peers, report too-old installed peers, report too-new peers, and accept inclusive lower/exclusive upper versions.
Why this case matters
An offline model of peer dependency diagnostics, suitable for testing build and release tooling without external services.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(peers, installed):
result = []
for name, low, high, optional in peers:
if name not in installed:
if True: result.append((name, 'missing'))
continue
version = installed[name]
if version < low: result.append((name, 'low'))
elif version >= high: result.append((name, 'high'))
return result
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], {}), [])
check('fixture 2', solve([('a', 1, 3, False)], {}), [('a', 'missing')])
check('fixture 3', solve([('a', 1, 3, True)], {}), [])
check('fixture 4', solve([('a', 1, 3, False)], {'a': 0}), [('a', 'low')])
check('fixture 5', solve([('a', 1, 3, False)], {'a': 1}), [])
check('fixture 6', solve([('a', 1, 3, False)], {'a': 2}), [])
check('fixture 7', solve([('a', 1, 3, False)], {'a': 3}), [('a', 'high')])
check('fixture 8', solve([('a', 1, 3, False)], {'a': 4}), [('a', 'high')])
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 |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [['a', 'missing']] | [['a', 'missing']] | Passed |
| fixture 3 | [['a', 'missing']] | [] | Failed |
| fixture 4 | [['a', 'low']] | [['a', 'low']] | Passed |
| fixture 5 | [] | [] | Passed |
| fixture 6 | [] | [] | Passed |
| fixture 7 | [['a', 'high']] | [['a', 'high']] | Passed |
| fixture 8 | [['a', 'high']] | [['a', 'high']] | Passed |
SHA-256 / 65b3eadccfe60656057c2caf8faf91807f7eed28ae0aa5b2610c0ea6e0fc27b3
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(peers, installed):
result = []
for name, low, high, optional in peers:
if name not in installed:
if optional: result.append((name, 'missing'))
continue
version = installed[name]
if version < low: result.append((name, 'low'))
elif version >= high: result.append((name, 'high'))
return result
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], {}), [])
check('fixture 2', solve([('a', 1, 3, False)], {}), [('a', 'missing')])
check('fixture 3', solve([('a', 1, 3, True)], {}), [])
check('fixture 4', solve([('a', 1, 3, False)], {'a': 0}), [('a', 'low')])
check('fixture 5', solve([('a', 1, 3, False)], {'a': 1}), [])
check('fixture 6', solve([('a', 1, 3, False)], {'a': 2}), [])
check('fixture 7', solve([('a', 1, 3, False)], {'a': 3}), [('a', 'high')])
check('fixture 8', solve([('a', 1, 3, False)], {'a': 4}), [('a', 'high')])
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 |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [] | [['a', 'missing']] | Failed |
| fixture 3 | [['a', 'missing']] | [] | Failed |
| fixture 4 | [['a', 'low']] | [['a', 'low']] | Passed |
| fixture 5 | [] | [] | Passed |
| fixture 6 | [] | [] | Passed |
| fixture 7 | [['a', 'high']] | [['a', 'high']] | Passed |
| fixture 8 | [['a', 'high']] | [['a', 'high']] | Passed |
SHA-256 / ba988df4d54a5c48f5873e0df37a5de7a9c3121a7b16f22ee263ddaa62eec6bc
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(peers, installed):
result = []
for name, low, high, optional in peers:
if name not in installed:
if not optional: result.append((name, 'missing'))
continue
version = installed[name]
if version < low: result.append((name, 'low'))
elif version >= high: result.append((name, 'high'))
return result
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], {}), [])
check('fixture 2', solve([('a', 1, 3, False)], {}), [('a', 'missing')])
check('fixture 3', solve([('a', 1, 3, True)], {}), [])
check('fixture 4', solve([('a', 1, 3, False)], {'a': 0}), [('a', 'low')])
check('fixture 5', solve([('a', 1, 3, False)], {'a': 1}), [])
check('fixture 6', solve([('a', 1, 3, False)], {'a': 2}), [])
check('fixture 7', solve([('a', 1, 3, False)], {'a': 3}), [('a', 'high')])
check('fixture 8', solve([('a', 1, 3, False)], {'a': 4}), [('a', 'high')])
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 |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [['a', 'missing']] | [['a', 'missing']] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [['a', 'low']] | [['a', 'low']] | Passed |
| fixture 5 | [] | [] | Passed |
| fixture 6 | [] | [] | Passed |
| fixture 7 | [['a', 'high']] | [['a', 'high']] | Passed |
| fixture 8 | [['a', 'high']] | [['a', 'high']] | Passed |
SHA-256 / ce7871ca447a0375c01414401f4069f99495a3b156059158d057f3ca3c2d867d
Verification & scope
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:30.174643+00:00.
Case digest / 762b192759f16289d4d91b16f12d8569ce41185ca59319818dc8a78fe1da4301