NeuralRelay Modulator Messages
This reference defines the relay vocabulary used when RAS sends a modulator signal through Neuromodulators via a terminal registered to NeuralRelay.
The contract is transport-agnostic. It defines semantic payloads only, whether messages are carried via in-process relay, HTTP, WebSocket, NATS, or Kafka.
Communication defaults
Section titled “Communication defaults”These defaults are normative unless a future contract explicitly overrides them.
- In this flow, all inter-component communication MUST be sent and received through terminals registered to
NeuralRelay. - Interaction is asynchronous and transmission-driven; components delegate and react instead of synchronously waiting.
- Broadcast fanout defaults to null outcome per receiver unless that receiver emits an explicit transmission.
- Silent synthesizers are the expected default for non-matching broadcasts.
How the protocol works
Section titled “How the protocol works”RAS passes a single ModulatorSignal to Neuromodulators. From the outside, the black-box contract is just signal in, mediated transmission out through a terminal registered to NeuralRelay. Internal synthesis fanout is an implementation detail of the orchestrator and is not part of this section’s external contract.
sequenceDiagram
participant RAS
participant NM as Neuromodulators
RAS->>NM: ModulatorSignal
NM-->>RAS: ModulatorSuccess (artifact-ref: neuromodulators/dopamine-instance-42)
The outer protocol is contract-level metadata, not a transport for the live Python object itself. A synthesizer creates the concrete modulator instance in its local runtime and publishes it through Neuromodulators. Neuromodulators then emits a single external transmission carrying the runtime reference through its registered terminal into NeuralRelay for distribution. The registry and object-resolution step are handled elsewhere; this page stays focused on the relay message contract.
This contract standardizes the external message families visible between RAS and Neuromodulators:
ModulatorSignal— fromRAStoNeuromodulators.ModulatorResultas the base outcome type, with concreteModulatorSuccessandModulatorFailuresubtypes fromNeuromodulatorsback toRAS.
The internal broker-to-synthesizer messages are intentionally distinct: SynthesisBroadcast and SynthesisReply describe the internal work of producing the single signaled modulator and are not part of the external RAS contract.
Scope note: this contract documents the relay-bound modulation path. Axis-based direct substrate-to-substrate transport is outside this contract.
If you are reading this as a black-box boundary, stop here. The broadcast step belongs to the ModulatorOrchestrator implementation and should be understood as an internal mediation detail, not as part of the external message contract.
Interaction points
Section titled “Interaction points”The protocol defines both logical addresses and code-level interaction points.
Logical addresses:
- RAS signal destination:
relay://neuromodulators.main(or environment-specific equivalent) - Neuromodulators reply destination: the external relay channel used for reply transmissions
- Internal broker fanout destination (owned by
ModulatorOrchestratorinsideNeuromodulators):relay://synthesizers.broadcastusingSynthesisBroadcast - Runtime object registry: reserved for the later Neuromodulators runtime contract and not part of this message reference
Orchestrator interaction notes:
ModulatorOrchestratorbroadcasts aSynthesisBroadcastto all registeredSynthesizerimplementations.- Eligible synthesizers reply with a
SynthesisReplyon the relay channel; silent or late synthesizers are ignored. ModulatorOrchestratoremits a singleModulatorSuccessorModulatorFailuretransmission onto the relay channel.- A downstream consumer may observe the returned
artifact-refand resolve it through a later runtime contract.
These names are the minimum vocabulary expected across package boundaries.
Broadcast and reply behavior:
SynthesisBroadcasthas a null default outcome; non-matching synthesizers remain silent.SynthesisReplyis an explicit return-path transmission on the relay channel.
Ontology alignment
Section titled “Ontology alignment”This vocabulary follows the Intent-Capability pattern and aligns with W3C semantic agent communication concepts.
| Cerebel message role | Ontology concept | Meaning in this contract |
|---|---|---|
ModulatorSignal |
Intent | RAS declares the desired modulator outcome. |
| Synthesizer self-selection | Capability | Each synthesizer internally matches the signal against its own registered capability and only replies if it can contribute. |
ModulatorResult |
ExecutionRecord | Neuromodulators-issued result object for the signaled modulator, resolved to a concrete success or failure subtype. |
| Signal or reply envelope | CommunicativeAct | Atomic interaction carrying the signal or reply payload. |
Relay envelope
Section titled “Relay envelope”Runtime messages in this flow use the NeuralRelay transmission models directly.
Common transmission fields:
| Field | Type | Required | Constraints |
|---|---|---|---|
| transmission_id | str | yes | non-empty, globally unique |
| timestamp | RFC3339 datetime | yes | UTC required |
| source | str | yes | sender identity, for example ras.main or neuromodulators.main |
| link | str | conditional | correlation key tying related transmissions together |
| metadata | object | no | transport and tracing metadata |
| payload | object | yes | domain payload for the transmission kind |
Signal-specific fields:
| Field | Type | Required | Constraints |
|---|---|---|---|
| signal_type | str | yes | for this contract: modulator.signal |
Broadcast-specific fields:
| Field | Type | Required | Constraints |
|---|---|---|---|
| broadcast_type | str | yes | for internal synth fanout: synthesis.broadcast |
Reply-specific fields:
| Field | Type | Required | Constraints |
|---|---|---|---|
| success | bool | yes | true for success replies, false for failure replies |
| error | str | no | failure summary when success=false |
Rules:
linkMUST remain stable across the originatingModulatorSignal, subsequentSynthesisBroadcast, and all relatedSynthesisReplyand external result replies.- Correlation to the originating ingress signal SHOULD be carried in
payload.in_response_towhen a producer needs explicit causality in addition tolink. - Unknown top-level fields SHOULD be rejected for strict runtime contracts.
Message type: ModulatorSignal
Section titled “Message type: ModulatorSignal”Signal purpose
Section titled “Signal purpose”Signal from RAS to Neuromodulators stating the intent to obtain a single concrete modulator for a substrate lifecycle action. Neuromodulators broadcasts that signal to all registered synthesizers and reacts to explicit synthesis reply transmissions; silent receivers remain null by default.
Signal message-type
Section titled “Signal message-type”modulator.signal
Signal payload
Section titled “Signal payload”ModulatorSignal.payload contains a single signal for one concrete modulator.
| Field | Type | Required | Constraints |
|---|---|---|---|
| modulator-name | str | yes | concrete modulator name to produce; should already be validated by application layer and DomainBundle before dispatch to RAS |
| parameters | object mapping | no | signal-scoped hints passed to the synthesizer |
Signal example
Section titled “Signal example”{ "transmission_id": "4f9d7e12-89cf-4dd1-b4d6-4d8e7ea4c4f2", "signal_type": "modulator.signal", "timestamp": "2026-08-15T12:10:00Z", "source": "ras.main", "link": "c4d1b55d-3a08-41b8-b2af-7b21f8b13f42", "metadata": {}, "payload": { "modulator-name": "dopamine", "parameters": { "window_tokens": 16000, "temperature": 0.2 } }}Message type: ModulatorResult
Section titled “Message type: ModulatorResult”Result purpose
Section titled “Result purpose”Base outcome object emitted by Neuromodulators after a synthesize attempt. A successful child result indicates that a signaled modulator has been produced and published under an artifact-ref. A failure child result indicates the signal could not be satisfied. By the time a signal reaches RAS, the list of required modulators and the synthesizers registered to produce them have already been validated by the application layer and DomainBundle. Each synthesizer knows what it produces; Neuromodulators emits a result after it receives a produced modulator instance or an explicit failure.
Result message-type
Section titled “Result message-type”Relay Reply transmission.
Result payload
Section titled “Result payload”ModulatorResult.payload is emitted through the concrete ModulatorSuccess or ModulatorFailure subtype.
ModulatorSuccess.payload fields:
| Field | Type | Required | Constraints |
|---|---|---|---|
| synthesizer-id | str | yes | non-empty synthesizer identifier |
| artifact-ref | str | yes | resolves to the concrete Python instance stored in Neuromodulators |
ModulatorFailure.payload fields:
| Field | Type | Required | Constraints |
|---|---|---|---|
| code | str | yes | canonical Neuromodulators error code |
| synthesizer-id | str | no | origin synthesizer when known |
| diagnostics | object | no | machine-readable diagnostics payload |
At envelope level, result replies carry success and optional error, consistent with the base Reply transmission contract.
Result example
Section titled “Result example”{ "transmission_id": "9a1c2d33-11ab-4ef2-a901-8f3b77cc1200", "timestamp": "2026-08-15T12:10:00Z", "source": "neuromodulators.main", "link": "c4d1b55d-3a08-41b8-b2af-7b21f8b13f42", "success": true, "error": null, "metadata": {}, "payload": { "synthesizer-id": "cortex-lamina-synthesizer", "artifact-ref": "neuromodulators/dopamine-instance-42" }}Message type: ModulatorSuccess
Section titled “Message type: ModulatorSuccess”Success result purpose
Section titled “Success result purpose”ModulatorSuccess is the concrete success subtype of ModulatorResult. It indicates that a synthesizer produced the signaled modulator and published it under an artifact-ref in Neuromodulators.
Success payload
Section titled “Success payload”ModulatorSuccess carries the same minimal result shape as its base, with the additional success-specific requirement that artifact-ref be present and resolvable.
Message type: ModulatorFailure
Section titled “Message type: ModulatorFailure”Failure result purpose
Section titled “Failure result purpose”ModulatorFailure is the concrete failure subtype of ModulatorResult. It indicates that the signal could not be satisfied, either because no synthesizer matched or an explicit failure condition was raised.
Failure payload
Section titled “Failure payload”ModulatorFailure carries the base Reply envelope with success=false, optional error, and a payload containing canonical failure code and diagnostics.
Diagnostics code convention:
payload.codeMUST use theNM_prefix for Neuromodulators canonical error codes.NM_is an explicitly approved abbreviation for Neuromodulators error namespaces.- Producers SHOULD emit these codes in upper-snake-case to match the Neuromodulators reference.
Runtime handoff model
Section titled “Runtime handoff model”The message contract does not carry the instantiated Python object directly. Instead, synthesizer runtimes create actual modulator instances and store them in Neuromodulators. Neuromodulators returns a ModulatorSuccess child result with an artifact-ref pointer. Each artifact-ref is resolved by RAS so the resulting transmission can arrive through a terminal registered to NeuralRelay before the concrete object instance is bound into the runtime cocktail for substrate consumption.
This keeps the transport layer minimal and lets RAS stay focused on the mediated result: it does not need a description of how the modulator was built, only the handle to the concrete result it was asked to produce.
Execution provenance and logging
Section titled “Execution provenance and logging”This reference defines the minimum contract exchanged through terminals registered to NeuralRelay. It deliberately does not include the full synthesizer execution record; the base ModulatorResult is intentionally thin, while child classes carry the outcome details.
The synthesizer runtime SHOULD record richer provenance in its own execution log or audit trail, including:
- the concrete modulator name that was actually produced
- the version resolved during synthesis
- the actual parameter values used at runtime
- the synthesis strategy or factory path used to create the instance
- the source package or artifact metadata used to build it
- execution timing and diagnostics for success, failure, or partial synthesis
This information is operationally important for observability, debugging, and reproducibility, but it is not part of the minimal message contract because RAS only needs the runtime handoff reference to place the resolved result onto NeuralRelay and let the substrate consume it from the updated cocktail through its terminal.
In other words, the network contract answers the question: “did the synthesizer produce the signaled modulator and where is it?” The execution record answers the question: “what exactly was produced, with which version and configuration, and how did it happen?”
The two concerns should remain separate: the ModulatorResult message stays small and transport-focused, while the synthesizer’s execution log captures the full provenance trail.
Pydantic DTO readiness
Section titled “Pydantic DTO readiness”This contract is intended to be directly representable as strict Pydantic models.
Recommended DTO set:
ModulatorSignalPayloadDTOModulatorSuccessPayloadDTOModulatorFailurePayloadDTOSynthesisBroadcastPayloadDTOSynthesisReplyPayloadDTO- Relay envelope models inherited from
Signal,Broadcast, andReply
Minimum validation rules to encode:
signal_typemust bemodulator.signalfor ingress signals.broadcast_typemust besynthesis.broadcastfor internal fanout broadcasts.- Reply envelopes must carry
successand optionalerroras defined by the baseReplymodel. artifact-refmust match^neuromodulators/[A-Za-z0-9._:-]+$forModulatorSuccess.payload.payload.codein failure payloads should be a canonicalNM_error code.- Unknown payload fields should be rejected with
extra="forbid".
Example DTO sketch:
from datetime import datetimefrom typing import Any, Literal
from pydantic import BaseModel, ConfigDict, Field, model_validator
class ResultDiagnosticsDTO(BaseModel): model_config = ConfigDict(extra="forbid") stage: str | None = None reason: str | None = None message: str | None = None
class ModulatorSuccessPayloadDTO(BaseModel): model_config = ConfigDict(extra="forbid") synthesizer_id: str = Field(alias="synthesizer-id", min_length=1) artifact_ref: str = Field(alias="artifact-ref", pattern=r"^neuromodulators/[A-Za-z0-9._:-]+$")
class ModulatorFailurePayloadDTO(BaseModel): model_config = ConfigDict(extra="forbid") code: str synthesizer_id: str | None = Field(default=None, alias="synthesizer-id") diagnostics: dict[str, Any] = Field(default_factory=dict)With these DTOs and rules, the modulation message layer is strict enough for contract-first implementation.
Handoff readiness checklist
Section titled “Handoff readiness checklist”The flow is ready to hand off when all items below are true:
- A
RASimplementation publishesModulatorSignalPayloadDTOthrough its terminal intoNeuralRelay. Neuromodulatorsvalidates the signal envelope and fans it out to registered synthesizers.- Synthesizers reply explicitly or remain silent.
NeuromodulatorspublishesReplytransmissions carryingModulatorSuccess.payloadorModulatorFailure.payloadback toRAS.- Failed response paths emit canonical diagnostics and stop affected modulation steps explicitly.
- Envelope and payload DTOs run with strict validation (
extra="forbid") in both request and response directions. - Integration tests cover RAS signal publication, Neuromodulators fanout, synthesizer self-selection, response handling, and failure paths.
Compatibility and evolution
Section titled “Compatibility and evolution”semantic-versionfollows Semantic Versioning 2.0.0.- Minor version updates MAY add optional fields only.
- Major version updates MAY remove or rename fields.
- Producers and consumers MUST fail fast on unknown required semantics.
Security and trust recommendations
Section titled “Security and trust recommendations”- Require synthesizer identity verification before
RASaccepts a response. - Use signed
ModulatorResultentries where audit guarantees are required. - Scrub sensitive fields before long-term storage, consistent with NeuralRelay policy.
Relationship to other contracts
Section titled “Relationship to other contracts”- RAS Bridge Contract: launch handoff boundary where this modulation exchange occurs before the runtime is returned.
- Substrate Core Contracts: substrate identity and lifecycle fields referenced by
substrate-ref. - Substrate Package Requirements: package obligations for synthesizer behavior and modulation injection.
- Naming Conventions: naming conventions for Signal, Response, Synthesizer, and Modulator roles.
- Neuromodulators Contract: normative runtime registry contract and interfaces used by synthesizers and
RAS.