A Programming Paradigm for Spatiotemporal Composability
一句话摘要:这篇 2026-08-13 草稿论文是 DeepSeek Harness 底层框架 Cordis 的理论基础——它把”动态组合”问题分解为时间可组合性(移除组件时完全回退其副作用)与空间可组合性(声明并响应式管理组件间依赖)两个正交维度,并分别用**可逆效应(revertible effects)与反应式共效应(reactive coeffects)**将其提升为运行时机制,最终统一为单一 context 类型,形成一个编程范式。
一、论文元数据
- 标题:A Programming Paradigm for Spatiotemporal Composability
- 状态:preprint,Draft of August 13, 2026
- 作者联系:shigma@cordis.io
- 载体:github.com/cordiverse/paper(README.md + paper.pdf)
二、问题陈述
论文指出,现代软件——从插件系统到”自我演化的 agent harness”——越来越需要动态组合(dynamic composition),但其形式化基础仍不发达:
“Modern software—from plugin systems to self-evolving agent harnesses—increasingly requires dynamic composition, yet its formal foundations remain underdeveloped.”
注意这里”self-evolving agent harnesses(自我演化的智能体框架)“直接把 DeepSeek Harness 这类系统当成了研究动机。
三、两个正交维度
论文把问题分解为两个正交维度:
“temporal composability, the ability to completely revert a component’s side effects upon removal”
时间可组合性——一个组件被移除时,它造成的副作用能被完全回退。
“spatial composability, the ability to declare and reactively manage inter-component dependencies”
空间可组合性——组件之间的依赖关系可以被声明式地表达,并被响应式地管理。
即:
- 时间可组合性(temporal composability):组件被移除时,它的副作用能被完全回退。
- 空间可组合性(spatial composability):组件之间的依赖能被声明式表达并响应式管理。
四、两个核心机制
论文通过把经典的 effect 与 coeffect 概念提升到运行时机制来解决上述两维:
“we formalize revertible effects, in which every context transformation carries an inverse that the runtime tracks.”
“we formalize reactive coeffects, in which each change of the context notifies a component against its coeffect specification.”
- 可逆效应(revertible effects):每一次 context 变换都携带一个逆变换,由运行时追踪。→ 解决”时间”维度(可回退)。
- 反应式共效应(reactive coeffects):context 的每次变化,都按组件的 coeffect 规格通知该组件。→ 解决”空间”维度(依赖管理)。
五、统一为单一 context 类型
“We unify the effect context and the coeffect context into a single context type, which constitutes a programming paradigm.”
这是论文的理论贡献核心:把 effect context 与 coeffect context 统一成一个 context 类型,从而形成一个编程范式。
进一步,论文把机制组合为”组件(component)“概念,并给出一个动态组合的演算(calculus of dynamic composition):
“we combine these mechanisms into the notion of a component and give a calculus of dynamic composition, whose metatheory carries spatiotemporal composability from a single component to a whole system of interleaved components.”
也就是说,时空可组合性从单个组件被推广到整个交错组件系统。
六、Cordis 实现
“We implement these ideas in Cordis, a meta-framework of spatiotemporal composability that provides a core library with effect tracking and coeffect resolution, as well as a declarative component loader with configuration reconciliation and hot module replacement.”
我们把这些想法实现在了 Cordis 里——一个面向时空可组合性的元框架。它提供一个带「效应追踪」和「共效应解析」的核心库,以及一个支持配置合并和热更新的声明式组件加载器。
Cordis 作为”元框架(meta-framework)“提供:
- 带 **effect tracking(效应追踪)**与 coeffect resolution(共效应解析) 的核心库
- 带 **configuration reconciliation(配置调和)**与 hot module replacement(热模块替换,HMR) 的声明式组件加载器
七、与 DeepSeek Harness 的关系
这篇论文是理解 DSH 为什么”一切皆插件”的关键。DSH 的每个设计都能对应到论文机制:
| 论文概念 | DSH 落点 |
|---|---|
| 可逆效应(revertible effects) | ctx.effect() / ctx.on(),注册返回 disposer,卸载可回退 |
| 反应式共效应(reactive coeffects) | inject 声明依赖 + typed events 通知 |
| 单一 context 类型 | Cordis Context,服务用 ctx.<key> 定位 |
| 组件演算 | 插件树(profile/bundle/patch 分层组合) |
| 声明式加载 + 配置调和 | cordis.yml + patch 覆盖层 |
| HMR | Creator mode 内存中测试/组合插件 |
重要引用汇总
“we formalize revertible effects, in which every context transformation carries an inverse that the runtime tracks.”
我们把「可逆效应」形式化——每一次对上下文的改动,都自带一个逆操作,由运行时替你记录下来。
“we formalize reactive coeffects, in which each change of the context notifies a component against its coeffect specification.”
我们把「反应式共效应」形式化——上下文每发生一次变化,都会按照组件事先声明的共效应规格去通知它。
“We unify the effect context and the coeffect context into a single context type, which constitutes a programming paradigm.”
我们把「效应上下文」和「共效应上下文」统一成同一个 context 类型,这就构成了一种编程范式。