docs: add Floatboat mechanism adoption plan - #236
Merged
Conversation
基于 Floatboat/Selfware 调研,提出用其治理机制优化 DeepCode 的整体方案: File Contract(路径维度三态权限契约)、Change Ledger(带 rollbackHint 的 变更账本)、Capability Manifest(运行时能力声明)、Combo(thread 蒸馏为 skill)、Trigger Profile(cron job 携带权限档位)。 方案的核心约束是单向取严:新增的治理层只收紧不放宽,配置缺失时行为与 今天逐用例相等。同时明确列出拒绝清单(.self 自执行分发、Tacit 被动观察、 跨组织 agent 网络、loopback HTTP runtime)及其理由。 本 PR 只含提案文档,不含实现。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
基于 Floatboat / Selfware 调研,提出用其治理机制优化 DeepCode 的整体方案 ——
docs/FLOATBOAT_ADOPTION_PLAN.md。本 PR 只含提案,不含实现,等待评审后再拆实施 PR。与
docs/CODEX_ALIGNMENT_PLAN.md的关系是正交补充,不取代:alignment plan 收敛"运行时语义统一"(谁执行、怎么恢复、怎么中断),本文收敛"工作区治理"(凭什么能改、改了什么、怎么撤销)。核心论点
DeepCode 缺的不是能力,是治理面。有三件事今天在 DeepCode 里表达不出来(均已对源码核实):
.env永远不许读"file_path通常是绝对路径 ——Read(.env*)匹配不到任何真实调用(config/permissions.tsparseRule/primaryInput)。沙箱层的denyRead能表达,但未配置时resolveSandboxMode落到danger-full-access(sandbox/index.ts:69),且硬编码 deny 只覆盖 home 下凭证库,不覆盖项目内.envMEMORY.md存的是事实不是变更;snapshots 有但缺"意图 + 回滚句柄"索引initialize()的 capabilities 只声明协议特性,不声明权限与写边界(protocol/src/runtime.ts:112)采纳 / 拒绝
rollbackHint的 append-only 变更账本SKILL.md草稿.self自执行分发 / Tacit 被动观察 / FloatIM 跨组织网络 / loopback HTTP runtime / 日历集成三个关键设计决定
finalVerdict = mostRestrictive(toolVerdict, pathVerdict)。File Contract 只收紧不放宽,因此不可能降低现有安全性;无契约文件时pathVerdict恒为no-match,结果与今天逐用例相等。evaluatePermission第三参数可选,签名向后兼容。read: deny而沙箱关闭时,启动打印告警并在doctor长期可见。文档措辞必须是"减少误触与提示注入的可利用面,真正的隔离仍来自沙箱",不得宣传成秘密防护。独立的安全副产品
CronJob今天不携带任何权限信息 —— 凌晨 3 点无人值守触发的任务,拿到的是与交互式会话相同的档位。方案提出onApprovalRequired默认'deny'(拒绝该次调用并继续,而非静默放行或永久挂起)。这条不依赖方案其余部分,可作为 PR 0 独立先落地。落地路线
8 个独立可合可 revert 的 PR,风险从低到高排序。建议的最小有价值切片是 PR 0 + 1 + 3(三个都低风险、无相互依赖);File Contract 接入 dispatcher(PR 2)是唯一需要谨慎评审的一步。
文档同时写明了 4 条未解假设(契约默认值该多严、ledger 是否默认开、
/combo要不要调模型、与 alignment plan 的先后),需要评审拍板。Test plan
纯文档 PR,无代码改动。
node scripts/check-docs.mjs— Documentation consistency checks passednpx prettier --check docs/FLOATBOAT_ADOPTION_PLAN.md— All matched files use Prettier code stylepackages/core源码逐条核实(非推测)pnpm typecheck/pnpm test/pnpm build— N/A(未触碰代码)Documentation
docs/FLOATBOAT_ADOPTION_PLAN.md§6 列出了实施后需要对
docs/security-model.md威胁模型表追加的 3 条新威胁与 1 条增强,含残余风险声明;实施 PR 落地时同步更新。Release notes label
release-notes:internal— 设计提案,不出现在用户可见 changelogChecklist
Related
调研依据见独立 PR https://github.com/oratis/deepcode/pull/235(`docs/research/floatboat.md`)。两个 PR 相互独立,可任意顺序合并 —— 本文档内的
research/floatboat.md链接在两者都合并后生效。🤖 Generated with Claude Code