Env
rm_lane_envDiagnoses and manages isolated git lane environments for concurrent agents, preventing collisions in worktrees, stashes, and caches. Runs non-mutating checks when tests or builds behave unexpectedly.
Instructions
Env (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
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | For '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. | |
| base | No | Base branch to fork from / land onto (default main). | |
| path | No | The lane's working tree for doctor/env/finish (default: cwd). | |
| repo | No | Repo basename or absolute path. Required for 'start'. | |
| force | No | For 'finish': enqueue despite a blocking preflight check. Recorded in the result. | |
| branch | No | Branch for 'start'/'finish' ('finish' defaults to that tree's HEAD). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||