MTConnect authoring accepts a dataType the runtime rejects (authoring weaker than runtime) #549
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the G-7 parity tests falsifiability control (merge
0695f682).MTConnectTagConfigModel.FromJsonreadsdataTypeviaTagConfigJson.GetEnum, which falls back toStringon any unrecognised value — so a misspelled name like"Strng"is accepted at authoring, silently coerced, and rewritten clean on save. The strict runtime parse (MTConnectTagDefinitionFactory.TryParseDataType:Enum.TryParseignore-case +IsDefined) rejects the same value, so the tag fails at the driver. This is the REVERSE direction from G-7: authoring weaker than runtime.Fix shape: one authority — expose the factory predicate from
MTConnect.Contractsand haveValidate()(which already keeps_rawDataTypefor the digits-only trap) reject any raw value the runtime would reject. Also survey the other tenTagConfigJson.GetEnumcall sites for the same asymmetry (lenient authoring is only correct where the runtime is equally lenient).Documented inline in
TagConfigAuthoringDeployParityTestsand in deferment.md §9 (2026-08-09 entry).FIXED, merged
3a70a4e6(work commita3c0ec03) — and the survey the issue asked for found the defect was 6 models wide, not 1. R2-11 Phase C had made every runtime TagConfig enum read strict (TagConfigJson.TryReadEnumStrictrejects the tag), so every lenientGetEnumauthoring model was asymmetric: MTConnect, Modbus (region/dataType/byteOrder), S7, AbCip, AbLegacy, TwinCAT, FOCAS dataType. Mqtt and Sql were already strict on both sides (untouched).Fix is one-authority as proposed: MTConnect Validate consults the exposed
MTConnectTagDefinitionFactory.IsAcceptedDataTypeName; the other five consult a newTagConfigJson.DescribeInvalidEnumthat delegates to the runtimes ownClassifyEnumText, so verdict AND wording come from one implementation. MTConnect also now captures the raw JSON token (an unquoted"dataType": 8` throws in the runtime DTO deserialise, so authoring rejects it too). Deliberately NOT stricter than runtime: absent keys and present-but-non-string tokens stay accepted where the runtime accepts them, each pinned by its own test.+48 AdminUI tests, 3 independent falsification reverts each red for the right reason. Follow-ups from the survey filed separately: the MTConnect
driverDataTypedual-spelling (authoring blind to the runtime-preferred key) and the residual gate-coverage gaps (CSV-import TagConfigJson column, S7 absent-key, AbCip member dataType, Modbus stringByteOrder, stale Inspect doc summaries).