FA-35486 / Tab interfaces / Open access
Cross pane move: target selection · case 01
The tab workspace reports an incorrect target selection.
ROOT CAUSE
The target selection decision uses x['target'][0] if x['target'] else None instead of x['moving'].
VERIFIED REPAIR
Use the stipulated workspace rule: x['moving'].
Unsuccessful approach: The partial repair x['target'][-1] if x['target'] else None still violates a workspace boundary or normal case.
Case contract
Moving a tab removes its source view and inserts it exactly once in the target pane at a clamped slot, preserving document and view state.
Why this case matters
Offline tab/panel workspace behavior; no browser or desktop framework is emulated.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
r0 = [t for t in x['source'] if t!=x['moving']]
r1 = x['target'][:min(x['slot'],len(x['target']))]+[x['moving']]+x['target'][min(x['slot'],len(x['target'])):]
r2 = {'view':x['moving'],'document':x['doc'],'scroll':x['scroll']}
r3 = x['doc']
r4 = x['scroll']
r5 = x['target'][0] if x['target'] else None
return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 28}, 'db', 28, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 2: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 56}, 'db', 56, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 3: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 84}, 'db', 84, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 4: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 112}, 'db', 112, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 5: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 140}, 'db', 140, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
check("workspace regression "+str(i), solve(inputs), 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 |
|---|---|---|---|
| workspace regression 0 | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'd'] | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Failed |
| workspace regression 1 | [['a', 'c'], ['b', 'd', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'd'] | [['a', 'c'], ['b', 'd', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Failed |
| workspace regression 2 | [['a', 'c'], ['d', 'e', 'b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'd'] | [['a', 'c'], ['d', 'e', 'b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Failed |
| workspace regression 3 | [['b', 'c'], ['d', 'a', 'e'], {'document': 'db', 'scroll': 28, 'view': 'a'}, 'db', 28, 'd'] | [['b', 'c'], ['d', 'a', 'e'], {'document': 'db', 'scroll': 28, 'view': 'a'}, 'db', 28, 'a'] | Failed |
| workspace regression 4 | [['a', 'c'], ['b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, None] | [['a', 'c'], ['b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Failed |
| workspace regression 5 | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 0, 'view': 'b'}, 'db', 0, 'd'] | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 0, 'view': 'b'}, 'db', 0, 'b'] | Failed |
SHA-256 / 4fee15b2519ea2d12c3d81ce32b5d2bc639d9e4b65ad886cfbc9d5f71ca6af01
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
r0 = [t for t in x['source'] if t!=x['moving']]
r1 = x['target'][:min(x['slot'],len(x['target']))]+[x['moving']]+x['target'][min(x['slot'],len(x['target'])):]
r2 = {'view':x['moving'],'document':x['doc'],'scroll':x['scroll']}
r3 = x['doc']
r4 = x['scroll']
r5 = x['target'][-1] if x['target'] else None
return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 28}, 'db', 28, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 2: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 56}, 'db', 56, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 3: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 84}, 'db', 84, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 4: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 112}, 'db', 112, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 5: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 140}, 'db', 140, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
check("workspace regression "+str(i), solve(inputs), 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 |
|---|---|---|---|
| workspace regression 0 | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'e'] | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Failed |
| workspace regression 1 | [['a', 'c'], ['b', 'd', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'e'] | [['a', 'c'], ['b', 'd', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Failed |
| workspace regression 2 | [['a', 'c'], ['d', 'e', 'b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'e'] | [['a', 'c'], ['d', 'e', 'b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Failed |
| workspace regression 3 | [['b', 'c'], ['d', 'a', 'e'], {'document': 'db', 'scroll': 28, 'view': 'a'}, 'db', 28, 'e'] | [['b', 'c'], ['d', 'a', 'e'], {'document': 'db', 'scroll': 28, 'view': 'a'}, 'db', 28, 'a'] | Failed |
| workspace regression 4 | [['a', 'c'], ['b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, None] | [['a', 'c'], ['b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Failed |
| workspace regression 5 | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 0, 'view': 'b'}, 'db', 0, 'e'] | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 0, 'view': 'b'}, 'db', 0, 'b'] | Failed |
SHA-256 / 47275c79f93a74d217a5ed5252736d006196e49dcb9954c14a98eed561501a08
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
r0 = [t for t in x['source'] if t!=x['moving']]
r1 = x['target'][:min(x['slot'],len(x['target']))]+[x['moving']]+x['target'][min(x['slot'],len(x['target'])):]
r2 = {'view':x['moving'],'document':x['doc'],'scroll':x['scroll']}
r3 = x['doc']
r4 = x['scroll']
r5 = x['moving']
return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 28}, 'db', 28, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 28}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 28}, 'db', 28, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 2: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 56}, 'db', 56, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 56}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 56}, 'db', 56, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 3: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 84}, 'db', 84, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 84}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 84}, 'db', 84, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 4: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 112}, 'db', 112, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 112}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 112}, 'db', 112, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])], 5: [({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 0, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['b', 'd', 'e'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 5, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['d', 'e', 'b'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'a', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['b', 'c'], ['d', 'a', 'e'], {'view': 'a', 'document': 'db', 'scroll': 140}, 'db', 140, 'a']), ({'source': ['a', 'b', 'c'], 'target': [], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 140}, [['a', 'c'], ['b'], {'view': 'b', 'document': 'db', 'scroll': 140}, 'db', 140, 'b']), ({'source': ['a', 'b', 'c'], 'target': ['d', 'e'], 'moving': 'b', 'slot': 1, 'doc': 'db', 'scroll': 0}, [['a', 'c'], ['d', 'b', 'e'], {'view': 'b', 'document': 'db', 'scroll': 0}, 'db', 0, 'b'])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
check("workspace regression "+str(i), solve(inputs), 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 |
|---|---|---|---|
| workspace regression 0 | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Passed |
| workspace regression 1 | [['a', 'c'], ['b', 'd', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | [['a', 'c'], ['b', 'd', 'e'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Passed |
| workspace regression 2 | [['a', 'c'], ['d', 'e', 'b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | [['a', 'c'], ['d', 'e', 'b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Passed |
| workspace regression 3 | [['b', 'c'], ['d', 'a', 'e'], {'document': 'db', 'scroll': 28, 'view': 'a'}, 'db', 28, 'a'] | [['b', 'c'], ['d', 'a', 'e'], {'document': 'db', 'scroll': 28, 'view': 'a'}, 'db', 28, 'a'] | Passed |
| workspace regression 4 | [['a', 'c'], ['b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | [['a', 'c'], ['b'], {'document': 'db', 'scroll': 28, 'view': 'b'}, 'db', 28, 'b'] | Passed |
| workspace regression 5 | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 0, 'view': 'b'}, 'db', 0, 'b'] | [['a', 'c'], ['d', 'b', 'e'], {'document': 'db', 'scroll': 0, 'view': 'b'}, 'db', 0, 'b'] | Passed |
SHA-256 / 51b2215e588db949913a824d320373a288a25365f426087bc3fe508bece55db4
Verification & scope
Finite stipulated workspace snapshots only. Independent result fields describe observable obligations, not a full UI runtime. 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:42:42.133227+00:00.
Case digest / a14f6472803d5ecf6e0feb0ba66483822b27bcf7061ebfd928d56d89cdf85613