Jeremy Sanecki

Everything Is a Composable Monad, and the Future of Coding

I fell in love with programming with objects, with C++, Smalltalk, and Java. I fell in love with monads through Scala. Who doesn't love "everything is a file"? Okay, I'm still being sold on that one. I've been building my agents with a composition approach, having the built scripts and tools for themselves to add to the mix a bit of deterministic tooling with the ability to compose complex systems. Now, with A Programming Paradigm for Spatiotemporal Composability, I think we have a design shift on how we compose our projects for developing code with AI.

As an industry we've heard this before plugin systems, hot reload, and dependency injection, all to give you the ability to compose a nice system, but in the end you throw it all away because cleanup was never guaranteed. That's because we've never had to manage plugins dynamically before. Humans prefer consistency in their tooling ecosystem, so we never thought to provide a different system for AI agents. But if we take what we've learned from computer science and language theory, we can compose an environment where our AI coding tools are managed with reversible effects, reactive dependencies, and ordered shutdown. Simple and powerful.

Self-modifying agent harnesses, where agents install, patch, and remove their own tools and components while continuously serving requests, build a tooling ecosystem that is useful for the agents themselves. With that, AI agents gain two distinct advantages: the ability to build a tooling ecosystem suited to the problem at hand, and the ability to experiment, developing through a cascading chain of thought into one stable, working solution.

Why is this possible? The paper names four mechanisms and gives each an actual guarantee instead of a convention.
  • Revertible effects, where every action a component takes is paired with an inverse the runtime tracks, so unloading it is guaranteed to leave nothing behind.
  • Reactive coeffects, where a component declares what it depends on, and the runtime re-resolves that dependency automatically as providers come and go, instead of the component polling for it or breaking silently when it's gone.
  • Ordered shutdown, where a provider can't finish tearing itself down until every component depending on it has torn down first, so nothing ever reads from something that's half-gone. Reference counting, anyone?
  • Finally, confluence, where no matter what order, or how many overlapping self-modifications happen, the system converges to the same state it would have reached if it had been built cleanly from scratch in one pass.
None of these four ideas are new on their own. What's new is drawing on all four with the aim of a system that rewires itself while it's still running, which is exactly what an AI agent harness needs to do.

Time will tell how impactful this paper will be, but I see something with the potential along the lines of "Attention Is All You Need." The paper has a bit of honesty to it as it points to its own limitations. It'll be interesting to see how Deepseek's Harness, which follows this paper, will impact coding over the next few months, and whether this idea leads to something more. For now, I'm going to rethink my own process for how I approach coding projects.

Moving from Self-Hosting

With recent changes in cloud costs, my blog expenses increased to $27 per month. Because of this, I've decided to move my blog to a more cost-effective service that's tough to beat. Stay tuned for more posts from me on this new platform!