refactor(persist): delegate SessionStore mechanism to acp-kernel/persist - #196
Closed
ranxianglei wants to merge 2 commits into
Closed
refactor(persist): delegate SessionStore mechanism to acp-kernel/persist#196ranxianglei wants to merge 2 commits into
ranxianglei wants to merge 2 commits into
Conversation
Owner
Author
|
防止模型擅自合并,先关闭 |
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.
Protocol-consolidation Phase P (user direction m00509: billion-context 的持久化机制进入内核,下游复用).
What
SessionStorebecomes a thin POLICY adapter overStateStore<PersistedSession>(acp-kernel/persist, shipped 0.0.40/fix(anthropic): forward round-2 stream with proper framing (vertical-text bug) #126 + 0.0.41/release v0.1.38 #130): ~270 lines of duplicated mechanism deleted (atomic write, rename retry, debounce timers, write chains, corrupt-tolerant walk).PersistedSessionv3), namespaced layout (relPathFor), validity, build/buildSession, env knobs (BILI_PERSIST*), singleton. Public API unchanged (session.ts/server.ts/export.tsuntouched).On-disk migration
{version, savedAt, id, payload}. Old flat files (all versions, incl. v1) load via the kernel'slegacyadoption hook and re-persist as envelope on the next dirty write — old sessions never break, files migrate organically.Semantics upgrades (documented in tests)
scheduleSavebuilds the record at WRITE time (freshest state under coalescing) instead of capturing at call time.loadSyncwith stale meta still resolves via the kernel's discovered-file cache — id is authoritative, meta is only a path hint (isolation probe uses a cold store).Deps
acp-kernel0.0.41 (carries the fix: re-inject the client's openai system around the kernel hoist (0.0.37) #193 hoist + persist subpath; base is fix: re-inject the client's openai system around the kernel hoist (0.0.37) #193 — merge that first).Tests
tscbuild-scope clean. Fixes nothing user-visible on its own; unlocks single-sourced persistence across proxy + omp (billion-context-omp#131).