FAILURE MAP
← Case archive

FA-11556 / Filesystem semantics / Open access

Creation mode subtraction borrows across permission bits · case 01

Creation mode subtraction borrows across permission bits.

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

ROOT CAUSE

The creation mask is subtracted as an integer rather than clearing selected permission bits.

THE FAILURE

The creation mask is subtracted as an integer rather than clearing selected permission bits.

Unsuccessful approach: Clamping subtraction to zero hides negative modes but still changes unrelated permission bits.

Case contract

Deterministic in-memory filesystem model. Return permission bits for a new file from requested and mask integers in 0..511, using requested AND NOT mask.

Why this case matters

An offline semantic experiment for file API clients; it models only the stated operations, not a complete operating system.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(requested, mask):
    return requested-mask
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent write bit cannot borrow',solve(0o444,0o022),0o444)
check('normal create',solve(0o666,0o022),0o644)
check('full mask',solve(N,0o777),0)
check('no mask',solve(N,0),N)
check('zero requested',solve(0,N),0)
check('execute only survives write mask',solve(0o111,0o222),0o111)
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
absent write bit cannot borrow274292Failed
normal create420420Passed
full mask-5100Failed
no mask11Passed
zero requested-10Failed
execute only survives write mask-7373Failed

SHA-256 / b03cbe97f18b51a03d005535cfd80e067549584a1198590947d512fcdb9d3988

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(requested, mask):
    return max(0,requested-mask)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent write bit cannot borrow',solve(0o444,0o022),0o444)
check('normal create',solve(0o666,0o022),0o644)
check('full mask',solve(N,0o777),0)
check('no mask',solve(N,0),N)
check('zero requested',solve(0,N),0)
check('execute only survives write mask',solve(0o111,0o222),0o111)
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
absent write bit cannot borrow274292Failed
normal create420420Passed
full mask00Passed
no mask11Passed
zero requested00Passed
execute only survives write mask073Failed

SHA-256 / e131b80561c5b729c6756bbbed2feb0a72f75ff759d0044efe5d594a3a5a6dd6

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 6 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:49.008799+00:00.

Case digest / 4f99d026e9e546cbfa954e3c4e4152ba830ac150e7acc97efb2fb7560a77daee