FA-10011 / Packaging / Open access
Distribution budget enforcement: Total distribution bytes are not checked · case 01
Total distribution bytes are not checked.
ROOT CAUSE
The implementation substitutes False for sum(size for name, size in files) > total_limit, so total distribution bytes are not checked.
VERIFIED REPAIR
Compare aggregate size against the inclusive total budget.
Unsuccessful approach: The attempted repair substitutes sum(size for name, size in files) >= total_limit. Fixture 1 still yields ['total'] 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 False: 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'] | Failed |
| fixture 5 | ['file'] | ['file'] | Passed |
| fixture 6 | ['extension'] | ['extension'] | Passed |
| fixture 7 | ['required'] | ['required'] | Passed |
SHA-256 / e22465e19f86df7a4fa6d8f4c1f2ee3d39d7e04509800e101ab3cd3ec74b92fa
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 | ['total'] | [] | Failed |
| fixture 2 | ['total'] | [] | Failed |
| fixture 3 | ['count', 'total'] | ['count'] | Failed |
| fixture 4 | ['total'] | ['total'] | Passed |
| fixture 5 | ['total', 'file'] | ['file'] | Failed |
| fixture 6 | ['total', 'extension'] | ['extension'] | Failed |
| fixture 7 | ['total', 'required'] | ['required'] | Failed |
SHA-256 / 5690e9fbbaa58eae484e46a956fc8b554bb83abd70ca20a4eb9034571b97f80e
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.093301+00:00.
Case digest / b59e0d2b5aab3b075e2b471daf1af0f660442c229245328c2379d77fd21c6f8e