Skip to content

resolve

resolve

Pure per-sheet resolution of the score's memory: key (spec 03, Behaviour 2-4).

resolve_memory turns a validated :class:MemoryConfig plus a sheet's phase identity into frozen :class:ResolvedBinding values. It performs no I/O: it creates no directory, opens no socket and reads no registry. Scope grammar errors surface as the typed E3 from :func:parse_scope.

  • memory: absent (None) -> []: zero gateway, zero sessions.
  • memory: present with no backends -> one synthesized default binding (files, local:default, every permission).
  • otherwise one binding per attachment active in this sheet's phase, in declaration order, matched by the shared technique phase matcher.

The binding is conductor-side data. The musician never sees its principal, permissions or scope; see :mod:marianne.memory.manifest for what it does see.

Classes

SheetPhase dataclass

SheetPhase(name='', movement=None)

A sheet's phase identity: its movement name and/or number (either may be absent).

ResolvedBinding dataclass

ResolvedBinding(name, attachment_id, system, scope, principal, access, permissions, recall_cap_bytes, provenance, lock_timeout_seconds, trust, run_dir, settings=())

One attachment, resolved for one sheet. Conductor-side; never shown to a musician.

Methods:
socket_path
socket_path(job_id, dispatch_id)

The per-dispatch socket path (pure computation, nothing is created).

Source code in src/marianne/memory/resolve.py
def socket_path(self, job_id: str | None, dispatch_id: str) -> Path:
    """The per-dispatch socket path (pure computation, nothing is created)."""
    return planned_socket_path(self.run_dir, job_id, dispatch_id, self.attachment_id)

Functions:

attachment_id

attachment_id(name, scope)

Deterministic UUIDv5 of name + "\0" + canonical scope (spec 03 Interfaces).

Source code in src/marianne/memory/resolve.py
def attachment_id(name: str, scope: str) -> str:
    """Deterministic UUIDv5 of ``name + "\\0" + canonical scope`` (spec 03 Interfaces)."""
    return str(uuid.uuid5(ATTACHMENT_NAMESPACE, f"{name}\0{scope}"))