Repository navigation
syncrule: a numeric errorOnFailure is EMPTY:0000435 with a quantity - #408
Merged
Merged
Conversation
…tity Root cause of the did-schema #292 failure in testAnUnreadParameterBecomesAMethodParameter: a numeric errorOnFailure fell to unreadParameters -> jParameterList -> jLabel -> did2.convert.registeredTerm('', 'errorOnFailure'), which looks the name up by did2.schema.termNameKey (lowercased, spaces/underscores/hyphens removed). 'errorOnFailure' and 'error on failure' share the key 'erroronfailure', so once #292 registers EMPTY:0000435 the own-name path resolves to the term; on did-schema main (no row) it stays 'errorOnFailure'. The output depended on the registry. The migrator now writes a finite numeric errorOnFailure itself as EMPTY:0000435 'error on failure' with its number as a quantity (a logical stays `logical`), so the result is the same with or without the registry row and the round trip rebuilds the type from the value form. The test expected the v1 name, which the decided lookup rule ([term names match ignoring spacing]) cannot keep once the term is registered; it now expects the term with a quantity. Adds a round-trip test for the numeric case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
jesshaley
marked this pull request as ready for review
November 6, 2026 19:17
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## V2 #408 +/- ##
=========================
=========================
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes the one DID-matlab test that fails on did-schema #292's registry:
did2.unittest.testMigratorsJClockAlignment/testAnUnreadParameterBecomesAMethodParameter(numeric case).Root cause
A numeric
errorOnFailureis not read byfailureFlag(logical only), so it fell tounreadParameters->jParameterList->jLabel->did2.convert.registeredTerm('', 'errorOnFailure').registeredTerm(src/did/+did2/+convert/registeredTerm.m:35-37) looks a name up bydid2.schema.termNameKey(src/did/+did2/+schema/termNameKey.m:21: lowercased, spaces,underscores and hyphens removed; [term names match ignoring spacing], Jess Haley, 2026-10-29).
'errorOnFailure'and'error on failure'share the keyerroronfailure, so once #292registers EMPTY:0000435 the "own name" path resolves to the term. On did-schema main (no row) it
stays
errorOnFailure. Removing the synonym in did-schema fd807349 could not help: the match is byname key, not synonym (
termIndex.m:79-80).Choice for the numeric case: the term, with a quantity
{node '', name 'errorOnFailure'}is refused by
did2.schema.termRegisteredonce the term is registered ("registered with nodeEMPTY:0000435; give the node",
termRegistered.m:50-51). It would also need a bypass ofjLabel/registeredTermfor one name.quantityis what the code alreadyproduced on testMigratorsJ: an openMINDS id that does not rebuild, now that C. elegans's does #292's registry. The round trip (
did2.convert.roundtrip.syncrule) already maps'error on failure' back to
errorOnFailure, andentryValuerebuilds the type from the value form:logicalgives a logical,quantitygives a number. So it is lossless for both.failureValue: one logical, or one finite realnumber), so the output no longer depends on whether the registry holds the row. A non-finite number
still carries the rule as v1, and any other value type still goes through
jParameterList.Test change, and why
The numeric expectation ("one parameter named 'errorOnFailure'") was written against a registry
without the EMPTY:0000435 row. Under the decided name-key lookup, the name cannot survive once the
term is registered. The test now expects 'error on failure', node EMPTY:0000435,
quantity.value1,and no 'errorOnFailure'. Added
testRawV1RoundTripDaq/testANumericErrorOnFailureRoundTrips, whichchecks that the v1 rule with
errorOnFailure = 1round-trips.How this was tested
I did not run anything locally; MATLAB is not available here. This PR's CI runs against did-schema
main, where the migrator writes the term node as given. It runs against #292's registry only whendid-schema #292's own "DID-matlab V2 quick tests on this schema" job is re-run after this merges.
Generated by Claude Code