Skip to content

docs(design): 054 zero-alloc connector boundary, 055 wildcard inbound links, 056 aimdb join CLI - #265

Merged
lxsaah merged 1 commit into
mainfrom
claude/aimdb-join-review-3n5ovl
Sep 27, 2026
Merged

lxsaah merged 1 commit into
mainfrom
claude/aimdb-join-review-3n5ovl

Conversation

@lxsaah

@lxsaah lxsaah commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Description

Three separate design documents, a revision of 043, and an allocation benchmark that grounds 054 in measured numbers. No production code changes.

Benchmark: aimdb-bench/benches/b0_alloc_connector.rs
Measures per-message heap allocations at the connector boundary on a no-op connector (Tokio, current-thread), with the results committed in data/baselines/b0_alloc_connector.json:

Path Allocs/msg
Router::route (64 routes, deserialize + produce) 0
pump_source with a minimal Source 2
outbound recv_into + Connector::publish, scratch serializer 2
same, dynamic topic (TopicProvider) 3
same, owned serializer 3

The bench asserts these values exactly, so a regression or an improvement fails it until EXPECTED and the baseline are updated together.

054 — Zero-allocation connector boundary. Buffers, the consume path (037) and routing already allocate nothing; every remaining per-message allocation comes from the connector interfaces (boxed futures, owned topic Strings). Extends 037's poll-based approach to the connector boundary:

  • inbound: borrowed push via InboundDispatch, and a poll-based Source;
  • outbound: a poll-based SerializedReader, per-route RoutePublisher (poll_ready/start_send), and a TopicWriter that writes topics into scratch storage;
  • MQTT specifics per backend, guidance for heap-containing values, and target numbers for each bench row.

This is an SPI break (next major); user-facing APIs are unchanged.

055 — Wildcard inbound links. Additive and independent of 054:

  • the connector supplies the topic grammar (TopicGrammar, MQTT_GRAMMAR);
  • named captures ({device}), available to the deserializer through RuntimeContext;
  • optional KeyId interning with a bounded table per link.

It costs one allocation per message on pattern routes only, which goes away once 054 lands.

056 — aimdb join CLI. Ports the implementation from the planning branch (e0dcf9b; it compiles on main and its 9 tests pass) and fixes five review defects:

  • the OAuth client ID was compiled in; it now comes from discovery;
  • end of input looped forever, and the prompts were deployment-specific; the command no longer prompts;
  • file permissions were wrong when overwriting, and existing profiles were overwritten silently; profiles are now written atomically and only replaced with --force;
  • http:// was accepted; https:// is now required except for loopback.

It also defines distinct exit codes and a test plan.

043 rev 2. Made deployment-neutral:

  • a discovery request (GET /v1/join);
  • optional app values in both directions;
  • node_id instead of the slot-based station_id;
  • credential rotation allowed on re-join;
  • 422 and 429 errors;
  • the broken link to the absent 042 flagship spec is removed.

Revised in place, since it is still Proposed and no server implements it.

Related Issue

  • None

Checklist

  • I have read the CONTRIBUTING.md document.
  • My code follows the project's coding standards. (cargo fmt and cargo clippy -p aimdb-bench --all-targets -- -D warnings clean)
  • I have added tests to cover my changes. (the bench asserts its expected values)
  • All new and existing tests passed (make check). Not run in full: only cargo bench -p aimdb-bench --bench b0_alloc_connector and clippy on aimdb-bench were run.
  • I have updated the documentation accordingly. (aimdb-bench/README.md)

Known, left out of scope: docs/design/044-embassy-mqtt-tls.md still links to 042-public-weather-mesh-flagship.md, which is not on main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E5ySyp4thSEktXg4Awwpn7


Generated by Claude Code

… links, 056 aimdb join CLI

- bench: add b0_alloc_connector, measuring per-message allocations at the
  connector boundary (Router::route 0, pump_source 2, outbound 2-3) and
  asserting them against a committed baseline.
- 054: zero-allocation connector boundary, grounded in that baseline;
  extends 037's poll-based SPI to inbound dispatch, outbound readers,
  per-route publishers and written topics.
- 055: wildcard inbound links on today's interfaces (additive):
  connector-supplied grammar, named captures, optional key interning.
- 056: aimdb join CLI, porting the planning-branch implementation and
  fixing its five review defects.
- 043 rev 2: deployment-neutral join format with discovery, optional app
  values and credential rotation on re-join.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5ySyp4thSEktXg4Awwpn7
@lxsaah
lxsaah merged commit 2d414cc into main Sep 27, 2026
11 checks passed
@lxsaah
lxsaah deleted the claude/aimdb-join-review-3n5ovl branch September 27, 2026 15:27
@lxsaah lxsaah mentioned this pull request Sep 28, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants