FAILURE MAP
← Case archive

FA-10021 / Packaging / Open access

Distribution budget enforcement: Forbidden file types enter the distribution · case 01

Forbidden file types enter the distribution.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The implementation substitutes False for name.rsplit('.', 1)[-1] in forbidden, so forbidden file types enter the distribution.

THE FAILURE

The implementation substitutes False for name.rsplit('.', 1)[-1] in forbidden, so forbidden file types enter the distribution.

Unsuccessful approach: The attempted repair substitutes name.rsplit('.', 1)[-1] not in forbidden. Fixture 2 still yields ['extension'] 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(False 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 fixtureActualExpectedOutcome
fixture 1[][]Passed
fixture 2[][]Passed
fixture 3['count']['count']Passed
fixture 4['total']['total']Passed
fixture 5['file']['file']Passed
fixture 6[]['extension']Failed
fixture 7['required']['required']Passed

SHA-256 / a82609c2b463d1dbb32a90622fac7dfcee158d6d48d5253aea8fdcf02a83a6bb

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] not 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 fixtureActualExpectedOutcome
fixture 1[][]Passed
fixture 2['extension'][]Failed
fixture 3['count', 'extension']['count']Failed
fixture 4['total', 'extension']['total']Failed
fixture 5['file', 'extension']['file']Failed
fixture 6[]['extension']Failed
fixture 7['extension', 'required']['required']Failed

SHA-256 / 0e6dd1af327b8d8296be4b212ed45870a96698843cf738fd573abf0ea1ccd950

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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 / 043be0873485b9685ca4966dfbb2d3752a830a93faaeb46f27ccee0affc7cb85