FAILURE MAP
← Case archive

FA-9476 / Dependency resolution / Open access

Peer dependency diagnostics: Diagnostics lose the failing package identity · case 01

Diagnostics lose the failing package identity.

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

ROOT CAUSE

The implementation substitutes ('peer', 'low') for (name, 'low'), so diagnostics lose the failing package identity.

VERIFIED REPAIR

Retain the peer name in diagnostics.

Unsuccessful approach: The attempted repair substitutes (str(version), 'low'). Fixture 4 still yields [('0', 'low')] instead of [('a', 'low')].

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 not optional: result.append((name, 'missing'))
            continue
        version = installed[name]
        if version < low: result.append(('peer', '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 fixtureActualExpectedOutcome
fixture 1[][]Passed
fixture 2[['a', 'missing']][['a', 'missing']]Passed
fixture 3[][]Passed
fixture 4[['peer', 'low']][['a', 'low']]Failed
fixture 5[][]Passed
fixture 6[][]Passed
fixture 7[['a', 'high']][['a', 'high']]Passed
fixture 8[['a', 'high']][['a', 'high']]Passed

SHA-256 / 4f13bbb7d14470ae0a8fd7aefe844e93b7b1f236a890021429a7b68062ed2152

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 not optional: result.append((name, 'missing'))
            continue
        version = installed[name]
        if version < low: result.append((str(version), '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 fixtureActualExpectedOutcome
fixture 1[][]Passed
fixture 2[['a', 'missing']][['a', 'missing']]Passed
fixture 3[][]Passed
fixture 4[['0', 'low']][['a', 'low']]Failed
fixture 5[][]Passed
fixture 6[][]Passed
fixture 7[['a', 'high']][['a', 'high']]Passed
fixture 8[['a', 'high']][['a', 'high']]Passed

SHA-256 / dc723fff317e37450a02e52f266f5d20c68e9a3db9915186f32a2ff958b1e805

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 fixtureActualExpectedOutcome
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.367301+00:00.

Case digest / ebed0c6ad4f133bacb86c37883f3d735db97d9b351165bffc9aaa4ce60ba37b6