Skip to main content
MRS defines a protocol for agent operations centered on typed operations (MRS-Ops), task-adaptive context, and progressive validation. Core Principle: Agents read MRS-S fragments with task-appropriate context. Agents write typed MRS-Ops operations. The orchestrator validates and applies. See: /MRS-Specification-RFC#5-mrs-ops-the-mutation-protocol

Why Typed Operations?

Asking agents to emit complete MRS-S fragments creates failure modes:
  • Accidental omission: Agent returns less content → content silently deleted
  • Calculation errors: Miscomputed :at values, duration sums
  • Hallucinated references: IDs that don’t exist
  • UUID management: Agent must generate valid, non-colliding UUIDs
MRS-Ops eliminates these by design:
  • Explicit operations: Create, update, delete are distinct (no omission risk)
  • Orchestrator-derived fields: Agent provides beat; orchestrator computes :at
  • Temporary IDs: Agent uses tmp-ids; orchestrator assigns UUIDs
  • Minimal surface: Only changed content in output

MRS-Ops Envelope

Operation Types

Create Event

Update Event

Delete Event

Create Span

Span endpoints can reference:
  • Existing UUIDs: #uuid "018c3f2a-..."
  • Temporary IDs from same operation set: "e1"

Update Span

Note: Span endpoints (:from, :to, :events) are immutable. To change endpoints, delete and recreate the span.

Delete Span

Create Measure

The orchestrator assigns UUID, :number, and computes :beat-start.

Delete Measure

Warning: Deleting a measure deletes all events within it.

Instrument Change

Temporary ID Rules

  1. Tmp-ids MUST be strings starting with a letter: "e1", "span-a", "m1"
  2. Tmp-ids are scoped to a single MRS-Ops envelope
  3. Operations MAY reference each other’s tmp-ids within same envelope
  4. Orchestrator maps all tmp-ids to UUIDs before application
  5. Response includes the tmp-id → UUID mapping

Task-Adaptive Context Views

Context views provide task-relevant information beyond the edit scope. Unlike fixed rings, views are selected for the specific task.

Melodic Reference

Harmonic Context

Orchestration Map

Phrase Structure

View Selection by Task Type

Example: Add Countermelody

Working Set Envelope (agent receives):
Agent Response (MRS-Ops):
Orchestrator Response:

Lane Bundles

Lane bundles grant permissions for common workflows:

Constraint Language

Constraint violations are caught in progressive validation.