Epic: Evaluate Pi (badlogic/pi-mono) architectural patterns for terraphim-ai
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- rust, typescript
- 领域
- ai, backend-api-design
调研方向
Read cto-executive-system/knowledge/external/context-engineering/pi-coding-agent-architecture.md and cto-executive-system/knowledge/claude-code-architecture-deep-dive.md, then review evaluation items #683-#687. Compare each Pi pattern with the stated terraphim-ai gaps and record an adoption or rejection rationale for every item; completion is a decision on all five items.
由索引模型根据 Issue 内容生成。
描述
Overview
Evaluate architectural patterns from Pi coding agent (badlogic/pi-mono, 24.5k stars, MIT) for adoption in terraphim-ai. Pi is a layered, extensible TypeScript coding agent toolkit with patterns that address known gaps in our current architecture.
Knowledge base article: cto-executive-system/knowledge/external/context-engineering/pi-coding-agent-architecture.md
Comparison article: cto-executive-system/knowledge/claude-code-architecture-deep-dive.md
Evaluation Items
- Tree-structured session storage for terraphim_persistence #683
- Layered crate architecture: extract standalone LLM interaction crate #684
- Cross-provider context serialisation for ADF multi-model routing #685
- Typed beforeToolCall/afterToolCall hook pattern for terraphim-skills #686
- Steering and follow-up message queues for ADF agent interaction #687
Context
Pi takes a fundamentally different approach from Claude Code: minimal core (4 built-in tools) with a TypeScript extension system that can replace any component. While we are not adopting Pi itself (our stack is Rust + Claude Code), several of its architectural patterns address real gaps:
- Session branching: Our current linear JSONL sessions lose history on compaction. Pi's tree structure (id/parentId) preserves all branches in a single file.
- Layered architecture: Pi cleanly separates LLM API, agent loop, and UI into independent packages. Our LLM interaction code is scattered across terraphim_orchestrator, terraphim_multi_agent, and ad-hoc scripts.
- Cross-provider handoffs: Pi serialises context for mid-session model switching. ADF routes different agents to different models but cannot hand off context between them.
- Tool hooks: Pi's typed
beforeToolCall/afterToolCallat the agent-core level is simpler than Claude Code's JSON-based shell hooks. Pattern applicable to terraphim-skills. - Message queues: Pi's steering (interrupt) vs follow-up (after completion) queues are missing from ADF agent interaction.
Architecture Decision
Each evaluation item is independent. Successful evaluations may lead to implementation issues. Items that do not justify adoption should be closed with rationale.
What NOT to Adopt
- Pi itself (TypeScript, not Rust)
- Anti-MCP philosophy (MCP is integral to our workflow)
- Anti-sub-agents philosophy (agent teams are core to our approach)
- TypeScript extension system (our skills are Markdown + shell)
- 主要语言
- Rust
- 星标
- 62
- 派生
- 5
- 平均合并
- 2 小时 27 分钟
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
terraphim/terraphim-ai 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
terraphim/terraphim-ai#885 ·
-
难度 4/5 3-5 天 新手友好度 55/100
terraphim/terraphim-ai#871 ·
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
terraphim/terraphim-ai#810 · 2 条评论 ·
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
terraphim/terraphim-ai#729 ·
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
terraphim/terraphim-ai#728 ·
查看 terraphim/terraphim-ai 的全部 Issue
相似的 Issue
-
risk:low runtime status:in-progress type:test
难度 1/5 1 小时以内 新手友好度 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 84/100
EricSpencer00/Resilient#4835 · 1 条评论 ·
-
agent:ready documentation
难度 2/5 1-3 小时 新手友好度 88/100
cesarferreira/stax#890 ·
-
bug
难度 1/5 1 小时以内 新手友好度 90/100