Skip to content

[Spec 1940] Stage 1 (in progress): named architects across workspaces on one Tower - #1957

Draft
waleedkadous wants to merge 89 commits into
mainfrom
builder/spir-1940
Draft

waleedkadous wants to merge 89 commits into
mainfrom
builder/spir-1940

Conversation

@waleedkadous

@waleedkadous waleedkadous commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Draft, opened early for CI. This pull request is not ready for review. It was opened part-way through implementation so that GitHub runs the full test suite on a clean runner, under the owner's standing ruling main-32 (a green GitHub run may stand in for porch's local tests check when the local suite fails only under machine load). The review phase finishes this pull request: the description below will be replaced, and the review document added, before it is marked ready.

What this is

Stage 1 of issue #1940 (Tower-to-Tower messaging: addressing, discovery, security model): named architects addressable across workspaces on one Tower. No second Tower, no transport, no Codev Cloud.

Spec: codev/specs/1940-tower-to-tower-messaging-proto.md
Plan: codev/plans/1940-tower-to-tower-messaging-proto.md

Where it stands

Plan phase State
1. Shared address contract and parser Done, reviewed
2. Named architects across workspaces and the builder rule Built; in review (round 1 fix applied)
3. Explicit workspace names Not started
4. Qualified provenance and reply commands Not started
5. One-Tower discovery: workspace list and whoami Not started
6. Addressing docs in both trees and end-to-end verification Not started
7. Front-door-only workspace setting Cut by the owner (decision main-31)

In the branch so far

  • One address parser and formatter in @cluesmith/codev-sdk/address, with the structured AgentAddress wire type in codev-types, and one table of cases run by the SDK, packages/codev and the VS Code extension.
  • <workspace>:architect:<name> resolves against live terminals and against the registry, so mail to a named architect in another workspace is delivered, or held when it has no live terminal.
  • A builder may name only its own spawning architect. Naming one in another workspace is refused with that workspace's front door.
  • Malformed addresses fail with the shape that was expected. Every afx:// address is refused as cross-Tower messaging not available.

Adjacent bugs fixed in place

Both are older than this branch and were found by review of phase 2.

  • The registry fallback could hold a builder's mail for an unrelated architect. For bare architect, the registry answered "the first registered" where the live resolver refuses (a builder whose spawning architect has gone, or a legacy builder, in a workspace with no main). The send route consults the registry on any not-found, so that mail was held for, and then delivered to, an architect the builder had nothing to do with. The registry now refuses exactly where the live resolver does.
  • Issue Offline architect resolver picks alphabetically, live resolver picks first-registered (getArchitects ORDER BY id) #1633 (offline architect resolver picks alphabetically, live resolver picks first-registered). getArchitects sorted by name, so with no main an offline hold named the alphabetically first architect where a live send reached the first registered. It now orders main first, then by start time, as loadState does. This also means a workspace's sibling architects are relaunched in registration order at workspace start.

Why the draft exists now, and the local check that was skipped

On d106d3984, porch's local tests check and one full local run failed with 92 timeouts in 17 test files, none touched by this branch, while the machine's load average was between 33 and 49. The same suite passed in full twice on the preceding commit.

Under the owner's ruling main-32, phase 2's local full-suite check was skipped (porch's build check still ran), on these grounds:

  • GitHub's run on this pull request was green, 8 of 8 checks, at 6804f57c7 (this branch with main merged in). The architect checked the run.
  • The 17 files that timed out pass when run alone in one vitest invocation: 586 passed, 1 skipped, at a load average of about 10.

main was merged into the branch (6df1df753) because the branch conflicted with it and GitHub runs no checks on a conflicting pull request. One conflict, packages/sdk/src/tower-client.ts: both sides added a field to the same two result shapes, and both are kept.

The details are in codev/state/spir-1940_thread.md.

waleedkadous and others added 30 commits November 20, 2026 17:30
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…builder rule, stage 2 walkthrough, connections per owner, existing code
…approval (main-31): front-door-only opt-in cut from stage 1
…istyped afx scheme fails with the shape meant
- The naming module tells workspaces apart by workspaceKey, never by the text
  of a path: a row and a running workspace that spell one directory two ways
  are one workspace, with the row's name. A lookup returns a running workspace
  in the spelling it runs under.
- findWorkspaceByAddressName lower-cases the name itself.
…ot change

Written and run against the code before any phase 4 production change: every
same-workspace sender and recipient kind, a sender with no workspace or the
workspace 'unknown', senders that are not agents, and raw sends.
…ands

A message from an agent in another workspace is framed with the sender's
workspace-qualified address, and its footer line carries a reply command the
recipient is allowed to use, or says how to reply when there is none.

- message-format: formatCrossWorkspaceMessage. The role comes from the
  address's kind; every address part is checked against the component rule.
- tower-messages: refusalToAddress (the builder rule on its own) and
  crossWorkspaceOrigin, which asks it with the recipient as the sender and
  offers the front door only when the front door reaches the sender.
- tower-routes: formatMessageForTarget takes a sender whose workspace is
  required by its type; all six call sites pass it.

Same-workspace frames, senders with no known workspace, senders that are
not agents and raw sends are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant