Repository navigation
Add an admin checkpoint of loaded sessions (MN-REQ-06.15) - #211
Merged
Merged
Conversation
The serve requirement and verify case sit after SafeServeUpgrade: copy every loaded session without draining or refusing traffic, and check a restored directory without loading the live registry. Co-authored-by: chouswei <chouswei@users.noreply.github.com>
Admin checkpoint and checkpoint-verify write and check lossless snaps under the state directory. Unsaveable sessions are skipped, stale snaps are removed, and the commands stay off the agent MCP surface. Co-authored-by: chouswei <chouswei@users.noreply.github.com>
chouswei
marked this pull request as ready for review
October 11, 2026 14:12
chouswei
added a commit
that referenced
this pull request
Oct 11, 2026
Hatch, project.toml, changelog, and the version map name the admin checkpoint and checkpoint-verify (#211, MN-REQ-06.15). Not 0.20.
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
MN-REQ-06.15 (
ServeCheckpoint, verify MN-VER-06-S13) adds an admin-only checkpoint of every loaded session. A backup of saved files misses sessions that never calledsession_save. This copy is taken from RAM, without draining the serve and without refusing new opens. Patch-levelcon 0.19. No version bump and no release.Design
memnet admin checkpointand serve envelope{checkpoint: true, admin_token}. Both useMEMNET_ADMIN_TOKENthe same way asupgrade-prepareandusage-report(unsetadmin_unconfigured, mismatchadmin_denied). Not an agent MCP tool.snapshot_textserialises a consistent copy. Other sessions keep serving. The serve does not enter quiesce.$MEMNET_STATE_DIR/checkpoint/<session>.snap. The previous snap for that session is overwritten. Snaps for sessions that are no longer loaded, and older snaps for sessions skipped this run, are removed so the directory matches the manifest.checkpoint-manifest.jsonreuses the upgrade manifest row (session, rows, edges, checksum, house, clocks) and adds the serve version, snapshot format version, and a timestamp.snapshot_unsaveableand the reason) and skipped. Other sessions are still written. Exit code is non-zero when any session was skipped. Stdout is@STAT: checkpoint|ok|<n>|skipped|<m>|bytes|<b>.memnet admin checkpoint-verify <dir>loads every snap in that directory into a throwaway in-process store (not the live registry) and checks row counts, edge counts, and checksums. Stdout is@STAT: checkpoint_verify|ok|<n>|failed|<m>.Tests
snapshot_unsaveable, and its previous snap is removed.checkpoint-verifypasses on a good directory and fails on a corrupt or missing snap, without registering sessions.Backup script
Hourly, then restic to R2 when the checkpoint exits 0:
Weekly, on a restic-restored copy (not the live state directory):
RESTIC_REPOSITORYis an R2 S3 URL.AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYcome from the job environment. Do not commit them. Teach:docs/operations/backup.md.