fix(anatomy): R5.3 shapes refused as Zod did (struct as array, enum as map), reads bounded to regular files, --check never follows links, plain names in --out

This commit is contained in:
bchanot committed 2026-10-23 01:33:01 +02:00
1 parent 314cf04e6a
commit 776c7095b3
9 files changed
+258 -25

No files matched your search

@@ -523,6 +523,103 @@ const ACCEPTED: Case[] = [
]
const REFUSED: Case[] = [
// 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).
{
name: 'shape-title-as-array',
changes_file: one([{ op: 'remove', target: `${MOBILITY}/flexion` }], {
title: ['Essai', 'Test'],
}),
},
{
name: 'shape-level-as-map',
changes_file: one([{ op: 'remove', target: `${MOBILITY}/flexion` }], {
level: { A: null },
}),
},
{
name: 'shape-change-as-array',
changes_file: {
changes: [
[
'CHG-001',
'A',
'technical',
{ fr: 'a', en: 'a' },
'r',
[],
[{ op: 'remove', target: `${MOBILITY}/flexion` }],
],
],
},
},
{
name: 'shape-scope-as-map',
changes_file: one([
{
op: 'cite',
target: MOBILITY,
reference_ids: ['atlas'],
scope: { subtree: null },
},
]),
},
{
name: 'shape-gate-name-as-array',
changes_file: one([
{ op: 'set', target: MOBILITY, field: 'name', value: ['a', 'b'] },
]),
},
{
name: 'shape-gate-status-as-map',
changes_file: one([
{
op: 'set',
target: MOBILITY,
field: 'review_status',
value: { reviewed: null },
},
]),
},
{
name: 'shape-gate-laterality-as-map',
changes_file: one([
{
op: 'set',
target: 'annotation:hip',
field: 'laterality',
value: { bilateral: null },
},
]),
},
{
name: 'shape-gate-view-box-as-array',
changes_file: one([
{
op: 'set',
target: 'view:head',
field: 'view_box',
value: [0, 0, 5, 5],
},
]),
},
{
name: 'shape-gate-geometry-as-array',
changes_file: one([
{
op: 'set',
target: 'annotation:hip',
field: 'geometry',
value: ['circle', 1, 2, 3],
},
]),
},
{
name: 'shape-gate-added-node-name-as-array',
changes_file: one([
{ op: 'add', target: MOBILITY, value: { id: 'x', name: ['a', 'a'] } },
]),
},
{
// TypeScript: readField returns the inherited Object.prototype.constructor, record's
// structuredClone throws DataCloneError. The Rust port reads a plain missing key
@@ -859,6 +956,14 @@ const REFUSED: Case[] = [
]
const REFERENCE_FILES: Array<{ name: string; file: unknown }> = [
{
name: 'references-entry-as-array',
file: { references: [['atlas', 'book', 'Atlas', null, null]] },
},
{
name: 'references-type-as-map',
file: { references: [{ ...MINI_REFERENCES[0], type: { book: null } }] },
},
{
name: 'references-duplicate-id',
file: { references: [...MINI_REFERENCES, MINI_REFERENCES[0]] },