Problem
Converging the agent home inside a container is one concept. It is written inline three
times, in bootstrap/web-dev.sh, bootstrap/python-dev.sh and bootstrap/rust-dev.sh.
Measured with difflib, after normalising the environment name:
| Pair |
Identical lines |
python-dev and rust-dev |
137 of 173 |
web-dev and python-dev |
125 of 218 |
web-dev and rust-dev |
122 of 218 |
The shared tail is one coherent step: install the agent CLIs, wire ~/.agents, wire the
Claude and Codex homes, link the skills, merge the Codex preferences, and install the status
line.
The LINK_ROOT block that remaps /workspace to the host spelling is byte-identical three
times, at web-dev.sh:47-55, python-dev.sh:35-43 and rust-dev.sh:39-47. It is subtle,
and a fix in one copy does not reach the other two.
docs/bootstrap.md reproduces the duplication a fourth time, as three idempotency tables
that differ only in their toolchain rows.
The host side already has the module
The host version of this exact concept is a module. bootstrap/lib/agent-home.sh:10-37
holds install_host_agent_home, and both bootstrap/host.sh:102 and
components/agent-home/install.sh:20 call it.
So bootstrap/lib/ holds a library for the side that has two callers, and none for the side
that has three.
install_host_agent_home already takes the home directory as a parameter
(local home=${2:-$HOME}), which is the same trick the container version needs.
No test covers these three scripts
They run inside a container. verify/25-python-dev.sh and verify/26-rust-dev.sh observe
the result on a live machine, and they share 61 of about 110 lines with each other.
Goal
Name the module the three environment bootstraps share, and let each script hold only its
toolchain.
Proposed direction
- Add a function beside
install_host_agent_home that converges the agent home inside a
container. It takes the home directory and the link root as parameters.
- Move the shared tail into it: the agent CLIs, the
~/.agents wiring, the client wiring,
the skills, the preferences, the status line and the LINK_ROOT resolution.
- Each
bootstrap/<env>.sh keeps its header, its guard, its manifest, its toolchain step,
one call and its manual list.
- Document the shared step once in
docs/bootstrap.md, and document the three toolchain
differences separately.
- Drive the shared environment checks in
verify/25-python-dev.sh and
verify/26-rust-dev.sh from the module record, so a new environment gets its container,
home, package and routing checks from its manifest, and contributes only its toolchain
assertions.
Acceptance criteria
Problem
Converging the agent home inside a container is one concept. It is written inline three
times, in
bootstrap/web-dev.sh,bootstrap/python-dev.shandbootstrap/rust-dev.sh.Measured with
difflib, after normalising the environment name:python-devandrust-devweb-devandpython-devweb-devandrust-devThe shared tail is one coherent step: install the agent CLIs, wire
~/.agents, wire theClaude and Codex homes, link the skills, merge the Codex preferences, and install the status
line.
The
LINK_ROOTblock that remaps/workspaceto the host spelling is byte-identical threetimes, at
web-dev.sh:47-55,python-dev.sh:35-43andrust-dev.sh:39-47. It is subtle,and a fix in one copy does not reach the other two.
docs/bootstrap.mdreproduces the duplication a fourth time, as three idempotency tablesthat differ only in their toolchain rows.
The host side already has the module
The host version of this exact concept is a module.
bootstrap/lib/agent-home.sh:10-37holds
install_host_agent_home, and bothbootstrap/host.sh:102andcomponents/agent-home/install.sh:20call it.So
bootstrap/lib/holds a library for the side that has two callers, and none for the sidethat has three.
install_host_agent_homealready takes the home directory as a parameter(
local home=${2:-$HOME}), which is the same trick the container version needs.No test covers these three scripts
They run inside a container.
verify/25-python-dev.shandverify/26-rust-dev.shobservethe result on a live machine, and they share 61 of about 110 lines with each other.
Goal
Name the module the three environment bootstraps share, and let each script hold only its
toolchain.
Proposed direction
install_host_agent_homethat converges the agent home inside acontainer. It takes the home directory and the link root as parameters.
~/.agentswiring, the client wiring,the skills, the preferences, the status line and the
LINK_ROOTresolution.bootstrap/<env>.shkeeps its header, its guard, its manifest, its toolchain step,one call and its manual list.
docs/bootstrap.md, and document the three toolchaindifferences separately.
verify/25-python-dev.shandverify/26-rust-dev.shfrom the module record, so a new environment gets its container,home, package and routing checks from its manifest, and contributes only its toolchain
assertions.
Acceptance criteria
LINK_ROOTresolution has one definition.bootstrap/<env>.shholds only its toolchain step and its manual list.docs/bootstrap.mdstates the shared step once../verify.shremains green.