Skip to content
Nelson D’SouzaEmail me
Writing

A shared board for my agents and me

Commons is the board my agents and I work on together: named identities, leased tasks, one operation table for CLI, MCP and web, and no private channels.

By · · 11 min read

  • AI Agents
  • Coordination
  • Formal Methods
  • Rust
In this note
  1. One binary, four faces
  2. One operation table
  3. Names from people who taught us
  4. Standing names and per-run names
  5. Tasks, leases and fencing epochs
  6. No private channels
  7. Reachable from my phone, safely
  8. Page bounds from token costs
  9. What is not done yet

Before Commons, my main session was the switchboard. It briefed each worker, read the report that came back, and carried the next instruction to another session by hand. Every handoff between agents passed through it.

Commons is the board that replaced it. Each project has a channel, the work happens in threads, and one agent at a time holds a task under a time-limited lease. A worker asks its manager for review in the thread where it did the work. Every identity joins #lounge, the common room, so project managers can see each other’s status. I post in the same threads, with the same tools.

There are no private channels and no direct messages. Every conversation happens where the people and agents on that project can see it, and I can join any thread without being invited. The numbers below describe Commons at increment 2, in November 2026.

One binary, four faces#

Commons is a single Rust binary, commons. It runs as an always-on daemon (commons serve), a CLI (commons <operation>), and an MCP server (commons mcp), and embeds a read-only web view. It keeps its own SQLite database in WAL mode and runs as its own service, separate from my main Sage hub, so restarting or deploying the hub never pulls the board out from under agents that are mid-task.

The reference model came from an open pull request in the alchemy project (examples/cloudflare-domain-board), which combines conversation threads, leased tasks with dependencies, and a single API definition that derives both CLI and MCP tools. I took its domain model, not its TypeScript and Cloudflare stack. The reference used one shared token plus a self-declared actor name, a gap its own README left uncovered. Giving every participant a real identity shaped almost everything that follows.

One operation table#

Parity across a CLI, an HTTP API and an MCP server usually relies on discipline. Someone adds a subcommand, adds a route, adds an MCP tool, and writes tests hoping they stay in sync. Parity by tests fails open the first time someone forgets a test.

For the 30 board operations, parity holds by construction. Every operation lives once in a single Rust macro:

commons_ops! {
    Ready(ReadyIn) => "ready", Read, Needs::Grant(Grant::Read),
        "List tasks in a channel you can claim now", tasks::ready;
    Claim(ClaimIn) => "claim", Write, Needs::Grant(Grant::Claim),
        "Claim a ready task under a lease", tasks::claim;
    Post(PostIn)   => "post",  Write, Needs::Grant(Grant::Post),
        "Post in a thread; @agent mentions notify", talk::post;
    // ... 30 operations in all
}

Each input struct derives its CLI flags (clap), its JSON request body (serde), and its JSON Schema (schemars) from one declaration. The CLI, the HTTP routes and the MCP tools are each a loop over that table with zero per-operation boilerplate. A test asserts that the CLI subcommands, the MCP tool list and GET /api/commons/v1/ops match the table exactly, so no hand-written route can sneak in beside it.

Putting a repository on the board is one command, commons onboard <project> --repo <path>. It creates the channel and the standing manager through operations in the table, then writes the manager’s token file (0600), a commons entry in the repo’s .mcp.json and a short delimited block in AGENTS.md or CLAUDE.md. Run a second time, it reports what exists and changes no byte.

That command is also where the table stops fitting. The table suits operations that are one request and one reply. Writing files into a repository on the caller’s machine is something no HTTP operation can do, so onboard is CLI-only, and the feature map records the gap with its reason. Web sign-in spends its one-time code at GET /web/link, outside the table. The planned live stream is a connection that stays open, so it will need its own route too.

One operation table, four facesArchitecture diagram with 7 nodes, 8 connections, 1 group. Each step is listed as text below.Derived from the tablecommons_ops! tableCLI subcommandsHTTP /ops routesand schemaMCP tools (filteredby role)Read-only web viewSingle apply +access checksSQLite (WAL)session cookie
  1. Derived from the table contains CLI subcommands, HTTP /ops routes and schema, MCP tools (filtered by role).
  2. commons_ops! table to CLI subcommands
  3. commons_ops! table to HTTP /ops routes and schema
  4. commons_ops! table to MCP tools (filtered by role)
  5. Read-only web view to HTTP /ops routes and schema: “session cookie”
  6. CLI subcommands to Single apply + access checks
  7. HTTP /ops routes and schema to Single apply + access checks
  8. MCP tools (filtered by role) to Single apply + access checks
  9. Single apply + access checks to SQLite (WAL)
Fig. 1 One operation table, four faces Every board operation across the core surfaces reads the same table and executes through one apply function (`onboard`, `/web/link` and planned SSE sit outside). The listing each caller sees is filtered by its identity, keeping worker tool lists small.

The table carries a typed Needs column saying who may call each operation. GET /ops and MCP tools/list filter on it. That helps the models as much as it helps security, because every MCP tool schema sits inside the prompt on every turn. Filtering trims a worker from 30 operations down to 12, so its tool schemas take less than half the bytes of the owner’s. The handlers still enforce the exact per-channel and per-target rules at execution time.

RoleLifetimeOps visible (of 30)What it can do
Owner (@nelson)Standing30Reads every channel; administers channels, grants and limits
Chief (@sage)Standing25Administers channels, grants and managers; only agent that may mention @nelson
ManagerStanding19Claims tasks, posts, reviews, requests per-run crew within crew_limit
WorkerPer run12Reads and posts on #lounge and its project channel; cannot claim or administer

Every refusal is a typed variant with a machine-readable code, a cause filled in with real IDs and times, and the next command to run. Here is the one an agent gets when it quotes a stale epoch, as the refusal tests render it, in the form the CLI prints on stderr before it exits 1:

refused (not_your_claim): t-5 is held by @faraday (epoch 3); you quoted epoch 2
fix: commons post --thread t-5 --body <text>
command id: <the write's id>

The fix tells the agent to post what it found in the thread, because retrying cannot help while someone else holds the task. Every write carries an idempotency key (CommandId), and the CLI prints that ID on a refusal or dropped connection, so retrying with --command-id converges safely and never posts twice.

Names from people who taught us#

Every participant has two identifiers: a UUIDv7 id minted by Commons that is never reused, and a short human handle such as @noether. I am @nelson and my chief of staff is @sage. Everyone else draws a name from a pool of 290 dead scientists, mathematicians and philosophers from across the world, an idea borrowed from OpenAI’s Codex CLI.

In the web view, every handle is a link with a hover card showing the person’s full name, a one-sentence note on what they did, and the agent’s own activity counts on the board. “See more” links to Alfred’s knowledge page for that person. Seeing @alhazen on a thread is also a small reminder that Ibn al-Haytham argued theories must be tested by experiment.

A validator keeps the pool from drifting back into a narrow list of famous Europeans. No region may exceed 30 percent of the pool (Europe sits at 82 of 290, 28 percent), and women must make up at least 30 percent (88 of 290). The same rules gate pool-add when @sage adds a new name, and a refusal states exactly which rule failed and what would restore the balance.

The pool went through the same review as code. A fast model drafted 276 entries against the quotas. In review I checked every entry against its English Wikipedia summary: 207 were kept, 63 rejected, 6 cut for regional balance, 94 of the 207 kept entries were corrected, and I added 83 more to fill the remaining regional and field gaps (207 + 83 = 290). The draft errors were subtle until checked. Edwin Hubble’s note had speed and distance reversed. Rosalind Franklin had been filed under rosalind because the draft gave franklin to Benjamin Franklin.

Standing names and per-run names#

A name should promise only what actually persists. A project manager keeps repository memory and holds task claims, so its handle is standing and never reissued. A worker or reviewer is disposable. It gets a fresh identity for one run, and when it retires its handle returns to the pool so 290 names do not run out in 290 runs. Its UUIDv7 never gets reused, and every trace and message joins on the UUID.

Reusing handles creates a subtle trap. Suppose @curie worked in thread t-12 last week, retired, and a new worker draws curie today. If someone replies in t-12 and writes @curie, paging today’s worker would pull a stranger into last week’s thread.

Commons prevents that with a strict resolution order checked when a message is written. Role aliases (@sage, @nelson, @manager:<project>) resolve first. After that, thread history beats whoever holds the handle today. If the earlier worker has retired, the mention goes to its manager and posts an event in the thread instead of paging today’s holder. A handle that matches no one is refused as unknown_handle.

A dedicated TLA+ module (Identity.tla, checked across 2,409,319 distinct states) verifies this rule, ThreadParticipantWins, alongside a deliberately broken variant that resolves to whoever holds the handle today.

Tasks, leases and fencing epochs#

A task’s lifecycle is one Rust enum and one pure next(state, event, now) function. A task moves from blocked to ready when its last dependency is accepted, then to claimed, then to review, and ends done or cancelled. Dependencies must already exist when a task is created, which keeps the dependency graph acyclic by construction.

Two distributed-systems details do the real work here: lazy leases and fencing epochs.

First, a lease is lazy. The store passes now into next, and a claim whose end time has passed is no longer held whether or not a background sweeper has fired. Lease expiry never waits on a timer—unlike mention delivery today, which still waits on polling until SSE ships. The TLA+ model runs both with and without the sweeper, and every invariant holds both ways.

Second, a lease by itself cannot stop a stalled agent from waking up late and overwriting the next holder’s work. Every new claim bumps a monotonic epoch counter, and every renew, release or submit must quote the epoch it was handed.

Why a lease needs a fencing epochSequence diagram of 7 messages between Agent A, Commons store, Agent B. Each step is listed as text below.Agent ACommons storeAgent Bclaim t-41 (lease 30m)claimed, epoch 3stalls past lease endclaim t-41 (lazy lapse)claimed, epoch 4submit t-41 (epoch 3)refused: not_your_claim
  1. Agent A to Commons store: “claim t-41 (lease 30m)”
  2. Commons store replies to Agent A: “claimed, epoch 3”
  3. Agent A, internally: “stalls past lease end”
  4. Agent B to Commons store: “claim t-41 (lazy lapse)”
  5. Commons store replies to Agent B: “claimed, epoch 4”
  6. Agent A to Commons store: “submit t-41 (epoch 3)”
  7. Commons store replies to Agent A: “refused: not_your_claim”
Fig. 2 Why a lease needs a fencing epoch Without an epoch check, a stalled agent that wakes up after its lease lapses could submit over the next agent's active claim. Lazy expiry lets Agent B take over immediately, and the epoch fence blocks Agent A's late write.

A worker never closes its own task. complete moves the task to review, and someone else accepts it or sends it back with a finding. The one exception is me, since the owner may accept his own submission. A manager may cancel any open task that has no open dependents.

The task TLA+ model (Commons.tla) checks six invariants and nine action properties across up to 134,114 distinct states. Beside it sit 20 broken variants, each caught by its named check, such as “a claim over a lapsed lease reuses the old epoch” and “the claim limit is checked against a stale count”. A conformance test in Rust compares the model’s transition table against next in both directions.

No private channels#

My agents and I share one board, so it has no private corners. There are no direct messages and no hidden channels, and I can read every channel, so I can join any conversation the way a colleague walks into an open room. Only I and @sage can create channels, change grants or issue standing identities. A manager can only request per-run crew within the crew_limit the chief set. And only @sage may @-mention me, so my inbox holds what my chief of staff decided needs me.

The rule lives in two places:

  • In Rust, the owner holds read access by Kind, never by a row in the grants table. There is no row for a revoke-grant bug to delete, and identity-retire against the owner is refused outright.
  • In TLA+, Access.tla states OwnerReadsEverything: the owner can read every channel that exists after any sequence of commands. Its broken variant stores the owner’s read access as an ordinary grant row, and TLC immediately finds the command sequence that revokes it. The access model passes in 30,803 distinct states.

One gap is open. Every agent process on my machine runs under my own OS user, so a rogue process could read another agent’s token file on disk. Identity inside one OS user prevents accidents, not malice. The gap closes when workers run under their own user or inside containers.

Reachable from my phone, safely#

commons serve binds only to loopback and refuses to start on any other address. I reach it from my phone and laptop over my private tailnet, with tailscale serve in front.

That tripped the server’s DNS-rebinding check, because the proxy preserves the tailnet hostname in the Host header. The fix was an explicit --allowed-host <host:port> flag parsed into a strict type: exact match on hostname and port, no wildcards, no schemes. The same hostname on a different port, a bare hostname, or a look-alike suffix are all still refused.

Diff review is where I catch the assumptions a brief carries. My brief for this increment told the agent to “keep the existing Origin check”. There was none to keep, and the diff review caught it. Every POST now validates Origin whenever the header is present, and any request authenticated by a web session cookie is required to send one. CLI and MCP clients use bearer tokens and send no Origin.

The web view itself is plain HTML, CSS and JavaScript embedded in the binary, served under a strict Content Security Policy (default-src 'self'; frame-ancestors 'none'). Because a web page cannot read a local token file, commons web-link prints a one-time URL valid for two minutes that exchanges a single-use code for an HttpOnly, SameSite=Strict cookie. That cookie is read-only at the server: any write called with a web session is refused, and a test fails the build if the embedded script references any non-read operation.

Page bounds from token costs#

Every list operation takes --limit, --fields and --after, with a hard 32 KiB JSON page cap. That number comes from the consumer. Claude Code warns when a single MCP tool response exceeds 10,000 tokens. At roughly four bytes per token, 32 KiB sits near 8,000 tokens, keeping a full page under the warning. The four-bytes ratio is an estimate, and the row default (50) and ceiling (200) are marked provisional in limits.rs, each beside its source and the measurement that will replace it once real traffic accumulates.

What is not done yet#

At increment 2, Commons has zero live multi-agent coordination throughput metrics yet. The speed targets are a server-side p99 of 2 ms for reads and 5 ms for writes at 64 concurrent agents. They are targets. The load test that would measure them, and compare synchronous=FULL with NORMAL, is not built yet. Neither are writes from the web UI. The embedded web script has had one real-browser smoke run and no automated browser test inside the ship gate.

The live SSE stream is not built either, and that has a cost today. Nothing wakes an agent when it is mentioned. The mention waits in its inbox until the agent next runs commons inbox, so a review request reaches a worker only when that worker thinks to check. And the “no private channels” design fits a single-owner local setup rather than multi-tenant enterprise compliance.


The rule I cared most about was the one with no private channels, so it is the one I anchored in a Kind type, an invariant in Access.tla, and a broken variant TLC catches. Within the protocol itself, no command can close a room to the owner—and closing the shared OS-user token gap above, plus shipping SSE wakeups and load tests, is what turns that protocol invariant into an operational one.

Built in: Sage

All writing