FA-9856 / Packaging / Open access
Package file manifest selection: Excluded files enter distributions · case 01
Excluded files enter distributions.
ROOT CAUSE
The implementation substitutes set(declared) for set(declared) - set(excluded), so excluded files enter distributions.
VERIFIED REPAIR
Subtract ordinary exclusions from declared files.
Unsuccessful approach: The attempted repair substitutes set(declared) | set(excluded). Fixture 2 still yields ['a', 'b'] instead of ['a'].
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(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', 'b'] | ['a'] | Failed |
| 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 / 2a9730e96e4e0d35fc7bd4c54adc7165429c51d4160c4674304b3945d3433c59
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)
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', 'b'] | ['a'] | Failed |
| 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 / e34d4f73cf4a7f64bd246f17e77aa3db3a88761b8445a3e3f0e51c612918d868
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.627532+00:00.
Case digest / a12cbc4ade15fd43f7febd2df6a2876e0d026e75cd79b1f6f7404acd4635c938