FA-9326 / Build systems / Open access
Generated file ownership: Ownership results depend on rule order · case 01
Ownership results depend on rule order.
ROOT CAUSE
The implementation substitutes return list(owners.items()) for return sorted(owners.items()), so ownership results depend on rule order.
VERIFIED REPAIR
Sort final output-owner pairs lexically.
Unsuccessful approach: The attempted repair substitutes return sorted(owners.items(), reverse=True). Fixture 2 still yields [('z', 'a'), ('x', 'a')] instead of [('x', 'a'), ('z', 'a')].
Case contract
Map output names to producing rules. Skip disabled rules, include all declared outputs, reject duplicate owners, retain owner names, and return sorted pairs. Duplicate declaration by the same owner is harmless.
Why this case matters
An offline model of generated file ownership, 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):
owners = {}
for name, enabled, outputs in rules:
if not enabled: continue
for output in outputs:
if output in owners and owners[output] != name: return 'conflict'
owners[output] = name
return list(owners.items())
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, ['z', 'x'])]), [('x', 'a'), ('z', 'a')])
check('fixture 3', solve([('a', False, ['x']), ('b', True, ['x'])]), [('x', 'b')])
check('fixture 4', solve([('a', True, ['x']), ('b', True, ['x'])]), 'conflict')
check('fixture 5', solve([('a', True, ['x', 'x'])]), [('x', 'a')])
check('fixture 6', solve([('a', True, [])]), [])
check('fixture 7', solve([('a', True, ['y']), ('b', True, ['x'])]), [('x', 'b'), ('y', '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 | [['z', 'a'], ['x', 'a']] | [['x', 'a'], ['z', 'a']] | Failed |
| fixture 3 | [['x', 'b']] | [['x', 'b']] | Passed |
| fixture 4 | conflict | conflict | Passed |
| fixture 5 | [['x', 'a']] | [['x', 'a']] | Passed |
| fixture 6 | [] | [] | Passed |
| fixture 7 | [['y', 'a'], ['x', 'b']] | [['x', 'b'], ['y', 'a']] | Failed |
SHA-256 / fc0da11f61d6a8902302e742ac54046238d56d41a2f35fd25f9c9d00b44ce043
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rules):
owners = {}
for name, enabled, outputs in rules:
if not enabled: continue
for output in outputs:
if output in owners and owners[output] != name: return 'conflict'
owners[output] = name
return sorted(owners.items(), reverse=True)
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, ['z', 'x'])]), [('x', 'a'), ('z', 'a')])
check('fixture 3', solve([('a', False, ['x']), ('b', True, ['x'])]), [('x', 'b')])
check('fixture 4', solve([('a', True, ['x']), ('b', True, ['x'])]), 'conflict')
check('fixture 5', solve([('a', True, ['x', 'x'])]), [('x', 'a')])
check('fixture 6', solve([('a', True, [])]), [])
check('fixture 7', solve([('a', True, ['y']), ('b', True, ['x'])]), [('x', 'b'), ('y', '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 | [['z', 'a'], ['x', 'a']] | [['x', 'a'], ['z', 'a']] | Failed |
| fixture 3 | [['x', 'b']] | [['x', 'b']] | Passed |
| fixture 4 | conflict | conflict | Passed |
| fixture 5 | [['x', 'a']] | [['x', 'a']] | Passed |
| fixture 6 | [] | [] | Passed |
| fixture 7 | [['y', 'a'], ['x', 'b']] | [['x', 'b'], ['y', 'a']] | Failed |
SHA-256 / 5fda81fd1d5ebc897b1232b049b259719db4cdc7e803ef7d042aab59be7919f7
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rules):
owners = {}
for name, enabled, outputs in rules:
if not enabled: continue
for output in outputs:
if output in owners and owners[output] != name: return 'conflict'
owners[output] = name
return sorted(owners.items())
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, ['z', 'x'])]), [('x', 'a'), ('z', 'a')])
check('fixture 3', solve([('a', False, ['x']), ('b', True, ['x'])]), [('x', 'b')])
check('fixture 4', solve([('a', True, ['x']), ('b', True, ['x'])]), 'conflict')
check('fixture 5', solve([('a', True, ['x', 'x'])]), [('x', 'a')])
check('fixture 6', solve([('a', True, [])]), [])
check('fixture 7', solve([('a', True, ['y']), ('b', True, ['x'])]), [('x', 'b'), ('y', '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 | [['x', 'a'], ['z', 'a']] | [['x', 'a'], ['z', 'a']] | Passed |
| fixture 3 | [['x', 'b']] | [['x', 'b']] | Passed |
| fixture 4 | conflict | conflict | Passed |
| fixture 5 | [['x', 'a']] | [['x', 'a']] | Passed |
| fixture 6 | [] | [] | Passed |
| fixture 7 | [['x', 'b'], ['y', 'a']] | [['x', 'b'], ['y', 'a']] | Passed |
SHA-256 / a3ea30a6f36a4b7551deb24c694597368e1288f85cba9721a4ea90e7b18c21f5
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:29.045256+00:00.
Case digest / 7db7c86abe378235e20fe56c8e04ac16eb68044c8954519677cc1e7d2afbe358