feat(taiji): unofficial custom package - warden/poke/RBAC, legion, ACP bridge, knowledge-base search - #2177
Open
1688mengdie wants to merge 5 commits into
Open
Conversation
chore(i18n): unify copy wording in zh-CN and zh-TW locale
Remove the parallel application connection and batch review surface, keeping the existing source policy and owner-specific permission controls as the single path. Reduce Web and TUI output, preserve remote and owner guards, and consume retired automatic defaults once without overwriting later user choices.
…icial - baseline: HEAD = 792459b (frozen baseline, clean tree) - merged: taiji-dev/main = ca6eb3d (parent = a86e191 = latest upstream main) - change surface: upstream 3 commits (92a6203 i18n / 8a5dbaa merge GCWing#2172 / a86e191 refactor external-sources) + custom package ca6eb3d - conflicts: none (merge-base = HEAD, taiji-dev side strictly ahead) - custom preserved: warden / legion_mode / acp_tools / knowledge_base_search / session tree / WebUI agents / BeeColonyMonitor / embed-server.py etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
taiji 定制包合入请求
将 taiji 非官方定制成果合入上游
custom/taiji-unofficial定制分支。1688mengdie:custom/taiji-unofficial(merge commit90f1ad2e5)ca6eb3dad(父 = 最新上游a86e1916a,含全部定制成果,压缩自完整开发历史)custom/taiji-unofficial(792459b7b)→ 合入后变更面 = 上游 3 提交 + 定制包共 482 文件(+53482 / -15744),零混入功能域总览
1. Warden 守卫 + RBAC 权限模型(warden/poke/RBAC)
定位:agentic 运行时守卫全链路 + 三权分立权限底座。
{contentLength: N}+ 内容指纹,判定模型只见长度/指纹、不见全文(防内容泄露 + 判定 token 大降)src/crates/assembly/core/src/agentic/warden/runtime.rs(summarize 链)src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs(convert_tool_result / summarize_judgement_tool_args).../tools/implementations/todo_write_tool.rs、.../plan_update_tool.rssanitize_rate(rate=0/NaN/负/超上限 → 永不 poke;f64::INFINITY保留为显式禁用)src/crates/assembly/core/src/agentic/warden/poisson.rs~/.bitfun/warden/(跨 workspace 共享、重启不丢)src/crates/assembly/core/src/agentic/warden/runtime.rs+ scheduler 接线src/crates/assembly/core/src/agentic/tools/restrictions.rsresolve_session_mutation_authorization统一 SessionControl / acp_control / SessionMessage 投递的授权语义(daemon/warden 拦截 + owner 豁免 + created_by + 祖先授权)已知边界:SKILL.md 已降承诺——deadline/defer 当前运行时未执法(协议设计意图);惩罚阶梯为 R-25 纯提醒(无 RBAC 降级/冻结)。
2. Legion 军团系统(legion_mode / legion_control / team_presets)
定位:军团拓扑部署——fractal deployment topology,把复杂工作分解到专门 agent 会话。
MAX_LEGION_NODES=20防资源爆炸src/crates/assembly/core/src/agentic/tools/implementations/legion_control_tool.rslegion_mode.md;注册链完整(modes/mod.rs + agent-runtime agents.rs + registry/catalog.rs + prompt_catalog_contracts)src/crates/assembly/core/src/agentic/agents/definitions/modes/legion.rs、src/crates/assembly/agent-content/prompts/agents/legion_mode.mdsrc/crates/assembly/core/src/agentic/agents/team_presets.rssrc/web-ui/src/app/scenes/agents/components/、src/web-ui/src/infrastructure/api/service-api/LegionPresetAPI.ts已知边界:军团节点硬上限 20;LegionControl 通过 SessionControl 同一条持久化路径部署会话。
3. ACP 通道(真通道直通,去转述层)
定位:把 BitFun 会话/工具调用桥接到真实外部 Agent(Codex / Claude Code / OpenCode 等),
acp__<client>会话 = 真实外部进程。acp__create / Taskacp__<client>spawn 直接经 AcpClientPort 创建真外部 ACP 流会话(持久记录 + 进程启动 + 失败回滚)src/crates/assembly/core/src/agentic/tools/implementations/session_control_tool.rs、.../task/execution.rssrc/crates/assembly/core/src/agentic/tools/implementations/acp_tools.rsAcpClientPort契约(create/send/cancel/release/delete/read_history/stream)+ DesktopAcpClientPort 服务桥src/crates/contracts/runtime-ports/src/acp_client_port.rs、src/apps/desktop/src/runtime/acp_client_port.rssrc/apps/desktop/src/runtime/acp_session_lifecycle.rs已知边界:ACP 外部进程未启动时由首次委托 turn 懒启动;ACL 授权门(R4)已接入。
4. Session 会话管理(session tree / 幽灵防护 / 工具族)
定位:会话全生命周期管理 + 会话树 + 幽灵复活防护。
src/crates/services/services-core/src/session/tree.rs、src/crates/contracts/core-types/src/session_tree.rsdeleted-session-ids.json,上限 2000)+ finalize 前检查 + list 后端 tombstone 过滤 + 写锁/原子写(KeyedAsyncLock + temp+rename)src/crates/assembly/core/src/agentic/session/session_manager.rssrc/crates/assembly/core/src/agentic/tools/implementations/session_control_tool.rs、.../session_message_tool.rsSESSION_CONTEXT_WINDOW_MIN_TOKENS = 1M已知边界:tombstone 损坏显式报错传播(Err 暴露);reconcile 删除失败错误传播 + Windows 删除重试(5×50ms)。
5. 执行引擎 + 工具链(engine / 工具防呆)
定位:执行引擎主循环(消息组装/压缩/输出预留)+ 工具层防呆。
src/crates/assembly/core/src/agentic/execution/execution_engine.rsMAX_SAME_ROUND_COMPRESSION_PASSES=2防同轮无限压缩;ENGINE-03 输出预留钳制 ≤40% 窗口src/crates/assembly/core/src/agentic/tools/implementations/grep_tool.rs、src/crates/services/services-integrations/src/workspace_search/rg_fallback.rs.../file_read_tool.rs、src/crates/execution/agent-runtime/src/file_read_state.rs已知边界:skip_message_for_model_send 仅跳 ComputerUse 截图(刻意窄化);BackgroundResult 通知注入不注全文。
6. 知识库搜索 + 计划/任务工具
knowledge_base_search_tool——知识库根目录经环境变量解析(workspace 外可达,无硬编码路径)src/crates/assembly/core/src/agentic/tools/implementations/knowledge_base_search_tool.rssrc/crates/assembly/core/src/agentic/tools/implementations/plan_*.rs、src/crates/assembly/core/src/agentic/coordination/plan_todo_binding.rs、.../review_propagation.rs7. WebUI 增强
src/web-ui/src/app/layout/BeeColonyMonitor.tsxsrc/web-ui/src/app/components/panels/content-canvas/8. 脚本 / CI / 上游同步基础设施
scripts/embed-server.pypackage-windows-assets.mjs+ 单测SHERPA_ONNX_LIB_DIR;desktop-package workflow 修复变更面
测试程度声明
cargo check -p bitfun-core/-p bitfun-runtime-ports/-p bitfun-services-core→ 0 error 0 warningscripts/check-core-boundaries.test.mjs67/67(上游规则零破坏)bitfun-desktop受限于本地 mobile-web 前端产物缺失(环境预存问题,无 Rust 代码错误;CONTRIBUTING 前置检查项)备注