Skip to content

feat(toolkit): the kind of an edge, when connect can make more than one - #96

Merged
endrix merged 2 commits into
mainfrom
feat/edge-roles
Oct 24, 2026
Merged

endrix merged 2 commits into
mainfrom
feat/edge-roles

Conversation

@endrix

@endrix endrix commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

A workflow connection is one thing, so connect never said what kind of edge it made. A specification's clauses are joined by typed edges (refines, verifies, depends-on), and a sidecar for them has to be told which one a drawn connection is. Plan item N7 of the ndf-ide plan.

  • The sidecar lists the kinds in its capabilities: diagnostic.edgeRoles, [{ id, label, description? }], parsed onto SidecarCapabilities.edgeRoles (parseEdgeRoles).
  • The create-edge handler asks which with a quick pick and sends it as args.role. A role given on the operation, or the only one listed, is taken without asking; a headless caller gets no pick (the sidecar's default applies); a dismissed pick makes no connection. The capabilities are asked once per sidecar command for the session (SidecarInvoker.edgeRoles), not on every connect.
  • The delete handler sends the edge's cal:edgeRole as args.role, so the right one of several edges between two nodes goes.
  • A sidecar that lists no roles is treated exactly as before: no pick, no role argument.
  • edge-roles.test.ts (6 tests); CHANGELOG entry. Neutral: the roles and their words come from the sidecar.

Independent of #90–#95.

Test plan

  • npm run typecheck, npm run check:neutrality
  • sidecar-toolkit suite

https://claude.ai/code/session_012yAjXyWw6JyWsXvHG3cG9c

Review fixes (28cce2f)

  • Capabilities probe: it runs once per session instead of on every connect, which had cost a second sidecar process per edge for every consumer. A failed ask is retried.
  • Agent edges: the create-edges MCP tool marks its edges headless, and its description tells the agent to name the kind in args.role. Before, an agent's call could open a quick pick mid-tool-call.
  • Delete: a role is sent only to a sidecar that lists kinds.
  • Tests: they now cover the once-per-session ask, the retry, the headless connect, and delete with and without listed kinds.

https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8

A workflow connection is one thing, so `connect` never said what kind of
edge it made. A specification's clauses are joined by typed edges
(refines, verifies, depends-on), and a sidecar for them has to be told
which one a drawn connection is.

The sidecar lists the kinds in its capabilities (`diagnostic.edgeRoles`,
`[{ id, label, description? }]`, parsed onto `SidecarCapabilities`). The
create-edge handler asks which with a quick pick and sends it as
`args.role`: a role given on the operation, or the only one listed, is
taken without asking; a headless caller gets no pick and the sidecar's
default applies; a dismissed pick makes no connection. The delete handler
sends the edge's `cal:edgeRole` as `args.role`, so the right one of
several edges between two nodes goes. A sidecar that lists no roles is
treated exactly as before.

Claude-Session: https://claude.ai/code/session_012yAjXyWw6JyWsXvHG3cG9c
…e headless

Review of #96:

- Every connect asked the sidecar for its capabilities, a process of its
  own, before the connect itself: two spawns per edge for every consumer,
  2N for an agent's create-edges of N. `SidecarInvoker.edgeRoles` now
  asks once per sidecar command for the session (a failed ask is not
  kept), and both the create-edge and the delete handler use it.
- The create-edges MCP tool passed the agent's args through without
  `headless`, so with a sidecar listing several kinds an agent's call
  opened a quick pick on the person's screen, and a dismissed pick made no
  edge while the tool reported success. The tool now marks each edge
  headless, and its description tells the agent to name the kind in
  `args.role` (else the sidecar's default kind is made).
- Delete sent the edge's role even to a sidecar that lists no kinds; it
  now sends one only when the sidecar does.

Tests: edge-roles.test.ts gains the once-per-session ask, the retry after
a failed ask, the headless connect and the delete handler with and
without listed kinds; mcp-diagram-module.test.ts expects the headless
marker.

Claude-Session: https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8
@endrix
endrix merged commit 025c827 into main Oct 24, 2026
1 check passed
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.

1 participant