# 设计文档

## 阅读顺序

1. 了解系统：[框架总览](https://fzkuji.github.io/OpenProgram/docs/reference/design/framework-overview.zh.html) → [仓库结构](https://fzkuji.github.io/OpenProgram/docs/reference/design/repository/structure.zh.html)。
2. 跟踪一次执行：[调用流程](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/agent/agent-call-flow.zh.html) → [执行控制](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/execution/control.zh.html) → [会话存储](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/session/storage.zh.html)。
3. 修改子系统：在下面选主题，读设计和实现状态附录，再核实源码归属和验收要求。

## 按领域

| 领域 | 按此顺序阅读 |
| --- | --- |
| 架构 | [框架总览](https://fzkuji.github.io/OpenProgram/docs/reference/design/framework-overview.zh.html) · [仓库结构](https://fzkuji.github.io/OpenProgram/docs/reference/design/repository/structure.zh.html) · [实现导航](https://fzkuji.github.io/OpenProgram/docs/reference/design/plans/implementation-status.zh.html) |
| 执行与会话 | [执行控制](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/execution/control.zh.html) · [会话存储](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/session/storage.zh.html) · [Session DAG](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/dag/overview.zh.html) · [目标与重启恢复](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/reliability/goal-and-recovery.zh.html) · [Agent 配置](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/agent-configuration/agent-configuration-ui.zh.html) |
| 函数与工作流 | [函数调用](https://fzkuji.github.io/OpenProgram/docs/reference/design/function/calling-unification.zh.html) · [工作流](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/workflows/workflow.zh.html) · [Program 模型](https://fzkuji.github.io/OpenProgram/docs/reference/design/function/agentic-program.zh.html) · [应用运行时](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/programs/application-runtime.zh.html) · [报告工作流](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/workflows/report-suite.zh.html) |
| 事件与调度 | [事件层](https://fzkuji.github.io/OpenProgram/docs/reference/design/proactive/event-layer.zh.html) · [规则执行](https://fzkuji.github.io/OpenProgram/docs/reference/design/proactive/execution-model.zh.html) · [调度与记忆](https://fzkuji.github.io/OpenProgram/docs/reference/design/scheduler/memory-integration.zh.html) · [任务页](https://fzkuji.github.io/OpenProgram/docs/reference/design/scheduler/tasks-page.zh.html) |
| 上下文与记忆 | [上下文总览](https://fzkuji.github.io/OpenProgram/docs/reference/design/context/overview.zh.html) · [上下文组成](https://fzkuji.github.io/OpenProgram/docs/reference/design/context/composition.zh.html) · [压缩](https://fzkuji.github.io/OpenProgram/docs/reference/design/context/compaction.zh.html) · [记忆总览](https://fzkuji.github.io/OpenProgram/docs/reference/design/memory/overview.zh.html) · [实体记忆](https://fzkuji.github.io/OpenProgram/docs/reference/design/memory/entity-memory-proposal.zh.html) |
| 界面 | [UI 总览](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/README.zh.html) · [状态层](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/state-layer.zh.html) · [聊天与输入框](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/composer/composer-interaction-modes.zh.html) · [内置浏览器](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/browser/built-in-browser.zh.html) · [项目工作区](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/workspace/project-workspace.zh.html) · [CLI 与 TUI](https://fzkuji.github.io/OpenProgram/docs/reference/design/cli/README.zh.html) |
| 模型 | [模型目录](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/models/overview.zh.html) · [请求构建](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/requests/request-build.zh.html) · [账号管理](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/auth/unified-account-management.zh.html) · [重试行为](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/reliability/error-retry.zh.html) · [用量计量](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/usage-metering.zh.html) |
| 连接 | [Harness 标准](https://fzkuji.github.io/OpenProgram/docs/reference/design/integrations/harness-standard.zh.html) · [MCP 集成](https://fzkuji.github.io/OpenProgram/docs/reference/design/integrations/extensions/mcp-integration.zh.html) · [MCP 服务器](https://fzkuji.github.io/OpenProgram/docs/reference/design/integrations/extensions/mcp-server.zh.html) · [扩展门控](https://fzkuji.github.io/OpenProgram/docs/reference/design/extension-gating/README.zh.html) · [渠道](https://fzkuji.github.io/OpenProgram/docs/reference/design/channels/design.zh.html) |
| 安全与分发 | [权限与沙箱](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/security/sandbox-architecture.zh.html) · [系统访问](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/security/system-access.zh.html) · [依赖安全](https://fzkuji.github.io/OpenProgram/docs/reference/design/security/dependency-security.zh.html) · [安装与打包](https://fzkuji.github.io/OpenProgram/docs/reference/design/distribution/installation-packaging.zh.html) · [自动更新](https://fzkuji.github.io/OpenProgram/docs/reference/design/distribution/automatic-updates.zh.html) |
| 工程 | [测试系统](https://fzkuji.github.io/OpenProgram/docs/reference/design/testing/test-system.zh.html) · [错误处理](https://fzkuji.github.io/OpenProgram/docs/reference/design/repository/error-handling.zh.html) · [文档结构与渲染](https://fzkuji.github.io/OpenProgram/docs/reference/design/docs-site/overview.zh.html) · [站点可发现性](https://fzkuji.github.io/OpenProgram/docs/reference/design/docs-site/discoverability-performance.zh.html) |

侧栏有七个领域：依次展开领域、模块、页面。导航展开当前路径，筛选同时匹配页面和分类名称。

## 辅助材料

| 类型 | 性质 |
| --- | --- |
| 原型 | 布局和交互实验，不证明行为已实现。有独立的侧栏分类。 |
| 实施记录 | 迁移步骤、计划和待核实差异。先读当前设计；这些不代表实现状态。 |
| 研究 | 探索性提案、威胁分析和评估笔记，不是产品承诺。 |

## 维护规则

- 每页只属于一个侧栏分类。在 `scripts/docs_site/nav.py` 登记页面和阅读顺序；未分类页面显示在“待分类”下。分类调整不改变 URL。
- 每个主题一份当前设计。图、对比和记录说明与它的关系，不复制正文。
- 默认英文，中文同步。见[文档约定](https://fzkuji.github.io/OpenProgram/docs/reference/design/docs-site/overview.zh.html)。
- 文档声明、源码存在、测试通过、已发布和已安装 App 验收是不同状态。分类不代表完成度。
