refactor(storage): add bounded context offload lifecycle - #4159
Merged
Conversation
Base automatically changed from
refactor/context-offload-sqlite-foundation
to
main
August 29, 2026 10:22
Generated-by: OpenAI Codex
likun666661
force-pushed
the
refactor/context-offload-bounded-lifecycle
branch
from
August 29, 2026 10:23
8ffaf9b to
9b04195
Compare
Generated-by: OpenAI Codex
6 tasks
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
context_gc_candidateseligibility set, so GC selects bounded metadata batches instead of scanning or anti-joining the complete blob population.EXPLAIN QUERY PLANassertions for the Session and GC indexes.This is a stacked, storage-only follow-up to #4078. Its base is
refactor/context-offload-sqlite-foundation; it should be rebased tomainafter #4078 merges. No runtime consumer is wired yet, so this does not change production behavior.Refs #4071
Depends on #4078
Bounded-work contracts
context_refs_sessionand is proportional to references owned by that Session.context_gc_candidates.maxBlobs + 1indexed candidate rows, obeys both blob and byte budgets, and never materializes payloads while selecting work.Verification
npm --workspace @maka/core run buildnpm --workspace @maka/storage run buildNODE_NO_WARNINGS=1 node --test packages/storage/dist/__tests__/sqlite-context-offload-store.test.js— 16/16 passNODE_NO_WARNINGS=1 node --test --test-reporter=dot "packages/storage/dist/**/*.test.js"— full storage suite passesnpx biome checkon all changed TypeScript filesnpm run check:asf-headersAI use
Tool and scope: OpenAI Codex contributed repository inspection, lifecycle and schema design, implementation, tests, and PR text. The commit includes the required
Generated-bytrailer.Checklist
Does this PR entail a change in behavior?