FAILURE MAP
← Case archive

FA-9281 / Build systems / Open access

Direct rebuild trigger selection: Phony targets are incorrectly cached · case 01

Phony targets are incorrectly cached.

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

ROOT CAUSE

The implementation substitutes False or for phony or, so phony targets are incorrectly cached.

VERIFIED REPAIR

Phony targets always require execution.

Unsuccessful approach: The attempted repair substitutes not phony or. Fixture 2 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 = False 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 fixtureActualExpectedOutcome
fixture 1[][]Passed
fixture 2[]['a']Failed
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 / fe05b42739e878dc4f7b8daba964856cfba8a49c1fdee31d9b0402e066aed79f

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 = not 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 fixtureActualExpectedOutcome
fixture 1[][]Passed
fixture 2[]['a']Failed
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 / 27fa372284533381e11f5ea32d3d337d9fa3364c8f80ecec0457eaa7d17d5205

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

Case digest / 310b7d03c135f159f2bace88dfd6c60ea3abb4abb7e3d35697e90a5890d6763c