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
24 lines
1.8 KiB
Markdown
24 lines
1.8 KiB
Markdown
# REPORT — the self-update folder cleans itself (R-1368 part 2) — committed, NOT released (2026-11-10, operator brief)
|
|
|
|
**Plain words first.** Each agent update left its downloaded file on the box for ever: 49 files and 740 MB on demo-hp.
|
|
The agent now removes the old files after an update that ended well. It keeps the file of the version that runs.
|
|
This is a commit only. No version, no build, no vouch. No box has it. It waits for the next agent release.
|
|
|
|
The full report of the run is in `felhom.eu`: `REPORT-endings-kernels-fixes-2026-11-10.md`.
|
|
|
|
| | |
|
|
|---|---|
|
|
| Change | `internal/selfupdate/prune.go` (new); the call in `MaybeCommit` (`commit.go`); one lock in `Execute` (`executor.go`) |
|
|
| Rule | After the wrapper's `commit` returned success: remove every staged binary but the running version's |
|
|
| Never removed | anything while `pending.json` exists or cannot be read; anything at a plain start or after a rollback; `pending.json`; a folder; a symlink; a name the code does not know |
|
|
| Rollback | Needs `pending.json` and `/usr/local/bin/felhom-agent.prev`. It reads no staged binary (`configs/felhom-selfupdate-guarded`, read first) |
|
|
| Tests | `TestPrune_*`, 6 tests. One runs the wrapper's real `commit` and `rollback` verbs from a sandboxed copy |
|
|
| Red seen | 3 times: no prune call; no pending refusal; no regular-file check |
|
|
| Gates | `python3 scripts/agent_gates.py --fast`: all OK |
|
|
| Not reached | `/usr/local/bin/felhom-agent.bak-*`: root-owned, made by a person. R-1368 part 4 stays open |
|
|
| Not proven | On a box. A box cleans its folder at the first good update AFTER the release that brings this code |
|
|
| Machines | None touched by this change |
|
|
|
|
**Next.** A release session builds and vouches it. After two updates on a test box, read the folder: it must hold one
|
|
binary.
|