Skip to content

did: fix CI failures from ndi-matlab#802 (doc2sql, validator, normalizeDependsOn empty)#138

Merged
stevevanhooser merged 1 commit into
V2from
claude/801-did-document-dependency-accessors
May 21, 2026
Merged

did: fix CI failures from ndi-matlab#802 (doc2sql, validator, normalizeDependsOn empty)#138
stevevanhooser merged 1 commit into
V2from
claude/801-did-document-dependency-accessors

Conversation

@stevevanhooser
Copy link
Copy Markdown
Contributor

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

  1. did.implementations.doc2sql line 52 — reads dependsOn.value directly when assembling the SQL meta-data string. I missed this in the original sweep.
  2. did.database/validate_doc_vs_schema line 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 strict strjoin equality. After V_delta renames the schema says ndi_daqmetadatareader_class but the body has reader_class.
  3. did.document/i_normalizeDependsOn — early-returns on empty depends_on arrays, leaving the schema as whatever it was instead of canonicalising to {name, document_id}. Subsequent set_dependency_value appends then trip heterogeneousStrucAssignment.

What changed

  • doc2sql.m{dependsOn.value} array build replaced with arrayfun(@(e) did.document.i_readDependencyTarget(e), dependsOn, …). V_delta bodies (with document_id) flow through cleanly.

  • database.mvalidate_doc_vs_schema retries the field-set comparison on mismatch with both sides normalised via the new did.document.i_normalizePropertyBlockFields helper. Only mismatches that aren't covered by a known V_delta rename still raise.

  • document.m:

    • New static-hidden i_normalizePropertyBlockFields(blockName, names). Maps V_delta canonical field names back to V_alpha legacy names per a small embedded rename table. Currently covers daqmetadatareader.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_normalizeDependsOn now 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

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.
@stevevanhooser stevevanhooser merged commit 83611ef into V2 May 21, 2026
3 checks passed
@stevevanhooser stevevanhooser deleted the claude/801-did-document-dependency-accessors branch May 21, 2026 21:53
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