fix(anatomy): R5.3 authored values read as JSON.parse does (key order, big integers), non-list children refused, document value bound, --check and seed guard by identity

This commit is contained in:
bchanot committed 2026-10-23 10:32:44 +02:00
1 parent 6c0fe88725
commit 07d63076d3
10 files changed
+222 -23

No files matched your search

@@ -505,6 +505,65 @@ const ACCEPTED: Case[] = [
{ op: 'remove', target: `${MOBILITY}/n1` },
]),
},
{
// JSON.parse semantics on authored values (final R5.3 gates): array index keys first.
name: 'js-index-key-in-value-overwritten',
changes_file: one([
{
op: 'set',
target: MOBILITY,
field: 'name',
value: { fr: 'A', en: 'B', 1: 'x' },
},
{
op: 'set',
target: MOBILITY,
field: 'name',
value: { fr: 'Mobilité', en: 'Mobility' },
},
]),
},
{
name: 'js-index-segment-overwritten',
changes_file: one([
{ op: 'set', target: MOBILITY, field: 'name.0', value: 'x' },
{
op: 'set',
target: MOBILITY,
field: 'name',
value: { fr: 'Mobilité', en: 'Mobility' },
},
]),
},
{
// An integer beyond 2^53, rounded by JSON.parse (written as a raw changes.json text).
name: 'js-big-integer-in-value-overwritten',
changes_file: one([
{
op: 'set',
target: 'region:C',
field: 'count',
value: 9007199254740992,
},
{ op: 'set', target: 'region:C', field: 'count', value: 7 },
]),
},
{
// The TypeScript replaced the non-list `children` by [] (childrenOf); the port refuses it.
name: 'declared-children-object-then-added-to',
changes_file: one([
{
op: 'add',
target: MOBILITY,
value: {
id: 'n1',
name: { fr: 'a', en: 'b' },
children: { x: { id: 'x', name: { fr: 'x', en: 'x' } } },
},
},
{ op: 'add', target: `${MOBILITY}/n1`, value: leaf('child') },
]),
},
{
name: 'two-changes',
changes_file: {