Skip to content

sheets

sheets

Sheet composer — produces the sheet structure for agent scores.

Generates a 12-sheet cycle structure with parallel fan-out phases:

Phase 1   (sequential):   Recon -> Plan -> Work          (sheets 1-3)
Phase 1.5 (CLI):          Temperature check (gates Play)  (sheet 4)
Phase 2   (fan-out of 3): Integration || Play || Inspect  (sheets 5-7)
Phase 3   (fan-out of 3): AAR || Consolidate || Reflect   (sheets 8-10)
Phase 3.5 (CLI):          Maturity check                  (sheet 11)
Phase 4   (sequential):   Resurrect                       (sheet 12)

Total: 12 sheets per cycle.

Classes

SheetComposer

SheetComposer(templates_dir=None)

Composes the sheet structure for an agent score.

Takes agent definitions and default config, produces the sheet section of a Mozart score YAML including fan-out, dependencies, cadenzas, and instrument assignments.

Source code in src/marianne/compose/sheets.py
def __init__(self, templates_dir: Path | None = None) -> None:
    self.templates_dir = templates_dir
Functions
compose
compose(agent_def, defaults, *, agents_dir=None)

Compose the sheet configuration for an agent score.

Parameters:

Name Type Description Default
agent_def dict[str, Any]

Agent definition dict.

required
defaults dict[str, Any]

Global defaults from the compiler config.

required
agents_dir Path | None

Path to agents identity directory.

None

Returns:

Type Description
dict[str, Any]

Dict representing the sheet: section of a Mozart score.

Source code in src/marianne/compose/sheets.py
def compose(
    self,
    agent_def: dict[str, Any],
    defaults: dict[str, Any],
    *,
    agents_dir: Path | None = None,
) -> dict[str, Any]:
    """Compose the sheet configuration for an agent score.

    Args:
        agent_def: Agent definition dict.
        defaults: Global defaults from the compiler config.
        agents_dir: Path to agents identity directory.

    Returns:
        Dict representing the ``sheet:`` section of a Mozart score.
    """
    name = agent_def["name"]
    agents_dir_path = agents_dir or Path.home() / ".mzt" / "agents"
    identity_dir = str(agents_dir_path / name)

    sheet_config: dict[str, Any] = {
        "size": 1,
        "total_items": SHEETS_PER_CYCLE,
        "descriptions": dict(SHEET_DESCRIPTIONS),
        "prelude": self._build_prelude(identity_dir, defaults),
        "cadenzas": self._build_cadenzas(identity_dir, defaults),
        "fan_out": {
            # Phase 2: 3 parallel instances (integration, play, inspect)
            5: 3,
            # Phase 3: 3 parallel instances (aar, consolidate, reflect)
            8: 3,
        },
        "dependencies": self._build_dependencies(),
    }

    # Add skip_when_command for play gating
    skip_when = self._build_skip_when(agent_def, defaults, identity_dir)
    if skip_when:
        sheet_config["skip_when_command"] = skip_when

    return sheet_config
get_phase_for_sheet
get_phase_for_sheet(sheet_num)

Return the phase name for a given sheet number.

Source code in src/marianne/compose/sheets.py
def get_phase_for_sheet(self, sheet_num: int) -> str:
    """Return the phase name for a given sheet number."""
    return SHEET_PHASE.get(sheet_num, "unknown")
get_sheets_for_phase
get_sheets_for_phase(phase)

Return sheet numbers for a given phase name.

Source code in src/marianne/compose/sheets.py
def get_sheets_for_phase(self, phase: str) -> list[int]:
    """Return sheet numbers for a given phase name."""
    return PHASE_MAP.get(phase, [])
is_cli_sheet
is_cli_sheet(sheet_num)

Return True if the sheet is a CLI instrument (not an LLM call).

Source code in src/marianne/compose/sheets.py
def is_cli_sheet(self, sheet_num: int) -> bool:
    """Return True if the sheet is a CLI instrument (not an LLM call)."""
    return sheet_num in CLI_SHEETS