FAILURE MAP
← Case archive

FA-9046 / Undo and history / Open access

Adjacent typing undo coalescing: Explicit undo boundaries fail to split typing groups · case 01

Explicit undo boundaries fail to split typing groups.

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

ROOT CAUSE

The boundary operation uses `` where the contract requires `and not boundary`.

THE FAILURE

The boundary operation uses `` where the contract requires `and not boundary`.

Unsuccessful approach: Reversing the flag merges exactly where a split was requested.

Case contract

Only contiguous insertion edits without explicit boundary coalesce; preserve the first before-state and newest after-state; no-op input creates no history.

Why this case matters

A deterministic model of adjacent typing undo coalescing; this isolates one interface invariant without requiring a browser.

1 / The failure

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

N = 1
observations = []
def solve(history, before, after, previous_kind, kind, previous_caret, caret, boundary):
    history = list(history)
    if before == after: return history
    merge = bool(history) and kind == 'insert' and previous_kind == kind and previous_caret == caret 
    if merge: history[-1] = (history[-1][0], after)
    else: history.append((before, after))
    return history
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('noop', solve([('a','ab')], 'ab', 'ab', 'insert', 'insert', 2, 2, False), [('a', 'ab')])
check('empty noop', solve([], 'a', 'a', None, 'insert', None, 1, False), [])
check('delete', solve([('abcd','abc')], 'abc', 'ab', 'delete', 'delete', 3, 3, False), [('abcd', 'abc'), ('abc', 'ab')])
check('contiguous', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, False), [('a', 'abc')])
check('moved caret', solve([('a','ab')], 'ab', 'axb', 'insert', 'insert', 2, 1, False), [('a', 'ab'), ('ab', 'axb')])
check('boundary', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, True), [('a', 'ab'), ('ab', 'abc')])
check('empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', 'a')])
check('parameterized inserted length', solve([], '', 'a'*N, None, 'insert', None, 0, False), [('', 'a'*N)])
for repetition in range(N):
    check('repeat empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', 'a')])
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
noop[['a', 'ab']][['a', 'ab']]Passed
empty noop[][]Passed
delete[['abcd', 'abc'], ['abc', 'ab']][['abcd', 'abc'], ['abc', 'ab']]Passed
contiguous[['a', 'abc']][['a', 'abc']]Passed
moved caret[['a', 'ab'], ['ab', 'axb']][['a', 'ab'], ['ab', 'axb']]Passed
boundary[['a', 'abc']][['a', 'ab'], ['ab', 'abc']]Failed
empty[['', 'a']][['', 'a']]Passed
parameterized inserted length[['', 'a']][['', 'a']]Passed
repeat empty[['', 'a']][['', 'a']]Passed

SHA-256 / d5e48653781537efb1d23df42d02c4a68ef7a9f1ffd12406207e3e6e7ec28df2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(history, before, after, previous_kind, kind, previous_caret, caret, boundary):
    history = list(history)
    if before == after: return history
    merge = bool(history) and kind == 'insert' and previous_kind == kind and previous_caret == caret and boundary
    if merge: history[-1] = (history[-1][0], after)
    else: history.append((before, after))
    return history
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('noop', solve([('a','ab')], 'ab', 'ab', 'insert', 'insert', 2, 2, False), [('a', 'ab')])
check('empty noop', solve([], 'a', 'a', None, 'insert', None, 1, False), [])
check('delete', solve([('abcd','abc')], 'abc', 'ab', 'delete', 'delete', 3, 3, False), [('abcd', 'abc'), ('abc', 'ab')])
check('contiguous', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, False), [('a', 'abc')])
check('moved caret', solve([('a','ab')], 'ab', 'axb', 'insert', 'insert', 2, 1, False), [('a', 'ab'), ('ab', 'axb')])
check('boundary', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, True), [('a', 'ab'), ('ab', 'abc')])
check('empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', 'a')])
check('parameterized inserted length', solve([], '', 'a'*N, None, 'insert', None, 0, False), [('', 'a'*N)])
for repetition in range(N):
    check('repeat empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', 'a')])
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
noop[['a', 'ab']][['a', 'ab']]Passed
empty noop[][]Passed
delete[['abcd', 'abc'], ['abc', 'ab']][['abcd', 'abc'], ['abc', 'ab']]Passed
contiguous[['a', 'ab'], ['ab', 'abc']][['a', 'abc']]Failed
moved caret[['a', 'ab'], ['ab', 'axb']][['a', 'ab'], ['ab', 'axb']]Passed
boundary[['a', 'abc']][['a', 'ab'], ['ab', 'abc']]Failed
empty[['', 'a']][['', 'a']]Passed
parameterized inserted length[['', 'a']][['', 'a']]Passed
repeat empty[['', 'a']][['', 'a']]Passed

SHA-256 / 0c84b6b6beb60a54fa802f828c75a8ee71f665a39459fb231ddb73f0828221fd

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 9 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:26.700667+00:00.

Case digest / fae769d71a811b748146db48f59be9f219147ad70ec6d6ac95ca50cea5ed0d3f