01
Atomic updates
Compare-and-swap guards shared state against lost updates from concurrent workers.
Agent Primitives /State = Keyed working data
Keep point reads, compare-and-swap updates, and TTLs next to the log. Copy-on-write branches let agents explore a change before promoting it or discarding it.
const kv = laser.kv("profiles")
await kv.set(utf8(KEY)).json(profile)
.ttl(TTL_MICROS).send()
const old = await kv.getEntry(utf8(KEY))
if (!old) throw new Error("profile missing")
await kv.set(utf8(KEY)).json(upgraded)
.expectVersion(old.version).commit()
const fork = laser.fork("experiment-1")
await fork.squash()
await fork.create().severed()
.tables(["profiles"]).send()
await fork.putRow("profiles", 0, 0n)
.field("plan", "enterprise-preview").send()
await fork.promote()Primitive guarantees
01
Compare-and-swap guards shared state against lost updates from concurrent workers.
02
TTLs keep sessions and temporary working data bounded without a separate cleanup system.
03
Test alternate state safely, then promote the branch only when the result is valid.
Explore the system
Combine transport, prompt assembly, recall, relationships, and live views without stitching together disconnected systems.