@@ -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: { ... } });
114118For any ` bitfun-core ` decomposition, feature-boundary, dependency-boundary, or
115119Rust 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