FA-11791 / Document structure integrity / Open access
Section footnote restarts reuse stale reference-number assignments · case 01
Section footnote restarts reuse stale reference-number assignments in the controlled document model.
ROOT CAUSE
A document-wide reference map ignores section-local note identities and numbering restart boundaries.
VERIFIED REPAIR
Clear the section-local identity map at every section boundary and independently apply the explicit counter restart policy.
Unsuccessful approach: Resetting the counter alone retains old identity assignments, producing stale numbers and collisions after a restart.
Case contract
Each section contains a restart boolean and integer note references. Identities are section-local. Repeated references within one section reuse a number; new identities consume the counter. Start at one; reset to one before any section marked restart, including an empty section. Return numbers for every reference, grouped by section.
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(sections):
out=[]
assigned={}
next_number=1
for restart,refs in sections:
numbers=[]
for identity in refs:
if identity not in assigned:
assigned[identity]=next_number
next_number+=1
numbers.append(assigned[identity])
out.append(numbers)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [(([(False,[N,N+1]),(True,[N+1,N+2,N+1])],),[[1,2],[1,2,1]]), (([],),[]), (([(False,[N,N]),(False,[N])],),[[1,1],[2]]), (([(False,[1]),(True,[]),(False,[2])],),[[1],[],[1]]), (([(False,[]),(False,[1,2,1])],),[[],[1,2,1]]), (([(False,[1,2]),(False,[3]),(True,[4])],),[[1,2],[3],[1]])]
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 | [[1, 2], [2, 3, 2]] | [[1, 2], [1, 2, 1]] | Failed |
| document fixture 1 | [] | [] | Passed |
| document fixture 2 | [[1, 1], [1]] | [[1, 1], [2]] | Failed |
| document fixture 3 | [[1], [], [2]] | [[1], [], [1]] | Failed |
| document fixture 4 | [[], [1, 2, 1]] | [[], [1, 2, 1]] | Passed |
| document fixture 5 | [[1, 2], [3], [4]] | [[1, 2], [3], [1]] | Failed |
SHA-256 / 7987c0e2030735398f026f0af86b35daae5d54596642a9f37cf5b47dbd3883fa
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(sections):
out=[]
assigned={}
next_number=1
for restart,refs in sections:
if restart: next_number=1
numbers=[]
for identity in refs:
if identity not in assigned:
assigned[identity]=next_number
next_number+=1
numbers.append(assigned[identity])
out.append(numbers)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [(([(False,[N,N+1]),(True,[N+1,N+2,N+1])],),[[1,2],[1,2,1]]), (([],),[]), (([(False,[N,N]),(False,[N])],),[[1,1],[2]]), (([(False,[1]),(True,[]),(False,[2])],),[[1],[],[1]]), (([(False,[]),(False,[1,2,1])],),[[],[1,2,1]]), (([(False,[1,2]),(False,[3]),(True,[4])],),[[1,2],[3],[1]])]
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 | [[1, 2], [2, 1, 2]] | [[1, 2], [1, 2, 1]] | Failed |
| document fixture 1 | [] | [] | Passed |
| document fixture 2 | [[1, 1], [1]] | [[1, 1], [2]] | Failed |
| document fixture 3 | [[1], [], [1]] | [[1], [], [1]] | Passed |
| document fixture 4 | [[], [1, 2, 1]] | [[], [1, 2, 1]] | Passed |
| document fixture 5 | [[1, 2], [3], [1]] | [[1, 2], [3], [1]] | Passed |
SHA-256 / aa4983d87b3c14a23e4b045eb5355f9855960d3fc3fd58a6acce7e742823ff52
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(sections):
out=[]
next_number=1
for restart,refs in sections:
if restart: next_number=1
assigned={}
numbers=[]
for identity in refs:
if identity not in assigned:
assigned[identity]=next_number
next_number+=1
numbers.append(assigned[identity])
out.append(numbers)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [(([(False,[N,N+1]),(True,[N+1,N+2,N+1])],),[[1,2],[1,2,1]]), (([],),[]), (([(False,[N,N]),(False,[N])],),[[1,1],[2]]), (([(False,[1]),(True,[]),(False,[2])],),[[1],[],[1]]), (([(False,[]),(False,[1,2,1])],),[[],[1,2,1]]), (([(False,[1,2]),(False,[3]),(True,[4])],),[[1,2],[3],[1]])]
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 | [[1, 2], [1, 2, 1]] | [[1, 2], [1, 2, 1]] | Passed |
| document fixture 1 | [] | [] | Passed |
| document fixture 2 | [[1, 1], [2]] | [[1, 1], [2]] | Passed |
| document fixture 3 | [[1], [], [1]] | [[1], [], [1]] | Passed |
| document fixture 4 | [[], [1, 2, 1]] | [[], [1, 2, 1]] | Passed |
| document fixture 5 | [[1, 2], [3], [1]] | [[1, 2], [3], [1]] | Passed |
SHA-256 / f0c6e9f8177203e91cd365f85993df079d29e51230a51c6ab9979080c072ef72
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.057307+00:00.
Case digest / dd1bb598afcfa34c08499b78e66cd6642f5436b148bbcdcbfd7d512247f11ad9