Skip to content

feat: 建立小妍持续进化机制并支持 checkpoint 续接 - #67

Merged
Yurken merged 1 commit into
masterfrom
codex/xiaoyan-continuous-evolution
Aug 6, 2026
Merged

feat: 建立小妍持续进化机制并支持 checkpoint 续接#67
Yurken merged 1 commit into
masterfrom
codex/xiaoyan-continuous-evolution

Conversation

@Yurken

@Yurken Yurken commented Aug 6, 2026

Copy link
Copy Markdown
Owner

变更内容

  • 新增《小妍持续进化规划》,明确事实基线、北极星指标、评测门禁、Codex 升级流程、杀停标准与迭代记录。
  • 在 AGENTS.md 和 README 中接入规划入口,要求模型或关键代理能力升级时同步更新评测、文档、代码和测试。
  • 新增版本化 checkpoint handoff,让工作台 checkpoint 可直接续接到小妍。
  • 优先恢复 checkpoint 来源会话;来源会话不可用时,退化为保留原研究上下文的新会话。
  • 预填可编辑续接请求,并显示可移除的 checkpoint 上下文条。
  • 补充 handoff、工作台映射和 Copilot 页面回归测试。

背景与影响

小妍此前的 checkpoint 入口只负责页面跳转,用户跨天恢复研究时仍需重复解释目标、进展和下一步。本 PR 建立持续进化的长期治理机制,并打通首个“工作台 checkpoint → 小妍 → 原会话/上下文 → 可编辑下一步”的垂直切片。

验证

  • pnpm --dir apps/desktop run type-check
  • pnpm --dir apps/desktop run test:81 个测试文件、306 项测试通过
  • pnpm --dir apps/desktop run lint:0 error,18 条仓库既有 warning
  • git diff --check origin/master...HEAD

@Yurken
Yurken marked this pull request as ready for review August 6, 2026 00:57
Copilot AI lite review requested due to automatic review settings August 6, 2026 00:57
@Yurken
Yurken merged commit fcf98c2 into master Aug 6, 2026
6 checks passed
@Yurken
Yurken deleted the codex/xiaoyan-continuous-evolution branch August 6, 2026 00:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The checkpoint handoff apply logic can fail to re-trigger on repeated navigation/dismiss scenarios due to missing location-state syncing and a non-reset restored-id guard.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR establishes a long-term “小妍持续进化” governance plan (metrics, evaluation gates, Codex upgrade workflow) and implements a versioned “workbench checkpoint → Copilot(/chat)” handoff so users can resume research with restored context and a prefilled, editable continuation prompt.

Changes:

  • Add and link the continuous-evolution plan document, and require following it during model/agent upgrades.
  • Route workbench checkpoint actions to /chat with a structured, versioned handoff in Link state.
  • Add Copilot-side restore/apply logic, a removable checkpoint context bar, and regression tests for handoff behaviors.
File summaries
File Description
README.md Adds entry point link to the continuous evolution plan.
AGENTS.md Adds enforcement note to follow the evolution plan during Codex/agent upgrades.
docs/xiaoyan-continuous-evolution-plan.md New long-term governance + evaluation plan and iteration records.
apps/desktop/src/pages/Copilot.tsx Applies checkpoint handoff on /chat, prioritizes restoring source session, renders context bar, updates new-chat/reset flow.
apps/desktop/src/features/workbench/shared.ts Extends link actions to carry state for router handoff payloads.
apps/desktop/src/features/workbench/OverviewModuleViews.tsx Passes state through workbench Link components.
apps/desktop/src/features/workbench/checkpointOverview.ts Builds checkpoint handoff payload and routes actions to /chat.
apps/desktop/src/features/research-context/checkpointHandoff.ts Adds versioned handoff normalization + prompt builder with size limits and guardrails.
apps/desktop/src/features/copilot/useCopilotCheckpointHandoff.ts Adds hook state + apply/dismiss logic for checkpoint handoff restore and prompt prefilling.
apps/desktop/src/features/copilot/CopilotCheckpointContextBar.tsx Adds UI bar showing checkpoint context and a dismiss button.
apps/desktop/src/tests/pages/Copilot.test.tsx Adds tests for session restore + prompt prefilling + dismiss behavior, plus fallback when session missing.
apps/desktop/src/tests/features/workbench/checkpointOverview.test.ts Adds tests ensuring workbench checkpoint actions create a valid handoff state.
apps/desktop/src/tests/features/copilot/checkpointHandoff.test.ts Adds tests for handoff normalization, version rejection, prompt generation, and size limits.
Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 3
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment on lines +9 to +23
export function useCopilotCheckpointHandoffState(locationState: unknown) {
const [handoff, setHandoff] = useState(() => readResearchCheckpointHandoff(locationState));
const activeHandoffRef = useRef(handoff);

useEffect(() => {
activeHandoffRef.current = handoff;
}, [handoff]);

const clearHandoff = useCallback(() => {
activeHandoffRef.current = null;
setHandoff(null);
}, []);

return { handoff, setHandoff, activeHandoffRef, clearHandoff };
}
Comment on lines +54 to +60
const restoredHandoffRef = useRef<string | null>(null);

useEffect(() => {
if (!handoff || !sessionsLoaded) return;
if (restoredHandoffRef.current === handoff.id) return;
restoredHandoffRef.current = handoff.id;
markLastSessionRestored();
- 目标切片:工作台 checkpoint → 小妍原会话 → 可编辑续接请求 → 继续执行
- 文档改动:更新事实基线、推进顺序与本记录
- 代码与测试改动:新增 checkpoint handoff 纯函数和上下文条;更新工作台导航、小妍恢复逻辑及相关测试
- 自动验证:桌面端 type-check 通过;lint 0 error(18 条既有 warning);完整单元测试 120 个文件、435 项全部通过
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants