Skip to content

[#665] Make the Topics chapter canonical, and reconcile the metric definition rules with the META messages - #666

Merged
wes-johnson merged 10 commits into
eclipse-sparkplug:developfrom
wes-johnson:665-tck-birth-datatype
Dec 5, 2026
Merged

wes-johnson merged 10 commits into
eclipse-sparkplug:developfrom
wes-johnson:665-tck-birth-datatype

Conversation

@wes-johnson

@wes-johnson wes-johnson commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

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-req required the datatype in NBIRTH and DBIRTH, directly against topics-nbirth-no-metadata and topics-dbirth-no-metadata. SessionEstablishmentTest enforced 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.adoc still said every Metric must include a Sparkplug Datatype in the NBIRTH or DBIRTH. operational-behavior-data-publish-node-metric-datatype and -device-metric-datatype required 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-birth said a Command Definition "MUST only be included in NBIRTH or DBIRTH messages" while topics-nmeta-cmd-metrics requires 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-requirement said "NBIRTH and DBIRTH messages MUST include both a metric name and alias" — wrong, and against topics-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-uniqueness is scoped to the META, where an alias is assigned, and payloads-name-requirement is 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.

Removed from Chapter 6 Relationship to its Topics twin
payloads-nmeta-metric-defs identical to topics-nmeta-metrics
payloads-dmeta-metric-defs identical to topics-dmeta-metrics
payloads-nbirth-metrics topics-nbirth-metrics + a second copy of topics-nbirth-no-metadata
payloads-nrebirth-metrics topics-nrebirth-metrics + a second copy of topics-nrebirth-no-metadata
payloads-dbirth-metrics topics-dbirth-metrics + a second copy of topics-dbirth-no-metadata
payloads-drebirth-metrics topics-drebirth-metrics + a second copy of topics-drebirth-no-metadata
payloads-metric-datatype-req contradicted them

None of the seven had a TCK test; payloads-metric-datatype-req had the only one, repointed in commit 1.

Identifier changes

Removed (11), added (4), net 664 → 657 ids. Four of the removals are renames:

Old New Why
payloads-command-definition-birth payloads-command-definition-meta named a message the rule no longer mentions
operational-behavior-command-definition-birth operational-behavior-command-definition-meta same
payloads-alias-birth-requirement payloads-alias-assigned states a case, not a message type
payloads-alias-data-cmd-requirement payloads-alias-not-assigned same

Seven 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:

  • the two datatype checks repointed at the no-metadata assertions, through setResultIfNotFail so 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 via hasDatatype() && 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;
  • the BIRTH alias 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.

Verification

  • ./gradlew build successful; :tck:test --rerun-tasks 10/10.
  • Broken link:# anchors: 11 at base, 11 at head.
  • tck-id appearance anomalies — ids not appearing exactly twice across the .adoc set, by an ad-hoc script, not a repo tool: 7 at base, 7 at head.
  • Distinct tck-ids 664 → 657, matching the table above with no collateral.
  • Assertion text shared between Chapters 4 and 6: 2 exact duplicates and 4 cases where the Chapter 6 text was its Topics twin plus one sentence → 0 and 0. Name-matched topics-X/payloads-X pairs 23 → 19.
  • tck/assertion_check.py output unchanged from the baseline, verified by running it in a worktree at upstream/develop: one pre-existing ID_PAYLOADS_NBIRTH_REBIRTH_REQ entry for SessionEstablishmentTest and one pre-existing ID_PAYLOADS_METRIC_DATATYPE_VALUE_TYPE entry for SendComplexDataTest, identical at both revisions.
  • Every removed id is absent from the regenerated Requirements.java, and every renamed one has its TCK references updated, so the TCK compiles.
  • git diff --check clean; no added prose line over 100 columns.

Scope and known gaps

  • One place where the canonical chapter is the weaker statement. Topics says a metric is "identified either by its alias … or otherwise by its metric name"; payloads-alias-assigned adds "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.
  • NMMETA/DMMETA is a deliberate exception to "Topics is canonical". The datatype rules contradict each other across chapters, and the TCK enforces the wrong side #665's list names payloads-mmeta-metric-defs, which does not exist; the real rule is payloads-mmeta-add, and the Topics chapter states no metric rule for NMMETA/DMMETA, so Chapter 6 stays canonical there.
  • 19 near-duplicate topics-X/payloads-X pairs remain (payloads-nmeta-cmd-metrics vs topics-nmeta-cmd-metrics, the *-defid pairs, others). Not definition rules; merging them belongs with the Clarify which components of a Sparkplug metric are mandatory and which are optional #446 matrix.
  • Rebirth rate limiting is not solved here. Commit 3 makes a previously unevaluatable rule live, and a mismatch is not self-curing: the rebirth re-reports the same declaration. The two assertions defer to the Rebirth Requests section and carry a non-normative note; the actual bound is Nothing bounds how often a Host Application may send Rebirth Requests #663.
  • Two TCK coverage gaps. Nothing scores 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 of payloads-alias-assigned. Both want following up separately.
  • topics-nrebirth-no-metadata and topics-drebirth-no-metadata remain unscored, as before this PR.

@wes-johnson
wes-johnson force-pushed the 665-tck-birth-datatype branch from f733173 to 1df7f50 Compare December 2, 2026 01:24
@wes-johnson wes-johnson changed the title [#665] Stop the TCK requiring a datatype in BIRTH messages [#665] Make the Topics chapter canonical for the metric datatype rules Dec 2, 2026
…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.
@wes-johnson
wes-johnson force-pushed the 665-tck-birth-datatype branch from 93d83f9 to 54683cc Compare December 2, 2026 02:40
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".
@wes-johnson wes-johnson changed the title [#665] Make the Topics chapter canonical for the metric datatype rules [#665] Make the Topics chapter canonical, and reconcile the metric definition rules with the META messages Dec 2, 2026
@wes-johnson
wes-johnson requested a review from ckienle December 2, 2026 03:28

@ckienle ckienle left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. 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.
  2. payloads-name-requirement now requires a name in every metric of a definition-carrying message, which includes NMMETA/DMMETA, while payloads-mmeta-update and payloads-mmeta-delete let 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)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@wes-johnson

Copy link
Copy Markdown
Contributor Author

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. payloads-alias-data-cmd-requirement named NCMD and DCMD explicitly; when I generalised it to payloads-alias-not-assigned I scoped both rules to "a value-carrying message", and the spec only ever uses that term for the BIRTH, REBIRTH and DATA messages. So CMD fell out, and NRESP/DRESP were never covered by either the old rule or the new one.

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:

…any message other than an NMETA, NMMETA, DMETA, or DMMETA that reports or targets that metric MUST identify it by its alias and MUST omit its metric name.

Defining by exclusion rather than by enumeration: the META messages define a metric and have their own identification rules (topics-nmeta-metrics, payloads-mmeta-update, payloads-mmeta-delete), and everything else identifies one. That covers CMD and RESP without a list to keep in sync.

On checkAliasInData: fixed the unconditional break, so it checks every metric rather than only the first, and moved it to setResultIfNotFail so a later conforming message can't erase a failure. It still only tests that exactly one identifier is present rather than the actual rule — the TCK has no NMETA/DMETA handling, so it cannot know which metrics were assigned an alias. Same limitation as topics-nmeta-metrics being unscored; both are in the PR description's known-gaps list.

Build green, 10/10 unit tests, anchors and tck-id anomalies unchanged from baseline, assertion_check.py output unchanged (the two pre-existing entries). Static review only on your side is fine — the TCK still can't be run end to end here either.

@ckienle ckienle left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-metrics and payloads-alias-assigned.
  • payloads-name-requirement is 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. checkAliasInData checks every metric and uses setResultIfNotFail.

Nit, no change needed: the Components:62 reflow leaves a short "request. Commands" line.

Approving.

@wes-johnson
wes-johnson merged commit 6965984 into eclipse-sparkplug:develop Dec 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants