FA-9876 / Packaging / Open access
Package file manifest selection: Manifest order is reverse lexical · case 01
Manifest order is reverse lexical.
ROOT CAUSE
The implementation substitutes return sorted(names, reverse=True) for return sorted(names), so manifest order is reverse lexical.
VERIFIED REPAIR
Emit unique names in ascending order.
Unsuccessful approach: The attempted repair substitutes return sorted(names, key=lambda x: x, reverse=True). Fixture 3 still yields ['b', 'a'] instead of ['a', 'b'].
Case contract
Include declared files, exclude forbidden files, retain force-included files despite ordinary exclusions, never include missing files, and sort unique names. Force cannot override forbidden.
Why this case matters
An offline model of package file manifest 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(available, declared, excluded, forced, forbidden):
names = (set(declared) - set(excluded)) | set(forced)
names &= set(available)
names -= set(forbidden)
return sorted(names, 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', 'b'], ['a', 'b'], ['b'], [], []), ['a'])
check('fixture 3', solve(['a', 'b'], ['a'], ['b'], ['b'], []), ['a', 'b'])
check('fixture 4', solve(['a'], ['a', 'missing'], [], [], []), ['a'])
check('fixture 5', solve(['a', 'b'], ['a', 'b'], [], ['b'], ['b']), ['a'])
check('fixture 6', solve(['z', 'a'], ['z', 'a', 'z'], [], [], []), ['a', 'z'])
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 | ['b', 'a'] | ['a', 'b'] | Failed |
| fixture 4 | ['a'] | ['a'] | Passed |
| fixture 5 | ['a'] | ['a'] | Passed |
| fixture 6 | ['z', 'a'] | ['a', 'z'] | Failed |
SHA-256 / a5a0bbc3dcdac9f1ad7582ef0f72b9fff70b82f27fa59a46f84c1a9437327f77
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(available, declared, excluded, forced, forbidden):
names = (set(declared) - set(excluded)) | set(forced)
names &= set(available)
names -= set(forbidden)
return sorted(names, key=lambda x: x, 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', 'b'], ['a', 'b'], ['b'], [], []), ['a'])
check('fixture 3', solve(['a', 'b'], ['a'], ['b'], ['b'], []), ['a', 'b'])
check('fixture 4', solve(['a'], ['a', 'missing'], [], [], []), ['a'])
check('fixture 5', solve(['a', 'b'], ['a', 'b'], [], ['b'], ['b']), ['a'])
check('fixture 6', solve(['z', 'a'], ['z', 'a', 'z'], [], [], []), ['a', 'z'])
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 | ['b', 'a'] | ['a', 'b'] | Failed |
| fixture 4 | ['a'] | ['a'] | Passed |
| fixture 5 | ['a'] | ['a'] | Passed |
| fixture 6 | ['z', 'a'] | ['a', 'z'] | Failed |
SHA-256 / 9d9308c2a4ca097cd550a99921da8501a657f1b0789489cb7fda278265395b84
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(available, declared, excluded, forced, forbidden):
names = (set(declared) - set(excluded)) | set(forced)
names &= set(available)
names -= set(forbidden)
return sorted(names)
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', 'b'], ['b'], [], []), ['a'])
check('fixture 3', solve(['a', 'b'], ['a'], ['b'], ['b'], []), ['a', 'b'])
check('fixture 4', solve(['a'], ['a', 'missing'], [], [], []), ['a'])
check('fixture 5', solve(['a', 'b'], ['a', 'b'], [], ['b'], ['b']), ['a'])
check('fixture 6', solve(['z', 'a'], ['z', 'a', 'z'], [], [], []), ['a', 'z'])
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', 'b'] | ['a', 'b'] | Passed |
| fixture 4 | ['a'] | ['a'] | Passed |
| fixture 5 | ['a'] | ['a'] | Passed |
| fixture 6 | ['a', 'z'] | ['a', 'z'] | Passed |
SHA-256 / a2e0ca92cbfa58fa99bfadde4276acfcfb0cc962c491df3311219a945bffcdfc
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:33.899861+00:00.
Case digest / e4c69dda37255934d17270212a347b16cf6b005163f79981608e8585a22feee4