FA-11806 / Document structure integrity / Open access
A heading attaches to a previous sibling instead of a shallower heading · case 01
A heading attaches to a previous sibling instead of a shallower heading in the controlled document model.
ROOT CAUSE
An outline builder treats the immediately previous heading as the parent.
THE FAILURE
An outline builder treats the immediately previous heading as the parent.
Unsuccessful approach: Requiring an exact preceding level drops a legal parent when the outline skips a level.
Case contract
For each positive heading level, return the index of the nearest preceding heading with a strictly smaller level, or None.
Why this case matters
Structured editing must preserve document semantics independently of visual rendering.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(levels):
return [None]+list(range(len(levels)-1)) if levels else []
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [(([1,3,3,2+N],),[None,0,0,0 if N==1 else 2]), (([],),[]), (([2],),[None]), (([1,1],),[None,None]), (([1,4],),[None,0]), (([2,4,1,3],),[None,0,None,2])]
for i, (args, expected) in enumerate(fixtures):
check("document fixture " + str(i), solve(*args), expected)
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 |
|---|---|---|---|
| document fixture 0 | [None, 0, 1, 2] | [None, 0, 0, 0] | Failed |
| document fixture 1 | [] | [] | Passed |
| document fixture 2 | [None] | [None] | Passed |
| document fixture 3 | [None, 0] | [None, None] | Failed |
| document fixture 4 | [None, 0] | [None, 0] | Passed |
| document fixture 5 | [None, 0, 1, 2] | [None, 0, None, 2] | Failed |
SHA-256 / 9f5df43765a8c7bb91c84c66443d8ff2f4374cb1f9fa9638df4b7ed3dff67636
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(levels):
return [next((j for j in range(i-1,-1,-1) if levels[j]==level-1),None) for i,level in enumerate(levels)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [(([1,3,3,2+N],),[None,0,0,0 if N==1 else 2]), (([],),[]), (([2],),[None]), (([1,1],),[None,None]), (([1,4],),[None,0]), (([2,4,1,3],),[None,0,None,2])]
for i, (args, expected) in enumerate(fixtures):
check("document fixture " + str(i), solve(*args), expected)
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 |
|---|---|---|---|
| document fixture 0 | [None, None, None, None] | [None, 0, 0, 0] | Failed |
| document fixture 1 | [] | [] | Passed |
| document fixture 2 | [None] | [None] | Passed |
| document fixture 3 | [None, None] | [None, None] | Passed |
| document fixture 4 | [None, None] | [None, 0] | Failed |
| document fixture 5 | [None, None, None, 0] | [None, 0, None, 2] | Failed |
SHA-256 / 17439a3a563e2534a082c937862f02412b38f0b4498a7b877a3669389d3285b3
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
An offline simplified document model, not a claim of conformance to any office file format. 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:51.134527+00:00.
Case digest / c95943cb085e0e985dfd9cb1e58b36e9a0dbb6da76a5acf2c781c426a560044e