版本化 runtime snapshot 并兼容旧格式 / Version runtime snapshots with legacy compatibility - #21
Merged
Merged
Conversation
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.
中文
用户可见结果
runtime snapshot 现在始终以
respo/runtime-snapshot|1顶层 header 开始,包括空 runtime tree。升级后的框架仍能读取现有无 header、每行四字段的 snapshot,并在下一次保存时自然写成 versioned envelope。组件作者继续只选择snapshot_store(...)或replay_store(...),不接触 envelope。安全与生命周期
initial,不会阻断 boot。respo/effectrender metadata 继续排除在 snapshot 外,domain model 也不进入该通道。koka-respo:component-state:v1localStorage key,以便发现并恢复升级前保存的数据。explore/react/runtimeimport。文档
更新 README、store recovery、component lifecycle、PLAN 与 Agents 指引,说明 envelope/entry 两层版本职责、legacy migration、安全回退和 localStorage key 策略。
验证
yarn test:koka:71 / 71 通过,新增 versioned header、空树、round-trip、effect exclusion、legacy decode/re-encode、partial corruption、unknown/malformed version 覆盖。yarn check:Koka 编译和 Vite production build 通过。yarn build:koka触发 Vite replacement,draft 继续保持。关联 issue
Closes #17
English
User-visible result
Runtime snapshots now always start with a
respo/runtime-snapshot|1top-level header, including an empty runtime tree. The upgraded framework still reads the existing headerless four-field-per-line format and naturally writes a versioned envelope on the next save. Component authors continue to select onlysnapshot_store(...)orreplay_store(...)and never handle the envelope.Safety and lifecycle
initialvalues without blocking boot.respo/effectrender metadata remains excluded from snapshots, and the domain model never enters this channel.koka-respo:component-state:v1localStorage key is retained so pre-upgrade values remain discoverable.explore/react/runtimeimports.Documentation
Update README, store recovery, component lifecycle, PLAN, and Agents guidance with the envelope/entry version responsibilities, legacy migration, safe fallback, and localStorage-key policy.
Verification
yarn test:koka: 71 / 71 passed, including new coverage for the versioned header, empty tree, round trip, effect exclusion, legacy decode/re-encode, partial corruption, and unknown/malformed versions.yarn check: Koka compilation and the Vite production build passed.yarn build:kokaafter another draft change triggered Vite replacement and preserved the draft.Related issue
Closes #17