FA-10016 / Packaging / Open access
Distribution budget enforcement: Oversized individual files pass an aggregate-only budget · case 01
Oversized individual files pass an aggregate-only budget.
ROOT CAUSE
The implementation substitutes False for any(size > file_limit for name, size in files), so oversized individual files pass an aggregate-only budget.
VERIFIED REPAIR
Apply the per-file limit independently.
Unsuccessful approach: The attempted repair substitutes any(size >= file_limit for name, size in files). Fixture 2 still yields ['file'] 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 False: 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'] | Failed |
| fixture 6 | ['extension'] | ['extension'] | Passed |
| fixture 7 | ['required'] | ['required'] | Passed |
SHA-256 / 53776cc4addb9e1fcd4d3868730885fd572b2fd84d48529ca8787edf98e3cb6e
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 | [] | [] | Passed |
| fixture 2 | ['file'] | [] | Failed |
| fixture 3 | ['count', 'file'] | ['count'] | Failed |
| fixture 4 | ['total', 'file'] | ['total'] | Failed |
| fixture 5 | ['file'] | ['file'] | Passed |
| fixture 6 | ['file', 'extension'] | ['extension'] | Failed |
| fixture 7 | ['file', 'required'] | ['required'] | Failed |
SHA-256 / 6a824e58f1279427757260d852196241600440c1d0e3b2a1768948c6c2e28999
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.146057+00:00.
Case digest / 74592d38040861462bb218b487c11b775892e854dd1b08b4dd7c804b9c04e195