pub fn load_md_agent(path: &Path) -> Result<AgentConfig>Expand description
Load a tcode AgentConfig from a .md agent source file.
Why: the primary entry point for the (now sole) agent loader — takes a
file path and returns a fully-populated AgentConfig or a descriptive
error.
What: resolves path’s parent directory as the extends: source dir and
its file stem as the agent name, composes the inheritance chain via
compose_agent, then projects the result via [project_to_agent_config].
A missing parent directory, an unreadable file stem, or any
AgentBuildError (not found, cycle, depth exceeded, malformed
frontmatter) is surfaced as a descriptive anyhow::Error — never a panic.
#8129: a disk document declaring only Claude Code’s tools: vocabulary
additionally gets that grant translated into a tcode allowlist by
agents::claude_tools::apply_claude_tools_fallback, which the embedded
projection paths below deliberately do not call.
Test: load_md_agent_base_case, load_md_agent_missing_file_errors,
load_md_agent_with_extends_resolves_chain,
agents::claude_tools::tests::translates_the_shared_version_control_grant.