From d394ac47ddbaf93187d6f6f432f50e6c6698f4aa Mon Sep 17 00:00:00 2001 From: M Waleed Kadous Date: Fri, 20 Nov 2026 17:30:58 -0800 Subject: [PATCH 01/92] chore(porch): 1940 init spir --- .../status.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 codev/projects/1940-tower-to-tower-messaging-proto/status.yaml diff --git a/codev/projects/1940-tower-to-tower-messaging-proto/status.yaml b/codev/projects/1940-tower-to-tower-messaging-proto/status.yaml new file mode 100644 index 000000000..87e6c96a6 --- /dev/null +++ b/codev/projects/1940-tower-to-tower-messaging-proto/status.yaml @@ -0,0 +1,20 @@ +id: '1940' +title: tower-to-tower-messaging-proto +protocol: spir +phase: specify +plan_phases: [] +current_plan_phase: null +gates: + spec-approval: + status: pending + plan-approval: + status: pending + pr: + status: pending + verify-approval: + status: pending +iteration: 1 +build_complete: false +history: [] +started_at: '2026-11-21T01:30:58.126Z' +updated_at: '2026-11-21T01:30:58.128Z' From d4cb7e648e2a1f05d9cc185a089c963b6ca815f2 Mon Sep 17 00:00:00 2001 From: M Waleed Kadous Date: Fri, 20 Nov 2026 17:47:14 -0800 Subject: [PATCH 02/92] [Spec 1940] Initial specification draft Co-Authored-By: Claude Fable 5.2 --- .../1940-tower-to-tower-messaging-proto.md | 740 ++++++++++++++++++ codev/state/spir-1940_thread.md | 34 + 2 files changed, 774 insertions(+) create mode 100644 codev/specs/1940-tower-to-tower-messaging-proto.md create mode 100644 codev/state/spir-1940_thread.md diff --git a/codev/specs/1940-tower-to-tower-messaging-proto.md b/codev/specs/1940-tower-to-tower-messaging-proto.md new file mode 100644 index 000000000..c02d2d00a --- /dev/null +++ b/codev/specs/1940-tower-to-tower-messaging-proto.md @@ -0,0 +1,740 @@ +# Specification: Messaging between workspaces and between Towers — addressing, discovery, security + + + +Issue: #1940. Command names, header layouts and limits shown here are illustrative; the plan settles +exact spellings. The decisions that are the owner's are collected under **Open Questions**, each with +a recommendation. + +## Problem Statement + +`afx send` reaches an agent only if the sender can name it, and only if it lives on the same Tower. +Three things the owner wants are impossible today, in this order of priority: + +1. **Named architects cannot be reached from outside their own workspace.** From workspace `codev` + there is no way to write "the architect named `tunnel` in workspace `codev-cloud`". Only that + workspace's `main` architect is reachable. This is a gap on a single Tower, with no network + involved. +2. **My Towers cannot message each other.** An architect on my laptop cannot message an architect on + my dev VM. +3. **My Tower cannot exchange messages with someone else's.** There is no way for a collaborator's + architect and mine to talk. + +Behind all three sits one missing piece: an address that can name a Tower, a workspace, a kind of +agent and the agent itself. Behind the second and third sits a security problem that has to be +treated as what it is. A message delivered to an agent is text typed into the prompt of a coding +agent that usually runs with permission checks skipped. **Accepting a message from another Tower is +accepting remote instructions for an agent with shell access.** + +Who is affected: every owner who runs more than one named architect (stage 1), more than one machine +(stage 2), or works with a collaborator who also runs Codev (stage 3). + +## Current State + +**Addressing.** An address is split on its first colon into two slots, `{project, agent}`. + +| Written today | Means | +|---|---| +| `architect` | From a builder: its spawning architect. From anyone else: `main`, else the first registered | +| `architect:review` | The architect named `review` in the sender's workspace | +| `builder-spir-1940`, `1940` | A builder in the sender's workspace (exact id, then tail match) | +| `codev-cloud:architect` | The `main` architect of the workspace whose directory basename is `codev-cloud` | +| `codev-cloud:builder-bugfix-12` | A builder in that workspace | + +- `architect:review` and `codev-cloud:architect` have the same two-slot shape. The resolver tells + them apart by intercepting the literal word `architect` in the first slot. With only two slots + there is nowhere to put a third thing, so "architect `tunnel` in workspace `codev-cloud`" cannot be + written. Spec 786 and Spec 823 both recorded cross-workspace architect coordination as deferred. +- A workspace is identified by its absolute path. Its address name is the directory basename, + matched case-insensitively against workspaces currently active in Tower. Two workspaces with the + same basename produce an `AMBIGUOUS` error that the user has no way to resolve. The basename is + stored once in `known_workspaces.name`; nothing lets the user change it, and + `.codev/config.json` has no name field. +- Architect names match `^[a-z][a-z0-9-]*$` (64 characters at most). Builder ids look like + `builder--`. Neither can contain a colon, a slash, a dot or `@`. + +**Provenance.** The recipient sees a header such as +`### [ARCHITECT:review MESSAGE → main |