Repository navigation
[#665] Make the Topics chapter canonical, and reconcile the metric definition rules with the META messages - #666
Conversation
f733173 to
1df7f50
Compare
…ssages SessionEstablishmentTest required the Metric datatype field in an NBIRTH and a DBIRTH, in two places. payloads-metric-datatype-req was scored by requiring every metric to carry it. That assertion contradicts topics-nbirth-no-metadata and topics-dbirth-no-metadata, which say a BIRTH MUST NOT convey a metric datatype because it is conveyed only in the META messages. Those two checks now score the no-metadata assertions instead, inverted to require that no metric carries the field, through setResultIfNotFail so one offending BIRTH is not erased by a later conforming one. Neither assertion had a test before this. topics-nbirth-metrics and topics-dbirth-metrics carried the same superseded rule a second time, failing a metric with no datatype. Their requirement text asks only that each metric include its current value and be identified by alias or name, so the datatype term is dropped. Without this the two checks would be mutually unsatisfiable and a conforming Edge Node would still fail, under a different assertion. The two new @SpecAssertion entries name PAYLOADS_DESC_NBIRTH and PAYLOADS_DESC_DBIRTH, the sections the audit actually places these assertions in. An earlier revision named the TOPICS_BIRTH_MESSAGE_* sections, which compile but do not bind, so the coverage report still reported both assertions as uncovered and listed the annotations as unmatched. The DBIRTH entry sits with the other DBIRTH assertions on checkDBirth rather than on checkNBirth. The specification side of this contradiction, including the removal of payloads-metric-datatype-req itself, is handled by the commits that follow. The broader Chapter 4 and Chapter 6 duplication stays with Verified by executing both predicates together against hand-built metrics: a conforming BIRTH metric now satisfies both assertions, one carrying a Metric datatype fails the no-metadata rule while still satisfying the metrics rule, and a metric with no value still fails the metrics rule. The coverage report now lists both assertions as covered and no longer lists the annotations as unmatched.
…ric datatype rules Seven assertions in the Payloads chapter restated rules the Topics chapter already makes. Six of them were word for word identical to their Topics twin, and the seventh contradicted them. Removed, each replaced by a non-normative pointer to the Topics section that is normative for the message: payloads-nbirth-metrics = topics-nbirth-metrics payloads-nrebirth-metrics = topics-nrebirth-metrics payloads-dbirth-metrics = topics-dbirth-metrics payloads-drebirth-metrics = topics-drebirth-metrics payloads-nmeta-metric-defs = topics-nmeta-metrics payloads-dmeta-metric-defs = topics-dmeta-metrics The four BIRTH assertions also each carried a second copy of "The <MESSAGE> MUST NOT be used to convey metric datatype, properties, or metadata", which is topics-nbirth-no-metadata and its three siblings - the assertions the preceding commit points the TCK at. payloads-metric-datatype-req required the datatype in NBIRTH and DBIRTH messages, directly contradicting those four. The datatype is conveyed in the META messages, as topics-nmeta-metrics and topics-dmeta-metrics require, so the rule is dropped here and a non-normative comment on the Metric datatype field says where to find it. None of the seven had a TCK test. payloads-metric-datatype-req had the only one, and the preceding commit repointed it at the no-metadata assertions, so nothing scores them and nothing references the generated constants. The TCK still compiles.
… Chapters 1 and 5 Two more places still describe a metric's datatype as travelling in the BIRTH, which it has not since the metadata separation moved it to the META messages. Chapter 1 said every Metric must include a Sparkplug Datatype in the NBIRTH or DBIRTH message; it is the NMETA or DMETA. operational-behavior-data-publish-node-metric-datatype and -device-metric-datatype required that the datatype of a metric "in an NBIRTH"/"in an DBIRTH" not change in subsequent NDATA/DDATA messages. Neither message carries the Metric datatype field any more, so as written the rule can never be evaluated. They now compare the datatype of the value carried in NDATA/DDATA against the datatype the NMETA or DMETA declares for that metric. The requirement that the Host Application request a rebirth on a mismatch is unchanged.
…ft behind Review of the preceding commit found three problems with the pointers that replaced the seven removed assertions. The pointer on the Metric datatype field sent readers to the NMMETA and DMMETA sections of the Topics chapter for the rule that an incremental metric definition carries a datatype. Those sections do not state it; payloads-mmeta-add does, in this chapter. The pointer now names the section that actually holds each rule, and the NMMETA/DMMETA half points here rather than at the Topics chapter. The six message pointers asserted that a Topics section "is normative for" a message. The specification defines normativity per statement, not per section - "All normative statements in this document are highlighted in yellow text" - and the claim was false where it stood, because the Payloads NBIRTH section still carries nine normative statements of its own. They now use the form already used elsewhere in this chapter, "as described in the link:#...[...] section", and name the target by its rendered title so a reader can see a chapter boundary is being crossed. The four message pointers also carried a bare "MUST NOT" outside a highlighted assertion, which reads as untagged normative prose - the problem eclipse-sparkplug#651 was raised about. Reworded to "does not convey". Also states the division of labour once, where the per-message sections begin, so the next editor has a rule to follow instead of inferring it from seven bullets, and corrects "a NBIRTH"/"a NREBIRTH" to "an", which the specification uses 19 to 3 and 5 to 1.
Review found a second instance of the contradiction this issue is about, in the Command Definition rules, which the earlier commits did not touch. payloads-command-definition-birth required that a Command Definition "MUST only be included in NBIRTH or DBIRTH messages", while topics-nmeta-cmd-metrics and topics-dmeta-cmd-metrics require a full NMETA or DMETA to include the definition of every Command-datatype metric. Those cannot both be satisfied. payloads-command-definition- datatype compounded it: a Command Definition must set the Metric datatype to Command, which topics-nbirth-no-metadata forbids a BIRTH from carrying. A Command Definition is a metric definition, so it belongs with the other metric definitions in the META. The rule now names the NMETA, NMMETA, DMETA and DMMETA, matching what the Topics chapter already required, and payloads-command-definition-datatype becomes consistent without changing because the META is where a datatype is carried. The two rules that resolved a Command Request or Response against "the corresponding BIRTH Command Definition" follow it to the NMETA or DMETA.
…iling Command metrics Two defects review found in the TCK change at the head of this branch. countDataType counted only metrics carrying a Metric datatype, but topics-nbirth-no-metadata and topics-dbirth-no-metadata forbid datatype, properties and metadata. A BIRTH whose metrics carried a properties or metadata submessage scored PASS. That is worse than no test, because the assertion is now reported as covered, so the two thirds of the rule that were unchecked were hidden rather than listed as uncovered. Renamed to countMetadata and extended to all three fields. Utils.hasValue(Metric) recognised a Command metric only through the guard hasDatatype() && getDatatype() == Command, then fell through to the TypedValue at field 13. A Command carries field 14. Now that a message conveying no metric structure carries no Metric datatype to read, a conforming Command metric would score as having no value and fail topics-nbirth-metrics and operational-behavior-data-publish-nbirth-values - the same class of false failure this branch set out to remove. The command field is now tested first and on its own, and a metric that declares the Command datatype without carrying one is reported as having no value.
93d83f9 to
54683cc
Compare
The preceding commit moved the Command Definition rules in the Payloads chapter to the META messages but left the rest of the Command family behind, which replaced one contradiction with another. operational-behavior-command-definition-birth still required that an Edge Node "MUST include every command it supports as a Command metric in the NBIRTH or DBIRTH", directly against the rule the preceding commit had just rewritten. It now names the NMETA and DMETA, and is renamed to operational-behavior-command-definition-meta so the identifier stops naming a message the rule no longer mentions. payloads-command-definition-birth is renamed to -meta for the same reason. Neither id is referenced by the TCK. Also repointed, all of which still described Command metrics as travelling in a BIRTH: - the Commands section opening, where custom command endpoints were "declared in an NBIRTH or DBIRTH message"; - the Typed Commands introduction, "includes as Command metrics in its BIRTH"; - the NCMD and DCMD sections, which invoked a Command "included in the NBIRTH" and "supplied in the DBIRTH"; - the inline schema comments on Command.arguments, Command.results and Metric.command. A sweep for a Command rule still tied to a BIRTH now returns nothing.
…he BIRTH payloads-alias-birth-requirement required that "NBIRTH and DBIRTH messages MUST include both a metric name and alias". That is wrong, and it contradicted topics-nbirth-metrics and topics-dbirth-metrics, which identify a metric either by its alias, if the referenced NMETA assigned one, or otherwise by its metric name. It is the alias twin of the datatype contradiction this issue was raised about. The alias to name binding is established in the NMETA or DMETA that defines the metric. Aliases are optional and are assigned per metric. If an alias was assigned, the messages that report that metric identify it by the alias and omit the name; if none was assigned, they identify it by the name. The four rules in this block now say that: - payloads-alias-uniqueness scoped to the NMETA and DMETA, which is where an alias is assigned, rather than to the NBIRTH and DBIRTH; - payloads-alias-birth-requirement states the assigned case, for every message that reports the metric rather than for the BIRTH alone; - payloads-alias-data-cmd-requirement states the complementary unassigned case, likewise for every message rather than for NDATA, DDATA, NCMD and DCMD alone; - payloads-name-requirement conditions the name on whether the META assigned an alias, instead of on whether "aliases are being used". The alias field description and its non-normative comments follow. In the TCK, the NBIRTH and DBIRTH check rejected a metric carrying an alias without a name, which the corrected rule requires, so it would have failed every conforming Edge Node. It now requires exactly one identifier, rejecting both and neither. Two log lines that quoted the superseded wording are updated. The TCK cannot yet check the rule faithfully, because it has no NMETA or DMETA handling and so cannot know which metrics were assigned an alias.
…ame them for it Review of the preceding commit found it overreached. "Every subsequent message that reports that metric MUST identify it by its alias and MUST omit its metric name" also covers the NMETA, NMMETA, DMETA and DMMETA, which is where the name must always appear, because the name is what the alias is bound to. As written it contradicted topics-nmeta-metrics and topics-dmeta-metrics, which require a full META to include the metric name, and payloads-mmeta-add, which requires an ADD metric to include it. payloads-name-requirement had the same defect from the other direction: it let a META omit the name whenever an alias was assigned. All three now scope the condition to a value-carrying message, the term the specification already uses for the NBIRTH, NREBIRTH, DBIRTH, DREBIRTH, NDATA and DDATA, and payloads-name-requirement states the definition-carrying case explicitly. Both ids named a message type their rule no longer mentions, so they are renamed to say which case they state: payloads-alias-birth-requirement -> payloads-alias-assigned payloads-alias-data-cmd-requirement -> payloads-alias-not-assigned Their TCK references follow. Also corrects the two inline schema comments on Metric.name and Metric.alias, which still described the name as "Required in BIRTH messages" and the alias as "tied to name on BIRTH and included in all later DATA messages".
ckienle
left a comment
There was a problem hiding this comment.
Thanks Wes. The direction is right and most of this lands well: the dedup pointers resolve to the right Topics sections, scoring the no-metadata assertions through setResultIfNotFail is correct, and countMetadata and the Utils.hasValue Command fix are both good catches.
Two things still contradict the new alias rules, so I'm requesting changes.
Required
- The TCK BIRTH metric checks still require a name (SessionEstablishmentTest:653 and :892). Combined with the new exactly-one-identifier check, every Edge Node that uses aliases fails one of the two assertions. Inline.
payloads-name-requirementnow requires a name in every metric of a definition-carrying message, which includes NMMETA/DMMETA, whilepayloads-mmeta-updateandpayloads-mmeta-deletelet those metrics be identified by alias alone. Inline.
Optional
3. The non-normative rebirth note points at rate limiting that the Rebirth Requests section doesn't contain (inline at Operational_Behavior:1682).
4. "MUST match the datatype declared" can't be evaluated from a protobuf NDATA/DDATA alone (inline at :1649; same at :1676).
5. Some BIRTH wording is left in the Command family: the Command.status schema comment (Payloads:251, inline), Components:62 ("included in the BIRTH certificate"), and Operational_Behavior:1781/:1794, where the NCMD/DCMD metric name is "included in the associated NBIRTH/DBIRTH". With alias-only BIRTHs the name now appears only in the META.
6. NCMD/DCMD identification no longer has a rule. The old payloads-alias-data-cmd-requirement covered NCMD/DCMD; payloads-alias-assigned and -not-assigned cover only value-carrying messages, which the spec defines as BIRTH, REBIRTH and DATA. SendComplexDataTest.checkAliasInData still evaluates NCMD/DCMD under ID_PAYLOADS_ALIAS_NOT_ASSIGNED, tests "exactly one identifier" rather than that rule, and only ever looks at the first metric because of the unconditional break (pre-existing). Was dropping CMD deliberate? If so, the check should stop scoring CMD topics; if not, the rule needs CMD back.
On your "either … or otherwise" question: I read it as exclusive too, so no conflict there.
Static review only; I didn't build or run the TCK.
| } | ||
|
|
||
| if (!m.hasName() || !Utils.hasValue(m) || !m.hasDatatype()) { | ||
| if (!m.hasName() || !Utils.hasValue(m)) { |
There was a problem hiding this comment.
Required. This line was edited but still fails topics-nbirth-metrics for any metric without a name. Under the corrected rules (payloads-alias-assigned, and topics-nbirth-metrics's own "by its alias … or otherwise by its metric name"), an aliased metric omits its name, and checkPayloadsAliasAndNameRequirement now enforces exactly that. The result is that every aliased Edge Node fails one of the two: alias-only fails this check, and name+alias fails payloads-alias-assigned.
Suggest if (!(m.hasAlias() || m.hasName()) || !Utils.hasValue(m)). The same change is needed at :892 for topics-dbirth-metrics. (The bdSeq lookup above uses getName(), which is fine as long as bdSeq is never aliased.)
There was a problem hiding this comment.
Fixed in a0226a9, both sites, with your predicate.
Confirmed the trap before changing anything: an aliased Edge Node failed topics-nbirth-metrics by omitting the name that payloads-alias-assigned requires it to omit, and failed payloads-alias-assigned if it included it. Mutually unsatisfiable, which is the same failure this branch opened with for datatype — I reintroduced it for aliases two commits after fixing it for datatype.
if (!(m.hasAlias() || m.hasName()) || !Utils.hasValue(m)) {You're right about bdSeq — the lookup above uses getName() and bdSeq is never aliased, so I left it.
| MQTT publishers a defined folder should always remain a folder. | ||
| ** [tck-testable tck-id-payloads-name-requirement]#[yellow-background]*[tck-id-payloads-name-requirement] The | ||
| name MUST be included with every metric unless aliases are being used.*# | ||
| name MUST be included with every metric in a message that conveys metric definitions. In a |
There was a problem hiding this comment.
Required. NMMETA/DMMETA are messages that convey metric definitions, so this now requires a name on every UPDATE and DELETE metric. But payloads-mmeta-update and payloads-mmeta-delete (:2049–2054) let those be identified "by its existing alias, if an alias was assigned". Suggest scoping the first sentence to the full NMETA/DMETA and to ADD operations in NMMETA/DMMETA, e.g. "The name MUST be included with every metric in a full NMETA or DMETA and with every ADD metric in an NMMETA or DMMETA."
There was a problem hiding this comment.
Fixed in a0226a9, with your wording:
The name MUST be included with every metric in a full NMETA or DMETA and with every ADD metric in an NMMETA or DMMETA. In any other message the name MUST be included unless an alias was assigned to that metric in the NMETA or DMETA.
Verified against payloads-mmeta-update and payloads-mmeta-delete at :2049–2054 — both identify by existing alias when one was assigned, so the old phrasing contradicted them directly.
The second sentence also does the work for your point 6: "any other message" rather than "a value-carrying message" is what brings NCMD/DCMD back into scope.
| ** Non-normative comment: a mismatch is evaluated against the declaration in the NMETA or DMETA, | ||
| which a rebirth does not change, so an Edge Node that keeps publishing the same mismatched value | ||
| will keep mismatching after the rebirth it triggered. A Host Application is expected to apply the | ||
| rate limiting described in the Rebirth Requests section rather than to request a rebirth for every |
There was a problem hiding this comment.
Optional: the Rebirth Requests section doesn't describe any rate limiting (the only rate-limit text in this chapter is the STATE-restore backoff at :413), and per the PR description the actual bound is #663. As written, this sends readers to a section that won't help them. Suggest "A Host Application is expected to limit the rate at which it requests rebirths for this condition rather than requesting one for every offending message" until #663 lands.
There was a problem hiding this comment.
Taken, in a0226a9. Checked the Rebirth Requests section and you're right — no rate-limit text in it at all; the only rate language in the chapter is the STATE-restore backoff at :413 and operational-behavior-host-partial-rebirth-rate at :1300, which is a SHOULD scoped to partial-subscription Hosts.
Now states it directly rather than pointing somewhere that can't help:
A Host Application is expected to limit the rate at which it requests rebirths for this condition rather than to request one for every offending message.
The normative cross-reference to the section stays, since that part is accurate; it's only the rate-limiting claim that moved into the comment. #663 remains the place the real bound lands.
| subsequent NDATA messages. If it does, the Host Application MUST send a rebirth request to the | ||
| offending Edge Node.*# | ||
| all metrics defined in an NMETA, the datatype of the value carried in subsequent NDATA messages | ||
| MUST match the datatype declared for that metric in the NMETA. If it does not, the Host Application |
There was a problem hiding this comment.
Optional: after #664 a protobuf NDATA carries no Metric datatype, so the only thing a Host can observe is the TypedValue variant, and Int8/Int16/Int32/UInt8/UInt16 all share int_value. "Match the datatype declared" can't be evaluated at that granularity. Suggest something closer to the old "corresponding protobuf datatype": "…the value carried in subsequent NDATA messages MUST use the TypedValue field that the datatype declared in the NMETA maps to." The same applies to the DDATA twin at :1676.
There was a problem hiding this comment.
Good catch, and the most useful finding of the five — taken in a0226a9 for both the NDATA and DDATA rules.
You're right that it isn't evaluable: the schema has one int32_value field at :208, and Int8/Int16/Int32/UInt8/UInt16 all land in it, so a Host has only the variant to look at. My rewrite lost exactly what the original "and corresponding protobuf datatype" was carrying, while I was busy fixing the half of that sentence that named the BIRTH.
Now reads:
For all metrics defined in an NMETA, the value carried in subsequent NDATA messages MUST use the TypedValue field that the datatype declared for that metric in the NMETA maps to.
Same for the DDATA twin.
| repeated Metric arguments = 1; // Input argument definitions (NMETA/DMETA) or supplied argument values (NCMD/DCMD) - omitted for commands that accept no inputs | ||
| repeated Metric results = 2; // Result/output argument definitions (NMETA/DMETA) or returned result values (NRESP/DRESP) - omitted for commands that return no outputs | ||
| string correlation_id = 3; // Set on an NCMD/DCMD request and echoed unchanged in the corresponding NRESP/DRESP response | ||
| Status status = 4; // Execution status - present in NRESP/DRESP responses, omitted in BIRTH definitions and CMD requests |
There was a problem hiding this comment.
Optional: one Command schema comment still says BIRTH: "omitted in BIRTH definitions" should be "META definitions". Also still referring to BIRTH: Components:62 ("included in the BIRTH certificate") and Operational_Behavior:1781/:1794, where the NCMD/DCMD metric name is "included in the associated NBIRTH/DBIRTH". With alias-only BIRTHs, the name now appears only in the META.
There was a problem hiding this comment.
All four fixed in a0226a9:
| Where | Was | Now |
|---|---|---|
Payloads:251 (Command.status) |
"omitted in BIRTH definitions" | "omitted in META definitions" |
Components:62 |
"included in the BIRTH certificate alongside the Edge Node's or Device's other metrics" | "included in the NMETA or DMETA alongside … other metric definitions" |
Operational_Behavior -ncmd-metric-name |
"a metric name that was included in the associated NBIRTH message" | "identify a metric that was defined in the associated NMETA" |
| same, DCMD twin | DBIRTH | DMETA |
The two non-normative "should be resilient to receiving metrics names that were not included in the NBIRTH/DBIRTH" bullets under those assertions followed.
My sweep for this missed them because I grepped Command.*BIRTH and these say "BIRTH certificate", "BIRTH definitions" and "metric name … included in the associated NBIRTH" — none of which put the two words near each other.
…and CMD identification Review found the alias rewrite had two unsatisfiable pairs and had narrowed a rule that should not have narrowed. The TCK BIRTH metric checks still required a name, so an Edge Node that uses aliases failed either topics-nbirth-metrics, by omitting the name the corrected rules require it to omit, or payloads-alias-assigned, by including it. Both call sites now accept either identifier. payloads-name-requirement required a name on every metric of a message that conveys metric definitions, which includes the NMMETA and DMMETA, against payloads-mmeta-update and payloads-mmeta-delete, which identify those metrics by their existing alias when one was assigned. It now names the full NMETA or DMETA and the ADD operation specifically. payloads-alias-assigned and payloads-alias-not-assigned were scoped to a value-carrying message, which the specification uses for the BIRTH, REBIRTH and DATA messages only. That silently dropped NCMD and DCMD, which the rule they replaced covered, and never reached NRESP or DRESP. Both now apply to any message other than an NMETA, NMMETA, DMETA, or DMMETA, which is the set that identifies a metric rather than defining it. Also from review: - The node and device data-publish rules said a value's datatype "MUST match the datatype declared". A protobuf NDATA carries no Metric datatype and Int8, Int16 and Int32 share int32_value, so that cannot be evaluated from the wire. They now require the value to use the TypedValue field the declared datatype maps to. - The non-normative rebirth comment pointed at rate limiting in the Rebirth Requests section, which does not describe any. It now states the expectation directly, pending eclipse-sparkplug#663. - Three more places still placed Command metrics in a BIRTH: the Command.status schema comment, the Sparkplug Command component description, and operational-behavior-commands-ncmd-metric-name and its DCMD twin, which asked for a metric name "included in the associated NBIRTH". With alias-only BIRTHs the name is in the META. SendComplexDataTest.checkAliasInData scored only the first metric, because of an unconditional break, and could be erased by a later conforming message. It now checks every metric through setResultIfNotFail. It still tests only that exactly one identifier is present, because the TCK has no META handling and so cannot know which metrics were assigned an alias.
|
Thanks Chad — all six addressed in a0226a9. Replies inline on the five threads; answering your point 6 here since it wasn't anchored. No, dropping CMD was not deliberate. It's a straight regression from my rename. I'd reached for "value-carrying" to fix the previous round of overreach — the rules had been worded "every subsequent message", which swept in the META messages where the name must always appear. Both rules now say what I should have said then:
Defining by exclusion rather than by enumeration: the META messages define a metric and have their own identification rules ( On Build green, 10/10 unit tests, anchors and tck-id anomalies unchanged from baseline, |
ckienle
left a comment
There was a problem hiding this comment.
Thanks Wes, all six points are addressed in a0226a9:
- SessionEstablishmentTest :653/:893 now accept alias or name, so aliased Edge Nodes pass both
topics-n/dbirth-metricsandpayloads-alias-assigned. payloads-name-requirementis scoped to full NMETA/DMETA and ADD metrics, so it no longer conflicts with the MMETA update/delete rules.- The rebirth note no longer points at rate limiting that Rebirth Requests doesn't define.
- The datatype rules are now checkable (TypedValue field the declared datatype maps to).
- The leftover BIRTH wording is fixed (Payloads:251, Components:62, NCMD/DCMD metric-name rules).
- The alias rules cover every message other than the META family again, which brings back CMD and adds RESP.
checkAliasInDatachecks every metric and usessetResultIfNotFail.
Nit, no change needed: the Components:62 reflow leaves a short "request. Commands" line.
Approving.
Closes #665.
The metadata separation moved a metric's definition — its datatype, alias, properties, metadata and Command signature — out of the BIRTH and into the NMETA/NMMETA and DMETA/DMMETA. The rules did not all follow. Four chapters and the TCK carried overlapping and in places directly opposed versions of where a definition lives, and the TCK enforced the superseded side.
Two things happen here. The Topics chapter becomes the single place a per-message rule is stated, and the definition rules that still named the BIRTH are repointed at the META.
Nine commits. The last six come from review passes over the earlier ones; findings that came out of review are called out as such below.
What changed, by family
Datatype
payloads-metric-datatype-reqrequired the datatype in NBIRTH and DBIRTH, directly againsttopics-nbirth-no-metadataandtopics-dbirth-no-metadata.SessionEstablishmentTestenforced that side, so an Edge Node that correctly omitted the field failed the TCK and one that wrongly included it passed. The two checks now score the no-metadata assertions, which had no test at all before this.Sparkplug_1_Introduction.adocstill said every Metric must include a Sparkplug Datatype in the NBIRTH or DBIRTH.operational-behavior-data-publish-node-metric-datatypeand-device-metric-datatyperequired a datatype "in an NBIRTH" not to change in later NDATA — unevaluatable, since neither message carries the field. Both now compare the value's datatype against the NMETA/DMETA declaration.Commands (found in review)
payloads-command-definition-birthsaid a Command Definition "MUST only be included in NBIRTH or DBIRTH messages" whiletopics-nmeta-cmd-metricsrequires a full NMETA to include every Command-datatype metric definition. Unsatisfiable. A Command Definition is a metric definition, so the whole family moves to the META: the assertion,operational-behavior-command-definition-birth(a second normative MUST that the first fix initially left contradicting it), the Commands and Typed Commands prose, the NCMD/DCMD invocation text, and three inline schema comments.Aliases (found in review)
payloads-alias-birth-requirementsaid "NBIRTH and DBIRTH messages MUST include both a metric name and alias" — wrong, and againsttopics-nbirth-metrics, which identifies a metric by its alias or its name. The alias-to-name binding is established in the META and is optional per metric. If an alias was assigned, a value-carrying message identifies the metric by the alias and omits the name; if not, by the name.payloads-alias-uniquenessis scoped to the META, where an alias is assigned, andpayloads-name-requirementis conditioned on the META assignment rather than on "whether aliases are being used".Deduplication
Seven Payloads assertions restated rules the Topics chapter already makes. Each is replaced by a pointer to the Topics section that states it.
payloads-nmeta-metric-defstopics-nmeta-metricspayloads-dmeta-metric-defstopics-dmeta-metricspayloads-nbirth-metricstopics-nbirth-metrics+ a second copy oftopics-nbirth-no-metadatapayloads-nrebirth-metricstopics-nrebirth-metrics+ a second copy oftopics-nrebirth-no-metadatapayloads-dbirth-metricstopics-dbirth-metrics+ a second copy oftopics-dbirth-no-metadatapayloads-drebirth-metricstopics-drebirth-metrics+ a second copy oftopics-drebirth-no-metadatapayloads-metric-datatype-reqNone of the seven had a TCK test;
payloads-metric-datatype-reqhad the only one, repointed in commit 1.Identifier changes
Removed (11), added (4), net 664 → 657 ids. Four of the removals are renames:
payloads-command-definition-birthpayloads-command-definition-metaoperational-behavior-command-definition-birthoperational-behavior-command-definition-metapayloads-alias-birth-requirementpayloads-alias-assignedpayloads-alias-data-cmd-requirementpayloads-alias-not-assignedSeven more assertions keep their id and change text. The repo has no tck-id stability policy and v4.0.0 is unreleased with no implementations; silent removal is the existing precedent (
[#495],[#643]).TCK
Kept to what the spec changes break, plus two defects review found in this branch's own first commit:
setResultIfNotFailso one offending BIRTH is not erased by a later conforming one;countDataType→countMetadata: the rule forbids datatype, properties and metadata, but only the datatype was counted. Worse than uncovered, because the assertion now reports as covered;Utils.hasValue(Metric)recognised a Command only viahasDatatype() && getDatatype() == Command, then fell through to the TypedValue at field 13; a Command carries field 14. With the datatype gone from BIRTH, a conforming Command metric scored as valueless;Verification
./gradlew buildsuccessful;:tck:test --rerun-tasks10/10.link:#anchors: 11 at base, 11 at head.tck-idappearance anomalies — ids not appearing exactly twice across the.adocset, by an ad-hoc script, not a repo tool: 7 at base, 7 at head.tck-ids 664 → 657, matching the table above with no collateral.topics-X/payloads-Xpairs 23 → 19.tck/assertion_check.pyoutput unchanged from the baseline, verified by running it in a worktree atupstream/develop: one pre-existingID_PAYLOADS_NBIRTH_REBIRTH_REQentry forSessionEstablishmentTestand one pre-existingID_PAYLOADS_METRIC_DATATYPE_VALUE_TYPEentry forSendComplexDataTest, identical at both revisions.Requirements.java, and every renamed one has its TCK references updated, so the TCK compiles.git diff --checkclean; no added prose line over 100 columns.Scope and known gaps
payloads-alias-assignedadds "MUST omit its metric name". I read "either … or otherwise" as exclusive so I do not think these conflict, but it is the one asymmetry this PR leaves and it is worth a reviewer's eye.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.topics-X/payloads-Xpairs remain (payloads-nmeta-cmd-metricsvstopics-nmeta-cmd-metrics, the*-defidpairs, others). Not definition rules; merging them belongs with the Clarify which components of a Sparkplug metric are mandatory and which are optional #446 matrix.topics-nmeta-metrics/topics-dmeta-metrics, so no test checks that a metric definition declares a datatype. And the TCK has no NMETA/DMETA handling, so it cannot know which metrics were assigned an alias — "exactly one identifier" is the closest honest approximation ofpayloads-alias-assigned. Both want following up separately.topics-nrebirth-no-metadataandtopics-drebirth-no-metadataremain unscored, as before this PR.