Expand description
Provider-neutral coding composition for Merry.
This crate is the single owner of coding composition: the parent runtime builder, child-runtime inputs, workspace tools, project-rule and skill projections, process admission lanes, tool order, and stable composition identity. The facade and CLI consume these types rather than assembling a second coding policy.
Structs§
- Coding
Agent Profile - One provider-neutral coding-agent composition applied to a runtime builder.
- Coding
Agent Profile Builder - Builder for the single shared coding-agent composition profile.
- Coding
Agent Profile Hash - Stable identity of a shared coding-agent composition profile.
- Coding
Agent RunPolicy - Coding-loop recovery and final-report policy.
- Coding
Model Role Config - A provider-neutral model/provider pair for one non-primary runtime role.
- Coding
Runtime - A built parent coding runtime and the policy that governs its loop.
- Coding
Runtime Builder - Builder for parent coding runtime composition.
- Coding
Runtime Input - Typed parent coding-runtime inputs shared by full and read-only variants.
- Coding
Subagents Config - Typed subagent composition policy for a parent coding runtime.
- Resolved
Subagent Runtime - Deterministic, fully resolved runtime specification for one child agent.
- Subagent
Default Override - Global
[subagents.default]overrides applied below role overrides and above live parent runtime inheritance. - Subagent
Model Override - Optional concrete provider/model override attached to
[subagents.default]or[subagents.roles.<name>]. - Subagent
Resolution Input - Inputs to the pure
resolve_subagent_runtimeresolver. - Subagent
Role Catalog - Validated catalog of built-in and configured subagent roles plus global defaults.
- Subagent
Role Overlay - User- or project-supplied overlay for defining or customizing a role.
- Subagent
Role Spec - Resolved definition for one subagent role in
SubagentRoleCatalog. - Workspace
Tool Limits - Limits applied by workspace tools.
- Worktree
GcReport - Summary counters returned by
cleanup_orphaned_worktrees. - Worktree
Isolation Manager - Manages detached Git worktree creation, reattachment, and directory layout.
Enums§
- Coding
Agent Profile Build Error - Errors raised while building the shared coding-agent profile.
- Coding
Agent RunPolicy Error - Invalid coding-loop policy.
- Coding
Auto Fallback - What happens when
autoreview denies an action or cannot decide. - Coding
Final Report Policy - Final-report behavior for a coding-agent run.
- Coding
Model Role Config Error - Error returned when a secondary coding role is constructed with the primary role identifier.
- Coding
Permission Mode - Who reviews permission requests, as selected by the product surface.
- Coding
Permission Policy - Permission configuration shared by parent and child coding runtimes.
- Coding
Permission Policy Error - Failure to construct a permission policy for a permission mode.
- Coding
Runtime Build Error - Errors raised while composing a parent coding runtime.
- Coding
Workflow Command - Built-in coding workflow command exposed to interactive surfaces.
- Project
Rules Load Error - Errors raised while loading the root project rules.
- Subagent
Role Error - Errors raised while validating or resolving subagent roles.
- Subagent
Workspace Access - Orthogonal OS sandbox workspace access mode for a subagent role.
- Workspace
Tool Config Error - Errors raised while validating workspace tool configuration.
- Worktree
Error - Errors raised while provisioning or reattaching an isolated Git worktree.
Constants§
- CODING_
AGENT_ DYNAMIC_ CONTEXT_ LAYOUT - Dynamic provider-context layout owned by the runtime coding composition.
- CODING_
AGENT_ POLICY_ PROMPT - Stable coding-specific policy block inserted after runtime instructions on the main coding agent.
- CODING_
AGENT_ PROFILE_ ID - Stable identity of the provider-neutral coding profile contract.
- CODING_
AGENT_ STABLE_ PREFIX_ LAYOUT - Stable provider-prefix layout owned by the runtime coding composition.
- CODING_
LOOP_ PROCESS_ TOOL - Coding-profile name for runtime-owned process execution.
- DEFAULT_
CODING_ AGENT_ MAX_ MODEL_ TURNS - Maximum model-turn ceiling for the coding-profile main agent.
- DEFAULT_
CODING_ SUBAGENT_ MAX_ MODEL_ TURNS - Default coding-profile ceiling for one child agent.
- MAX_
ROLE_ PROMPT_ FILE_ BYTES - Maximum UTF-8 bytes allowed for one role prompt file.
- MAX_
ROOT_ PROJECT_ RULES_ BYTES - Maximum accepted root project-rule file size.
- MIN_
CODING_ SUBAGENT_ MODEL_ TURNS - Minimum model-turn budget for a coding-profile child agent.
- ROOT_
PROJECT_ RULES_ FILE - Root project-rule file loaded by the coding composition.
Functions§
- builtin_
subagent_ role_ instructions - Returns the built-in
<merry_subagent_role>prompt instructions for one of Merry’s standard specialist roles (explore,coder,review). - cleanup_
orphaned_ worktrees - Scans
<base_dir>/<instance_id>/and removes worktrees owned by exited PIDs while sparing every instance whose.pidprocess is still alive. - cleanup_
orphaned_ worktrees_ default - Cleans up orphaned worktree directories left behind by dead Merry processes under the default cache directory.
- coding_
agent - Creates the shared coding-agent composition builder with one workspace root.
- coding_
agent_ loop_ config - Returns the shared default coding-agent loop configuration.
- coding_
subagent_ policy_ prompt - Builds a compact, tool-conditional coding policy tailored for subagent runtimes (omitting parent-only delegation, git-publish, and end-user conversation guidance).
- default_
worktree_ base_ dir - Returns the default base directory for isolated subagent Git worktrees.
- load_
root_ project_ rules - Loads the root
AGENTS.mdfile without following a file symlink. - load_
workspace_ prompt_ file - Loads a workspace-relative
prompt_filesafely, enforcing containment underworkspace_rootandMAX_ROLE_PROMPT_FILE_BYTES. - resolve_
subagent_ runtime - Pure function resolving role, capability intersection, orphaned tool pruning, and 4-level dynamic model/generation inheritance for one child.