Status: superseded by
ADR 0020:
the per-repo installers no longer run at container start, so there is no gate
left to hold; toolbox-refresh runs them on demand.
Every figure below is as measured when this decision was taken — evidence for the choice, not a description of the repo today. Nothing here is kept in sync; current values live in the files that set them.
Three Init Sequence scripts — 30-graphify.sh, 31-codegraph.sh and
40-playwright-cli.sh — re-ran their tool's per-repo installer on every shell,
gated only on the opt-in artefact already existing in the workspace
(graphify-out/, .codegraph/, .claude/skills/playwright-cli/). Because
those installers write into the workspace, every image upgrade that moved a
bundled tool version rewrote tracked files — CLAUDE.md,
.claude/settings.json, .claude/skills/graphify/ — and left the user with a
dirty tree they did not ask for. We now gate each refresh on version differs
or an expected artefact is missing, with a toolbox-owned version stamp kept
outside the workspace under $HOME/.toolbox-state/, keyed by (workspace, tool).
The name for the family is Workspace Install Refresh (see CONTEXT.md). The
three scripts already referenced each other in their comments ("mirrors
graphify/codegraph") without a written rule, which is the fan-out this repo has
collapsed before under Tool Catalog and Config Schema: unnamed, the fourth
member would have copied the old pattern.
Native per-tool stamps. Each tool would provide its own gate: graphify
already writes .graphify_version, codegraph ships install --refresh,
playwright-cli has neither. Rejected because one family would run on three
mechanisms, and the one member with no native support would silently stay
ungated. The graphify stamp is a poor input anyway — in project scope nothing
reads it (_check_skill_version walks user-scope destinations only), so it is
write-only state whose meaning we would have had to invent.
A stamp next to the installation (.claude/skills/<tool>/.toolbox-version).
Uniform, but it creates a new workspace file — the exact churn the gate exists
to remove.
Gate on version alone. Simpler, but it turns a broken installation into a
permanently broken one: deleting .mcp.json or the graphify skill would no
longer self-heal at the next shell, and the symptom (a missing source) does not
point at the cause (an up-to-date stamp). The or artefact missing half of the
condition keeps the self-healing property the unconditional re-install had.
Leave it as it is and commit the churn. Viable for this repo, but the scripts ship in the image: the cost lands on every user with an indexed repo, not on us.
30-graphify.sh additionally normalises the two PreToolUse matchers that
graphify install writes — the search guard Bash|Grep narrows to Grep,
the read guard Read|Glob to Glob — and only when a matcher is still the
known upstream value, so a hand-edited hook survives.
This is graphify-specific: it is the only member that installs hooks.graphify install re-installs by dropping what it wrote
last time and appending it afresh, and it recognises its own hooks by (the
matcher is a known wide literal) and (the entry mentions graphify).
The rename invalidates the first half only, so upstream stops seeing its own
work and appends a second pair on every reopened gate. 30-graphify.sh
therefore drops the graphify-owned entries already sitting at the narrowed
matcher before renaming the freshly appended wide ones — last run's entry and
this run's are never confusable, because only the latter is still wide.
Ownership is tested only where an entry is deleted, never on the rename, so a
hand-written Grep hook that says nothing about graphify is left alone; and
the drop is guarded on a wide graphify entry actually being present, so a
failed install (nothing appended) removes nothing and the workspace is never
left hookless. Deduplicating identical entries instead would have been the
smaller change and the wrong one: an upgrade that alters the hook payload
produces two entries that differ, which no equality test collapses.SKILL.md for graphify and playwright-cli, .mcp.json for codegraph — and
deliberately not the PreToolUse hook block or the ## graphify section in
CLAUDE.md. Those two are content a user may edit or remove on purpose, and
re-installing them on every shell would fight exactly the hand edits the
matcher normalisation goes out of its way to preserve. A missing skill means
the installation is broken; a missing hook block may mean the user meant it.toolbox stop and is
per-host, not per-container.graphify hook install stays outside the gate so fresh clones get local git
hooks even with a current stamp. It follows core.hooksPath, which can point
to tracked hooks: those hooks have only the interpreter pin in graphify's
block cleared after installation, so machine-local paths do not get committed
but payload upgrades still refresh. The installer also writes merge
attributes. When the graph is ignored, a newly created .gitattributes is
removed only if it contains exactly the default graphify merge rule; existing
or tracked attributes belong to the repository and are preserved.