refactor(connectors)!: MQTT knobs out of core builders; prune ConnectorConfig (034 Phase 2, #134)#139
Merged
Merged
Conversation
… configuration errors (#133) One failure model instead of two: builder methods never panic on user mistakes. TypedRecord setters, the connector-link finish() methods, and configure() record a ConfigError (skipping the conflicting registration) and build() returns a single DbError::InvalidConfiguration carrying every finding — record key and connector URL included — so one run surfaces every mistake. The spawn-time factory panics (missing buffer, record lookup) become build()-time checks; .buffer() after .link_to()/.link_from() is now legal. Duplicate keys and dependency-graph findings fold into the same collected report. Remaining panics on the builder path are internal invariants worded 'this is a bug in aimdb-core'. AnyRecord gains has_buffer() and drain_config_errors(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nnectorConfig (#134) Core knows schemes and key/value options, never protocol semantics: with_qos/with_retain are deleted from the generic link builders and now live in aimdb-mqtt-connector as MqttLinkExt (qos, outbound + inbound) and MqttOutboundLinkExt (retain, publish-side only) — pushing the same config keys the MQTT clients have always read from protocol_options, so wire behavior is unchanged. with_timeout_ms stays with protocol-neutral docs; with_config(key, value) is the generic spine. ConnectorConfig drops its never-read typed qos/retain fields and the speculative Kafka/HTTP/shmem interpretation docs; it keeps timeout_ms + protocol_options. Outbound/InboundConnectorBuilder are re-exported from core's root for the extension-trait impls. The tokio MQTT demo exercises the new traits explicitly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Base automatically changed from
refactor/034-phase2-133-build-validation
to
main
June 10, 2026 14:46
Contributor
Author
|
@copilot resolve the merge conflicts in this pull request |
Copilot stopped work on behalf of
lxsaah due to an error
June 10, 2026 14:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #134. Part of design 034 Phase 2 (review doc §3.6); last of three stacked PRs (#130 → #133 → #134). Stacked on #138 — will be re-targeted to
mainonce that merges; only the last commit is this PR's diff until then.What
Core knows schemes and key/value options, never protocol semantics.
OutboundConnectorBuilder::with_qos/with_retain,InboundConnectorBuilder::with_qos.with_timeout_mssurvives with protocol-neutral docs;with_config(key, value)(already existed) is documented as the generic option spine. The issue suggested addingwith_option— not needed,with_configalready is that method.aimdb-mqtt-connector::link_ext(compiled on every feature leg — std/tokio, embassy/no_std, alloc-only):MqttLinkExt::with_qos(u8)— outbound and inbound (publish/subscribe QoS)MqttOutboundLinkExt::with_retain(bool)— outbound only (retain is a publish-side flag; the old core API had the same asymmetry)with_config("qos", …)/with_config("retain", …)— the same keys both MQTT clients have always parsed fromprotocol_options(tokio:MqttSink::opt, embassy:opt_u8/opt_bool, defaults QoS 1 / no retain) → wire behavior unchanged.ConnectorConfigpruned: typedqos: u8/retain: boolfields deleted (verified unread by every connector in-tree), Kafka/HTTP/shmem interpretation docs deleted; keepstimeout_ms+protocol_options. TheConnectortrait example now reads knobs fromprotocol_options.OutboundConnectorBuilder/InboundConnectorBuilderre-exported fromaimdb_coreroot (needed by the extension-trait impls).examples/tokio-mqtt-connector-demoexercises the traits explicitly (.with_qos(1).with_retain(false)outbound,.with_qos(1)inbound — wire-identical to defaults)..with_retain(true)) were updated alongside (separate repo, import-only change) and compile against this branch.Acceptance criteria (from #134)
grep -rn "qos\|retain" aimdb-core/src→ only generic pass-through/doc mentions remaintests/link_ext_tests.rs: ext methods push exactly("qos","2")/("retain","true")into the link config)ConnectorConfigmentions no protocol that lacks an in-tree connectormake checkandmake examplespass (incl. thethumbv7em-none-eabihfembassy+defmt clippy leg for the new module)🤖 Generated with Claude Code