Skip to content
AI-driventedge-dot is developed largely by AI coding agents, and it is alpha software. Check what it does before you rely on it, and report what you find.

Reporting-policy test vectors (contract §5.3)

vectors.json pins the behaviour of the reporting policy for one point. The Rust SDK (impl/rust/crates/sdk/src/report.rs) and the C SDK (impl/c/sdk/src/report.c) both run every vector in their unit tests. The file is how the two implementations are kept identical below the conformance suite.

Each vector has these fields:

FieldMeaning
nameWhat the vector shows.
policyThe point’s effective report table, after inheritance, exactly as it would appear in a configuration.
pushedtrue for a subscribed (pushed) point, and false (the default) for a polled one. Only pushed points ask for heartbeat reads.
stepsEvents in time order. at is the monotonic time in milliseconds since the point’s state was created.

A step is one of the following:

StepMeaningChecked
{"at": t, "sample": {...}}A reading is offered to the policy.publish
{"at": t, "tick": true}A pass of the runtime loop.publish, read
{"at": t, "no_data": true}A heartbeat read returned nothing for the point (Rust Unsupported or no sample; C TDOT_READ_NO_DATA).—
{"at": t, "reset": true}The point’s state is reset: a reload, a device reconnect or an MQTT session restore.—

A sample has an id, which names it in the expectations, and an optional quality ("good" by default, or "bad" or "stale"). It carries one of these value fields:

FieldMeaning
numA number (value_repr = "number").
nantrue for a NaN number. The envelope carries it as JSON null.
boolA boolean.
strA string (value_repr = "string"), including 64-bit integers outside the safe range.
rawHex bytes, for a point with no decoded value (raw mode, or a bad sample).

A sample with a src field is replayed (§5.3 rule 7): src is its source time in Unix milliseconds, and the policy measures its intervals on it. at is still the runtime time it arrives at. A replayed step’s publish can name two ids: a held reading the replay released, then the sample itself.

A step’s expectations are:

ExpectationMeaning
publishThe ids of the samples the policy publishes as a result of the step, in order. The default is []. A held sample is named by its own id, and it is published with its own ts. seq is the position in the published sequence, so it is gap-free by construction.
readTick steps only: whether the policy asks the runtime for an on-demand heartbeat read of the point. The default is false.