FA-9196 / Build systems / Open access
Prerequisite manifest merge: Repeated prerequisites survive · case 01
Repeated prerequisites survive.
ROOT CAUSE
The implementation substitutes True for dep not in result[target], so repeated prerequisites survive.
VERIFIED REPAIR
Deduplicate against the entire accumulated list.
Unsuccessful approach: The attempted repair substitutes dep not in result[target][-1:]. Fixture 3 still yields {'a': ['b', 'c', '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 dep != target and True:
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', 'b', 'c', 'b']} | {'a': ['b', 'c']} | Failed |
| fixture 4 | {'z': []} | {'z': []} | Passed |
| fixture 5 | {'a': ['b', 'b', 'c', 'd']} | {'a': ['b', 'c', 'd']} | Failed |
| fixture 6 | {'new': ['z', 'a'], 'old': ['x']} | {'new': ['z', 'a'], 'old': ['x']} | Passed |
SHA-256 / 850430de376cfb7ae66134aeb06d97db7fd34b83ab622669f9c4d98905d45a5d
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][-1:]:
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', 'b']} | {'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 / 0707be1f1cad23b600c1c463854130ad6a3e1c5bbbc708e0e81a81731166b052
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.964311+00:00.
Case digest / 7300464b690287f1c3d577d14ec0473e669021ddbbf1afa64c7459516c6e2410