/MRS-Specification-RFC#7-working-set-envelope
Design Principles
- Agents read MRS-S — complete, human-auditable score fragments
- Scopes use UUIDs — not measure numbers — for structural stability
- Task-adaptive context — views tailored to the specific task, not fixed rings
- Permissions via bundles — lane bundles grant appropriate modification rights
Envelope Structure
Envelope Fields
Required Fields
| Field | Type | Description |
|---|---|---|
:version | decimal | Envelope version (1.0) |
:source-hash | string | SHA-256 hash of source state (conflict detection) |
:scope | scope-spec | What the agent may modify |
:content | MRS-S | The score fragment (readable, target of ops) |
Scope Specification
Permission Fields
| Field | Type | Description |
|---|---|---|
:bundle | keyword | Lane bundle granting permissions |
:allowed-ops | list | Explicit list of permitted operation types |
Optional Fields
| Field | Type | Description |
|---|---|---|
:task | string | Natural language task description |
:constraints | list | Validation rules agent must satisfy |
:context-views | list | Task-adaptive context views |
:structural-index-ref | string | Hash reference to structural index |
:available-queries | list | Queries agent may request |
Content Self-Containment
The:content of a Working Set Envelope MUST be parseable as standalone MRS-S:
- Instrument definitions MUST be included
- Time/key/tempo state at extraction start MUST be declared
- Spans MUST have both endpoints within scope OR be marked with boundary markers
Task-Adaptive Context Views
Context views provide task-relevant information beyond the edit scope. Unlike fixed “near/far” rings, views are selected and shaped for the specific task. See: Task-Adaptive Context ViewsView Types
| View Type | Purpose |
|---|---|
melodic-reference | Melody the agent should respond to |
harmonic-context | Chord progression and key areas |
orchestration-map | Active instruments and texture |
phrase-structure | Phrase boundaries and form |
dynamics-profile | Dynamics trajectory |
thematic-references | Themes and motifs |
View Selection by Task
| Task Type | Typical Views |
|---|---|
| Countermelody | melodic-reference, harmonic-context |
| Orchestration | orchestration-map, dynamics-profile |
| Dynamics pass | phrase-structure, dynamics-profile |
| Harmonization | melodic-reference, phrase-structure |
Boundary-Crossing Spans
When a span crosses the envelope boundary:Boundary Rules
:boundary-entry true— span starts outside scope, ends inside:boundary-exit true— span starts inside scope, ends outside- Both markers — span crosses through scope
:from, :to, or :events of boundary-marked spans.
Available Queries
Agents may request additional context:Constraints
Constraints specify rules that generated content must satisfy:Constraint Types
| Type | Syntax | Description |
|---|---|---|
| Range | (range <instrument> <low> <high>) | Notes within range |
| Avoid | (avoid <violation> <ref-part>?) | Prevent voice-leading errors |
| Prefer | (prefer <feature> <location>) | Style preferences |
| Density | (note-density <min> <max>) | Notes per measure |