fix: add session-log migration tool for pre-0.1.0 logs (Fixes #19) - #21
Open
uluckystar wants to merge 1 commit into
Open
fix: add session-log migration tool for pre-0.1.0 logs (Fixes #19)#21uluckystar wants to merge 1 commit into
uluckystar wants to merge 1 commit into
Conversation
…er#19) Logs written by 0.1.0 and earlier carry agent-teams/* events without the ignorable envelope marker, so the harness refuses to load those sessions (SessionFormatUnsupportedError). Add a zero-dependency migration script that rewrites such logs in place (idempotent, --self-test included), and document it in the README.
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.
Fixes #19 — 存量会话日志迁移工具。
背景
0.1.0 及更早版本(以及 #8 修复前的本地构建)写入会话日志的
agent-teams/*事件没有携带ignorable信封标记。harness 的持久化协调器会拒绝解释任何包含"未知且未标记 ignorable"事件类型的日志:#8/#9 修复了新写入,但存量会话的日志仍然打不开,#19 请求提供迁移工具。
改动
scripts/migrate-session-logs.mjs(新增,零依赖,仅 Node 内置 zstd):agent-teams/*事件插入"ignorable": true,其余字节原样保留--self-test:内存构造合成日志验证插入与幂等性README.md:新增「存量日志迁移」章节,给出find ... -exec一键迁移命令与自检方式验证
node scripts/migrate-session-logs.mjs --self-test通过