Repository navigation
Conversation
No database copy Tapas writes, uploads or keeps aside at restore holds a stored agent token: - A SQLite backup empties both token tables in its .partial file and vacuums before the rename. Each backup first removes .partial files a crash left (they hold every token), and refuses a second backup to a name that is already being written. - A restore strips the staged copy before it goes live, so a hand-made copy brings back no token, and refuses the restore if that fails. It renames the replaced database aside first and then strips it; a failed strip there never blocks the restore, and the error says to delete the file only when the restore finished. - The bucket copier refuses a SQLite file holding token rows before any upload, reading the main file alone, the bytes it uploads. - The chart's pg_dump excludes both tables' data. SQLite file URIs are now escaped, so a backup to a name with #, ? or % no longer opens a different file. contracts.md, patterns.md, the spec, the restore help, the CLI reference line for it, and the plan's evidence, checkpoint review and deviations are updated.
This branch has not been deployed
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.
Slice 18: Backups and restores hold no offline token
No database backup Tapas writes, copies to the bucket, or keeps aside at restore holds an offline token, and a restore is never blocked by the clean-up.
Spec: nebari-dev/tapas/docs/superpowers/specs/2026-11-30-agent-token-broker-design.md
Plan: nebari-dev/tapas/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md (Slice 18)
Contracts touched: The SQLite backup file that
store.Store.Backupwrites, The database copy in the backup bucket (whatbackup.DatabaseCopieruploads),store.RestoreSQLiteand the<database>.before-restorefile it keeps, The chart's Postgres backup (pg_dumpin thejavo-db-backupCronJob)Depends on: #69
.partialbefore the rename; stale partials a crash left are removed; a second backup to a name being written is refused.immutable=1).pg_dump:--exclude-table-datafor both tables (checked withpg_restore --liston the pinned image).#,?,%in a name opened the wrong file).Reviewer notes:
TestScheduledBackupsRunAndPruneis timing-based and fails locally under full-package-raceload (also before this PR); CI runs without-race.javo db restoreline is regenerated here.Validation
go test -count=1 ./internal/store/... ./internal/backup/...go test -count=1 ./test/helm/...site/scripts/cli-reference.sh && git diff --exit-code site/src/content/docs/reference/cli.mdmake test-localmake test-postgres)