Skip to content

Commit edcb7c4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into wc
2 parents 3f00678 + af7f5a3 commit edcb7c4

472 files changed

Lines changed: 45439 additions & 11376 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS-CN.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ BitFun 是一个由 Rust workspace 与共享 React 前端组成的项目。
2222
| 产品领域 crate | `src/crates/product-domains` | [AGENTS.md](src/crates/product-domains/AGENTS.md) |
2323
| Transport 适配层 | `src/crates/transport` | (使用 core 指南) |
2424
| API layer | `src/crates/api-layer` | (使用 core 指南) |
25+
| ACP 集成 | `src/crates/acp` | [AGENTS.md](src/crates/acp/AGENTS.md) |
2526
| AI adapters | `src/crates/ai-adapters` | [AGENTS.md](src/crates/ai-adapters/AGENTS.md) |
2627
| 桌面应用 | `src/apps/desktop` | [AGENTS.md](src/apps/desktop/AGENTS.md) |
2728
| Server | `src/apps/server` | (使用 core 指南) |
@@ -114,14 +115,13 @@ await api.invoke('your_command', { request: { ... } });
114115
任何 `bitfun-core` 拆解、feature 边界、依赖边界或 Rust 构建提速重构,
115116
都必须先阅读
116117
[`docs/architecture/core-decomposition.md`](docs/architecture/core-decomposition.md)。
117-
该文档定义产品行为不变量、crate 归属目标、禁止依赖方向、feature 安全规则和里程碑验证门禁。
118+
顶层文档只作为入口;模块级 ownership 细节应放到离代码最近的模块 `AGENTS.md`。
118119

119-
### Tool 归属护栏
120+
仓库级拆解规则:
120121

121-
- `src/crates/agent-tools` 拥有轻量 tool contract,以及 generic registry / dynamic-provider container。
122-
- `src/crates/core/src/agentic/tools` 当前负责产品工具组装、`dyn Tool` 适配、snapshot decoration、tool exposure / manifest resolution,以及按需工具说明发现(`GetToolSpec`)。
123-
- `ToolUseContext` 与具体工具实现继续留在 core,直到有已评审的 port/provider 设计和等价测试。
124-
- Tool 迁移必须保持 expanded/collapsed exposure、prompt 可见 manifest、`ToolUseContext.unlocked_collapsed_tools`,以及 desktop/MCP/ACP tool catalog 行为等价。
122+
- 不要把 DTO / contract 抽取误判为 runtime owner 已迁移。
123+
- 产品表面可以有差异;共享稳定 facts 或 ports,不共享 UI、protocol、lifecycle 或平台实现。
124+
- 迁移 runtime owner 必须有评审过的 port/provider 设计、旧路径兼容、行为等价测试;如果可能改变行为边界,还需要先确认。
125125

126126
### DeepReview 护栏
127127

‎AGENTS.md‎

Lines changed: 16 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ Repository rule: **keep product logic platform-agnostic, then expose it through
1818
|---|---|---|
1919
| Core (product logic) | `src/crates/core` | [AGENTS.md](src/crates/core/AGENTS.md) |
2020
| Extracted core support | `src/crates/{core-types,agent-stream,runtime-ports,terminal,tool-runtime}` | (use core guide) |
21-
| Core owner crates | `src/crates/{services-core,services-integrations,agent-tools,tool-packs}` | (use core guide + decomposition guardrails) |
21+
| Service core owner crate | `src/crates/services-core` | [AGENTS.md](src/crates/services-core/AGENTS.md) |
22+
| Service integrations owner crate | `src/crates/services-integrations` | [AGENTS.md](src/crates/services-integrations/AGENTS.md) |
23+
| Agent tool contracts | `src/crates/agent-tools` | [AGENTS.md](src/crates/agent-tools/AGENTS.md) |
24+
| Tool pack provider plan | `src/crates/tool-packs` | [AGENTS.md](src/crates/tool-packs/AGENTS.md) |
2225
| Product domains | `src/crates/product-domains` | [AGENTS.md](src/crates/product-domains/AGENTS.md) |
2326
| Transport adapters | `src/crates/transport` | (use core guide) |
2427
| API layer | `src/crates/api-layer` | (use core guide) |
28+
| ACP integration | `src/crates/acp` | [AGENTS.md](src/crates/acp/AGENTS.md) |
2529
| AI adapters | `src/crates/ai-adapters` | [AGENTS.md](src/crates/ai-adapters/AGENTS.md) |
2630
| Desktop app | `src/apps/desktop` | [AGENTS.md](src/apps/desktop/AGENTS.md) |
2731
| Server | `src/apps/server` | (use core guide) |
@@ -114,59 +118,17 @@ await api.invoke('your_command', { request: { ... } });
114118
For any `bitfun-core` decomposition, feature-boundary, dependency-boundary, or
115119
Rust build-speed refactor, read
116120
[`docs/architecture/core-decomposition.md`](docs/architecture/core-decomposition.md)
117-
before editing. The guardrail document defines product-behavior invariants,
118-
crate ownership targets, forbidden dependency directions, feature safety rules,
119-
and milestone verification gates.
120-
121-
### Tool ownership guardrails
122-
123-
- `src/crates/agent-tools` owns lightweight tool contracts and the generic
124-
registry / dynamic-provider container.
125-
- `src/crates/core/src/agentic/tools` owns product tool assembly, `dyn Tool`
126-
adaptation, snapshot decoration, tool exposure / manifest resolution, and
127-
on-demand tool spec discovery (`GetToolSpec`) for now.
128-
- Keep `ToolUseContext` and concrete tool implementations in core until a
129-
reviewed port/provider design and equivalence tests exist.
130-
- Tool migrations must preserve expanded/collapsed exposure, prompt-visible
131-
manifests, `ToolUseContext.unlocked_collapsed_tools`, and desktop/MCP/ACP
132-
tool catalog behavior.
133-
134-
### Latest-main runtime anchors
135-
136-
- Agent registry migration must preserve mode-scoped subagent availability,
137-
hidden/custom/review grouping, and desktop subagent API semantics.
138-
- DeepResearch report finalization currently relies on the core citation
139-
renumber hook; do not move it without preserving `report.md`,
140-
`citations.md`, `display_map.json`, and rejected-citation handling.
141-
- Workspace/search refactors must preserve remote workspace startup guards,
142-
remote flashgrep fallback, and search preview/context mapping.
143-
- ACP timeout handling and Web operation-diff fallback are product-surface
144-
behavior; share facts through contracts, not UI/protocol implementation.
145-
146-
### Services/product owner closure
147-
148-
- Remote-SSH path, session identity, mirror path, and unresolved-session layout
149-
helpers belong in `bitfun-services-integrations`; core may inject
150-
`PathManager` and hold SSH manager / remote FS / terminal assembly.
151-
- MiniApp storage shape belongs in `bitfun-product-domains`; core storage
152-
keeps filesystem IO, worker runtime, `PathManager`, and port adapters until a
153-
reviewed runtime migration exists.
154-
- Remote-connect port baselines live in `bitfun-runtime-ports` and
155-
`bitfun-services-integrations`; tracker state and tracker event reduction
156-
belong in `bitfun-services-integrations`. Remote command/response wire DTOs,
157-
remote model catalog DTOs, poll-response assembly helpers, and model-catalog
158-
poll delta policy also belong there. Pure remote image-context
159-
fallback/preference, restore-target, cancel-decision, and remote file-transfer
160-
size/chunk/name helpers also belong in `bitfun-services-integrations`, while
161-
core still owns the adapter back to `ImageContextData`, dispatcher assembly,
162-
session restore execution, file IO/path resolution, terminal pre-warm, and
163-
product execution routing. Further remote runtime owner migration must
164-
preserve the existing migration snapshots for command/response shape,
165-
restore, active-turn polling, cancel decisions, image context
166-
fallback/preference, tracker fanout, file transfer, and RemoteRelay/Bot queue
167-
policy.
168-
`AgentSubmissionPort` still rejects generic attachments until
169-
image/multimodal equivalence tests and a runtime migration plan are reviewed.
121+
before editing. Keep this file as an entry point; put module-specific ownership
122+
details in the nearest module `AGENTS.md`.
123+
124+
Repository-level decomposition rules:
125+
126+
- Do not confuse DTO/contract extraction with runtime owner migration.
127+
- Product surfaces may diverge; share stable facts or ports, not UI, protocol,
128+
lifecycle, or platform implementation.
129+
- Moving runtime ownership requires a reviewed port/provider design, old-path
130+
compatibility, behavior equivalence tests, and explicit confirmation when a
131+
behavior boundary could change.
170132

171133
### DeepReview guardrails
172134

0 commit comments

Comments
 (0)