Skip to content

[kata/root/M015/S05] Plugin Documentation Update#208

Merged
wollax merged 3 commits into
mainfrom
kata/root/M015/S05
Mar 29, 2026
Merged

[kata/root/M015/S05] Plugin Documentation Update#208
wollax merged 3 commits into
mainfrom
kata/root/M015/S05

Conversation

@wollax
Copy link
Copy Markdown
Owner

@wollax wollax commented Mar 29, 2026

Summary

Updates the plugins/smelt-agent/ documentation for M015 distributed signal capabilities.

Changes

  • AGENTS.md: adds poll_signals and send_signal to MCP tools table; adds supports_signals and supports_peer_registry capability section; adds cross-instance forwarding overview
  • skills/peer-message.md: adds signal-based messaging section covering poll_signals/send_signal as the agent-facing interface; documents ASSAY_SIGNAL_BIND and ASSAY_SIGNAL_URL
  • skills/peer-registry.md (new): documents peer discovery via peers.json, PeerInfo type shape, backend lifecycle, cross-instance forwarding, loop prevention, multi-machine topology
  • tests/verify-docs.sh (new): structural test verifying all doc-referenced MCP tool names exist in the router

Verification

  • bash plugins/smelt-agent/tests/verify-docs.sh passes
  • just ready green

Test added 2 commits March 29, 2026 10:51
- New plugins/smelt-agent/skills/peer-registry.md skill covering
  PeerInfo type, backend methods, automatic lifecycle, cross-instance
  forwarding, loop prevention, and multi-machine setup
- New plugins/smelt-agent/tests/verify-docs.sh structural test
  verifying all documented tool names exist in the MCP router
Copilot AI review requested due to automatic review settings March 29, 2026 15:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the plugins/smelt-agent/ documentation to describe M015 distributed signaling concepts (signal-based peer messaging and peer registry), and adds a lightweight structural check to keep documented MCP tool names aligned with the MCP router.

Changes:

  • Document signal-based messaging (poll_signals, send_signal) and cross-instance forwarding concepts in the smelt-agent docs.
  • Add new /assay:peer-registry skill describing peer discovery/registration and forwarding topology.
  • Add plugins/smelt-agent/tests/verify-docs.sh to verify doc-referenced MCP tool names exist in crates/assay-mcp/src/server.rs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
plugins/smelt-agent/tests/verify-docs.sh Adds a doc/tool-name structural verification script against the MCP router.
plugins/smelt-agent/skills/run-dispatch.md Documents smelt as a state_backend config option in manifests.
plugins/smelt-agent/skills/peer-registry.md New skill documenting peer registry + cross-instance forwarding behavior and setup.
plugins/smelt-agent/skills/peer-message.md Adds signal-based messaging guidance using poll_signals / send_signal.
plugins/smelt-agent/AGENTS.md Updates skills/tools list and documents forwarding + signal endpoint env vars.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +40
# These are documented in advance of the M015 merge and will be
# validated once M015 lands.
PENDING_TOOLS="poll_signals send_signal"

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PENDING_TOOLS includes poll_signals and send_signal, but both tools are already present in crates/assay-mcp/src/server.rs (they are #[tool] pub async fn in the router). Marking them as pending means this test will stop validating these docs against the router and could let future renames/drift slip through unnoticed. Consider removing them from PENDING_TOOLS, or only treating a tool as pending when it is actually absent from the router output.

Suggested change
# These are documented in advance of the M015 merge and will be
# validated once M015 lands.
PENDING_TOOLS="poll_signals send_signal"
# Currently none; add tool names here temporarily if docs lead server.rs.
PENDING_TOOLS=""

Copilot uses AI. Check for mistakes.
Comment on lines +65 to +78
Registers peers by POSTing `PeerInfo` JSON to `{smelt_url}/api/v1/peers`. Graceful degradation — registration failure logs a warning but does not abort startup. `list_peers` and `unregister_peer` use the default no-op implementations (Smelt manages peer lifecycle server-side).

### Other Backends

`NoopBackend`, `LinearBackend`, `GitHubBackend`, and `SshSyncBackend` all return `supports_peer_registry: false` and use the default no-op implementations.

## Automatic Lifecycle

The MCP server manages peer registration automatically:

1. **On startup** — after the signal endpoint binds, the server calls `register_peer` with its hostname and `signal_url` derived from `ASSAY_SIGNAL_BIND` and `ASSAY_SIGNAL_PORT`.
2. **On clean shutdown** — the server calls `unregister_peer` to remove itself.

No manual registration is needed for normal operation.
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs state that SmeltBackend supports peer registry / cross-instance forwarding, but the code currently reports supports_peer_registry: false for SmeltBackend (and does not implement list_peers/unregister_peer). As written, using SmeltBackend will disable forwarding because the signal server gates forwarding on capabilities().supports_peer_registry. Please update the docs to match current behavior, or (if the intended behavior is support) update the backend capability flag and implementations in code.

Suggested change
Registers peers by POSTing `PeerInfo` JSON to `{smelt_url}/api/v1/peers`. Graceful degradation — registration failure logs a warning but does not abort startup. `list_peers` and `unregister_peer` use the default no-op implementations (Smelt manages peer lifecycle server-side).
### Other Backends
`NoopBackend`, `LinearBackend`, `GitHubBackend`, and `SshSyncBackend` all return `supports_peer_registry: false` and use the default no-op implementations.
## Automatic Lifecycle
The MCP server manages peer registration automatically:
1. **On startup** — after the signal endpoint binds, the server calls `register_peer` with its hostname and `signal_url` derived from `ASSAY_SIGNAL_BIND` and `ASSAY_SIGNAL_PORT`.
2. **On clean shutdown** — the server calls `unregister_peer` to remove itself.
No manual registration is needed for normal operation.
As of this version, `SmeltBackend` reports `supports_peer_registry: false` and relies on the default no-op implementations of `register_peer`, `list_peers`, and `unregister_peer`. Deployments using `SmeltBackend` do not currently participate in the peer registry or cross-instance signal forwarding.
### Other Backends
`SmeltBackend`, `NoopBackend`, `LinearBackend`, `GitHubBackend`, and `SshSyncBackend` all return `supports_peer_registry: false` and use the default no-op implementations.
## Automatic Lifecycle
When using a backend that reports `supports_peer_registry: true` (for example, `LocalFsBackend`), the MCP server manages peer registration automatically:
1. **On startup** — after the signal endpoint binds, the server calls `register_peer` with its hostname and `signal_url` derived from `ASSAY_SIGNAL_BIND` and `ASSAY_SIGNAL_PORT`.
2. **On clean shutdown** — the server calls `unregister_peer` to remove itself (this is a no-op for backends like `SmeltBackend` that do not support the peer registry).
No manual registration is needed for normal operation when the selected backend supports the peer registry.

Copilot uses AI. Check for mistakes.

The MCP server manages peer registration automatically:

1. **On startup** — after the signal endpoint binds, the server calls `register_peer` with its hostname and `signal_url` derived from `ASSAY_SIGNAL_BIND` and `ASSAY_SIGNAL_PORT`.
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step says the server derives signal_url from ASSAY_SIGNAL_BIND and ASSAY_SIGNAL_PORT, but the server code uses ASSAY_SIGNAL_URL as an override (and warns that 0.0.0.0 is unroutable for peer registration). The docs should mention ASSAY_SIGNAL_URL and recommend setting it in multi-machine deployments to a reachable host/IP.

Suggested change
1. **On startup** — after the signal endpoint binds, the server calls `register_peer` with its hostname and `signal_url` derived from `ASSAY_SIGNAL_BIND` and `ASSAY_SIGNAL_PORT`.
1. **On startup** — after the signal endpoint binds, the server calls `register_peer` with its hostname and `signal_url`. If `ASSAY_SIGNAL_URL` is set, that value is used directly. Otherwise, `signal_url` is derived from `ASSAY_SIGNAL_BIND` and `ASSAY_SIGNAL_PORT` (note that `0.0.0.0` is not routable from other machines, so in multi-machine deployments you should set `ASSAY_SIGNAL_URL` to a reachable host or IP).

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +113
| Variable | Default | Description |
| --- | --- | --- |
| `ASSAY_SIGNAL_PORT` | `7432` | Port for the HTTP signal listener |
| `ASSAY_SIGNAL_BIND` | `127.0.0.1` | Bind address (`0.0.0.0` for multi-machine) |
| `ASSAY_SIGNAL_TOKEN` | _(none)_ | Optional bearer token for auth (shared across peers) |

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable table omits ASSAY_SIGNAL_URL, but the server supports it and it is required for correct peer registration when binding ASSAY_SIGNAL_BIND=0.0.0.0 (otherwise peers get an unroutable URL). Please document ASSAY_SIGNAL_URL here (and its relationship to ASSAY_SIGNAL_BIND/ASSAY_SIGNAL_PORT).

Copilot uses AI. Check for mistakes.
Comment on lines +118 to +119
- `supports_peer_registry: true` — `LocalFsBackend`, `SmeltBackend`
- `supports_peer_registry: false` — `NoopBackend`, `LinearBackend`, `GitHubBackend`, `SshSyncBackend`
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The capability guard lists SmeltBackend as supports_peer_registry: true, but SmeltBackend currently reports supports_peer_registry: false in code. This list should be corrected so operators don’t assume peer forwarding works on Smelt-backed deployments.

Suggested change
- `supports_peer_registry: true``LocalFsBackend`, `SmeltBackend`
- `supports_peer_registry: false``NoopBackend`, `LinearBackend`, `GitHubBackend`, `SshSyncBackend`
- `supports_peer_registry: true``LocalFsBackend`
- `supports_peer_registry: false``SmeltBackend`, `NoopBackend`, `LinearBackend`, `GitHubBackend`, `SshSyncBackend`

Copilot uses AI. Check for mistakes.
Comment on lines +75 to +76
Returns a `PollSignalsResult` with a `signals` array of `PeerUpdate` objects. Messages are consumed on read (exactly-once delivery).

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This says signals are consumed on read with “exactly-once delivery”, but the underlying inbox polling is best-effort and can deliver duplicates if file deletion fails (it logs a warning: “may be delivered twice”). Also, poll_signals can consume-but-skip malformed messages during JSON decode. Please soften this claim (e.g., at-least-once / best-effort) to match actual semantics.

Suggested change
Returns a `PollSignalsResult` with a `signals` array of `PeerUpdate` objects. Messages are consumed on read (exactly-once delivery).
Returns a `PollSignalsResult` with a `signals` array of `PeerUpdate` objects. Messages are removed from the inbox on a best-effort, at-least-once basis; callers should tolerate occasional duplicates and understand that malformed messages may be consumed but skipped.

Copilot uses AI. Check for mistakes.

### Capability Guard

13. **Check `supports_signals` and `supports_peer_registry`** to determine if signal-based messaging and cross-instance forwarding are available. The `SmeltBackend` supports both; `LocalFsBackend` supports peer registry but not signal push; `NoopBackend` supports neither.
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This states “SmeltBackend supports both” supports_signals and supports_peer_registry, but SmeltBackend currently reports supports_peer_registry: false in code, which disables forwarding. Please update the backend matrix here to match actual capability flags.

Suggested change
13. **Check `supports_signals` and `supports_peer_registry`** to determine if signal-based messaging and cross-instance forwarding are available. The `SmeltBackend` supports both; `LocalFsBackend` supports peer registry but not signal push; `NoopBackend` supports neither.
13. **Check `supports_signals` and `supports_peer_registry`** to determine if signal-based messaging and cross-instance forwarding are available. The `SmeltBackend` supports signals but not the peer registry; `LocalFsBackend` supports the peer registry but not signal push; `NoopBackend` supports neither.

Copilot uses AI. Check for mistakes.
…, send_signal URL

- peer-message.md: correct SmeltBackend capability claim — supports_peer_registry
  is false (fire-and-forget register_peer, no list/unregister)
- peer-registry.md: move SmeltBackend to supports_peer_registry: false row in
  capability table; add note explaining why despite implementing register_peer
- peer-registry.md + AGENTS.md: add ASSAY_SIGNAL_URL to env var tables; update
  multi-machine setup step 1 to require it when ASSAY_SIGNAL_BIND=0.0.0.0
- peer-message.md: fix send_signal example URL to include /api/v1/signal path
- verify-docs.sh: remove poll_signals + send_signal from PENDING_TOOLS — both
  exist in server.rs on main
@wollax wollax merged commit 720c111 into main Mar 29, 2026
@wollax wollax deleted the kata/root/M015/S05 branch March 29, 2026 16:04
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