Application Boundary Contract
This reference defines the normalized contract between application implementations, their adapters, and the RAS-driven runtime.
Purpose
Section titled “Purpose”The application boundary exists so multiple host-specific application implementations can connect to the same Cerebel runtime without changing the runtime contract.
Examples include CLI applications, HTTP services, websocket gateways, and device-oriented control surfaces.
Boundary roles
Section titled “Boundary roles”Adapter responsibilities
Section titled “Adapter responsibilities”Adapters may:
- Receive tool-native or transport-native events.
- Convert those events into normalized interaction requests.
- Convert normalized responses into tool-native output or commands.
- Maintain connection or session state local to the tool.
- Apply local safety checks for physical execution endpoints.
Adapters must not:
- Perform domain reasoning.
- Orchestrate substrates directly.
- Replace runtime routing decisions.
Application responsibilities
Section titled “Application responsibilities”Application implementations must:
- Validate incoming requests.
- Normalize and propagate interaction metadata.
- Apply authorization and boundary policy.
- Delegate interaction and management operations to RAS.
- Return normalized responses back to adapters.
Application implementations must not:
- Perform modality-specific decoding or rendering that belongs in runtime substrates.
- Embed hardware protocol logic.
- Duplicate decision-making logic from the runtime.
Standard application APIs
Section titled “Standard application APIs”Interaction API
Section titled “Interaction API”Purpose: conversation, command, feedback, and actuation requests.
Operations:
submit_interaction(request) -> responsesubmit_feedback(request) -> response
Management API
Section titled “Management API”Purpose: lifecycle and topology management.
Operations:
boot(bundle) -> boot_resultstop(cerebrum_id) -> stop_resultreadiness(cerebrum_id) -> boolregister_adapter(adapter_descriptor) -> resultunregister_adapter(adapter_id) -> resultadapter_health(adapter_id) -> health_status
Modulation API
Section titled “Modulation API”Purpose: system control-state modulation independent of business payloads.
Operations:
publish_modulator_cocktail(cocktail, scope) -> resultget_modulation_state(scope) -> state
The modulation API is part of the target boundary even if a specific application implementation phases it in later.
Adapter contract
Section titled “Adapter contract”Each adapter should expose the same conceptual contract regardless of transport or tool type.
Identity and capability fields
Section titled “Identity and capability fields”adapter_idtool_typesupported_input_modalitiessupported_output_modalitiessupports_streamingsafety_class
Lifecycle operations
Section titled “Lifecycle operations”start()stop()health()
Inbound path
Section titled “Inbound path”receive_tool_event(event)to_interaction_request(event) -> interaction_request- Submit to the application interaction API.
Outbound path
Section titled “Outbound path”from_interaction_response(response) -> tool_output_or_commandsend_to_tool(output_or_command)
Telemetry and feedback path
Section titled “Telemetry and feedback path”receive_tool_telemetry(telemetry)to_feedback_request(telemetry) -> interaction_request- Submit feedback through the application interaction API.
Required interaction metadata
Section titled “Required interaction metadata”Requests and responses should carry enough metadata to survive routing, correlation, diagnostics, and degradation handling.
Required request concepts
Section titled “Required request concepts”interaction_idsession_idorcorrelation_idintentsource_modalitytarget_modalitypayloadtarget_hintswhen needed
Required response concepts
Section titled “Required response concepts”interaction_idhandledoutput_modalitypayloaddiagnosticsdegraded
Routing selectors
Section titled “Routing selectors”When an application hosts multiple adapters, routing selectors should include:
adapter_id- source modality
- target modality
- interaction intent
- optional target hints
- policy and safety constraints
Message model rules
Section titled “Message model rules”- Interaction payloads and modulation payloads should remain separate.
- Interaction metadata should propagate end-to-end.
- Feedback should be explicit interaction intent rather than a hidden side effect.
- Diagnostics and degraded-state reporting should be first-class response fields.