did: fix CI failures from ndi-matlab#802 (doc2sql, validator, normalizeDependsOn empty)#138
Merged
Conversation
Three remaining V_alpha-side gaps surfaced by the symmetry tests
on ndi-matlab#802:
1. did.implementations.doc2sql line 52 read `dependsOn.value`
directly when assembling the SQL meta-data string. Missed in
the original sweep. Migrated to use
did.document.i_readDependencyTarget so V_delta bodies (with
`document_id`) flow through cleanly.
2. did.database/validate_doc_vs_schema line 1348 (the
per-property-block field-set assertion) compared the
V_alpha-shaped schema's declared field names against the
actual body field names with a strict strjoin equality. After
V_delta renames the schema declaration "ndi_daqmetadatareader_class"
no longer matches the body's "reader_class". Re-compare via
a new normalisation pass on mismatch: both sides go through
did.document.i_normalizePropertyBlockFields, which maps
V_delta canonical names back to V_alpha legacy names per the
small rename table. Only daqmetadatareader.reader_class is in
the table today; extend as additional block-level renames
surface. The subfield-level renames (probe_location.location.node
etc.) are not direct property-block fields and don't hit this
code path.
3. did.document/i_normalizeDependsOn early-returned on empty
depends_on arrays, leaving the schema as whatever it was
instead of canonicalising to {name, document_id}. Subsequent
set_dependency_value appends would then attempt
`struct('name', ..., 'document_id', ...)` against a
`struct('name', {}, 'id', {})` schema and trip
heterogeneousStrucAssignment. Now rebuilds the empty array
with the canonical schema. Matches the same fix on
ndi.compat.normalizeDependsOn (separate PR #802).
New helper:
- did.document.i_normalizePropertyBlockFields(blockName, names) -
static-hidden. Normalises a list of field names within a class
property block by remapping V_delta canonical -> V_alpha
legacy via a small embedded rename table. Used by the V_alpha
field-set validator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to merged #137. Three remaining V_alpha-side gaps the symmetry tests on vh-lab/ndi-matlab#802 surfaced after #137 landed.
What's broken
did.implementations.doc2sqlline 52 — readsdependsOn.valuedirectly when assembling the SQL meta-data string. I missed this in the original sweep.did.database/validate_doc_vs_schemaline 1348 — the per-property-block field-set assertion compares the V_alpha-shaped schema's declared field names against the actual body's field names with strictstrjoinequality. After V_delta renames the schema saysndi_daqmetadatareader_classbut the body hasreader_class.did.document/i_normalizeDependsOn— early-returns on emptydepends_onarrays, leaving the schema as whatever it was instead of canonicalising to{name, document_id}. Subsequentset_dependency_valueappends then tripheterogeneousStrucAssignment.What changed
doc2sql.m—{dependsOn.value}array build replaced witharrayfun(@(e) did.document.i_readDependencyTarget(e), dependsOn, …). V_delta bodies (withdocument_id) flow through cleanly.database.m—validate_doc_vs_schemaretries the field-set comparison on mismatch with both sides normalised via the newdid.document.i_normalizePropertyBlockFieldshelper. Only mismatches that aren't covered by a known V_delta rename still raise.document.m:i_normalizePropertyBlockFields(blockName, names). Maps V_delta canonical field names back to V_alpha legacy names per a small embedded rename table. Currently coversdaqmetadatareader.reader_class → ndi_daqmetadatareader_class. Extend as additional block-level renames surface. The subfield-level renames (probe_location.location.node etc.) are not direct property-block fields and don't reach this code path.i_normalizeDependsOnnow canonicalises the schema for empty depends_on arrays by rebuilding the 0×0 struct with exactly{name, document_id}. Matches the same fix on ndi-matlab side in #802.Coordination
This unblocks the still-failing tests in ndi-matlab #802. Once this merges, #802 needs an empty-commit CI re-trigger to clear.
Generated by Claude Code