Skip to content

Tower-to-Tower messaging, stage 2: between my own Towers through Codev Cloud #1967

Done

Description

@waleedkadous

Stage 2 of the Tower-to-Tower messaging design: an agent on one of my Towers sends to an agent on another of my Towers, both behind NAT, through Codev Cloud.

Design: the approved spec for issue #1940, codev/specs/1940-tower-to-tower-messaging-proto.md (on main once PR #1957 merges). It designs all three stages; this issue builds stage 2. Read Decisions 2, 5, 6, 7 and 9, the stage 2 walkthrough, and the "What Codev Cloud must change" section before planning.

Already in place (stage 1, PR #1957): the address grammar and one shared parser (afx:// addresses parse today and are refused with a clear message), <workspace>:architect:<name> on one Tower, the builder rule, workspace names, afx workspace list and afx whoami, the qualified sender header and reply line.

Depends on:

Narrows: issue #655 (cloud messaging) to whatever this does not cover.

Acceptance criteria (inherited from the spec as written)

  • The headline path works between two Towers on one account, both behind NAT. The stage 2
    walkthrough can be followed as written: the same commands, in that order, with those results.
  • With remote messaging off, a Tower refuses an afx:// send to another Tower before anything
    leaves the machine, and says how a human turns it on.
  • A Tower's name is unique within its owner's account only. The name I give a Tower is not
    affected by what any other account has registered, and an address for one of my own Towers
    never contains an owner.
  • A Tower accepts no remote message until its owner has granted a peer. A fresh install, and an
    upgraded one, refuse everything.
  • The sender is told delivered, held with where and why, or refused with the reason. A
    refusal exits non-zero and leaves nothing on the receiving Tower.
  • A message for a Tower that is offline, or sent while the cloud is unreachable, is held on the
    sending Tower, visible in afx inbox, and is accepted exactly once when the route returns,
    provided that is within the message's 30-day lifetime. After that it is shown as expired.
  • Mail held on the sending Tower is a distinct kind of held mail: the local delivery drainer
    never tries to type it into a terminal, it never raises the starved-agent escalation, and
    afx inbox and the held-mail indicator show it apart from mail waiting for a local agent.
  • Messages from one Tower to one recipient are delivered in the order they were sent,
    including when the peer is online and several agents send at once: the sending Tower makes
    one relay call at a time for each peer.
  • The recipient's header marks the message as remote and names the sending Tower and the
    sender's full address; the reply command in it works.
  • The sending Tower's identity shown to the recipient comes from Codev Cloud's authentication
    of that Tower, carried in the attested statement. No field of the message can change it.
  • A relayed request is accepted only with a statement whose MAC verifies under the current
    tunnel session's secret. A request from this machine that holds the local key, a request
    through Codev Cloud's /t/ browser proxy with any headers, a replayed statement, and one
    from an earlier tunnel session are each refused, and nothing is stored.
  • A send to a peer that does not speak the protocol, or through a cloud without the relay, is
    refused with that reason and not held.
  • --raw, --interrupt and --no-enter are refused for a remote recipient, and control
    characters in a remote body never reach a terminal.
  • From one Tower I can list my other Towers, and for one I have been granted, its workspaces and
    agents.
  • Removing a grant refuses further mail from that peer immediately, and stops automatic
    delivery of mail from it that was accepted but not yet delivered.
  • Flooding is bounded at the cloud and again at the receiving Tower.
  • Both Towers keep a record of every cross-Tower attempt and its outcome, without bodies in
    logs.
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

    area/tower

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions