Skip to main content

Crate merry_coding

Crate merry_coding 

Source
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§

CodingAgentProfile
One provider-neutral coding-agent composition applied to a runtime builder.
CodingAgentProfileBuilder
Builder for the single shared coding-agent composition profile.
CodingAgentProfileHash
Stable identity of a shared coding-agent composition profile.
CodingAgentRunPolicy
Coding-loop recovery and final-report policy.
CodingModelRoleConfig
A provider-neutral model/provider pair for one non-primary runtime role.
CodingRuntime
A built parent coding runtime and the policy that governs its loop.
CodingRuntimeBuilder
Builder for parent coding runtime composition.
CodingRuntimeInput
Typed parent coding-runtime inputs shared by full and read-only variants.
CodingSubagentsConfig
Typed subagent composition policy for a parent coding runtime.
ResolvedSubagentRuntime
Deterministic, fully resolved runtime specification for one child agent.
SubagentDefaultOverride
Global [subagents.default] overrides applied below role overrides and above live parent runtime inheritance.
SubagentModelOverride
Optional concrete provider/model override attached to [subagents.default] or [subagents.roles.<name>].
SubagentResolutionInput
Inputs to the pure resolve_subagent_runtime resolver.
SubagentRoleCatalog
Validated catalog of built-in and configured subagent roles plus global defaults.
SubagentRoleOverlay
User- or project-supplied overlay for defining or customizing a role.
SubagentRoleSpec
Resolved definition for one subagent role in SubagentRoleCatalog.
WorkspaceToolLimits
Limits applied by workspace tools.
WorktreeGcReport
Summary counters returned by cleanup_orphaned_worktrees.
WorktreeIsolationManager
Manages detached Git worktree creation, reattachment, and directory layout.

Enums§

CodingAgentProfileBuildError
Errors raised while building the shared coding-agent profile.
CodingAgentRunPolicyError
Invalid coding-loop policy.
CodingAutoFallback
What happens when auto review denies an action or cannot decide.
CodingFinalReportPolicy
Final-report behavior for a coding-agent run.
CodingModelRoleConfigError
Error returned when a secondary coding role is constructed with the primary role identifier.
CodingPermissionMode
Who reviews permission requests, as selected by the product surface.
CodingPermissionPolicy
Permission configuration shared by parent and child coding runtimes.
CodingPermissionPolicyError
Failure to construct a permission policy for a permission mode.
CodingRuntimeBuildError
Errors raised while composing a parent coding runtime.
CodingWorkflowCommand
Built-in coding workflow command exposed to interactive surfaces.
ProjectRulesLoadError
Errors raised while loading the root project rules.
SubagentRoleError
Errors raised while validating or resolving subagent roles.
SubagentWorkspaceAccess
Orthogonal OS sandbox workspace access mode for a subagent role.
WorkspaceToolConfigError
Errors raised while validating workspace tool configuration.
WorktreeError
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 .pid process 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.md file without following a file symlink.
load_workspace_prompt_file
Loads a workspace-relative prompt_file safely, enforcing containment under workspace_root and MAX_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.