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.

Value-mapping test vectors (contract §4.3)

vectors.json pins the behaviour of a point’s value map. The Rust SDK (impl/rust/crates/sdk/src/map.rs) and the C SDK (impl/c/tests/map.c, over impl/c/sdk/src/map.c) both run every vector in their unit tests. This file is how the two implementations are kept identical below the conformance suite, messages included.

maps names the maps the vectors share. Each map is written as it would appear in a point’s map table. The C runner renders it as TOML and loads it through the config loader. An integer with 16 or more digits stays exact on that path.

A read vector maps one decoded value:

FieldMeaning
nameWhat the vector shows.
mapThe name of a map in maps, or a map table inline.
datatypeThe point’s datatype.
transformOptional. The point’s transform, applied to in before the map.
inThe decoded value.
outThe mapped value. Absent when error is set.
errorThe sample’s error text, without the point <id>: prefix the runtime adds.

in and out carry one of these fields:

FieldMeaning
numA number.
nantrue for a NaN number.
boolA boolean.
strA string, including a 64-bit integer outside the safe range (§4.1).

A write vector maps one written value back. Both runners go through the SDK’s write path, so the inverse transform and the raw bypass apply as they do for the write verb.

FieldMeaning
name, map, datatype, transformAs for read.
valueThe written value, as a write request’s JSON value.
rawA raw (hex) write in place of value. The C runtime has no raw writes and skips these vectors.
deviceThe value the connector is asked to write. Numbers compare by value.
device_rawFor a raw write: the hex the connector receives.
errorThe write’s failure reason, without the point <id>: prefix.

An invalid vector is a map the loader refuses:

FieldMeaning
mapThe map table, inline.
datatype, modeThe point’s datatype, and "raw" for a raw-mode point.
errorThe message, without the device and point prefix.