Skip to main content
Glama
Knuckles-Team

Repository Manager

Doctor

rm_lane_doctor

Diagnoses impossible test, build, or merge failures in concurrent Git worktree lanes by checking environment and lifecycle collisions without mutating files.

Instructions

Doctor (rm_lane). The lane lifecycle for concurrent agents and humans (CONCEPT:RM-LANE-DOCTOR).

Every check behind this tool exists because a specific collision destroyed real work while the rule that would have prevented it was written down, in prose, in front of the actor who broke it: editing a canonical checkout a background git reset then discarded; a git stash into the ONE refs/stash shared by ~54 worktrees; a shared CARGO_TARGET_DIR that corrupts rather than merely serializes; an unset PRE_COMMIT_HOME whose shared store swallows unstaged work; a foreign or stale worktree-local .venv worth ~167 phantom failures; and measuring a branch TIP that will never be the tree that lands. The exact all-extras environment managed by scripts/uv_workspace.py is accepted because it is lane-partitioned and synchronized before execution.

doctor is the one to reach for when something behaves impossibly — a test failing that cannot fail, a build that will not go green, a merge that keeps being refused. It answers in under a second and mutates nothing.

Input Schema

NameRequiredDescriptionDefault
envNoFor 'doctor': the CALLER's own exported environment (at least PRE_COMMIT_HOME/CARGO_TARGET_DIR/PYTEST_ADDOPTS). Required for a truthful remote check (D-CDX-61) — this server process's own environment is not the lane process's, so omitting this evaluates the checks against server-internal state that has nothing to do with what the caller will actually run with.
baseNoBase branch to fork from / land onto (default main).
pathNoThe lane's working tree for doctor/env/finish (default: cwd).
repoNoRepo basename or absolute path. Required for 'start'.
forceNoFor 'finish': enqueue despite a blocking preflight check. Recorded in the result.
branchNoBranch for 'start'/'finish' ('finish' defaults to that tree's HEAD).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.5.1

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish the safety profile (readOnlyHint=false, openWorld=false, non-idempotent), so the description only needs to add context — and it does add latency ('under a second') plus the important env-source caveat. But the claim 'it mutates nothing' sits awkwardly against the readOnlyHint=false annotation and the schema's mutating 'finish'/force path, creating ambiguity rather than resolving it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition is long and front-loads lore ('Every check behind this tool exists because a specific collision destroyed real work...') rather than selection essentials. The single most useful sentence for an agent — when to reach for this tool — is buried at the very end, and there is no header-style structure to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described. The description covers the concept and the caller-env caveat, which is the highest-risk invocation detail, but it never reconciles the 'doctor' framing with the start/finish parameters present in the schema, leaving the tool's actual action surface ambiguous.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds only marginal parameter meaning — the note that the uv_workspace.py all-extras environment is an accepted/partitioned value — while base, path, branch, repo, and force are left entirely to the schema. No syntax, defaults, or interaction details are added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The tool is identifiable as a fast, read-style diagnostic for 'rm_lane' worktrees — the final sentence states the trigger ('something behaves impossibly') and the shape of the answer (sub-second, no mutation). However, most of the text is narrative justification rather than a compact statement of what the tool actually does, and it never names the checks or outputs in enumerable form. It also gives weak differentiation from siblings like rm_lane_env, rm_lane_heal, or repository_manager_worktree_hygiene.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives concrete, actionable triggers: a test that cannot fail failing, a build that will not go green, a merge repeatedly refused. That is clear when-to-use context beyond what the schema provides. It does not, however, state any when-not condition or name the alternative diagnostic tool to prefer in adjacent situations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools