Skip to content

did: fix CI failures from ndi-matlab#802 follow-up (doc2sql orientation, validator reverse lookup)#139

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 follow-up (doc2sql orientation, validator reverse lookup)#139
stevevanhooser merged 1 commit into
V2from
claude/801-did-document-dependency-accessors

Conversation

@stevevanhooser
Copy link
Copy Markdown
Contributor

Follow-up to #138. Two regressions my #138 fixes introduced, surfaced by the next ndi-matlab #802 CI run:

1. doc2sql vertcat dimension mismatch

My #138 fix:

targets = arrayfun(@(e) did.document.i_readDependencyTarget(e), dependsOn, 'UniformOutput', false);
allData = [{dependsOn.name}; targets];

arrayfun preserves the input struct array's orientation, but {struct.field} always returns a row regardless. When dependsOn is a column struct array, the two have different orientations and vertcat fails with MATLAB:catenate:dimensionMismatch.

Rewritten to a plain for-loop that fills a preallocated 2×N cell. Orientation-independent.

2. validator subfield-loop V_alpha lookup

My #138 field-set normalization accepts that the V_delta body uses reader_class where the schema declares ndi_daqmetadatareader_class. The next loop (line ~1370) then iterates the schema's subfields and does docValue.(subfield) with the V_alpha name — which doesn't exist on the V_delta body.

Added did.document.i_aliasV_alphaToV_delta(block, vAlphaName). When the dot-access would fail, look up the V_delta canonical via the rename map and try that name instead. The original error still fires on truly missing fields.

The forward map (i_normalizePropertyBlockFields) and the reverse helper now share a single source-of-truth table via the new i_propertyBlockRenameMap().

Coordination

ndi-matlab #802 needs a CI re-trigger once this lands. Pushing the matching normalizeDependsOn empty-array fix on that side concurrently.


Generated by Claude Code

Two follow-up fixes after #138 landed; surfaced by next ndi-matlab
#802 CI run.

1. did.implementations.doc2sql line 54: vertcat dimension mismatch.
   My #138 fix used `[{dependsOn.name}; targets]` where `targets`
   came from arrayfun. arrayfun preserves the input's orientation,
   but `{struct.field}` always returns a row regardless of the
   struct array's shape. When dependsOn was a column struct array
   the two sides had different orientations and concatenation
   failed.

   Rewritten to a plain for-loop that fills a preallocated 2xN
   cell. Bulletproof regardless of dependsOn's orientation.

2. did.database/validate_doc_vs_schema line 1370: the per-subfield
   loop iterates the schema-declared subfield names. After my #138
   field-set-tolerance accepted that the V_delta body uses
   reader_class instead of ndi_daqmetadatareader_class, the
   subfield loop then tried `docValue.(subfield)` with subfield =
   the schema name ('ndi_daqmetadatareader_class') which doesn't
   exist on the V_delta body.

   Added did.document.i_aliasV_alphaToV_delta(block, vAlphaName)
   which maps the schema's V_alpha name to the V_delta canonical
   so the body lookup succeeds. The forward map
   (i_normalizePropertyBlockFields) and the reverse helper now
   share a single source-of-truth table via the new
   i_propertyBlockRenameMap helper. The original error still fires
   on truly-missing fields.
@stevevanhooser stevevanhooser merged commit cea07dd into V2 May 21, 2026
3 checks passed
@stevevanhooser stevevanhooser deleted the claude/801-did-document-dependency-accessors branch May 21, 2026 22:32
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