Dongxi 东锡 NLP@dongxi_nlp
56AI 编辑部评分,满分 100

DeepSeek Harness 开源:把边界写成契约

2026-08-16 13:58· 20分钟前
AI 导读

DeepSeek Harness 开源,设计哲学是“事实有据,权限有度”。它拒绝将 agent state 写成模糊目标,让每份重要 state 由能验证它的 owner 持有,并通过 atomic comparison 关闭 time-of-check/time-of-use gap。

https://x.com/i/article/2088856146954067968

DeepSeek Harness:把边界写成契约

DeepSeek Harness 开源了,如果说简单总结 DeepSeek Harness 的设计哲学,那就是 "事实有据,权限有度"。

第一次面对它,你可能会期待一个 model wrapper、一组 tools,或者一个围绕 DeepSeek model 搭起来的 CLI。

沿着 contracts、source 和 tests 走完以后,真正吸引我的,是另一个地方:

它拒绝把 agent state 写成一个模糊不清的目标。

每一份重要 state,都会被放到有能力验证它的 owner 身边。

Truth Has An Owner

file provider 持有当前 file truth。

session policy 记住 Agent 曾经观察到了什么。

live events 协调正在发生的 execution。

durable events 记录下一次 session 仍然可以 replay 的历史。

model projection 和 client projection,只选择各自真正需要的部分。

DeepSeek 框架具有清晰的架构特征:每个重要事实都位于可验证或可执行的位置。

Example:shell command 运行时可以不断发送"40% complete"这类 live state。结束后,durable history 只需要保存 command 和 final result。

The Stale Read Tells The Whole Story

假设 Agent 在 v1 读过一个文件。准备 edit 之前,另一个 process 改写了文件。

薄弱的 Harness 只记得 transcript 里出现过一次 read。DeepSeek Harness 会保留 observed version,然后要求 filesystem provider 只在 current version 仍然等于 v1 时执行 mutation。

policy 持有 expectation。provider 持有 current truth。atomic comparison 关闭了 time-of-check/time-of-use gap。

还有一个很精细的边界:window read 可以证明这个 file version 仍然 fresh,却不能证明 model 看懂了整个文件。

所以说,freshness 和 completeness 是两条 policy。

Example:Agent 读到 timeout = 30。同事把它改成 60。Agent 的 edit 仍然携带旧 version,provider 会拒绝它,并要求重新 read。

A Tool Is An Event Pipeline

tool call 不会直接落进 handler。

它会经过 immutable identity、schema validation、pre-execution hooks、monotonic guards、execution wrapper、normalization、finalization 和 result recording。

DeepSeek 甚至区分 live tools/result notification 和 durable tool/result session fact。

这一个复数差异很能说明问题:coordination state 与 historical state 有联系,也有各自的 owner。

Example:对于"find TODOs",schema 检查 query,guard 把 search 限制在 workspace,runner 找到 matches,finalizer 再记录 normalized result。

A Subagent Opens A Managed Runtime

DeepSeek 也让 subagent 比"再 call 一个 model"更准确。

spawn child 时,需要分别做三类决定。

第一,context seed:fresh instructions 或 completed-turn fork。

第二,lifecycle:one-shot、background,或者可以 follow-up 的 continuable child。

第三,authority:tools、approval behavior、resources 和 delegation depth。

parent 最后拿到 report、settlement,或者 transcript projection。child 可以消耗很大的 local context,同时避免污染 parent conversation。

Example:parent 让 child 检查 failing tests。child 只拿到这个 task 和 read/test tools,最后返回五条 diagnosis,不回传整段 transcript。

What Is Worth Copying ?

DeepSeek Harness 的哪些部分可以借鉴到你自己的 harness?

真正值得带走的经验或许是一种架构的设计哲学:

对每一种 capability,都要说清 truth owner、authority gate、durable record、model projection 和 recovery rule。

Example:对于 screenshot,browser 持有 pixels,permission 控制 capture,file 保存 durable artifact,model 只看到 bounded preview,retry rule 处理 capture failure。

如果其中一项没有找到根据,Harness contract 就还没有完成。

这就是我对 DeepSeek Harness 的一瞥:这就是我对 DeepSeek Harness 的一瞥:它把隐性边界变成了可测试的运行时契约。

把边界写成契约

来源:Dongxi 东锡 NLP · x.com

DeepSeek Harness 开源:把边界写成契约

Dongxi 东锡 NLP · @dongxi_nlp · X·2026-08-16 13:58·20分钟前
AI 导读

DeepSeek Harness 开源,设计哲学是“事实有据,权限有度”。它拒绝将 agent state 写成模糊目标,让每份重要 state 由能验证它的 owner 持有,并通过 atomic comparison 关闭 time-of-check/time-of-use gap。

https://x.com/i/article/2088856146954067968

DeepSeek Harness:把边界写成契约

DeepSeek Harness 开源了,如果说简单总结 DeepSeek Harness 的设计哲学,那就是 "事实有据,权限有度"。

第一次面对它,你可能会期待一个 model wrapper、一组 tools,或者一个围绕 DeepSeek model 搭起来的 CLI。

沿着 contracts、source 和 tests 走完以后,真正吸引我的,是另一个地方:

它拒绝把 agent state 写成一个模糊不清的目标。

每一份重要 state,都会被放到有能力验证它的 owner 身边。

Truth Has An Owner

file provider 持有当前 file truth。

session policy 记住 Agent 曾经观察到了什么。

live events 协调正在发生的 execution。

durable events 记录下一次 session 仍然可以 replay 的历史。

model projection 和 client projection,只选择各自真正需要的部分。

DeepSeek 框架具有清晰的架构特征:每个重要事实都位于可验证或可执行的位置。

Example:shell command 运行时可以不断发送"40% complete"这类 live state。结束后,durable history 只需要保存 command 和 final result。

The Stale Read Tells The Whole Story

假设 Agent 在 v1 读过一个文件。准备 edit 之前,另一个 process 改写了文件。

薄弱的 Harness 只记得 transcript 里出现过一次 read。DeepSeek Harness 会保留 observed version,然后要求 filesystem provider 只在 current version 仍然等于 v1 时执行 mutation。

policy 持有 expectation。provider 持有 current truth。atomic comparison 关闭了 time-of-check/time-of-use gap。

还有一个很精细的边界:window read 可以证明这个 file version 仍然 fresh,却不能证明 model 看懂了整个文件。

所以说,freshness 和 completeness 是两条 policy。

Example:Agent 读到 timeout = 30。同事把它改成 60。Agent 的 edit 仍然携带旧 version,provider 会拒绝它,并要求重新 read。

A Tool Is An Event Pipeline

tool call 不会直接落进 handler。

它会经过 immutable identity、schema validation、pre-execution hooks、monotonic guards、execution wrapper、normalization、finalization 和 result recording。

DeepSeek 甚至区分 live tools/result notification 和 durable tool/result session fact。

这一个复数差异很能说明问题:coordination state 与 historical state 有联系,也有各自的 owner。

Example:对于"find TODOs",schema 检查 query,guard 把 search 限制在 workspace,runner 找到 matches,finalizer 再记录 normalized result。

A Subagent Opens A Managed Runtime

DeepSeek 也让 subagent 比"再 call 一个 model"更准确。

spawn child 时,需要分别做三类决定。

第一,context seed:fresh instructions 或 completed-turn fork。

第二,lifecycle:one-shot、background,或者可以 follow-up 的 continuable child。

第三,authority:tools、approval behavior、resources 和 delegation depth。

parent 最后拿到 report、settlement,或者 transcript projection。child 可以消耗很大的 local context,同时避免污染 parent conversation。

Example:parent 让 child 检查 failing tests。child 只拿到这个 task 和 read/test tools,最后返回五条 diagnosis,不回传整段 transcript。

What Is Worth Copying ?

DeepSeek Harness 的哪些部分可以借鉴到你自己的 harness?

真正值得带走的经验或许是一种架构的设计哲学:

对每一种 capability,都要说清 truth owner、authority gate、durable record、model projection 和 recovery rule。

Example:对于 screenshot,browser 持有 pixels,permission 控制 capture,file 保存 durable artifact,model 只看到 bounded preview,retry rule 处理 capture failure。

如果其中一项没有找到根据,Harness contract 就还没有完成。

这就是我对 DeepSeek Harness 的一瞥:这就是我对 DeepSeek Harness 的一瞥:它把隐性边界变成了可测试的运行时契约。

把边界写成契约

来源:Dongxi 东锡 NLP· x.com