Skip to main content
The agent has outgrown one host. Reservation on SQLite is a write lock on a local file; two hosts need a store they share. The change is the store constructor, and nothing else: same policy, same decorator, same receipts, same guarantees, graded on Postgres by the same suite that grades SQLite.

The policy

runnable

The code

This script runs on SQLite offline and on Postgres when CTRLRUN_STORE_URL names one; the part that changes is open_store.
runnable file=main.py

What the agent sees

With CTRLRUN_STORE_URL=postgresql://ctrlrun@db.internal/ctrlrun the first line reads PostgresStateStore and the rest is identical, and now it holds across hosts: the refusal comes from a unique index on the effect key and compare-and-set updates whose row counts are checked, instead of SQLite’s file lock.

The receipt

runnable
On Postgres the same command reads the shared store when CTRLRUN_STORE_URL is set, or with --store-url 'postgresql://db.internal/ctrlrun?ctrlrun_schema=ctrlrun'. A read command migrates nothing and creates nothing.

When an AMBIGUOUS appears

One new case: a connection lost during COMMIT. Postgres very often did commit, so the store treats it as unknown and re-reads the row to find out which; only if the re-read fails does it refuse to proceed. Your executor’s lost replies are handled as before. Resolve them with ctrlrun resolve --store-url … from any host.

Next