test(anatomy): R5.3 characterisation: Object.prototype member as a plain key, migration-map cascade debt, refusal reasons compared by stage

This commit is contained in:
bchanot committed 2026-10-23 00:50:22 +02:00
1 parent 8010661de6
commit 9901106a62
3 files changed
+252 -6

No files matched your search

@@ -474,6 +474,23 @@ const ACCEPTED: Case[] = [
{ op: 'set', target: `${MOBILITY}/flexion`, field: 'description.en' },
]),
},
{
// Migration-map debt kept during R5 (owner 2026-10-23): the replay reads `record.op`
// whatever the record's target, so the view rename's cascade record on annotation:hip
// (field view_id) is replayed as a rename of that annotation: legacy-hip -> 'principal'.
name: 'quirk-view-rename-retargets-annotation',
changes_file: one([{ op: 'rename', target: 'view:main', id: 'principal' }]),
},
{
// Same debt: the reference rename's cascade record on a cited finding is replayed as a
// rename of that finding's path: hip/hip-dysfunctions/mobility -> .../atlas-2, then
// absent from the final paths -> null.
name: 'quirk-reference-rename-renames-finding-path',
changes_file: one([
{ op: 'cite', target: MOBILITY, reference_ids: ['atlas'] },
{ op: 'rename', target: 'reference:atlas', id: 'atlas-2' },
]),
},
{
name: 'two-changes',
changes_file: {
@@ -506,6 +523,39 @@ const ACCEPTED: Case[] = [
]
const REFUSED: Case[] = [
{
// TypeScript: readField returns the inherited Object.prototype.constructor, record's
// structuredClone throws DataCloneError. The Rust port reads a plain missing key
// (declared, RUST.md §11.12); the later `set name` removes the written key.
name: 'declared-inherited-member-overwritten',
changes_file: one([
{ op: 'set', target: MOBILITY, field: 'name.constructor', value: 'x' },
{
op: 'set',
target: MOBILITY,
field: 'name',
value: { fr: 'Mobilité', en: 'Mobility' },
},
]),
},
{
name: 'apply-inherited-member-kept',
changes_file: one([
{ op: 'set', target: MOBILITY, field: 'name.toString', value: 'x' },
]),
},
{
name: 'apply-inherited-member-as-field',
changes_file: one([
{ op: 'set', target: MOBILITY, field: 'constructor', value: 'x' },
]),
},
{
name: 'apply-inherited-member-intermediate',
changes_file: one([
{ op: 'set', target: MOBILITY, field: 'name.toString.x', value: 'x' },
]),
},
{
name: 'schema-unknown-change-key',
changes_file: one([{ op: 'remove', target: `${MOBILITY}/flexion` }], {