Skip to content

[Issue #34] Add conversation lineage foundation and operations - #53

Draft
CC1227871 wants to merge 8 commits into
helsome:mainfrom
CC1227871:fix/issue-34-conversation-lineage
Draft

[Issue #34] Add conversation lineage foundation and operations#53
CC1227871 wants to merge 8 commits into
helsome:mainfrom
CC1227871:fix/issue-34-conversation-lineage

Conversation

@CC1227871

@CC1227871 CC1227871 commented Sep 11, 2026

Copy link
Copy Markdown

Implementation plan for Issue #34

This draft PR is intentionally staged so each layer is reviewable and pushed as a separate commit.

Phase 1 — conversation lineage foundation

  • stable branch/message/run/generation identities
  • append-only branch projection and reload-safe cursors
  • Main branch migration for existing sessions

Phase 2 — conversation operations and IPC

  • send, retry failed/cancelled, regenerate, edit, and fork operations
  • branch-aware session IPC and renderer client surface
  • persisted run manifests and workspace snapshots
  • Node smoke coverage for send → regenerate → edit → fork

Phase 3a — native Pi conversation cursors

  • typed RPC support for fork, get_fork_messages, and get_entries
  • stable runtime entry/leaf identity types for audit and branch isolation
  • protocol-level fake-runtime coverage

Phase 3b — native Pi branch isolation

  • branch preparation before a child generation
  • native Pi fork(entryId) when a stable user entry exists
  • fresh branch session file when no native cursor is available
  • per-branch runtime state and runtime session cleanup
  • runtime user/assistant entry IDs and leaf IDs persisted on Run manifests
  • branch-aware RunManager/runtime integration

Phase 4a — branch visibility and switching

  • branch metadata cache and reload hydration
  • visible current-branch selector in the Copilot panel
  • switching reloads only the selected branch projection
  • branch switch is disabled during an active generation

Phase 4b — message-level conversation actions

  • edit action with inline draft/save/cancel UI
  • regenerate, retry, and fork actions on the relevant message/run
  • operation results activate and reload the returned branch projection
  • failed/cancelled runs are loaded after reload and remain retryable
  • live event projection avoids duplicating an already reloaded operation message

Verification so far:

  • root TypeScript check passes
  • packages/shared and packages/ui TypeScript checks pass
  • Node smoke flow passes for send → regenerate → edit → fork
  • Node smoke flow passes for native branch preparation and runtime-path isolation
  • branch atom test covers switching without transcript mixing
  • Bun unit tests are not runnable in this environment because the Bun executable is unavailable

Remaining phases: complete the real Copilot demonstration/evidence flow and run the acceptance checklist end to end.

Related to #34.

@CC1227871 CC1227871 changed the title [Issue #34] Add conversation lineage foundation [Issue #34] Add conversation lineage foundation and operations Sep 11, 2026

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Draft 阶段的 foundation 方向是对的,尤其是 append-only lineage、独立 run/generation identity、retry/regenerate/edit/fork 的非破坏语义。当前先保持 Draft,不建议提前合基础层,因为 #34 的关键闭环还没有完成:

  • 把 Folio branch projection 真正接到 Pi runtime 的 fork/get_fork_messages/get_entries,确保切 branch 后模型上下文本身隔离,而不只是本地 UI/存储投影隔离;
  • branch UI:当前 branch 可见、regenerate alternatives 可切换、failed/cancelled 可正确 retry、历史 branch 可返回;
  • reload 后验证 branch/message/run lineage、workspace snapshot、tool/citation/evidence 都恢复且不串 branch;
  • 用 Bun 跑 unit/integration + 当前仓库 CI。现在“环境没有 Bun”不能作为 ready-to-merge 的最终验证;
  • #34 做真实 Copilot E2E:生成回答 → regenerate → 编辑早期问题 → fork → 两个 branch 分别产生不同 tool/evidence,并证明 reload 后引用和 tool state 仍严格隔离。

这些完成后再 Ready for review。当前不要求推翻已有 3 个 phase,重点是把 runtime/UI/真实 E2E 接成完整闭环。

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

补充更新一下审核标准:上一轮对 #34 的验收要求偏严。你现在已经补到 Phase 3b / 4a / 4b,runtime branch isolation、branch switching、edit/regenerate/retry/fork 的 UI 与 smoke coverage 都已经形成完整骨架。真实 Copilot 的完整多分支 evidence/citation 演示可以作为后续验证,不再要求一次性做到极致。当前继续保持 Draft 主要是尊重作者状态;等你认为实现 ready、标记 Ready for review 后,只要基础 unit/typecheck/关键 smoke 能通过、没有明显 branch 串线或 destructive overwrite 问题,就可以按可合增量处理。

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

补充当前贡献验收要求(你这条仍是 Draft,所以先不做强制 Request Changes):转 Ready for review 前,请把验证材料整理成可复现的测试报告,而不是只写“passes”。至少包含实际命令、Bun/OS、pass/fail 数量、失败基线说明。

另外这条已经修改了 BranchSwitcherAgentPanelTurnCard 等可见 UI,Ready 前请贴至少一张实际修改后截图;最好覆盖 branch switching / edit-regenerate-fork 相关界面。已有界面改造优先 Before/After。

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