FA-10026 / Packaging / Open access
Distribution budget enforcement: Mandatory package files may be absent · case 01
Mandatory package files may be absent.
ROOT CAUSE
The implementation substitutes False for not set(required) <= {name for name, size in files}, so mandatory package files may be absent.
VERIFIED REPAIR
Require every declared mandatory file.
Unsuccessful approach: The attempted repair substitutes not set(required) < {name for name, size in files}. Fixture 1 still yields ['required'] instead of [].
Case contract
Report file-count, total-size, per-file-size, prohibited-extension, and missing-required-file violations in that order. Limits are inclusive. Files are name-size pairs.
Why this case matters
An offline model of distribution budget enforcement, 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(files, count_limit, total_limit, file_limit, forbidden, required):
errors = []
if len(files) > count_limit: errors.append('count')
if sum(size for name, size in files) > total_limit: errors.append('total')
if any(size > file_limit for name, size in files): errors.append('file')
if any(name.rsplit('.', 1)[-1] in forbidden for name, size in files): errors.append('extension')
if False: errors.append('required')
return errors
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], 0, 0, 0, [], []), [])
check('fixture 2', solve([('a.py', 1)], 1, 1, 1, [], ['a.py']), [])
check('fixture 3', solve([('a.py', 1), ('b.py', 1)], 1, 2, 1, [], []), ['count'])
check('fixture 4', solve([('a.py', 2)], 1, 1, 2, [], []), ['total'])
check('fixture 5', solve([('a.py', 2)], 1, 2, 1, [], []), ['file'])
check('fixture 6', solve([('a.exe', 1)], 1, 1, 1, ['exe'], []), ['extension'])
check('fixture 7', solve([('a.py', 1)], 1, 1, 1, [], ['b.py']), ['required'])
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 | [] | [] | Passed |
| fixture 3 | ['count'] | ['count'] | Passed |
| fixture 4 | ['total'] | ['total'] | Passed |
| fixture 5 | ['file'] | ['file'] | Passed |
| fixture 6 | ['extension'] | ['extension'] | Passed |
| fixture 7 | [] | ['required'] | Failed |
SHA-256 / 66ce62e700c51bbf291ae1a95b0fe2e66593083f89f2d0b717aa0e5ac20735ef
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(files, count_limit, total_limit, file_limit, forbidden, required):
errors = []
if len(files) > count_limit: errors.append('count')
if sum(size for name, size in files) > total_limit: errors.append('total')
if any(size > file_limit for name, size in files): errors.append('file')
if any(name.rsplit('.', 1)[-1] in forbidden for name, size in files): errors.append('extension')
if not set(required) < {name for name, size in files}: errors.append('required')
return errors
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], 0, 0, 0, [], []), [])
check('fixture 2', solve([('a.py', 1)], 1, 1, 1, [], ['a.py']), [])
check('fixture 3', solve([('a.py', 1), ('b.py', 1)], 1, 2, 1, [], []), ['count'])
check('fixture 4', solve([('a.py', 2)], 1, 1, 2, [], []), ['total'])
check('fixture 5', solve([('a.py', 2)], 1, 2, 1, [], []), ['file'])
check('fixture 6', solve([('a.exe', 1)], 1, 1, 1, ['exe'], []), ['extension'])
check('fixture 7', solve([('a.py', 1)], 1, 1, 1, [], ['b.py']), ['required'])
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 | ['required'] | [] | Failed |
| fixture 2 | ['required'] | [] | Failed |
| fixture 3 | ['count'] | ['count'] | Passed |
| fixture 4 | ['total'] | ['total'] | Passed |
| fixture 5 | ['file'] | ['file'] | Passed |
| fixture 6 | ['extension'] | ['extension'] | Passed |
| fixture 7 | ['required'] | ['required'] | Passed |
SHA-256 / ab8e14e0e180d9983bdc3023367872c701529cfd7c465d5f8ea363e7f21d5985
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(files, count_limit, total_limit, file_limit, forbidden, required):
errors = []
if len(files) > count_limit: errors.append('count')
if sum(size for name, size in files) > total_limit: errors.append('total')
if any(size > file_limit for name, size in files): errors.append('file')
if any(name.rsplit('.', 1)[-1] in forbidden for name, size in files): errors.append('extension')
if not set(required) <= {name for name, size in files}: errors.append('required')
return errors
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], 0, 0, 0, [], []), [])
check('fixture 2', solve([('a.py', 1)], 1, 1, 1, [], ['a.py']), [])
check('fixture 3', solve([('a.py', 1), ('b.py', 1)], 1, 2, 1, [], []), ['count'])
check('fixture 4', solve([('a.py', 2)], 1, 1, 2, [], []), ['total'])
check('fixture 5', solve([('a.py', 2)], 1, 2, 1, [], []), ['file'])
check('fixture 6', solve([('a.exe', 1)], 1, 1, 1, ['exe'], []), ['extension'])
check('fixture 7', solve([('a.py', 1)], 1, 1, 1, [], ['b.py']), ['required'])
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 | [] | [] | Passed |
| fixture 3 | ['count'] | ['count'] | Passed |
| fixture 4 | ['total'] | ['total'] | Passed |
| fixture 5 | ['file'] | ['file'] | Passed |
| fixture 6 | ['extension'] | ['extension'] | Passed |
| fixture 7 | ['required'] | ['required'] | Passed |
SHA-256 / 6b28e3754b0b6fa913b87e9359b980ba1a4e78cf7f0b761c51e95011d0b2d281
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:35.221455+00:00.
Case digest / 412db1852cadf67fcdf557728b7d8067fa3b9c02e3f359bec9e04721df3a806e