FA-9291 / Build systems / Open access
Direct rebuild trigger selection: Order-only changes trigger content rebuilds · case 01
Order-only changes trigger content rebuilds.
ROOT CAUSE
The implementation substitutes set(deps) for set(deps) - set(order_only), so order-only changes trigger content rebuilds.
VERIFIED REPAIR
Exclude order-only dependencies from dirty content triggers.
Unsuccessful approach: The attempted repair substitutes set(order_only). Fixture 4 still yields [] instead of ['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(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 | ['a'] | [] | Failed |
| fixture 6 | ['z', 'a'] | ['z', 'a'] | Passed |
| fixture 7 | ['a'] | ['a'] | Passed |
SHA-256 / b4c5e0d58f8761609c47798d5f4f23f4a8323b02e85e994ac149a5b50539eba0
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(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'] | Failed |
| fixture 5 | ['a'] | [] | Failed |
| fixture 6 | ['z', 'a'] | ['z', 'a'] | Passed |
| fixture 7 | [] | ['a'] | Failed |
SHA-256 / 77e0ecf765cd55998a14a9bdbb2fbd3d5c2599c4622b8f070601b3965accab04
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.607009+00:00.
Case digest / 42b3c1725a46d5386f8954d38eed014325264414667fc20e5b60692dc639bb8e