FAILURE MAP
← Case archive

FA-9181 / Build systems / Open access

Prerequisite manifest merge: Existing targets are erased during updates · case 01

Existing targets are erased during updates.

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

ROOT CAUSE

The implementation substitutes {} for {name: list(deps) for name, deps in previous.items()}, so existing targets are erased during updates.

VERIFIED REPAIR

Copy existing target prerequisites before applying updates.

Unsuccessful approach: The attempted repair substitutes {name: [] for name in previous}. Fixture 2 still yields {'a': ['c']} instead of {'a': ['b', 'c']}.

Case contract

Merge prerequisite lists by target, preserving first occurrence order, retaining previous prerequisites, ignoring self references, and retaining empty targets.

Why this case matters

An offline model of prerequisite manifest merge, 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(previous, updates):
    result = {}
    for target, deps in updates:
        result.setdefault(target, [])
        for dep in deps:
            if dep != target and dep not in result[target]:
                result[target].append(dep)
    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': ['b']}, [('a', ['c'])]), {'a': ['b', 'c']})
check('fixture 3', solve({}, [('a', ['a', 'b', 'b', 'c', 'b'])]), {'a': ['b', 'c']})
check('fixture 4', solve({}, [('z', [])]), {'z': []})
check('fixture 5', solve({'a': ['b']}, [('a', ['b', 'c']), ('a', ['d'])]), {'a': ['b', 'c', 'd']})
check('fixture 6', solve({'old': ['x']}, [('new', ['z', 'a'])]), {'old': ['x'], 'new': ['z', 'a']})
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': ['c']}{'a': ['b', 'c']}Failed
fixture 3{'a': ['b', 'c']}{'a': ['b', 'c']}Passed
fixture 4{'z': []}{'z': []}Passed
fixture 5{'a': ['b', 'c', 'd']}{'a': ['b', 'c', 'd']}Passed
fixture 6{'new': ['z', 'a']}{'new': ['z', 'a'], 'old': ['x']}Failed

SHA-256 / 9b6b1e78f840191c4335f39fb1d262586ec9b00f14115fbc038d839ed3dd61ae

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(previous, updates):
    result = {name: [] for name in previous}
    for target, deps in updates:
        result.setdefault(target, [])
        for dep in deps:
            if dep != target and dep not in result[target]:
                result[target].append(dep)
    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': ['b']}, [('a', ['c'])]), {'a': ['b', 'c']})
check('fixture 3', solve({}, [('a', ['a', 'b', 'b', 'c', 'b'])]), {'a': ['b', 'c']})
check('fixture 4', solve({}, [('z', [])]), {'z': []})
check('fixture 5', solve({'a': ['b']}, [('a', ['b', 'c']), ('a', ['d'])]), {'a': ['b', 'c', 'd']})
check('fixture 6', solve({'old': ['x']}, [('new', ['z', 'a'])]), {'old': ['x'], 'new': ['z', 'a']})
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': ['c']}{'a': ['b', 'c']}Failed
fixture 3{'a': ['b', 'c']}{'a': ['b', 'c']}Passed
fixture 4{'z': []}{'z': []}Passed
fixture 5{'a': ['b', 'c', 'd']}{'a': ['b', 'c', 'd']}Passed
fixture 6{'new': ['z', 'a'], 'old': []}{'new': ['z', 'a'], 'old': ['x']}Failed

SHA-256 / 9b82d970f51b0ecd0c7ff485c609c5f29a944555dee187758eaae02b717690bc

3 / The verified repair

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

N = 1
observations = []
def solve(previous, updates):
    result = {name: list(deps) for name, deps in previous.items()}
    for target, deps in updates:
        result.setdefault(target, [])
        for dep in deps:
            if dep != target and dep not in result[target]:
                result[target].append(dep)
    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': ['b']}, [('a', ['c'])]), {'a': ['b', 'c']})
check('fixture 3', solve({}, [('a', ['a', 'b', 'b', 'c', 'b'])]), {'a': ['b', 'c']})
check('fixture 4', solve({}, [('z', [])]), {'z': []})
check('fixture 5', solve({'a': ['b']}, [('a', ['b', 'c']), ('a', ['d'])]), {'a': ['b', 'c', 'd']})
check('fixture 6', solve({'old': ['x']}, [('new', ['z', 'a'])]), {'old': ['x'], 'new': ['z', 'a']})
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': ['b', 'c']}{'a': ['b', 'c']}Passed
fixture 3{'a': ['b', 'c']}{'a': ['b', 'c']}Passed
fixture 4{'z': []}{'z': []}Passed
fixture 5{'a': ['b', 'c', 'd']}{'a': ['b', 'c', 'd']}Passed
fixture 6{'new': ['z', 'a'], 'old': ['x']}{'new': ['z', 'a'], 'old': ['x']}Passed

SHA-256 / a6328c86dae56e4f1ea99d519b6c0a1368c33f3c341f63c7d2c733635c8b744d

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

Case digest / 3d37b1be7a67fe953e7ebeb86d7bf919f1645f1ece305f8f476ccce8b528457c