FA-9191 / Build systems / Open access
Prerequisite manifest merge: A target becomes its own prerequisite · case 01
A target becomes its own prerequisite.
ROOT CAUSE
The implementation substitutes True and for dep != target and, so a target becomes its own prerequisite.
VERIFIED REPAIR
Exclude self references.
Unsuccessful approach: The attempted repair substitutes dep == target and. Fixture 2 still yields {'a': ['b']} 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 = {name: list(deps) for name, deps in previous.items()}
for target, deps in updates:
result.setdefault(target, [])
for dep in deps:
if True 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | {} | {} | Passed |
| fixture 2 | {'a': ['b', 'c']} | {'a': ['b', 'c']} | Passed |
| fixture 3 | {'a': ['a', 'b', 'c']} | {'a': ['b', 'c']} | Failed |
| 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 / 53ca45d8aadee097953c08bfdebadd581547cb8963228d910d7d38b771926996
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: 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | {} | {} | Passed |
| fixture 2 | {'a': ['b']} | {'a': ['b', 'c']} | Failed |
| fixture 3 | {'a': ['a']} | {'a': ['b', 'c']} | Failed |
| fixture 4 | {'z': []} | {'z': []} | Passed |
| fixture 5 | {'a': ['b']} | {'a': ['b', 'c', 'd']} | Failed |
| fixture 6 | {'new': [], 'old': ['x']} | {'new': ['z', 'a'], 'old': ['x']} | Failed |
SHA-256 / cd09d39a9f50a2020ff92c1709174b8c896a0241d938c44b4bf0e1a73ff1dd08
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.883123+00:00.
Case digest / 936052c79839925e0a909b3f268876ff1724194d01cfaac35efbf0d486f513b4