FA-11576 / Filesystem semantics / Open access
Seeking an append descriptor causes an overwrite · case 01
Seeking an append descriptor causes an overwrite.
ROOT CAUSE
Append mode chooses the current descriptor offset rather than EOF at write time.
THE FAILURE
Append mode chooses the current descriptor offset rather than EOF at write time.
Unsuccessful approach: Seeking to EOF once at open time fails after a subsequent explicit seek.
Case contract
Deterministic in-memory filesystem model. Open a character file in append mode, seek to nonnegative seek, then write payload. Return [contents,new offset]; zero-length payload leaves the sought offset unchanged in this controlled model.
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(text, seek, payload):
return [text[:seek]+'\0'*max(0,seek-len(text))+payload+text[seek+len(payload):],seek+len(payload)] if payload else [text,seek]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('seek to beginning does not overwrite',solve('abc',0,str(N)),['abc'+str(N),4])
check('seek past EOF does not make hole',solve('a',N+3,'b'),['ab',2])
check('seek to EOF',solve('abc',3,'d'),['abcd',4])
check('empty file',solve('',N,'x'),['x',1])
check('empty write leaves offset',solve('abc',N,''),['abc',N])
check('multiple characters appended',solve('abc',1,'XY'),['abcXY',5])
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 |
|---|---|---|---|
| seek to beginning does not overwrite | ['1bc', 1] | ['abc1', 4] | Failed |
| seek past EOF does not make hole | ['a\x00\x00\x00b', 5] | ['ab', 2] | Failed |
| seek to EOF | ['abcd', 4] | ['abcd', 4] | Passed |
| empty file | ['\x00x', 2] | ['x', 1] | Failed |
| empty write leaves offset | ['abc', 1] | ['abc', 1] | Passed |
| multiple characters appended | ['aXY', 3] | ['abcXY', 5] | Failed |
SHA-256 / 51cdac175b62c39b428f74fa22df0ee3566d1fa5cfe0dc9cc8e614af54221ab4
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(text, seek, payload):
position = seek if seek < len(text) else len(text)
return [text[:position]+payload+text[position+len(payload):],position+len(payload)] if payload else [text,seek]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('seek to beginning does not overwrite',solve('abc',0,str(N)),['abc'+str(N),4])
check('seek past EOF does not make hole',solve('a',N+3,'b'),['ab',2])
check('seek to EOF',solve('abc',3,'d'),['abcd',4])
check('empty file',solve('',N,'x'),['x',1])
check('empty write leaves offset',solve('abc',N,''),['abc',N])
check('multiple characters appended',solve('abc',1,'XY'),['abcXY',5])
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 |
|---|---|---|---|
| seek to beginning does not overwrite | ['1bc', 1] | ['abc1', 4] | Failed |
| seek past EOF does not make hole | ['ab', 2] | ['ab', 2] | Passed |
| seek to EOF | ['abcd', 4] | ['abcd', 4] | Passed |
| empty file | ['x', 1] | ['x', 1] | Passed |
| empty write leaves offset | ['abc', 1] | ['abc', 1] | Passed |
| multiple characters appended | ['aXY', 3] | ['abcXY', 5] | Failed |
SHA-256 / 1bc6e44592b9e54feb7040e80446dbe85f36ab7067ee46d9a36d203df9997afb
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.216151+00:00.
Case digest / 0c67e4dc70d27c2ca315c0f715eb2b85107df6a7805a73235684cddf198a7bb7