CHANGELOG
Changelog for package ros2_medkit_gateway
Unreleased
Breaking Changes:
Typed router refactor.
HandlerContextno longer carriessend_json/send_error/send_plugin_error/send_dto/parse_body: handlers returnhttp::Result<TResponse>and the framework owns response writing throughRouteRegistry. The rawvoid(httplib::Request, httplib::Response)RouteRegistrylambda overloads are removed - call sites must use the typedreg.get<T>/reg.post<TBody, T>/reg.del<T>overloads, the multi-shapereg.post_alternates<TBody, TAlt...>/reg.del_alternates<TAlt...>, or one of the named escape hatches (reg.sse/reg.binary_download/reg.multipart_upload<T>/reg.static_asset/reg.docs_endpoint/reg.docs_subtree).static_assert(dto::has_dto_shape_v<T>)gates every typed overload, so non-DTO return types fail at compile time. The plugin ABI is unaffected:PluginResponsekeeps itssend_json/send_errorsurface and now routes through the same internalhttp::detail::write_json_bodyprimitive as the framework, so plugin wire format is unchanged (#403)Provider ABI typed.
FaultProvider,DataProvider,OperationProvider, andUpdateProvider::get_updatereturn typed DTO envelopes (FaultListResult/FaultDetailResult/FaultClearResult/ the matchingData*ResultandOperation*Resultshapes /UpdateStatusResult) instead of rawtl::expected<nlohmann::json, ErrorInfo>. The wire bytes are byte-identical because each envelope wraps an opaquecontentobject emitted verbatim byJsonWriter; commercial and out-of-tree plugins must wrap their existing JSON in the matching envelope type (mechanical:Result.content = std::move(json_payload)). The plugin ABI itself (PluginRouteshape,PluginResponsector, plugin api version) is locked bytest_plugin_abi_conformanceand is unchanged (#403)SchemaWriteremits optional DTO fields asanyOf: [<inner>, {type: "null"}](the OpenAPI 3.1 idiom) instead ofnullable: true. Generated clients seeT | nullfor every optional field rather thanT | undefined. Wire format is unchanged - the gateway still omits absent optional fields, andJsonReadercontinues to accept absent fields; the schema change only opts the published spec into round-tripping a literalnullvalue cleanly for clients that prefer to send one. As part of this, a handful of fields that were previously emitted as an explicit JSONnullwhen absent are now omitted entirely (consistent with the optional-omission policy): the script execution fieldsprogress/started_at/completed_at/parameters/error(GET .../scripts/{id}/executions/{eid}) and the scriptparameters_schemafield (GET .../scripts/{id}). Clients that testedfield === nullor relied on the key always being present must treat an absent key the same asnull. Thertmaps_medkitvariant is explicitly NOT covered by this PR - its handlers continue to run on the pre-typed HandlerContext surface and will be migrated separately (#403)Synchronous operation-execution service-call failures (
POST /api/v1/{entity-path}/operations/{id}/executionswhen the underlying ROS 2 service call fails) now return the standard SOVDGenericErrorenvelope ({"error_code": "vendor-error", "vendor_code": "x-medkit-ros2-service-unavailable", "message": "Service call failed", ...}, HTTP status 500 unchanged) instead of the previous bespoke nested{"error": {"code", "message", "details"}}object. This aligns the one remaining non-standard error path with every other gateway error; clients that parsederror.code/error.detailsfor this specific failure must readvendor_code/parametersinstead (#403)GET /api/v1/{entity-path}/datanow publishes the opaqueDataListResultschema ({type: object, additionalProperties: true, x-medkit-opaque: true}), matching howGET .../faultsalready publishesFaultListResult. The wire payload is unchanged for runtime (ROS 2) entities - it is still{"items": [...], "x-medkit": {...}}built from the typedCollection<DataItem, DataListXMedkit>- but for plugin-owned entities the provider’s free-form per-item shape now passes through verbatim instead of being re-parsed intoCollection<DataItem>. This fixes a regression in which plugin per-item fields (the OPC-UA plugin’svalue/unit/data_type/writable) were silently dropped by the typed re-parse. Clients that generated a typedDataItemmodel from the previous spec for this route now see an opaque object instead (#403)Entity responses (areas, components, apps, functions - list items and detail) now always carry a top-level
typediscriminator (an enum ofarea/component/app/function). Previously list items had notypeand detail responses exposed it only insidex-medkit.entityType. Additive and tolerant-client-safe; consumers keying on the entity kind can now read the top-leveltype(#403)ros2_medkit_msgs/srv/ClearFaultrequest gains abool skip_correlation_auto_clearfield (see the per-entity fault scope entry below for the in-tree motivation). Adding a request field changes the service type hash, so out-of-tree callers that invoke the service directly (for exampleros2 service call /fault_manager/clear_fault ros2_medkit_msgs/srv/ClearFault ...as documented in theros2_medkit_fault_managerREADME) must rebuild against the newros2_medkit_msgsto keep talking tofault_manager. The in-tree gateway client and server are updated together (#395)Per-entity fault routes are now correctly scoped to the entity’s hosted apps.
GET /api/v1/{entity-path}/faults/{fault_code},DELETE /api/v1/{entity-path}/faults/{fault_code},GET /api/v1/{entity-path}/faults, andDELETE /api/v1/{entity-path}/faultspreviously fell back to a prefix match against the entity’snamespace_path; when that was empty (host-derived / synthetic components, manifest components without anamespacefield, Areas, Functions, and Apps with a wildcardros_binding.namespace_pattern) the scope filter was silently disabled and the routes exposed - and onDELETE, cleared - faults reported by apps that belonged to entirely different entities. All four handlers now resolve the addressed entity to its hosted-app FQN set (via the newHandlerContext::resolve_entity_source_fqnshelper) and apply a strict all-sources scope check: a fault counts as in scope only when every entry in itsreporting_sourcesis owned by the entity (exact FQN match, or strict path-child via<fqn>/...). Per-fault routes return404 Resource Not Foundfor any fault that fails the check; collection routes return an emptyitemsarray. The underlyingGetFault.srvcontract is unchanged;ClearFault.srvgains a newskip_correlation_auto_clearrequest flag so per-entity DELETE can opt out of cascade-clearing correlated symptom fault codes that may live in other entities. Per-entity collection responses no longer include the globalmuted_count/cluster_count/muted_faults/clusterscorrelation metadata; those remain on the globalGET /api/v1/faultsroute. Behavior changes visible to clients: (a) faults reported by apps outside the addressed entity are no longer returned or cleared via that entity’s route, (b) mixed-source faults that include at least one out-of-entity reporter are likewise rejected with404on per-fault routes and excluded from per-entity collection responses (use the globalGET /api/v1/faultsto see them), (c) per-entity DELETE no longer cascade-clears correlated symptoms outside the entity (#395)GET /api/v1/updates/{id}/statusno longer returns404for a registered-but-idle package;POST /api/v1/updatesnow seeds apendingstatus, so the endpoint returns200 {"status": "pending"}immediately after registration.404is reserved for packages that are not registered. Clients that used404as a signal for “registered but nothing started yet” must adapt (#378)
Features:
Typed
fan_out_collection<T>aggregating helper replaces raw-JSONmerge_peer_itemson the typed collection routes (data, operations, config, logs). Peer items are decoded viadto::JsonReader<T>; items that fail validation are removed from the mergeditemsarray, recorded inx-medkit.peer_dropped_itemswith the JsonReader error plus a best-effortsource_id, and logged atWARN. Items that parse successfully are re-serialized through the localdto::JsonWriter<T>, so any peer-supplied fields outside the local DTO schema are dropped from the merged response (the previous raw passthrough preserved unknown peer fields verbatim). Previously, malformed peer items silently disappeared into the merged response; fleet operators can now detect inter-gateway schema drift directly on the wire (#403)Collection<T, XMedkitT>is now a 2-parameter template. Domain list endpoints (faults, config, logs) reference their richer per-domain collection x-medkit struct (FaultListXMedkit,ConfigListXMedkit,LogListXMedkit) directly in the published schema instead of the genericXMedkitCollection, so generated clients see aggregation counts, peer provenance, andpeer_dropped_itemsfrom the schema. The data list builds the same typedCollection<DataItem, DataListXMedkit>internally (so the wire still carries those fields) but publishes the opaqueDataListResultenvelope, because plugin-owned data entities can return vendor per-item fields the typed item schema cannot describe (see the data-list breaking-change entry above) (#403)New
opaque_object("key", &T::field)DTO field descriptor indto/contract.hpp. Binds anlohmann::jsonmember as a typed “any JSON object” field:JsonWriteremits it verbatim,JsonReaderrejects scalars / arrays / null,SchemaWriteremits{type: object, additionalProperties: true, x-medkit-opaque: true}. Used for fields whose runtime shape is decided by an upstream component the gateway cannot introspect (live ROS message payloads, plugin-defined fault envelopes, action results) (#403)GET /api/v1/faults/streamevent payloads now carry an optionalx-medkitSOVD payload-extension object withentity_typeandentity_idfields. When the gateway can resolve the fault’s first reporting source back to a SOVD entity (via the manifest-mode linking index, or a runtime-mode last-segment match against an existing App), consumers can hit/{entity_type}/{entity_id}/bulk-data/rosbags/{fault_code}directly instead of HEAD-probing every entity. Resolution is snapshotted at event arrival, so a discovery refresh between enqueue and stream-out cannot retroactively change the entity reported to consumers. Thex-medkitobject is omitted entirely when no entity can be resolved, so existing SSE consumers ignore the addition (#380)Plugin API version bumped to v7. Adds
PluginContext::notify_entities_changed(EntityChangeScope)lifecycle hook for plugins that mutate the entity surface at runtime; default no-op keeps v6 source code compiling unchanged against v7 headers. Binary compatibility is not provided: the plugin loader uses a strict equality check onplugin_api_version(), so out-of-tree plugins must be recompiled (#376)New
discovery.manifest.fragments_dirparameter: gateway scans the directory for*.yaml/*.ymlfragment files on every manifest load / reload and merges apps, components, and functions on top of the base manifest. Fragments are forbidden from declaring top-levelareas,metadata,discovery,scripts,capabilities, orlock_overrides- those stay in the base manifest. Presence of any forbidden key (including empty-valued ones likeareas: []) is reported as aFRAGMENT_FORBIDDEN_FIELDvalidation error that fails the load / reload. Unknown top-level keys (typos such asapp:vsapps:) are ignored with a warning log. Files merged in alphabetical order for deterministic duplicate-id errors (#376)Fragment files are size-capped at 1 MiB (
ManifestParser::kMaxFragmentBytes) before being read into memory, and any symlink resolving outside the canonicalfragments_diris skipped with a warning, so misconfigurations or symlink-based escapes cannot hand arbitrary bytes to the YAML parser (#376)All-or-nothing fragment semantics: a single malformed or forbidden fragment fails the entire load / reload and keeps the previously-loaded manifest active (#376)
ManifestParser::parse_fragment_fileconvenience entrypoint that injects a syntheticmanifest_versionheader when the fragment omits oneSee
design/plugin_entity_notifications.rstfor the lifecycle, merge-rule, and plugin-side write-contract walkthrough
0.4.0 (2026-03-20)
Breaking Changes:
GET /version-inforesponse key renamed fromsovd_infotoitemsfor SOVD alignment (#258)GET /root endpoint restructured:endpointsis now a flat string array, addedcapabilitiesobject,api_basefield, andname/versiontop-level fields (#258)Default rosbag storage format changed from
sqlite3tomcap(#258)Plugin API version bumped to v4 - added
ScriptProvider, locking API, and extendedPluginContextwith entity snapshot, fault listing, and sampler registrationGraphProviderPluginextracted to separateros2_medkit_graph_providerpackage
Features:
Discovery & Merge Pipeline:
Layered merge pipeline for hybrid discovery with per-layer, per-field-group merge policies (#258)
Gap-fill configuration: control heuristic entity creation with
allow_heuristic_*options and namespace filtering (#258)Plugin layer:
IntrospectionProvidernow wired into discovery pipeline viaPluginLayer(#258)/healthendpoint includes merge pipeline diagnostics (layers, conflicts, gap-fill stats) (#258)Entity detail responses now include
logs,bulk-data,cyclic-subscriptionsURIs (#258)Entity capabilities fix: areas and functions now report correct resource collections (#258)
discovery.manifest.enabled/discovery.runtime.enabledparameters for hybrid modeNewEntities.functions- plugins can now produce Function entitiesGET /apps/{id}/is-located-onendpoint for reverse host lookup (app to component)Beacon discovery plugin system - push-based entity enrichment via ROS 2 topic
x-medkit-topic-beaconandx-medkit-param-beaconvendor extension REST endpointsLinux introspection plugins: procfs, systemd, and container plugins via
x-medkit-*vendor endpoints (#263)
Locking:
SOVD-compliant resource locking: acquire, release, extend with session tracking and expiration
Lock enforcement on all mutating handlers (PUT, POST, DELETE)
Per-entity lock configuration via manifest YAML with
required_scopesLock API exposed to plugins via
PluginContextAutomatic cyclic subscription cleanup on lock expiry
LOCKScapability in entity descriptions
Scripts:
SOVD script execution endpoints: CRUD for scripts and executions with subprocess execution
ScriptProviderplugin interface for custom script backendsDefaultScriptProviderwith manifest + filesystem CRUD, argument passing, and timeoutManifest-defined scripts:
ManifestParserpopulatesScriptsConfig.entriesfrom manifest YAMLallow_uploadsconfig toggle for hardened deploymentsRBAC integration for script operations
Logging:
LogProviderplugin interface for custom log backends (#258)LogManagerwith/rosoutring buffer and plugin delegation/logsand/logs/configurationendpointsLOGScapability in discovery responsesConfigurable log buffer size via parameters
Area and function log endpoints with namespace aggregation (#258)
Triggers:
Condition-based triggers with CRUD endpoints, SSE event streaming, and hierarchy matching
TriggerManagerwithConditionEvaluatorinterface and 4 built-in evaluators (OnChange, OnChangeTo, EnterRange, LeaveRange)ResourceChangeNotifierfor async dispatch from FaultManager, UpdateManager, and OperationManagerTriggerTopicSubscriberfor data trigger ROS 2 topic subscriptionsPersistent trigger storage via SQLite with restore-on-restart support
TriggerTransportProviderplugin interface for custom trigger delivery
OpenAPI & Documentation:
RouteRegistryas single source of truth for routes and OpenAPI metadataOpenApiSpecBuilderfor full OpenAPI 3.1.0 document assembly withSchemaBuilderandPathBuilderCompile-time Swagger UI embedding (
ENABLE_SWAGGER_UI)Named component schemas with
$ref, cleanoperationIdvalues, endpoint descriptions,GenericErrorschema refs,info.contact, Spectral-clean output, multipart upload schemas, static spec cachingSOVD compliance documentation with resource collection support matrix (#258)
Other:
Multi-collection cyclic subscription support (data, faults, logs, configurations, update-status)
Generation-based caching for capability responses via
CapabilityGeneratorPluginContext::get_child_apps()for Component-level aggregationSub-resource RBAC patterns for all collections
Auto-populate gateway version from
package.xmlvia CMakeNamespaced fault manager integration -
FaultManagerPathsresolves service/topic names for custom namespacesGrouped
fault_manager.*parameter namespace for cleaner configuration
Build:
Extracted shared cmake modules into
ros2_medkit_cmakepackage (#294)Auto-detect ccache for faster incremental rebuilds
Precompiled headers for gateway package
Centralized clang-tidy configuration (opt-in locally, mandatory in CI)
Tests:
Unit tests for DiscoveryHandlers, OperationHandlers, ScriptHandlers, LockHandlers, LockManager, ScriptManager, DefaultScriptProvider
Comprehensive integration tests for locking, scripts, graph provider plugin, beacon plugins, OpenAPI/docs, logging, namespaced fault manager
Contributors: @bburda
0.3.0 (2026-02-27)
Features:
Gateway plugin framework with dynamic C++ plugin loading (#237)
Software updates plugin with 8 SOVD-compliant endpoints (#237, #231)
SSE-based periodic data subscriptions for real-time streaming without polling (#223)
Global
DELETE /api/v1/faultsendpoint (#228)Return HEALED/PREPASSED faults via status filter (#218)
Bulk data upload and delete endpoints (#216)
Token-bucket rate limiting middleware, configurable per-endpoint (#220)
Reduce lock contention in ConfigurationManager (#194)
Cache component topic map to avoid per-request graph rebuild (#212)
Require cpp-httplib >= 0.14 in pkg-config check (#230)
Add missing
ament_index_cppdependency topackage.xml(#191)Unit tests for HealthHandlers, DataHandlers, and AuthHandlers (#232, #234, #233)
Standardize include guards to
#pragma once(#192)Use
foreachloop for CMake coverage flags (#193)Migrate
ament_target_dependenciesto compat shim for Rolling (#242)Multi-distro CI support for ROS 2 Humble, Jazzy, and Rolling (#219, #242)
Contributors: @bburda, @eclipse0922, @mfaferek93
0.2.0 (2026-02-07)
Initial rosdistro release
HTTP REST gateway for ros2_medkit diagnostics system
SOVD-compatible entity discovery with four entity types:
Areas, Components, Apps, Functions
HATEOAS links and capabilities in all responses
Relationship endpoints (subareas, subcomponents, related-apps, hosts)
Three discovery modes:
Runtime-only: automatic ROS 2 graph introspection
Manifest-only: YAML manifest with validation (11 rules)
Hybrid: manifest as source of truth + runtime linking
REST API endpoints:
Fault management: GET/POST/DELETE /api/v1/faults
Data access: topic sampling via GenericSubscription
Operations: service calls and action goals via GenericClient
Configuration: parameter get/set via ROS 2 parameter API
Snapshots: GET /api/v1/faults/{code}/snapshots
Rosbag: GET /api/v1/faults/{code}/snapshots/bag
Server-Sent Events (SSE) at /api/v1/faults/stream:
Multi-client support with thread-safe event queue
Keepalive, Last-Event-ID reconnection, configurable max_clients
JWT-based authentication with configurable policies
HTTPS/TLS support via OpenSSL and cpp-httplib
Native C++ ROS 2 serialization via ros2_medkit_serialization (no CLI dependencies)
Contributors: Bartosz Burda, Michal Faferek