Skip to content

docs(design): 059 probes: cancel, reply limits, spike findings - #466

Merged
lxsaah merged 5 commits into
mainfrom
claude/quirky-rubin-jkubwh
Nov 11, 2026
Merged

lxsaah merged 5 commits into
mainfrom
claude/quirky-rubin-jkubwh

Conversation

@lxsaah

@lxsaah lxsaah commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Description

Updates the probe design (docs/design/059-probe.md) after a review and a throwaway spike against the current code base. Only the design document changes; no code.

From the review

  • probe.cancel: cancels the probe in flight on a connection. The client sends it when a run call is dropped, which covers Ctrl-C in the CLI and an abandoned MCP tool call.
  • MCP makes one call per endpoint at a time; this is stated as intended.
  • Optional max_frame in hello, and WebSocket added to the transports' reply limits.
  • A blocking probe stalls the whole instance on every runtime, not only on Embassy.
  • The MQTT and KNX discovery probes are reference implementations in the connector crates; the KNX observer hook is defined as connector API.
  • Registration exposes a probe on every AimX endpoint of the instance.

From the spike (new §11, and applied to the sections it names)

  • ctx.db() returns a read-only ProbeDb view; the AimDb handle can write records.
  • Both reply limits are counted in payload bytes, and the path from Framer through PeerInfo to the session is named.
  • Session::call_deferred borrows the params.
  • Params types use deny_unknown_fields; serde otherwise accepts a misspelled field in silence.
  • Core's std feature has to enable serde_json/std for bounded serialization.
  • Deadline tests need a test runtime on a controllable clock; core's existing test runtimes complete every sleep at once.

§11 also lists what the spike confirmed (liveness during a probe, deadline drop with a stalled writer, cancel, 4.0 compatibility of the error frame, the serial page size, no_std compile of core) and what it did not cover (the discovery probes, running on Embassy, CLI and MCP, WebSocket, a real serial link).

The spike code itself is not part of this PR and was not pushed.

Two choices in the document were made without being asked for and are worth a look:

  • the MCP timeout_s default of 30 (§4.3);
  • the shape of the ProbeDb view (§2): record metadata with configured links, and a record's latest value as JSON.

Related Issue

  • None

Checklist

  • I have read the CONTRIBUTING.md document.
  • My code follows the project's coding standards. (documentation only)
  • I have added tests to cover my changes. (documentation only)
  • All new and existing tests passed (make check). (not run; documentation only)
  • I have updated the documentation accordingly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGkDJ8KYHaFuAx8mJii9Kn

claude and others added 5 commits November 10, 2026 21:45
…t limit

- probe.cancel drops the probe in flight on a connection; the client
  sends it when a run call is dropped (Ctrl-C, abandoned MCP tool call)
- optional max_frame in hello lets the client state its receive cap;
  list WebSocket among the transports' reply limits
- state that MCP makes one call per endpoint at a time
- a blocking probe stalls the instance on every runtime, not only Embassy
- discovery probes are reference implementations; define the KNX
  observer hook as connector API
- registration exposes a probe on every AimX endpoint of the instance

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGkDJ8KYHaFuAx8mJii9Kn
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGkDJ8KYHaFuAx8mJii9Kn
- ctx.db() returns a read-only ProbeDb view, not the AimDb handle
- both reply limits are counted in payload bytes; name the path from
  Framer through PeerInfo to the session
- call_deferred borrows the params
- Params types use deny_unknown_fields
- core's std feature enables serde_json/std for bounded serialization
- deadline tests need a test runtime on a controllable clock
- state reply order after cancel, slot release, the deadline timer,
  the registry's home and the builder settings

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGkDJ8KYHaFuAx8mJii9Kn
… design

- mqtt.discover and knx.discover are registered by their connectors
  (with_discover_probe); the connector supplies the link topics
- ProbeDb no longer promises a link listing
- the MQTT probe has its own minimal streaming client and needs no
  packet buffer; Embassy memory is socket buffers and one socket
- the KNX observer slot carries the tunnel's connected state
- core provides the fit_to_budget trimming helper
- open questions: mqtts for the probe on Embassy, repeated KNX telegrams
- section 11.6 records what ran on the NUCLEO-H563ZI

Co-Authored-By: Claude <noreply@anthropic.com>
After review:
- probes are registered on the builder only; db.register_probe and the
  sealed, interior-mutable registry are removed
- the KNX connector hands out a tap before build(); KnxDiscover is a
  reference probe built on it, registered by the application
- the tap is a bounded queue per subscription with a drop count and the
  tunnel's connected state; no user code runs in the tunnel engine
- MqttDiscover::dedicated is registered by the application again
- ProbeDb::inbound_links(scheme) is new in core and supplies 'linked'

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@lxsaah
lxsaah merged commit 13185f2 into main Nov 11, 2026
10 checks passed
@lxsaah
lxsaah deleted the claude/quirky-rubin-jkubwh branch November 11, 2026 19:00
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