Skip to content

Spike: one bench mail command as the verb surface, so any runtime can send without an integration #322

Description

@Wirasm

Spike: one bench mail command as the mailbox's verb surface, so any runtime can send and read without an integration of its own. Prove it, measure what it costs, and decide whether the hooks and the pi extension should keep sending or become sensors only.

The operator's proposal, in his words

we can add a bench mail command to helm, that would remove the codex problem right? if it can just call bench mail send etc — then just add rules that any spawned agent send bench mail check every 10 min or so — if it works we can make sure that pi and cc are also using the same command instead of hooks

Why this is bigger than the codex gap it was proposed to close

It closes the codex gap, yes: codex has no mailbox integration today (codex appears nowhere in hooks/, pi/extensions/ or either mail skill), and a CLI needs none — anything that can run a command can send.

But the larger prize is that the verb surface is currently the integration. "Sending" today means write a JSON file with exactly these fields into exactly this directory, having resolved the root by exactly these rules — and that rule now exists in three languages: Swift (MailboxDirectory), a standalone node script (hooks/helm-mail.mjs) and a TypeScript pi extension. #285 made a fourth and fifth copy appear in the two skill docs, and closing it required a conformance harness that extracts the Swift and runs all three against one fixture set, plus four self-check mutations, to keep them honest.

A single command is one implementation with one spelling. That is a direct attack on the most expensive duplication in this repo — the one AGENTS.md defends as an honest carve-out "because a runtime boundary makes sharing impossible." If a CLI dissolves that boundary, the carve-out stops being necessary rather than stops being honest.

The tension to be explicit about: this is pull, #320 is push

#320 asks whether an idle Claude Code session can be woken over its socket. This asks whether the verb surface can be one command. They are orthogonal and they compose:

today this spike #320
claim per-runtime hook/extension one command unchanged
send per-runtime file write one command unchanged
read per-runtime one command unchanged
wake arm-a-watch (cc) / in-process (pi) / none (codex) poll push

So the honest framing is: a CLI is the floor and push is the ceiling. Polling makes every runtime work at once, badly; pushing makes some runtimes work well. Neither replaces the other, and the spike should say which parts of each survive together.

What a 10-minute poll actually costs — measure, do not assume

This is the number that decides whether the poll is a floor or a mistake.

  • A poll is a turn. An agent checking every 10 minutes spends 6 turns an hour whether or not there is mail. With a fleet of N agents that is 6N turns an hour of nothing. Quantify it against a real model call, not in the abstract.
  • Latency is the interval. Mail sent at 00:01 is read at 00:10. For "your teammate is blocked" that may be fine; for "stop, you are about to duplicate my work" it is not. Say which class of message the interval is acceptable for.
  • Who enforces it? "Add a rule that spawned agents check every 10 min" is a prompt instruction — an agent that forgets, or is mid-task, simply does not. Compare against a mechanism that cannot be forgotten. An instruction is not a schedule.
  • Does it survive an idle agent? An agent that has finished and is sitting at a prompt is not running a loop at all. A poll only happens if something is taking turns — which is exactly the state where mail matters most and polling works least. This may be the finding that decides the whole ticket.

Assumptions to prove

  1. A bench mail command can send and read with no per-runtime integration — measured from codex, pi and Claude Code, all three, against one mailbox.
  2. It stays callable the way the spool scripts are: no build, no cwd inside the repo, no resolved dependencies. AGENTS.md's "Why the spool is a script, and must stay one" is the constraint — A HelmWire library target — the spool's format is typed on one side and spelled out on the other #221 measured all three properties breaking when the scripts became SPM targets. A bench mail that needs swift build is not usable by the agent that needs it.
  3. It collapses the triplication rather than becoming a fourth copy. If the command shells out to the same rules while the hook and extension keep their own, this has made the problem worse. Prove what can be deleted, not merely what can be added.
  4. The poll's real cost, per the section above: turns per hour per agent, latency, and what happens to an idle agent that is not taking turns at all.
  5. Whether the hooks and pi extension can become sensors only — claiming and reporting state, never resolving a root or formatting a message. That is the shape that would let the conformance harness shrink.
  6. What it does to operator mail. The operator's own notes route through CanvasNoteRoute today and carry his authority. A command any agent can run must not become a way to send as him — operator is reserved and must stay so.
  7. How it composes with Spike: wake an idle Claude Code session over its own socket, and make mail delivery transport-aware #320. If the socket wake proves out, does the CLI remain the send surface with push as the wake, or does one make the other redundant? Answer with a recommendation, not a preference.

Scope

In: the verb surface (send, check/read, and whatever claim turns out to need), across Claude Code, pi and codex.

Out: building it. This is a spike. No production change, no PR, and the hooks and extension stay exactly as they are until a second ticket says otherwise.

Related: #320 (socket wake — push, where this is pull). Read it before starting; the two share the mailbox and must not each invent a different answer to "who resolves the root".

Acceptance

  • Every assumption has a verdict backed by something that was run, on all three runtimes where the assumption names them.
  • The poll cost is a number, not an adjective.
  • A recommendation on whether the hooks and pi extension keep sending, become sensors, or go away entirely — and what that would do to hooks/mailbox-conformance.mjs.
  • If the answer is "the CLI is right for codex and wrong for the other two", that is a fine outcome — say so and say why.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions