Repository navigation
feat(bytedcli): 支持混合执行身份、逐命令权限配置和插件权限预设 - #3971
Merged
deepcoldy merged 72 commits intoNov 29, 2026
Merged
Conversation
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
deepcoldy
reviewed
Nov 28, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
【修复复核记录(当前 head 71d0e5da7f)】
此前 7 项 finding 及后续 replacement/transfer 对抗复核问题均已处理,并已合入最新 master 9508af5300。当前 GitHub 为 MERGEABLE;CI 已启动,尚未执行合并。
主要修复:
- 受信 helper 只使用
/usr/local/bin、/usr/bin、/bin的 canonical 固定目录,不再执行自定义 PATH 或工作区 bin 中的替换工具。 - 严格只读 MCP 在 manifest 生成和 Gateway 启动时都校验常规文件树,拒绝
--link、内部软链、特殊文件及越界运行根。 - 缺失的可选运行时/DB 挂载 leaf 不再产生无效 bind;absent→created 完整性围栏保留。补齐系统 Node 外置内建模块与固定 Python 标准库隔离支持。
- GDPR replay 使用本次 replay signal;strict fork/clean recovery 继承 strict/cold-start 证明。
- replacement 先预留 successor generation 再清理旧代;pending 期间的重复调用明确拒绝,过期 prepared generation 不得复活。identity 失配会结算原调用,transfer bypass 保留到 accepted 后才 flush,不再持续换代重试。
- 修正 runner 登记、Dashboard 可见字段与 legacy 深链分类、worker harness 新依赖,并覆盖系统 Node/Python 原生技能隔离。
验证结果:
bun run build、bun run build:bun通过。- 最终全部变更测试:60 文件通过、1 跳过;2071 项通过、7 跳过。
- 真实 Linux network namespace 集成测试:6/6。
- Bun 隔离测试 5/5、broker acceptance 17/17、executor lifecycle 21/21。
- 独立对抗复核覆盖旧代重入、pending generation 覆盖、重复 fork、same-id 接管及 buffered transfer;最终均无剩余阻断,未再出现持续换代循环。变异复验中,摘除 pending-refusal 与 reserved-generation fence 的测试均按预期咬红。
- 合入最新 master 后,AtomCode、bytedcli、trae-login 等入口同时保留;runner 编译入口回归通过。
以上探针均使用临时 HOME、隔离子进程和假上游,没有执行真实业务写、重启 live daemon 或读取线上凭据。等待 CI 与后续逐项复核。
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
deepcoldy
reviewed
Nov 28, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
【CI 兼容修复记录(当前 head 688902c65d)】
首轮 CI 暴露的运行时与 transfer 兼容问题已修复并推送,未将其归为 G4 环境失败:
bytedcli-isolated-process:builtin-support bind 与 runtime 文件一致,允许 root 或 daemon 当前用户,避免错误拒绝 GitHub toolcache 的非 root 所有者。bytedcli-python-runtime:固定标准库支持扩展到 Python 3.10。forkTransferReplacement:只有存在 retirement callback 时才传第三参onAdmission;无 callback 保持原双参 fork seam,避免破坏既有 transfer 调用和断言。
本地复验:
bun run build通过。- 全部变更测试与 AtomCode runner 回归:60 文件通过、1 跳过,2071 项通过、7 跳过。
- transfer 相关 648 项、runtime/isolation 相关 18 项通过。
- peer 敏感的 broker acceptance 17/17、current-execution 71/71 串行复验通过;重复出现的 socket owner 超时仅记为负载现象,没有放宽 5 秒安全预算。
- Linux network namespace 6/6,Bun 隔离 5/5。
新 head 的 CI 已启动,当前等待结果;未执行合并。
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi Code <[email protected]>
Co-Authored-By: Kimi <[email protected]>
Co-Authored-By: Kimi <[email protected]>
Co-Authored-By: Kimi <[email protected]>
Co-Authored-By: Kimi <[email protected]>
Co-Authored-By: Kimi <[email protected]>
deepcoldy
approved these changes
Nov 29, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
复核结论:可合
本结论绑定最终候选 OID 1f7757df86055021510d24b7a73d6b040d9f12d3。
安全与行为复核
- 混合身份、逐命令权限、写操作 intent/结果不确定语义、执行证明与 generation retirement 的既有修复保持完整。
- PATH 仅使用 canonical 固定 helper 目录;运行树、链接插件与只读 MCP 的冻结检查未放宽。
- Linux 隔离仍保留 tmpfs root、只读 bind、独立 namespace、
0o022拒绝及 fail-closed。非 root 属主例外精确限定于/etc/resolv.conf这一只读解析配置;hosts、nsswitch、两套 CA、系统库和 distro Python 均保持 root-only。 - 路径分类已接入生产调用并有反向覆盖:将分类器变异为恒
host-data后,hosts、nsswitch、两套 CA 的 4 个保护用例全部咬红;恢复后通过。独立对抗复核未发现未闭环问题。
测试兼容与 CI
- Bun partial mock 的传递依赖导出已补齐,相关文件仍在 Bun runnable 集合中实跑,没有通过 defer 规避。
- 需要可信运行时的测试统一使用私有、独立 inode 的 Node 副本,不再依赖 runner toolcache 的属主、目录权限或
/usr/bin/node假设。 - 本地定向 Bun/Vitest 回归及
bun run build通过;严格环境发送用例仍保留 exit 0 和全部环境/发送断言,仅采用有界等待。 - 已独立回读当前 head 的全部 15 项 check:均为
completed / success,无 pending、无 failure;build、3 个 binary、network-boundary、4 个 Bun shard、4 个 Vitest shard 与聚合检查均通过。 test (3/4)的 Meego 临时目录清理竞态属于已开放 issue #3808 的同款已知 flake,本 PR 未修改该测试或 Meego 源码。仅该 job 在同一 SHA 重跑一次,attempt 2(job141178642302)已成功;run46206297913总体为 success。该 flake 仍由 #3808 独立跟踪,不计入本 PR 功能回归。
后续若同步 master 产生新 head,仍需按合前流程完成该新 head 的 CI 首跑与 G7 核验;本审批不替代那些检查,也不包含发版或部署授权。
deepcoldy
approved these changes
Nov 29, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
最终认可:merge-only head 可合
本认可绑定 OID 048f26b1426158deb0f752c03efb9ae7f984fe0e。
Head 变化复核
- 该 merge commit 的双亲为此前已审批的
1f7757df86055021510d24b7a73d6b040d9f12d3与 master0b67d1d8edd68c039a2c9d4c782f586d44ca5200,仅用于同步 master。 - 已独立执行
git merge-tree --write-tree HEAD^1 HEAD^2:预测 tree 与实际 commit tree 完全一致,均为91417f528388fb7c0e763c174b3ee9ad6e74023d。没有预测合并树之外的净改动;此前安全与行为复核结论继续适用。
CI 与 G4
- 已独立回读当前 head 的全部 15 项 check:全部
completed / success,无 pending、无 failure;build、3 个 binary、network-boundary、4 个 Bun shard、4 个 Vitest shard 与聚合检查均通过。 - Vitest 3/4 首跑仅命中 #3808 已开放 issue 所记录的 Meego afterEach
rmSync/ENOTEMPTY清理竞态,本 PR 未修改 Meego 文件。按窄例外在同一 SHA 仅重跑该 job 一次,attempt 2 的新 job141196930931已成功并绑定048f26b1426158deb0f752c03efb9ae7f984fe0e;run46211680520总体为 success。该 flake 仍归 #3808 独立根治。 - 当前 PR 为
MERGEABLE / clean。
因此确认该 merge-only head 可合。此处不包含发版或部署授权。
|
🚀 Released in v3.59.38 |
deepcoldy
pushed a commit
to lijason1121/botmux
that referenced
this pull request
Nov 29, 2026
master deepcoldy#3971 新增的 signed relay 用例仍调用 readProcessStartIdentity, 而本分支已把该文件的进程身份入口统一改为 readAttestedProcessStartIdentity (Linux 上两者等价委托,darwin 上后者提供微秒级 BSD 出生标识)。 两边改动区域不同,自动合并后留下未导入的旧符号引用,合并树会直接 ReferenceError。改为统一入口。 Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Nov 29, 2026
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.
背景
此前 ByteCLI 只能统一使用机器身份或触发者身份,无法按命令选择权限。共享 Bot 场景需要使用本机账号完成部分查询,同时让写操作归属于当前触发者,并允许管理员为指定命令配置机器身份例外。
本 PR 新增独立的混合模式,提供宿主与 Bot 两层命令规则、Dashboard 可视化编辑和外部插件权限预设,同时兼容原有身份配置。
主要变更
1. 新增 ByteCLI 混合执行模式
2. 建立受管执行与身份校验链路
3. 支持版本化命令规则
bytedcli skill-api入口,将已适配 Skill 的最终 API 调用纳入同一执行器。4. 优化 Dashboard 交互
5. 将业务权限预设迁移为插件扩展
dist/bytedcli/operation-presets.json提供版本化配置。6. 修复混合模式冷启动
兼容性与当前范围
tools、能力范围、授权来源、委托和 Git 身份配置;合法旧策略按原语义迁移。mix-next ecop等其他 CLI 继续使用各自的认证机制。验证
bun run build:在完整依赖的隔离构建目录通过。BOTMUX_PROTECTED_LOOPBACK_INTEGRATION=1 bun run test test/protected-provider-loopback-linux.test.ts:6 项真实 Linux 隔离测试通过。STARTUP_OK。bytedcli --version返回 0.199.0,botmux execution current --json返回verified,退出码均为 0。验证覆盖启动、执行身份和上述定向用例;未逐一验证全部业务平台的实际账号权限。
界面示意