FA-9301 / Build systems / Open access
Direct rebuild trigger selection: Duplicate declarations schedule duplicate jobs · case 01
Duplicate declarations schedule duplicate jobs.
ROOT CAUSE
The implementation substitutes True for name not in result, so duplicate declarations schedule duplicate jobs.
VERIFIED REPAIR
Schedule each dirty target once.
Unsuccessful approach: The attempted repair substitutes name not in result[-1:]. Fixture 6 still yields ['z', 'a', 'z'] instead of ['z', 'a'].
Case contract
Return declaration-order unique targets whose non-order prerequisites changed, whose output is missing, or which are phony. Keep targets with no prerequisites when phony or missing.
Why this case matters
An offline model of direct rebuild trigger selection, 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(rules, changed, outputs):
result = []
for name, deps, order_only, phony in rules:
dirty = phony or name not in outputs or bool((set(deps) - set(order_only)) & set(changed))
if dirty and True:
result.append(name)
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', [], [], True)], [], ['a']), ['a'])
check('fixture 3', solve([('a', [], [], False)], [], []), ['a'])
check('fixture 4', solve([('a', ['b'], [], False)], ['b'], ['a']), ['a'])
check('fixture 5', solve([('a', ['b'], ['b'], False)], ['b'], ['a']), [])
check('fixture 6', solve([('z', [], [], True), ('a', [], [], True), ('z', [], [], True)], [], []), ['z', 'a'])
check('fixture 7', solve([('a', ['b', 'c'], ['c'], False)], ['b'], ['a']), ['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'] | ['a'] | Passed |
| fixture 3 | ['a'] | ['a'] | Passed |
| fixture 4 | ['a'] | ['a'] | Passed |
| fixture 5 | [] | [] | Passed |
| fixture 6 | ['z', 'a', 'z'] | ['z', 'a'] | Failed |
| fixture 7 | ['a'] | ['a'] | Passed |
SHA-256 / 452f7c308a04cc788ed17d4be73f936b5c72df7fad841fb4b4a5aea2ea7d2b75
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rules, changed, outputs):
result = []
for name, deps, order_only, phony in rules:
dirty = phony or name not in outputs or bool((set(deps) - set(order_only)) & set(changed))
if dirty and name not in result[-1:]:
result.append(name)
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', [], [], True)], [], ['a']), ['a'])
check('fixture 3', solve([('a', [], [], False)], [], []), ['a'])
check('fixture 4', solve([('a', ['b'], [], False)], ['b'], ['a']), ['a'])
check('fixture 5', solve([('a', ['b'], ['b'], False)], ['b'], ['a']), [])
check('fixture 6', solve([('z', [], [], True), ('a', [], [], True), ('z', [], [], True)], [], []), ['z', 'a'])
check('fixture 7', solve([('a', ['b', 'c'], ['c'], False)], ['b'], ['a']), ['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'] | ['a'] | Passed |
| fixture 3 | ['a'] | ['a'] | Passed |
| fixture 4 | ['a'] | ['a'] | Passed |
| fixture 5 | [] | [] | Passed |
| fixture 6 | ['z', 'a', 'z'] | ['z', 'a'] | Failed |
| fixture 7 | ['a'] | ['a'] | Passed |
SHA-256 / b17002984e60e2cc343c0c755884959b712ec6ffc168dd7940f0cdc9c266daf3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rules, changed, outputs):
result = []
for name, deps, order_only, phony in rules:
dirty = phony or name not in outputs or bool((set(deps) - set(order_only)) & set(changed))
if dirty and name not in result:
result.append(name)
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', [], [], True)], [], ['a']), ['a'])
check('fixture 3', solve([('a', [], [], False)], [], []), ['a'])
check('fixture 4', solve([('a', ['b'], [], False)], ['b'], ['a']), ['a'])
check('fixture 5', solve([('a', ['b'], ['b'], False)], ['b'], ['a']), [])
check('fixture 6', solve([('z', [], [], True), ('a', [], [], True), ('z', [], [], True)], [], []), ['z', 'a'])
check('fixture 7', solve([('a', ['b', 'c'], ['c'], False)], ['b'], ['a']), ['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'] | ['a'] | Passed |
| fixture 3 | ['a'] | ['a'] | Passed |
| fixture 4 | ['a'] | ['a'] | Passed |
| fixture 5 | [] | [] | Passed |
| fixture 6 | ['z', 'a'] | ['z', 'a'] | Passed |
| fixture 7 | ['a'] | ['a'] | Passed |
SHA-256 / e55e80f67fb13465df0cdea039239784b31023cf478f7a2007356ff79b098364
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:28.724809+00:00.
Case digest / 1e3ea5d8a8d66c563febcc0801cc06cae742c4ec63783d09b18bd82a0838f36a