fix(anatomy): R5.3 non-object children refused at add, reads confined to the seed, array length in the shape check, only run-created folders, seed guard tested in place

This commit is contained in:
bchanot committed 2026-10-23 10:11:51 +02:00
1 parent 42bbc48fcc
commit 86273b6206
6 files changed
+149 -21

No files matched your search

@@ -491,6 +491,20 @@ const ACCEPTED: Case[] = [
{ op: 'rename', target: 'reference:atlas', id: 'atlas-2' },
]),
},
{
// The TypeScript accepted it (the rename's citation walk skipped the string, the remove
// took it away); the port refuses a non-object child at the add (declared).
name: 'declared-children-string-renamed-then-removed',
changes_file: one([
{
op: 'add',
target: MOBILITY,
value: { id: 'n1', name: { fr: 'a', en: 'b' }, children: ['s'] },
},
{ op: 'rename', target: 'reference:atlas', id: 'atlas2' },
{ op: 'remove', target: `${MOBILITY}/n1` },
]),
},
{
name: 'two-changes',
changes_file: {
@@ -523,6 +537,37 @@ const ACCEPTED: Case[] = [
]
const REFUSED: Case[] = [
// A null or a primitive among the children of an added item (final R5.3 gates): the
// TypeScript threw where it walked it; the port refuses it at the add.
{
name: 'children-null-then-removed',
changes_file: one([
{
op: 'add',
target: MOBILITY,
value: { id: 'n1', name: { fr: 'a', en: 'b' }, children: [null] },
},
{ op: 'remove', target: `${MOBILITY}/n1` },
]),
},
{
name: 'children-string-marked-then-removed',
changes_file: {
changes: [
change(
[
{
op: 'add',
target: MOBILITY,
value: { id: 'n1', name: { fr: 'a', en: 'b' }, children: ['s'] },
},
],
{ level: 'B' },
),
change([{ op: 'remove', target: `${MOBILITY}/n1` }], { id: 'CHG-002' }),
],
},
},
// serde's derives read a struct from an array and a unit variant from a one-key map; Zod
// refused both (final R5.3 gates, 2026-10-23).
{