Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Offline device Catalogue

The thermostat, RGB lamp, door lock, metered power strip, irrigation controller and coffee machine examples provide authored models and conventional JSON Sample values for local development. Run the regression checks from the repository root.

cargo test --test device_catalogue

The private Rust runner invokes the existing Check plan CLI. Every case has an independent constraint or contract rationale and typed expectations for its native state, disposition, completion and Sample admission or comparison classification. Decisive diagnostics also require the expected source, effective and sample pointer relations. Every expected source acquisition remains visible, including deliberately failed acquisitions. Missing or unexpected source identities fail the runner. Case identities are checked once per plan. Missing, unused or duplicate expectations, unexpected or duplicate observed cases, host failures and malformed or unavailable reports fail the test with the device, variant and case identified where available.

An intentionally rejected Sample retains its native failed disposition and CLI exit 1. It passes the regression test when those results were expected. Completion is checked separately, including the limited thermostat’s known rejection alongside unavailable calibration meaning. Small controlled records exercise identity accounting, and altered admission, completion and diagnostic expectations demonstrate named failures.

These are supplied descriptions and values. They establish neither physical device behaviour nor network protocol interoperability. Each value is checked against its selected data description. No stateful device engine or interaction-sequence assertion is involved. The native meanings follow ADR 0003, Check findings and completeness, ADR 0004, Supplied catalogues and checking scope and ADR 0016, Selected samples with explicit admission and coverage.

Direct Check plans

cargo run -- check --plan examples/thermostat-check/minimal-plan.json --format json
cargo run -- check --plan examples/thermostat-check/rich-plan.json
cargo run -- check --plan examples/thermostat-check/limited-plan.json --format json
cargo run -- check --plan examples/rgb-lamp-check/rich-plan.json
cargo run -- check --plan examples/door-lock-check/rich-plan.json --format json
cargo run -- check --plan examples/power-strip-check/rich-plan.json --format json
cargo run -- check --plan examples/irrigation-check/rich-plan.json --format json
cargo run -- check --plan examples/coffee-machine-check/rich-plan.json

The minimal and rich variants of each family complete Initial Catalogue and Full selected-model checks. Their plans exit 1 because they contain intentional sample rejections. The rich lock plan also compares the minimal lock with the rich one. Both breaking changes are acknowledged, so that case passes with a breaking classification. The limited thermostat combines an invalid bound and missing dependency. Its model checks fail and remain incomplete. Its two undetermined samples and independently rejected sample also remain incomplete.

The limited lamp has only unavailable calibration meaning. Its model and sample cases are undetermined and incomplete, and its plan exits 3. The limited lock combines an invalid numeric bound with an unsupplied credential definition. Its plan exits 1, with failed incomplete model checks, an undetermined credential sample and an admitted complete state sample. Model findings remain distinct from selected-sample admission.

The power strip supplies three supported variants and one limited variant. Its rich model imports repeated outlets and shared meter definitions from an explicitly supplied second document. Its separate copied-requiredness plan imports an Object that requires its own declaration through an absolute pointer, and the copied requirement relocates to the importing outlet under ADR 0036, Copied reference relocation, so that plan exits 0. Its missing plan records the failed acquisition of a needed local dependency and exits 3 while preserving complete independent Sample admissions.

The limited irrigation and coffee models need unsupplied optional calibration meaning. Their model checks are undetermined and incomplete. Samples with absent optional calibration are admitted completely. Present calibration keeps applicable child work incomplete, while a missing required zone array or excessive servings still gives an independent rejection. Both plans exit 1.

All ordinary runs are offline and use existing finite allowances. The plans retrieve nothing and change no input bytes. Copy the complete directory for any family elsewhere, then pass the copied plan path to esdieff check --plan. All sources resolve relative to that plan. The Rust suite repeats every device plan from a temporary copy and checks that the original and copied bytes remain unchanged.

Device and constraint coverage

There are 19 model variants and 116 distinct Sample cases across 20 plans. The thermostat provides three variants and 20 cases, the lamp three variants and 16 cases, the lock three variants and 17 cases, and the power strip four variants and 22 cases. Irrigation adds three variants and 21 cases, and coffee adds three variants and 20 cases. The preserved thermostat entry plan shares the minimal model. The matrix lists actual cases rather than potential capabilities. Sample areas use the existing esdieff.sample/1 inventory from the Sample contract.

Family and variantNamed casesConstraint or contractRequested work
Thermostat, minimal entryComfortable target, Too hot targetFractional number within bounds, above maximumProperty, sample-type-null/1 and sample-numeric/1
Thermostat, minimalTarget lower boundary, Target upper boundary, Target below minimumInclusive exact bounds 5 and 30Property, sample-numeric/1
Thermostat, minimalTarget wrong type, Target unavailableString instead of number, explicit nonnullable targetProperty, sample-type-null/1
Thermostat, richFractional current reading, Current reading unavailableUnconstrained fractional step, nullable sensor readingProperty, sample-type-null/1 and sample-numeric/1
Thermostat, richTarget off half-degree stepExact multiple of 0.5Property, sample-numeric/1
Thermostat, richConfigure heatingRequired target and enumerated mode, absent optional label, exact target stepAction input, sample-map/1, sample-alternatives/1 and sample-numeric/1
Thermostat, richConfigure missing mode, Configure null modeAbsent required entry differs from present disallowed nullAction input, sample-map/1 and sample-type-null/1
Thermostat, richConfigure unknown mode, Configure wrong optional labelRejected enum value, present optional entry with wrong typeAction input, sample-alternatives/1 and sample-type-null/1
Thermostat, richOverheating alarm, Unknown alarm reasonStructured Event output and enumerated reasonEvent output, sample-map/1 and sample-alternatives/1
Thermostat, limitedCurrent reading needs dependency, Configure needs calibrationNeeded referenced meaning is not suppliedProperty and Action input, sample-context/1
Thermostat, limitedConfigure too hot despite missing calibrationIndependent bound rejection with unfinished sibling workAction input, sample-numeric/1, sample-map/1 and sample-context/1
Thermostat, minimal and richCatalogue and selected-model cases named by each planComplete supported model descriptionsInitial Catalogue and Full selected-model
Thermostat, limitedLimited Catalogue, Limited modelTextual numeric maximum is invalid, calibration dependency unavailableInitial Catalogue and Full selected-model, failed and incomplete
RGB lamp, minimalLamp on, Lamp off, Text is not on stateBoolean values and wrong-type rejectionProperty, sample-type-null/1 and sample-text-boolean/1
RGB lamp, minimalBrightness lower boundary, Brightness upper boundary, Brightness above maximumInclusive integer bounds 0 and 100Property, sample-numeric/1
RGB lamp, richRGB channel boundaries, RGB green above maximumRequired integer channels, inclusive bounds 0 and 255, invalid compound valueProperty, sample-map/1 and sample-numeric/1
RGB lamp, richSteady mode, Unknown modeAdmitted and rejected enum valuesProperty, sample-alternatives/1
RGB lamp, richDim red scene, Bright blue scene, Mixed scene has no Choice witnessOne whole Choice witness, exact branch boundaries and rejection of mixed branch constraintsAction input, sample-map/1, sample-alternatives/1, sample-const/1 and sample-numeric/1
RGB lamp, richScene applied output, Scene refused outputRequired Boolean result and const trueAction output, sample-map/1 and sample-const/1
RGB lamp, limitedBrightness needs calibrationUnsupplied selected brightness descriptionProperty, sample-context/1
Door lock, minimalLocked state, Unknown lock stateTwo-state text enumerationProperty, sample-alternatives/1
Door lock, minimalPIN lower length boundary, PIN upper length boundary, PIN too short, PIN has a letterInclusive scalar lengths 4 and 8, anchored digit patternProperty, sample-text-boolean/1
Door lock, richAuthorize Unicode credential, Authorize short Unicode credential, Authorize spaced credentialUnicode scalar length rather than UTF-8 bytes, anchored no-space patternAction input, sample-text-boolean/1 and sample-map/1
Door lock, richAuthorize missing operation, Authorize null credentialAbsent required entry differs from present disallowed nullAction input, sample-map/1 and sample-type-null/1
Door lock, richAuthorization result, Authorization result wrong typeStructured result with required Boolean and enumerated stateAction output, sample-map/1, sample-type-null/1 and sample-alternatives/1
Door lock, richTimestamped locked event, Impossible event dateEstablished date-time and definite calendar rejectionEvent output, sample-abstract-values/1
Door lock, limitedState survives unrelated model faults, Credential needs dependencyComplete selected state despite unrelated model errors, incomplete selected credentialProperty, sample-alternatives/1 and sample-context/1
RGB lamp and door lock, minimal and richCatalogue and selected-model cases named by each planComplete supported descriptionsInitial Catalogue and Full selected-model
RGB lamp, limitedLimited Catalogue, Limited modelUnsupplied calibration meaningInitial Catalogue and Full selected-model, undetermined and incomplete
Door lock, limitedLimited Catalogue, Limited modelInvalid textual maximum and unsupplied credential meaningInitial Catalogue and Full selected-model, failed and incomplete
Power strip, minimalOutlet on, Outlet off, Outlet text stateBoolean outlet state and wrong-type rejectionProperty, sample-type-null/1 and sample-text-boolean/1
Power strip, minimalOutlet power lower boundary, Outlet power upper boundary, Outlet power above maximumInclusive watt bounds 0 and 2400Property, sample-numeric/1
Power strip, richOutlet fractional powerImported repeated outlet with exact 12.345 watt readingProperty, sample-context/1 and sample-numeric/1
Power strip, richShared power above product bound, Total power rejects shared readingThe same 2400 reading is admitted by shared Power and rejected by its consuming overridesdfData and Property, sample-context/1 and sample-numeric/1
Power strip, richTotal power within override, Total power override boundary, Total power just above overrideExplicit maximum 1800 with source/effective override relationProperty, sample-numeric/1
Power strip, richOrdinary fractional energy, Large fractional energy, Large exact energy boundary, Energy above exact boundaryExact values beyond ordinary machine-float precision, inclusive model maximum 9007199254740994Property, sample-numeric/1
Power strip, richEnergy off eighth step, Shared energy lower boundaryRejected half-step 0.0625 and admitted zero under shared step 0.125Property and sdfData, sample-numeric/1
Power strip, minimal and richCatalogue and selected-model cases named by each planComplete supported models, repeated outlet components, supplied reusable definitions, W and Wh declarationsInitial Catalogue and Full selected-model, including full.special-type-unit/1 registry guidance separately from numeric admission
Power strip, missing dependencyMissing dependency Catalogue, Missing dependency model, Total power needs dependencyFailed acquisition of an explicitly named needed local file and unavailable imported meaningInitial Catalogue, Full selected-model and Property, incomplete model work and sample-context/1
Power strip, missing dependencyOutlet state survives missing dependencyIndependent complete Boolean admission despite the absent donorProperty, sample-type-null/1 and sample-text-boolean/1
Power strip, copied requirednessCopied requiredness Catalogue, Copied requiredness modelSurviving copied required pointer relocated to the importing outlet’s own declarationInitial Catalogue and Full selected-model, complete and passed
Power strip, copied requirednessCopied outlet state, Independent total powerInherited Boolean and locally authored numeric PropertiesProperty, sample-type-null/1, sample-text-boolean/1 and sample-numeric/1
Irrigation, minimalOne zone lower count boundary, Four zones upper count boundary, No zones, Five zonesInclusive identifier-array counts 1 and 4 and definite count failuresProperty, sample-array/1
Irrigation, minimalDuplicate zone identifier, Invalid zone identifierWhole-element text uniqueness with both sample locations, anchored zone-1 through zone-4 patternProperty, sample-array/1 and sample-text-boolean/1
Irrigation, richConfigure without optional feedback, Configure moisture lower boundary, Configure moisture upper boundary, Configure excessive nested moistureRecursive conjunction of arrays, zone records and optional nested moisture bounds 0 and 100Action input, sample-array/1, sample-map/1 and sample-numeric/1
Irrigation, richConfigure missing required zones, Configure null zonesMissing required array differs from supplied disallowed nullAction input, sample-map/1 and sample-type-null/1
Irrigation, richConfigure missing duration despite default, Configure invalid optional feedbackNo insertion of a documentary default, absent optional child differs from present wrong-type childAction input, sample-map/1 and sample-type-null/1
Irrigation, richConfigure empty zone array, Configure excessive zone arrayNested zone-record counts without projecting uniqueness onto id fieldsAction input, sample-array/1
Irrigation, richConfiguration applied output, Configuration output above maximumStructured Boolean result and bounded configured-zone countAction output, sample-map/1, sample-text-boolean/1 and sample-numeric/1
Irrigation, limitedAbsent optional calibration, Present calibration needs definition, Missing zones despite incomplete calibrationComplete admission with absent optional child, undetermined needed child and independent required-entry rejection with incomplete workAction input, sample-map/1 and sample-context/1
Coffee machine, minimalResources lower boundary, Resources upper boundary, Water above maximumRequired water and beans plus optional milk percentages with inclusive 0 and 100 boundsProperty, sample-map/1 and sample-numeric/1
Coffee machine, minimalMissing required beans, Present null beansMissing required entry differs from supplied disallowed nullProperty, sample-map/1 and sample-type-null/1
Coffee machine, minimalEspresso preparation, Unknown preparationAdmitted and rejected preparation enum valuesProperty, sample-alternatives/1
Coffee machine, richBrew espresso lower boundaries, Brew latte upper boundaries, Mixed recipe has no Choice witnessOne whole nested recipe alternative with const drink and matching size bounds, no witness assembled across alternativesAction input, sample-map/1, sample-alternatives/1, sample-const/1 and sample-numeric/1
Coffee machine, richRecipe witness cannot admit excessive servings, Missing servings despite defaultComplete child witness preserves outer conjunction, documentary default supplies no required valueAction input, sample-map/1 and sample-numeric/1
Coffee machine, richStructured brew result, Brew result wrong typeRequired Boolean result and nonempty text messageAction output, sample-map/1, sample-type-null/1 and sample-text-boolean/1
Coffee machine, richMaintenance clean event, Unknown maintenance reason, Maintenance nested resource above maximumEnumerated maintenance reason conjoined with nested bounded resource readingsEvent output, sample-map/1, sample-alternatives/1 and sample-numeric/1
Coffee machine, limitedBrew without optional calibration, Brew calibration needs definition, Excess servings despite incomplete calibrationComplete admission with absent optional child, undetermined needed child and independent bound rejection with incomplete workAction input, sample-map/1, sample-numeric/1 and sample-context/1
Irrigation and coffee machine, minimal and richCatalogue and selected-model cases named by each planComplete supported descriptionsInitial Catalogue and Full selected-model
Irrigation and coffee machine, limitedLimited Catalogue, Limited modelOptional model description needs an unsupplied calibration definitionInitial Catalogue and Full selected-model, undetermined and incomplete

These families exercise all five selectors through Property, sdfData, Action input, Action output and Event output. Irrigation exercises Sample-array counts, text-element uniqueness and authored zone identifier patterns. These patterns are ordinary text constraints, rather than URI or UUID format checks. Repeated outlet declarations are model components rather than Sample-array checks. Nullability, presence, enum, Choice and temporal cases here do not claim exhaustive combinations.

Sources and adaptations

All thermostat models and samples are authored for this repository and use its MIT or Apache-2.0 licence. No external device document, vendor data, simulator implementation or historical SDF dialect is imported.

The minimal Catalogue reuses the existing thermostat.sdf.json without changing it. The entry plan.json, comfortable.json and too-hot.json also remain unchanged. The rich variant adds a nullable current reading, half-degree target steps, a configuration Action and an alarm Event. The limited variant is newly authored to demonstrate a faulty bound and unsupplied calibration definitions. Its namespace uses the reserved example.test domain as an identifier and is never retrieved. The Count examples remain a separate entry workflow.

The lamp and lock adapt interface ideas from the same pinned One Data Model playground revision used by the external-model pilot. Their lamp source notes and lock source notes identify the original documents, metadata, copyright notices and unchanged BSD licence text alongside the newly authored constraints, models, plans and samples. Historical source documents and their absolute required declarations are not imported into the standalone examples.

The power-strip source notes record the RFC composition ideas and the pilot’s pinned Binary Switch source with its original notice and licence. The meter definitions, exact readings, product override and distinguishing limitation variants are newly authored. No original external corpus needs to be downloaded or rerun. Its failed-dependency source expectations are checked explicitly, including a regression check that rejects hidden failed or successful acquisition attempts or a fabricated acquisition success.

The irrigation source notes identify newly authored examples and the recorded RFC array, map and Choice rules. The coffee-machine source notes pin Eclipse Thingweb’s interface ideas and original licence notice. Coffee resource readings and brew results are re-expressed as SDF with authored presence constraints, recipes and maintenance data. No simulator code, protocol forms, scheduling behaviour or upstream defaults are imported.