Skip to main content

Module feature

Module feature 

Source
Expand description

Feature — the protocol behaviours a session may or may not have, and resolve — the pure function that decides which of them it has.

§The table is the model

FEATURES is a const table, and resolve is a fold over it. That is the whole design: there is no second place where a feature’s availability is written down, so a row cannot disagree with the code that consults it, and adding a revision is a data change rather than a code change.

Each row answers four questions, all of them from the vendored changelogs:

  • Who must support it — Side. A server feature with no client to call it is off.
  • What capability it needs — at most one client and one server flag. This is the prerequisite rule, and it is a requirement rather than a hint: a peer that did not advertise elicitation cannot be sent an elicitation request, whatever the revision allows.
  • Which transport it needs — None for transport-independent features. Legacy SSE exists only on 2024-11-05, so a feature that is only expressible there cannot be on for a 2025-03-26 peer.
  • Which revisions define it — first and last. A feature that was later removed has a last, and the removal is as much a part of the matrix as the addition.

§Every row cites its changelog

The doc comment on each variant names the revision and changelog entry that introduced or removed it. A row without a citation is a failing task, and every_row_is_cited_and_ordered enforces the ordering half of that mechanically: a removal must be attributed to a revision strictly after the one that added it.

§Removals are features of the matrix

2026-07-28 removes ping, logging/setLevel and notifications/roots/list_changed, and moves tasks out of the core protocol into an extension. Modelling those as rows with a last — rather than as their absence — is what lets a bridge report why it cannot lower a message, which is the difference between a diagnosable failure and a silent drop.

Structs§

DegradePolicy
The downgrades a caller will accept when a feature is unavailable.
FeatureProfile
The set of features a negotiated session has.
FeatureSpec
One row of the feature matrix.
Negotiation
Everything a session’s peers and transport tell us, as one argument.

Enums§

Feature
A protocol behaviour a session may have.

Constants§

FEATURES
The feature matrix.

Functions§

resolve
Resolves the features a negotiated session has.