claude-code: remove from or restore to only an agent account's own home
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: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh, merge-check-typescript.sh): main's version judged it; the change's judges the pull r…
mesh/delivery delivered

Removing a rule from the operator's own home changes what their sessions
obey as surely as placing one: an agent could remove the rule that
constrains it (hq issue 340).
This commit is contained in:
jochen
2026-10-09 09:51:18 +02:00
parent 3677af6079
commit d984eb84d6
5 changed files with 66 additions and 7 deletions
@@ -199,6 +199,9 @@ type KeptFile struct {
// a copy in the module's state first, under a dated folder, checks the copy, then deletes and logs. An item
// the mesh placed is refused — unregistering owns it. Answers where the copy is, so it can be put back.
func RemoveHome(p Paths, kind, name, why string, now time.Time) (map[string]any, error) {
if refused := HomeChangeRefused(p, "removing an item of the home"); refused != "" {
return nil, errors.New(refused)
}
why = strings.TrimSpace(why)
if why == "" {
return nil, errors.New("why is required: the person's reason for removing it, kept in the log")
@@ -348,6 +351,9 @@ func removalFolder(p Paths, kept string) (string, error) {
// kept copy is exactly what was removed, file by file against the digests its note recorded. Logged as the
// removal was; the copy stays, marked as put back.
func RestoreHome(p Paths, kept string, now time.Time) (map[string]any, error) {
if refused := HomeChangeRefused(p, "putting an item back in the home"); refused != "" {
return nil, errors.New(refused)
}
folder, err := removalFolder(p, kept)
if err != nil {
return nil, err