feat(generator): emit SEM001 diagnostic for unknown dimension references#65
Merged
matt-edmondson merged 1 commit intovectorsfrom May 9, 2026
Merged
feat(generator): emit SEM001 diagnostic for unknown dimension references#65matt-edmondson merged 1 commit intovectorsfrom
matt-edmondson merged 1 commit intovectorsfrom
Conversation
…ension When dimensions.json declares an integral / derivative / dotProduct / crossProduct that targets a dimension that doesn't exist (typo, stale name after a rename), QuantitiesGenerator silently dropped the operator. Typos were invisible until someone noticed the missing operator at the call site. Now: emit a Warning-severity SEM001 diagnostic naming the owning dimension, the unresolved reference, and the metadata path, e.g. warning SEM001: Dimension 'Force' references unknown dimension 'Lengt' in integrals[Lengt -> Energy].other; the operator will not be generated. Check spelling and that the referenced dimension exists in dimensions.json. The operator is still skipped (build doesn't fail) so existing valid trees keep working, but typos surface in build output where they're noticeable. Closes #56.
|
This was referenced May 9, 2026
Closed
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.


Summary
Closes #56.
When
dimensions.jsondeclares an integral / derivative / dotProduct / crossProduct that targets a dimension that doesn't exist (typo, stale name after a rename),QuantitiesGeneratorsilently dropped the operator. Typos were invisible until someone noticed the missing operator at the call site.This PR makes those failures visible:
The diagnostic is
Warningseverity — the build doesn't fail, the operator is still skipped, so existing valid metadata keeps generating identically. The change just surfaces typos in build output where they're visible.All eight
dimMap.TryGetValue(...)sites inCollectAllOperatorsandCollectAllProductsnow emitSEM001on miss with the owning dimension, the unresolved name, and the metadata field path (e.g.integrals[Force -> Energy].other).Test plan
dimensions.json(it's clean).dimensions.json(e.g."other": "Lengt"instead of"Length"), build, observe a SEM001 warning. Revert.🤖 Generated by Claude Code
Generated by Claude Code