Summary
CLAUDE.md lists the following invariants as part of the project's validation rules:
- Temperature values cannot be below absolute zero (0 K)
- Frequency values cannot be negative
- Throw
DivideByZeroException when dividing by zero in DivideToStorage
None of these are enforced in the current generated quantity types.
Evidence
Semantics.Quantities/Generated/.../Temperature.g.cs accepts any value via Create/From*. No < 0 K guard.
grep -E "absolute zero|cannot be negative" Semantics.Quantities/Generated/**/*.g.cs returns nothing.
Semantics.Quantities/PhysicalQuantity.cs does not implement per-dimension validation hooks.
Suggested next step
Extend dimensions.json (or a sibling metadata file) with optional physicalConstraints per dimension (e.g. { "minValue": "0", "minValueUnit": "Kelvin" }) and have the generator emit factory-level guards that throw ArgumentException when violated. Cover with tests for at minimum: Temperature absolute zero, Frequency >= 0, Wavelength > 0, Mass > 0, Pressure (absolute) >= 0.
Area / Severity
SourceGenerators / Metadata · incomplete
Summary
CLAUDE.mdlists the following invariants as part of the project's validation rules:None of these are enforced in the current generated quantity types.
Evidence
Semantics.Quantities/Generated/.../Temperature.g.csaccepts any value viaCreate/From*. No< 0 Kguard.grep -E "absolute zero|cannot be negative" Semantics.Quantities/Generated/**/*.g.csreturns nothing.Semantics.Quantities/PhysicalQuantity.csdoes not implement per-dimension validation hooks.Suggested next step
Extend
dimensions.json(or a sibling metadata file) with optionalphysicalConstraintsper dimension (e.g.{ "minValue": "0", "minValueUnit": "Kelvin" }) and have the generator emit factory-level guards that throwArgumentExceptionwhen violated. Cover with tests for at minimum: Temperature absolute zero, Frequency >= 0, Wavelength > 0, Mass > 0, Pressure (absolute) >= 0.Area / Severity
SourceGenerators / Metadata · incomplete