selfupdate: the staging folder keeps what it needs and no more (R-1368 part 2) — not released
gates / gates (push) Successful in 35s
gates / gates (push) Successful in 35s
Each good update left its staged binary in <state dir>/selfupdate for ever (49 files / 740 MB on demo-hp). After the wrapper's commit returned success, MaybeCommit now removes every staged binary but the running version's. Nothing is removed while a pending marker exists or cannot be read, at a plain start, or after a rollback. Only a regular file with the exact name Execute writes is removed. The rollback reads pending.json and felhom-agent.prev, no staged binary: pinned by a test on the wrapper's text and by a test that runs the wrapper's real commit and rollback verbs in a sandbox. Red seen three times. No version bump, no build, no vouch. /usr/local/bin/felhom-agent.bak-* is not reached (root-owned; R-1368 part 4). Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
41d5eb8051
commit
776025c824
8 files changed
+523
-58
No files matched your search
@@ -128,4 +128,11 @@ func (m *Manager) MaybeCommit(ctx context.Context) {
|
||||
if m.onCommitted != nil {
|
||||
m.onCommitted(ctx)
|
||||
}
|
||||
// R-1368 part 2: the update ended healthy — the folder keeps the running version's binary and no other
|
||||
// (prune.go). A refusal or a failed removal is logged and changes nothing about the commit.
|
||||
if removed, err := pruneStaged(m.stateDir, m.runningVersion, m.logger); err != nil {
|
||||
m.logger.Warn("selfupdate: old staged binaries NOT removed after the commit", "err", err)
|
||||
} else if len(removed) > 0 {
|
||||
m.logger.Info("selfupdate: old staged binaries removed after the commit", "count", len(removed), "kept", "felhom-agent-"+m.runningVersion)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user