Repository navigation
Description
The rules about where a metric's datatype lives have drifted apart across four chapters since the metadata separation moved it out of the BIRTH. They are not consistent with each other today, and one of the inconsistencies makes the TCK fail a conforming Edge Node.
Found while reviewing #662; none of it is caused by that change, and #664 is the narrow part that could be done without touching any of this.
The contradiction
tck-id-topics-nbirth-no-metadata, -dbirth-no-metadata |
the BIRTH MUST NOT be used to convey metric datatype; it is conveyed only in the NMETA/NMMETA, or DMETA/DMMETA for a Device |
tck-id-payloads-metric-datatype-req |
the datatype MUST be included with each metric definition in NBIRTH and DBIRTH messages |
Two MUSTs, directly opposed, for the same field in the same message.
It is live in the TCK, not just on paper
SessionEstablishmentTest enforces the second one. Lines 676-682 (NBIRTH) and 875-882 (DBIRTH) score ID_PAYLOADS_METRIC_DATATYPE_REQ with countDataType(metrics) == metrics.size(), requiring every metric in a BIRTH to carry the field.
So an Edge Node that correctly omits the datatype from its BIRTH, as the Topics chapter requires, fails the TCK, while one that includes it — violating the Topics chapter — passes. Both log lines still read "The datatype MUST be included with each metric definition in NBIRTH and DBIRTH messages."
Nothing scores topics-nbirth-no-metadata or topics-dbirth-no-metadata, so the rule that is presumably correct is unchecked.
Two more places carrying the pre-separation model
Sparkplug_1_Introduction.adoc:429— "Every Metric must include a Sparkplug Datatype in the NBIRTH or DBIRTH message depending on whether the Metric is a 'Node level' or 'Device level' metric."operational-behavior-data-publish-node-metric-datatypeand-device-metric-datatyperequire that the datatype not change "in subsequent NDATA messages", which cannot happen if NDATA carries no datatype at all.
And a duplication, which is the #651 failure mode
The same rule is stated in several places, so any fix has to touch all of them:
- the datatype belongs in the META:
topics-nmeta-metrics,topics-dmeta-metrics,payloads-nmeta-metric-defs,payloads-dmeta-metric-defs,payloads-mmeta-metric-defs; - the BIRTH must not carry it:
topics-nbirth-no-metadata,topics-nrebirth-no-metadata,topics-dbirth-no-metadata,topics-drebirth-no-metadata, and again inpayloads-nbirth-metrics,-nrebirth-metrics,-dbirth-metrics,-drebirth-metrics.
Why it is one issue
An attempt to fix payloads-metric-datatype-req alone was tried in #662 and did not hold: rewording it to name the META messages removed the contradiction but restated four assertions that already said the same thing, left Chapter 1 behind, and made the SessionEstablishmentTest failure above go live. The pieces have to move together.
This is the concrete, worked case of #446 — which components of a metric are mandatory, by message type. Suggest doing it as the first row of that matrix rather than as a separate exercise.
Activity
[eclipse-sparkplug#665] Stop the TCK requiring a datatype in BIRTH me…
[eclipse-sparkplug#665] Make the Topics chapter canonical for the met…
[eclipse-sparkplug#665] Retire the pre-separation datatype wording in…
[eclipse-sparkplug#665] Stop the TCK requiring a datatype in BIRTH me…
[eclipse-sparkplug#665] Make the Topics chapter canonical for the met…
[eclipse-sparkplug#665] Retire the pre-separation datatype wording in…
[eclipse-sparkplug#665] Fix the cross-references the deduplication le…
[eclipse-sparkplug#665] Move Command Definitions to the META messages
[eclipse-sparkplug#665] Score the whole no-metadata rule, and stop fa…
[eclipse-sparkplug#665] Finish moving Command Definitions off the BIRTH
[eclipse-sparkplug#665] State the alias rules against the META, not t…
[eclipse-sparkplug#665] Keep the alias rules out of the META, and ren…
[eclipse-sparkplug#665] Address review: aliased BIRTHs, MMETA names, …
Merge pull request #666 from wes-johnson/665-tck-birth-datatype
wes-johnson commentedon Dec 5, 2026
Done in #666, merged to
developas 6965984. Closing by hand: theCloses #665keyword only fires on a merge into the default branch (master), and this line merges intodevelopfirst.What landed
payloads-metric-datatype-reqremoved. The datatype is required bytopics-nmeta-metricsandtopics-dmeta-metrics, as the Topics chapter already said.topics-nbirth-no-metadataandtopics-dbirth-no-metadata, which had no test at all before. A conforming Edge Node no longer fails.Sparkplug_1_Introduction.adoc:429and the twooperational-behavior-data-publish-*-metric-datatypeassertions retired off the BIRTH; the latter now require the value to use the TypedValue field the declared datatype maps to, which is actually checkable from a protobuf NDATA.Two families turned up during review that this issue didn't name, and both were the same defect in a different field:
topics-nmeta-cmd-metricsrequired them in the full NMETA. Moved to the META, along withoperational-behavior-command-definition-meta, the Commands prose, the NCMD/DCMD name rules and three schema comments.payloads-alias-birth-requirementdemanded "both a metric name and alias" in a BIRTH, againsttopics-nbirth-metrics. The alias-to-name binding is established in the META and is optional per metric; renamed topayloads-alias-assigned/payloads-alias-not-assigned.Net 664 → 657 tck-ids (11 removed, 4 added, of which 4 removals are renames).
Gaps this leaves open
Recording these here rather than letting them close with the issue.
TCK coverage — the TCK has no NMETA/DMETA handling, which is the root of the first three:
topics-nmeta-metrics/topics-dmeta-metrics, so no test checks that a metric definition declares a datatype at all. Before [#665] Make the Topics chapter canonical, and reconcile the metric definition rules with the META messages #666 that was enforced bypayloads-metric-datatype-reqand ahasDatatype()term in the BIRTH checks; both were correct to remove, but nothing replaced them on the META side.SessionEstablishmentTest,SendComplexDataTest.checkAliasInData) test only that exactly one identifier is present, not the actual rule, because the test cannot know which metrics were assigned an alias.topics-nrebirth-no-metadataandtopics-drebirth-no-metadataremain unscored — the TCK has no NREBIRTH/DREBIRTH handling. Pre-existing.Specification
topics-X/payloads-Xpairs remain (down from 23) —payloads-nmeta-cmd-metricsvstopics-nmeta-cmd-metrics,payloads-nmeta-no-valuevstopics-nmeta-no-value, the*-defidpairs. Near-duplicates rather than identical, and not definition rules, so they belong with the Clarify which components of a Sparkplug metric are mandatory and which are optional #446 matrix rather than here.payloads-mmeta-metric-defs, which does not exist; the real rule ispayloads-mmeta-add, and the Topics chapter states no metric rule for NMMETA/DMMETA, so Chapter 6 stays canonical there.Items 1, 2 and 4 want a TCK issue of their own once NMETA/DMETA handling exists; 5 goes to #446 and 7 to #663.