feat: harden gbrain self-update — smoke test, auto-rollback, daily catch-up - #11
Merged
Merged
Conversation
…tch-up Extracted self-update from the 04:00 nightly into gbrain-selfupdate.sh so it can also run from a new SessionStart hook (gbrain-update-check.py), rate limited once/day — a machine asleep at 04:00 is never more than a day behind. Every update now runs a smoke test (gbrain doctor --fast) after installing; a broken pull auto-rolls back to the previous commit instead of leaving a dead gbrain. Result is written to ~/.gbrain/last-update.json and surfaced as a one-line block in Profile/memory.md (with the new version's top CHANGELOG bullets), only when something actually changed. test-hooks.sh: 25/25 (10 new checks for the two pieces). Claude-Session: https://claude.ai/code/session_01QEFbVY56vJYjVfEkf8Ldww
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
engine/nightly/gbrain-selfupdate.sh, callable from two places: the nightly, and a new SessionStart catch-up hook (gbrain-update-check.py, rate-limited once/day) — a machine asleep at 04:00 is never more than a day behind.gbrain doctor --fast) after install; a broken pull auto-rolls back to the previous commit instead of shipping a deadgbrain.~/.gbrain/last-update.jsonand surfaced as a one-line block inProfile/memory.md(with the new version's top CHANGELOG bullets) — only when something actually changed, no daily noise.Test plan
bash -non every touched/new shell scriptpython3 -m py_compileon the new hook./test-hooks.sh— 25/25 passing, including 10 new checks: no-op when up to date, memory.md block + changelog surfaced on a real update,last-update.jsonstatus, auto-rollback on a failed smoke test, SessionStart daily rate-limitinghttps://claude.ai/code/session_01QEFbVY56vJYjVfEkf8Ldww