Skip to content

Drop element/daqreader_ndr/daqmetadatareader migrators; preserve superclasses entry fields#140

Merged
stevevanhooser merged 2 commits into
V2from
claude/revert-property-block-renames
May 22, 2026
Merged

Drop element/daqreader_ndr/daqmetadatareader migrators; preserve superclasses entry fields#140
stevevanhooser merged 2 commits into
V2from
claude/revert-property-block-renames

Conversation

@stevevanhooser
Copy link
Copy Markdown
Contributor

Summary

Companion to did-schema PR #53 (V_delta property-block rename revert) and NDI-matlab PR #803 (gate flip). did-schema reverts the V_delta renames for element.{name,type}, daqreader_ndr.ndr_reader_string + ndi_daqreader_ndr_class, and daqmetadatareader.ndi_daqmetadatareader_class. v1 bodies now satisfy the V_delta schema unchanged, so the per-class migrators become no-ops.

Changes:

  • Delete src/did/+did2/+convert/+migrators/{element,daqreader_ndr,daqmetadatareader}.m. The dispatcher's identity fallback handles them.
  • Fix did2.convert.universalRenames.normaliseSuperclasses: the previous implementation rebuilt the superclasses struct array as struct('class_name', names) which silently DROPPED the v1 definition path. did.database/validate_doc_vs_schema:1206 then read {superclasses.definition} as empty and the DID:Database:ValidationSuperClasses assertion fired on the next write of any migrated body. The new implementation preserves every input field, derives/normalises class_name, and rebuilds a homogeneous struct array across the union of fields.
  • Tests: removed three rename-asserting tests and the matching end-to-end dispatcher test; added three identity-passthrough tests showing the v1 bodies for these classes survive the dispatcher with their v1 field names intact.

The element_epoch superclass migrator (parallel epoch_clock+t0_t1clocks array-of-records) is kept; the user elected to preserve that structural change and update the single NDI-matlab reader site instead of reverting it.

Merge order

  1. did-schema datestamps / timestamps - use note #53 (root)
  2. this PR (CI fetches did-schema@main)
  3. NDI-matlab #803 (CI fetches did-matlab@V2 + did-schema@main)

Test plan

  • CI on this PR (matlab unit tests including testMigrators.m and the migrate-then-validate path)
  • After merge, kick NDI-matlab #803 CI and confirm the 44 failures clear

Generated by Claude Code


Generated by Claude Code

claude added 2 commits May 22, 2026 00:46
…rclasses entry fields

did-schema reverted the V_delta renames for these three property
blocks (element.name/type, daqreader_ndr.ndr_reader_string +
ndi_daqreader_ndr_class, daqmetadatareader.ndi_daqmetadatareader_class)
so v1 bodies now satisfy the V_delta schema unchanged. The per-class
migrators became no-ops; deleting them lets the dispatcher's identity
fallback handle these classes.

Companion fix in universalRenames.normaliseSuperclasses: the previous
implementation rebuilt the superclasses struct array as
struct('class_name', names) which silently DROPPED the v1 `definition`
field. did.database/validate_doc_vs_schema then read
{superclasses.definition} as empty and the
DID:Database:ValidationSuperClasses assertion fired on the very next
write of any migrated body. The validator and the recursive
superclass-schema lookup at line 1255 both rely on `definition` being
present, so preserving it (rather than teaching every reader to fall
back to class_name) is the smaller, safer change. The new
normaliseSuperclasses keeps every input field, derives/normalises
class_name as before, and rebuilds a homogeneous struct array across
the union of fields.

Tests:
- removed three rename-asserting tests (Daqreader/Daqmetadatareader/Element)
  plus the corresponding end-to-end dispatcher tests;
- added three identity-passthrough tests showing v1 bodies for these
  classes survive the dispatcher with their v1 field names intact.

The element_epoch migrator is kept: that one performs a real
structural rewrite (parallel epoch_clock + t0_t1 -> clocks array of
records), which the user explicitly elected to keep over the
per-block-revert path.
V_delta (and v1) declare element.direct as integer, but the PRED
corpus and historical writes in the larger public corpora emit it
as a JSON boolean ("direct": true/false). After jsondecode that
arrives as MATLAB `logical`, and the V_delta validator rejects it
because `isnumeric(logical)` is false:

    Field "element.direct" must be integer.

That accounted for all ~5,365 element-doc quarantines in the
20211116 / B / Dab / JH discovery reports and the 2 strict
quarantines that flip testCorpusPRED to fail.

Add a per-class element migrator that canonicalises direct to
numeric integer: logical -> double, char/string '0'/'1'/'true'/
'false' -> 0/1 (defensive), already-numeric passes through. Other
element fields (name, type, reference, ndi_element_class) keep
their v1 shape since V_delta declares them identically.

Update the existing identity-passthrough element test to assert
the integer coercion, and add a logical->integer regression test.
@stevevanhooser stevevanhooser merged commit 771f7c0 into V2 May 22, 2026
3 checks passed
@stevevanhooser stevevanhooser deleted the claude/revert-property-block-renames branch May 22, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants