feat(trajectory): D1 轨迹飞轮 — 汇聚标注 + SFT/DPO/GRPO 导出 (#50 #51) - #56
Merged
Conversation
新增 trajectory 顶层子命令, 把 session jsonl 清洗为训练数据飞轮: #50 统一汇聚 + is_error 标注: - collector 扫描 ~/.fusion-code/projects/**/*.jsonl (含 subagents) - 配对 tool_use ↔ tool_result, 按 is_error 标注 positive / self_correction - 写入 ~/.fusion/trajectories/{manifest.json, raw/*.jsonl} #51 三格式导出 CLI: - SFT — ShareGPT messages, 仅 positive 轨迹 - DPO — 偏好对, self_correction: 失败作 rejected / 最终成功作 chosen - GRPO — prompt + reward, reward = is_error ? 0 : 1 模块: src/services/trajectory/{types,collector,exporters,index}.ts CLI: src/cli/handlers/trajectory.ts (collect|export|manifest|list) 注册: src/entrypoints/cli.tsx fast-path (args[0] === "trajectory") 测试: src/__tests__/trajectory/trajectory.test.ts (11 pass) 文档: docs/trajectory-pipeline.md + README.md 验证: tsc clean / biome lint 0 error / 11 test pass / build green / 端到端冒烟通过 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
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.
概述
实现 D1 轨迹飞轮, 把 fusion-code 会话产生的 session jsonl 清洗为 fusion-trainer 可消费的训练数据集。
Closes #50 (统一汇聚目录 + is_error 标注)
Closes #51 (三格式导出 CLI: SFT/DPO/GRPO)
数据流
标注规则
is_error=true→ SFTCLI
模块
src/services/trajectory/{types,collector,exporters,index}.tssrc/cli/handlers/trajectory.ts(trajectoryMain)src/entrypoints/cli.tsxfast-path 注册src/__tests__/trajectory/trajectory.test.ts(11 pass)docs/trajectory-pipeline.md+ README.md验证
🤖 Generated with Claude Code