claude-code: undo a home removal through the mesh
mesh/merge-gate pass: builds claude-code → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered

A removal kept its copy but nothing could put it back without a shell on
the machine. claude_code_home_restore puts a kept copy back when nothing is
at its path and the copy matches the digests recorded at removal;
claude_code_home_removed lists what is kept.
This commit is contained in:
jochen
2026-10-07 19:44:07 +02:00
parent 03728728c3
commit a0deb90741
5 changed files with 304 additions and 23 deletions
@@ -329,6 +329,13 @@ func configTools(p Paths, state ConfigState, view *ConfigView) []stdio.Tool {
}
return answer, nil
}},
stdio.Tool{Name: "claude_code_home_removed",
Description: "Every item removed from this node's home through claude_code_home_remove whose copy the module keeps, newest first: what it was, where it was, why it went, its keptAt, and whether it was put back.",
Run: func(map[string]any) (any, error) { return KeptRemovals(p) }},
stdio.Tool{Name: "claude_code_home_restore",
Description: "Undo a removal made with claude_code_home_remove: put the kept copy back at the path it was removed from. Refused when something is at that path now, or when the copy is not exactly what was removed (checked file by file against the digests its removal.json recorded). Logged as the removal was; the copy stays.",
Input: map[string]any{"kept": str("the keptAt the removal answered, as claude_code_home_removed lists it")},
Run: func(a map[string]any) (any, error) { return RestoreHome(p, strArg(a, "kept"), time.Now()) }},
)
return out
}