FA-10006 / Packaging / Open access
Distribution budget enforcement: A bundle exactly at its count limit is rejected · case 01
A bundle exactly at its count limit is rejected.
ROOT CAUSE
The implementation substitutes len(files) >= count_limit for len(files) > count_limit, so a bundle exactly at its count limit is rejected.
VERIFIED REPAIR
Reject only counts greater than the inclusive limit.
Unsuccessful approach: The attempted repair substitutes len(files) == count_limit. Fixture 1 still yields ['count'] 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 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 | ['count'] | [] | Failed |
| fixture 2 | ['count'] | [] | Failed |
| fixture 3 | ['count'] | ['count'] | Passed |
| fixture 4 | ['count', 'total'] | ['total'] | Failed |
| fixture 5 | ['count', 'file'] | ['file'] | Failed |
| fixture 6 | ['count', 'extension'] | ['extension'] | Failed |
| fixture 7 | ['count', 'required'] | ['required'] | Failed |
SHA-256 / 63d5ebf751baa0f62d96b17345a3c6f6e307e772e9b6097d9ba6b31da69ee0da
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 | ['count'] | [] | Failed |
| fixture 2 | ['count'] | [] | Failed |
| fixture 3 | [] | ['count'] | Failed |
| fixture 4 | ['count', 'total'] | ['total'] | Failed |
| fixture 5 | ['count', 'file'] | ['file'] | Failed |
| fixture 6 | ['count', 'extension'] | ['extension'] | Failed |
| fixture 7 | ['count', 'required'] | ['required'] | Failed |
SHA-256 / 9fd1be08ecf6b976282543db690da4d35f76e522e902ad424e30e7de6d61b70f
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.025953+00:00.
Case digest / af9bbf817042757df86890b71c825434c75f260ce616a0570f287a67965a959e