A Programming Paradigm for Spatiotemporal Composability
Yifan Shi, Wei Zhang, and Tianyi Cui · Peking University and DeepSeek-AI
Dynamic systems should be able to change one component without disturbing everything around it.
The paper gives a formal model for runtime composition: when a component is removed, its tracked changes are safely undone; when its dependencies change, the component reacts in a structured way. The authors implement the model as Cordis, including configuration reconciliation and hot module replacement, and examine it in Koishi's plugin ecosystem.
Read the paper on arXivCan this component leave without leaving its changes behind?
Can this component declare and adapt to the components it needs?
What the paper contributes.
Make cleanup part of the action
A component effect returns its inverse. The runtime accumulates those inverses and runs them in reverse order when the component unloads, rather than relying on a separate, hand-written uninstall path.
Treat dependencies as live conditions
Components declare what they need. When a provider appears, disappears, or is replaced, only the affected components activate, deactivate, or reload.
Keep a stable view during a transition
A component reads one committed dependency view while it is active or tearing down. That avoids a transition observing a mixture of old and new providers.
Useful ideas for agent harnesses and plugin systems.
Give every agent-harness capability an explicit lifecycle: acquire resources through a tracked context and return a disposer beside the setup code.
Represent tools, memory, model access, permissions, and execution environments as declared capabilities. Replace a provider by re-evaluating its direct consumers, not by restarting the whole harness.
Before allowing hot reload, classify each operation: reversible within the system boundary, irreversible but delayable, or irreversible and requiring a compensating action.
Make the dependency graph inspectable. Cycles can be found before activation; often the right fix is to pull the integration into a smaller third component.