agent-embassy 1.9.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +87 -0
- package/CONTRIBUTING.md +19 -34
- package/README.md +110 -221
- package/SECURITY.md +55 -89
- package/dist/src/errors.d.ts +10 -1
- package/dist/src/errors.js +3 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/gateway/claude-helper-protocol.d.ts +9 -12
- package/dist/src/gateway/claude-helper-protocol.js +15 -13
- package/dist/src/gateway/claude-helper-protocol.js.map +1 -1
- package/dist/src/gateway/claude-helper-supervisor.d.ts +2 -6
- package/dist/src/gateway/claude-helper-supervisor.js +10 -9
- package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
- package/dist/src/gateway/claude-helper.js +18 -10
- package/dist/src/gateway/claude-helper.js.map +1 -1
- package/dist/src/gateway/claude-peer.d.ts +0 -3
- package/dist/src/gateway/claude-peer.js +6 -18
- package/dist/src/gateway/claude-peer.js.map +1 -1
- package/dist/src/gateway/cli.d.ts +18 -13
- package/dist/src/gateway/cli.js +942 -298
- package/dist/src/gateway/cli.js.map +1 -1
- package/dist/src/gateway/codex-local-transport.d.ts +1 -1
- package/dist/src/gateway/codex-local-transport.js +2 -2
- package/dist/src/gateway/codex-local-transport.js.map +1 -1
- package/dist/src/gateway/codex-socket-holder.d.ts +26 -0
- package/dist/src/gateway/codex-socket-holder.js +76 -0
- package/dist/src/gateway/codex-socket-holder.js.map +1 -0
- package/dist/src/gateway/codex-stateless-transport.js +1 -1
- package/dist/src/gateway/codex-stateless-transport.js.map +1 -1
- package/dist/src/gateway/config.d.ts +5 -13
- package/dist/src/gateway/config.js +7 -19
- package/dist/src/gateway/config.js.map +1 -1
- package/dist/src/gateway/control.d.ts +55 -108
- package/dist/src/gateway/control.js +95 -222
- package/dist/src/gateway/control.js.map +1 -1
- package/dist/src/gateway/federation-nodes.d.ts +29 -3
- package/dist/src/gateway/federation-nodes.js +200 -15
- package/dist/src/gateway/federation-nodes.js.map +1 -1
- package/dist/src/gateway/peer-client.d.ts +4 -3
- package/dist/src/gateway/peer-client.js +22 -13
- package/dist/src/gateway/peer-client.js.map +1 -1
- package/dist/src/gateway/peer-protocol.d.ts +8 -11
- package/dist/src/gateway/peer-protocol.js +5 -12
- package/dist/src/gateway/peer-protocol.js.map +1 -1
- package/dist/src/gateway/provenance-envelope.d.ts +0 -1
- package/dist/src/gateway/provenance-envelope.js +4 -19
- package/dist/src/gateway/provenance-envelope.js.map +1 -1
- package/dist/src/gateway/providers.d.ts +10 -7
- package/dist/src/gateway/providers.js +21 -28
- package/dist/src/gateway/providers.js.map +1 -1
- package/dist/src/gateway/server.d.ts +4 -14
- package/dist/src/gateway/server.js +33 -59
- package/dist/src/gateway/server.js.map +1 -1
- package/dist/src/gateway/service-agent.d.ts +187 -0
- package/dist/src/gateway/service-agent.js +758 -0
- package/dist/src/gateway/service-agent.js.map +1 -0
- package/dist/src/gateway/service.d.ts +117 -32
- package/dist/src/gateway/service.js +525 -576
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/status-view.d.ts +167 -0
- package/dist/src/gateway/status-view.js +488 -0
- package/dist/src/gateway/status-view.js.map +1 -0
- package/dist/src/gateway/store.d.ts +103 -21
- package/dist/src/gateway/store.js +473 -547
- package/dist/src/gateway/store.js.map +1 -1
- package/dist/src/gateway/types.d.ts +51 -102
- package/dist/src/gateway/types.js +15 -52
- package/dist/src/gateway/types.js.map +1 -1
- package/docs/CONFIGURATION.md +194 -59
- package/docs/DELIVERY.md +11 -11
- package/docs/GATEWAY-ARCHITECTURE.md +286 -394
- package/package.json +4 -12
- package/skills/embassy-peer/SKILL.md +72 -92
- package/skills/embassy-peer/agents/openai.yaml +1 -1
- package/README.zh-CN.md +0 -269
- package/assets/live-dashboard/app.css +0 -1619
- package/assets/vendor/react/LICENSE +0 -21
- package/assets/vendor/react/react-dom.production.min.js +0 -267
- package/assets/vendor/react/react.production.min.js +0 -31
- package/dist/src/gateway/acp-client.d.ts +0 -110
- package/dist/src/gateway/acp-client.js +0 -407
- package/dist/src/gateway/acp-client.js.map +0 -1
- package/dist/src/gateway/acp-provider.d.ts +0 -66
- package/dist/src/gateway/acp-provider.js +0 -275
- package/dist/src/gateway/acp-provider.js.map +0 -1
- package/dist/src/gateway/cli-copy.d.ts +0 -8
- package/dist/src/gateway/cli-copy.en.d.ts +0 -17
- package/dist/src/gateway/cli-copy.en.js +0 -58
- package/dist/src/gateway/cli-copy.en.js.map +0 -1
- package/dist/src/gateway/cli-copy.js +0 -22
- package/dist/src/gateway/cli-copy.js.map +0 -1
- package/dist/src/gateway/cli-copy.zh-CN.d.ts +0 -17
- package/dist/src/gateway/cli-copy.zh-CN.js +0 -58
- package/dist/src/gateway/cli-copy.zh-CN.js.map +0 -1
- package/dist/src/gateway/codex-doctor.d.ts +0 -36
- package/dist/src/gateway/codex-doctor.js +0 -127
- package/dist/src/gateway/codex-doctor.js.map +0 -1
- package/dist/src/gateway/dashboard-copy.d.ts +0 -7
- package/dist/src/gateway/dashboard-copy.en.d.ts +0 -504
- package/dist/src/gateway/dashboard-copy.en.js +0 -505
- package/dist/src/gateway/dashboard-copy.en.js.map +0 -1
- package/dist/src/gateway/dashboard-copy.js +0 -514
- package/dist/src/gateway/dashboard-copy.js.map +0 -1
- package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +0 -504
- package/dist/src/gateway/dashboard-copy.zh-CN.js +0 -505
- package/dist/src/gateway/dashboard-copy.zh-CN.js.map +0 -1
- package/dist/src/gateway/dashboard-model.d.ts +0 -343
- package/dist/src/gateway/dashboard-model.js +0 -1061
- package/dist/src/gateway/dashboard-model.js.map +0 -1
- package/dist/src/gateway/dashboard.d.ts +0 -20
- package/dist/src/gateway/dashboard.js +0 -874
- package/dist/src/gateway/dashboard.js.map +0 -1
- package/dist/src/gateway/deepseek-detect.d.ts +0 -14
- package/dist/src/gateway/deepseek-detect.js +0 -41
- package/dist/src/gateway/deepseek-detect.js.map +0 -1
- package/dist/src/gateway/live-dashboard-app/app.js +0 -2385
- package/dist/src/gateway/live-dashboard-assets.d.ts +0 -10
- package/dist/src/gateway/live-dashboard-assets.js +0 -74
- package/dist/src/gateway/live-dashboard-assets.js.map +0 -1
- package/dist/src/gateway/live-dashboard-command.d.ts +0 -58
- package/dist/src/gateway/live-dashboard-command.js +0 -334
- package/dist/src/gateway/live-dashboard-command.js.map +0 -1
- package/dist/src/gateway/live-dashboard-http.d.ts +0 -39
- package/dist/src/gateway/live-dashboard-http.js +0 -383
- package/dist/src/gateway/live-dashboard-http.js.map +0 -1
- package/dist/src/gateway/live-dashboard-protocol.d.ts +0 -34
- package/dist/src/gateway/live-dashboard-protocol.js +0 -114
- package/dist/src/gateway/live-dashboard-protocol.js.map +0 -1
- package/dist/src/gateway/live-dashboard-server.d.ts +0 -33
- package/dist/src/gateway/live-dashboard-server.js +0 -144
- package/dist/src/gateway/live-dashboard-server.js.map +0 -1
- package/dist/src/gateway/live-dashboard-stream.d.ts +0 -46
- package/dist/src/gateway/live-dashboard-stream.js +0 -234
- package/dist/src/gateway/live-dashboard-stream.js.map +0 -1
- package/dist/src/gateway/live-dashboard.d.ts +0 -28
- package/dist/src/gateway/live-dashboard.js +0 -154
- package/dist/src/gateway/live-dashboard.js.map +0 -1
- package/dist/src/gateway/locale.d.ts +0 -4
- package/dist/src/gateway/locale.js +0 -10
- package/dist/src/gateway/locale.js.map +0 -1
- package/dist/src/gateway/progress-watch-machine.d.ts +0 -45
- package/dist/src/gateway/progress-watch-machine.js +0 -70
- package/dist/src/gateway/progress-watch-machine.js.map +0 -1
- package/dist/src/gateway/state-v2-to-v3.d.ts +0 -24
- package/dist/src/gateway/state-v2-to-v3.js +0 -1034
- package/dist/src/gateway/state-v2-to-v3.js.map +0 -1
- package/docs/CONFIGURATION.zh-CN.md +0 -93
- package/docs/DASHBOARD.md +0 -98
- package/docs/DASHBOARD.zh-CN.md +0 -49
- package/docs/DELIVERY.zh-CN.md +0 -55
|
@@ -1,40 +1,34 @@
|
|
|
1
1
|
# Embassy Gateway Architecture
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
supports macOS, the only platform exercised end to end
|
|
3
|
+
Local bidirectional routing between Claude Code sessions, Codex CLI tasks,
|
|
4
|
+
and universal shell peers, with optional federation of named routes between
|
|
5
|
+
the operator's own machines over a fixed attach-only SSH transport. The
|
|
6
|
+
published package supports macOS, the only platform exercised end to end.
|
|
7
7
|
|
|
8
|
-
This document uses
|
|
8
|
+
This document uses three evidence labels:
|
|
9
9
|
|
|
10
10
|
- **Official**: documented by Anthropic or OpenAI.
|
|
11
|
-
- **Implemented**: present in this
|
|
12
|
-
- **Observed**: established by a bounded, read-only local
|
|
13
|
-
- **Planned**: designed but not yet integrated or live-validated.
|
|
14
|
-
|
|
15
|
-
A bounded real test completed native Claude discovery and messaging, held a
|
|
16
|
-
message while the registered Codex task was active, automatically started the
|
|
17
|
-
queued turn after idle, and delivered the exact final reply back to Claude.
|
|
11
|
+
- **Implemented**: present in this tree and covered by deterministic tests.
|
|
12
|
+
- **Observed**: established by a bounded, read-only local probe.
|
|
18
13
|
|
|
19
14
|
## Purpose and boundary
|
|
20
15
|
|
|
21
16
|
The gateway lets already-running Claude Code sessions and explicitly
|
|
22
|
-
registered native Codex tasks address one another by short aliases.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
registered native Codex tasks address one another by short aliases. The
|
|
18
|
+
permission to message is the boundary the broker already sits inside: the same
|
|
19
|
+
UID, the same host — or a host the operator listed in the private `nodes.json`
|
|
20
|
+
— and an exact alias. There is no separate, revocable grant between two
|
|
21
|
+
endpoints, because no such record could defend against software already
|
|
22
|
+
running as that UID; what the broker guarantees instead is attribution, and a
|
|
23
|
+
discovered Claude session's route installs on its first use rather than by a
|
|
24
|
+
separate command. It provides
|
|
30
25
|
a single private operational view across the two products without rebuilding
|
|
31
26
|
either agent runtime.
|
|
32
27
|
|
|
33
28
|
Provider versions are best-effort diagnostic metadata, never routing authority.
|
|
34
|
-
|
|
29
|
+
The OS boundary plus the exact owned route and session identity authorizes an
|
|
35
30
|
attempt; the current per-operation transport, strict wire, capability, and
|
|
36
|
-
correlated operation facts decide its result.
|
|
37
|
-
the tested-artifact record and is never imported by runtime. Unsafe OS evidence
|
|
31
|
+
correlated operation facts decide its result. Unsafe OS evidence
|
|
38
32
|
for Embassy-owned or executed artifacts and Embassy callback, control, or state
|
|
39
33
|
paths refuses broker startup; unsafe UID or mode evidence on Claude's external
|
|
40
34
|
sessions registry root quarantines only Claude. A Claude session record whose
|
|
@@ -50,12 +44,8 @@ It is deliberately:
|
|
|
50
44
|
- unable to create Codex sidebar task cards or Claude session UI.
|
|
51
45
|
|
|
52
46
|
Embassy uses one private same-user Unix-domain control socket for its thin
|
|
53
|
-
clients
|
|
54
|
-
|
|
55
|
-
API. The opt-in `embassy dashboard --live` companion is a separate foreground
|
|
56
|
-
process that binds an unauthenticated stable-port listener with four bounded
|
|
57
|
-
route actions on exact `127.0.0.1`; it is
|
|
58
|
-
described under [Live dashboard companion](#live-dashboard-companion).
|
|
47
|
+
clients. `embassy serve` does not add a TCP listener, HTTP server, or public
|
|
48
|
+
API.
|
|
59
49
|
|
|
60
50
|
### Why this uses the new feature, but is not skill-only
|
|
61
51
|
|
|
@@ -67,9 +57,9 @@ Claude–Codex address book the user wants.
|
|
|
67
57
|
|
|
68
58
|
The repo-shipped skill is the lightweight user/agent interface. A persistent
|
|
69
59
|
local broker is still required to own the private control socket, retain
|
|
70
|
-
transient reply correlation, publish native advertisements, queue while a
|
|
71
|
-
task is busy
|
|
72
|
-
|
|
60
|
+
transient reply correlation, publish native advertisements, and queue while a
|
|
61
|
+
Codex task is busy. The skill does not wrap, replace, or recreate either
|
|
62
|
+
provider.
|
|
73
63
|
|
|
74
64
|
## What is official and what is internal
|
|
75
65
|
|
|
@@ -105,11 +95,12 @@ Consequences:
|
|
|
105
95
|
explicitly marked `codex-*` gateway peer.
|
|
106
96
|
- The gateway discovers compatible real Claude sessions as transient
|
|
107
97
|
candidates, but publishes only sanitized aliases and state. A send from a
|
|
108
|
-
registered Codex task
|
|
109
|
-
|
|
98
|
+
registered Codex task addresses a session by its current name or its UUID,
|
|
99
|
+
and the broker installs that session's logical route on this first use.
|
|
100
|
+
Per-message consent stays native: delivery lands in the
|
|
110
101
|
Claude session's own `crossSessionInbound` policy and approval flow.
|
|
111
|
-
- Codex aliases are discovered through the gateway CLI/skill
|
|
112
|
-
|
|
102
|
+
- Codex aliases are discovered through the gateway CLI/skill, not through
|
|
103
|
+
`ListAgents`.
|
|
113
104
|
- A gateway-owned anonymous callback UDS can receive a correlated reply. It
|
|
114
105
|
does not need, and must not create, a Claude registry record.
|
|
115
106
|
|
|
@@ -122,20 +113,6 @@ turn start, turn steer, turn interrupt, and notifications. Embassy exposes
|
|
|
122
113
|
`turn/steer` only behind the exact Claude-to-Codex `STEER:` contract described
|
|
123
114
|
below; there is no generic RPC surface.
|
|
124
115
|
|
|
125
|
-
**Official:** for an SSH project, the ChatGPT desktop app starts the remote
|
|
126
|
-
Codex App Server through SSH using the remote user's login shell. Files,
|
|
127
|
-
commands, credentials, permissions, plugins, skills, and local tools come from
|
|
128
|
-
that execution host. App Server transports should not be exposed directly on
|
|
129
|
-
a shared or public network.
|
|
130
|
-
|
|
131
|
-
**Observed:** this Desktop build connects to a host-local App Server on each
|
|
132
|
-
execution host. Remote tasks on `build-mac` do not route through the local App
|
|
133
|
-
Server. Desktop reaches the remote listener through an SSH `app-server proxy`.
|
|
134
|
-
A second attach-only client successfully initialized against the already-owned
|
|
135
|
-
`build-mac` listener and called only `thread/loaded/list` without creating a turn.
|
|
136
|
-
The same topology is expected for `lab-mac.example`, but that host has not been
|
|
137
|
-
probed by this project.
|
|
138
|
-
|
|
139
116
|
## Topology
|
|
140
117
|
|
|
141
118
|
```text
|
|
@@ -146,14 +123,12 @@ probed by this project.
|
|
|
146
123
|
│ │ callback replies
|
|
147
124
|
▼ ▼
|
|
148
125
|
┌──────────────────────── local singleton gateway ───────────────────────┐
|
|
149
|
-
│ private control UDS │ retained bodies │ metadata state │
|
|
150
|
-
|
|
126
|
+
│ private control UDS │ retained bodies │ metadata state │ public snapshot │
|
|
127
|
+
└──────────┬──────────┴──────────────────┴────────────────┴─────────────────┘
|
|
151
128
|
│
|
|
152
129
|
├─ local Codex App Server ─ registered native local tasks
|
|
153
130
|
│
|
|
154
|
-
|
|
155
|
-
│
|
|
156
|
-
└─ planned attach-only SSH proxy ─ lab-mac.example App Server
|
|
131
|
+
└─ optional federation ─ ssh <node> embassy peer-stdio ─ peer broker
|
|
157
132
|
|
|
158
133
|
Claude-side skill/CLI ─ private control UDS ─ gateway
|
|
159
134
|
Codex-side skill/CLI ─ private control UDS ─ gateway
|
|
@@ -166,32 +141,28 @@ wake a different idle runtime after that turn ends.
|
|
|
166
141
|
|
|
167
142
|
## Component status
|
|
168
143
|
|
|
169
|
-
|
|
144
|
+
Everything below is exercised by the deterministic suite; live validation is
|
|
145
|
+
a separately authorized operator action (see [Validation boundary](#validation-boundary)).
|
|
170
146
|
|
|
171
147
|
| Component | Current evidence |
|
|
172
148
|
| --- | --- |
|
|
173
|
-
| Neutral gateway types,
|
|
149
|
+
| Neutral gateway types, schema-5 metadata store, bounded attempt state machine, queues, dedupe, rate limits, and public projection | **Implemented**, deterministic tests; message bodies persist under bounded retention |
|
|
174
150
|
| Private JSONL control protocol over a controller-owned UDS | **Implemented**, deterministic synthetic tests; no provider connection required |
|
|
175
|
-
|
|
|
176
|
-
| Opt-in live dashboard companion (`embassy dashboard --live`) | **Implemented**, deterministic tests over the stable loopback listener, direct multi-browser access, projection, request guards, and four bounded route actions; it is a separate foreground process, never part of `embassy serve` |
|
|
177
|
-
| Claude registry/peer adapter with strict peer protocol 1 and per-operation validation | **Implemented** and live-tested through Claude Code 2.1.227, including discovery, native status frames, cancellation, and accessible-workspace validation |
|
|
151
|
+
| Claude registry/peer adapter with strict peer protocol 1 and per-operation validation | **Implemented**; deterministic tests cover discovery, native status frames, cancellation, and accessible-workspace validation |
|
|
178
152
|
| Claude current-user runtime roots | **Implemented**; derives the registry and callback roots from the verified OS user without inspecting a launcher or configuration file |
|
|
179
153
|
| Stateless allowlisted Codex App Server transport with bounded busy behavior | **Implemented**; every operation opens and attests its own transport, and the conformance suite covers idle gating, exact `STEER:` behavior, clean retry, and ambiguous no-replay settlement |
|
|
180
154
|
| Attach-only local Codex proxy transport and exact-owned cleanup | **Implemented**, five deterministic tests; no live App Server connection in routine tests |
|
|
181
|
-
| Local provider adapters and Embassy-node federation | **Implemented**, focused synthetic tests cover Claude discovery, exact Codex ownership,
|
|
155
|
+
| Local provider adapters and Embassy-node federation | **Implemented**, focused synthetic tests cover Claude discovery, exact Codex ownership, plus bounded catalog reconciliation and destination-owned handoff over the fixed attach-only SSH transport |
|
|
182
156
|
| Universal shell peer mailbox | **Implemented**, alias-plus-token same-UID attribution, hash-only durable ownership, bounded long polling, stdout-flush receipts, and restart uncertainty tests; no PID binding, token file, Keychain entry, or daemon |
|
|
183
|
-
| Gateway service composition | **Implemented**, including private control-server startup, synthetic cross-provider
|
|
184
|
-
| Delivery receipt/status lifecycle | **Implemented**, deterministic synthetic tests cover stable-UUID native receipt re-resolution, the merged/verbose/quiet Claude notice policy, one bounded stall notice with pending age where enabled, opaque private-
|
|
157
|
+
| Gateway service composition | **Implemented**, including private control-server startup, synthetic cross-provider route installation/dispatch/reply correlation, bounded public-snapshot projection, and restart attempt-phase tests |
|
|
158
|
+
| Delivery receipt/status lifecycle | **Implemented**, deterministic synthetic tests cover stable-UUID native receipt re-resolution, the merged/verbose/quiet Claude notice policy, one bounded stall notice with pending age where enabled, opaque private-v5 correlation handles, restart continuity, the closed status/terminal schema, and one-shot/bounded-wait CLI behavior |
|
|
185
159
|
| Broker-owned cross-provider provenance framing | **Implemented**, deterministic tests cover exact Codex and Claude wire shapes, bounded long-alias attribution, recipient reply hints, reserved-tag neutralization, single wrapping across clean retries, and pre-write failure |
|
|
186
160
|
| Operator/agent client CLI and package binary | **Implemented**, deterministic private-UDS tests cover the closed command family, inherited provider identity, bounded stdin-only bodies, normalized output, and ambiguous no-retry behavior |
|
|
187
161
|
| Repo-shipped cross-provider skill | **Implemented** as a repo-scoped workflow over the client CLI; it is not installed into either provider's global configuration |
|
|
188
162
|
| Foreground local broker launcher and provider assembly | **Implemented** as `embassy serve`; local-host-only with native messaging enabled |
|
|
189
|
-
| Live Codex-to-Claude delivery | **Tested** through selected real Claude 2.1.224–2.1.226 sessions |
|
|
190
|
-
| Claude-initiated Codex turn/reply into Codex | **Tested** with a real busy Codex task: native `busy → waiting`, automatic post-idle turn, terminal delivery status, and exact reply round trip |
|
|
191
|
-
| Remote production connector | **Planned**; only the `build-mac` read-only attach feasibility probe is complete |
|
|
192
163
|
|
|
193
164
|
Synthetic tests do not scan `~/.claude`, connect `/tmp/cc-socks`, attach to a
|
|
194
|
-
|
|
165
|
+
live App Server, invoke SSH, or make a model request.
|
|
195
166
|
|
|
196
167
|
## Identity, discovery, and opt-in
|
|
197
168
|
|
|
@@ -209,7 +180,7 @@ claude-advisor@this-mac
|
|
|
209
180
|
Claude's native `sessionId` UUID is its sole logical identity. Its current
|
|
210
181
|
name is a mutable lookup alias for that UUID; the gateway keeps no historical
|
|
211
182
|
name index. A rename therefore makes the old name stop resolving immediately,
|
|
212
|
-
while the UUID and an already
|
|
183
|
+
while the UUID and an already installed UUID-bound route continue to identify
|
|
213
184
|
the same session. PID, registry path, process generation, and socket generation
|
|
214
185
|
are replaceable delivery coordinates, not identity, and are refreshed from the
|
|
215
186
|
live registry before a write. The gateway rejects duplicate current names and
|
|
@@ -225,18 +196,11 @@ Codex registration is explicit. A task registers its own alias and
|
|
|
225
196
|
authoritative `CODEX_THREAD_ID`; the gateway does not enumerate global Codex
|
|
226
197
|
history to invent routes. Registration performs no provider I/O. Each delivery
|
|
227
198
|
opens a fresh attested App Server transport, initializes it, resumes the exact
|
|
228
|
-
private task with history excluded, and authorizes one body write.
|
|
229
|
-
|
|
199
|
+
private task with history excluded, and authorizes one body write. An App
|
|
200
|
+
Server restart is therefore a transport fact, not a logical route transition;
|
|
230
201
|
an unavailable or duplicate exact task fails that operation with a safe code
|
|
231
202
|
without retargeting the alias or replaying an ambiguous write.
|
|
232
203
|
|
|
233
|
-
The live dashboard exposes the bounded `remove_codex_registration` operation.
|
|
234
|
-
It carries only one public canonical `codex-*` alias and requires explicit
|
|
235
|
-
operator confirmation of the consequences. In one fencing commit the broker
|
|
236
|
-
cancels queued or reserved work, settles armed work ambiguous and accepted work
|
|
237
|
-
unconfirmed, removes that registration and its incident consent edges, and
|
|
238
|
-
never replays uncertain work. The browser cannot name a thread ID.
|
|
239
|
-
|
|
240
204
|
Claude discovery is passive and limited to currently advertised genuine
|
|
241
205
|
Claude session records. Only a validated native record bearing the supported
|
|
242
206
|
explicit versioned Embassy-advertisement marker is classified as a gateway
|
|
@@ -262,20 +226,73 @@ correlation, accessibility, liveness, and generation checks above without an
|
|
|
262
226
|
invented additional owner or mode rule. A current name resolves to a UUID but
|
|
263
227
|
never substitutes for it.
|
|
264
228
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
229
|
+
An installed Claude route keeps its UUID as durable identity until a
|
|
230
|
+
different session claims its alias and displaces it; there is no operator
|
|
231
|
+
command that retires one.
|
|
232
|
+
Discovery publishes only bounded sanitized candidates and current
|
|
233
|
+
lookup aliases; it never changes the installed UUID. Immediately before a
|
|
268
234
|
Claude-bound write, Embassy performs a fresh bounded registry scan, resolves
|
|
269
235
|
that byte-identical UUID exactly once, and revalidates its current workspace,
|
|
270
236
|
process, socket, and used-artifact generation. An incomplete scan, duplicate
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
237
|
+
UUID, changed UUID, or unsafe current coordinate fails that operation closed.
|
|
238
|
+
A duplicate display name is fenced from listing and from every send that
|
|
239
|
+
addresses it BY NAME, and the fence is re-evaluated inside the
|
|
240
|
+
send path, never only on the discovery timer. The fence is a fence on names:
|
|
241
|
+
a session UUID is unambiguous, so an operator-supplied UUID remains the
|
|
242
|
+
recovery selector and reaches the session even while its name collides, and a
|
|
243
|
+
sender whose own display name collides is never silenced, because its identity
|
|
244
|
+
was attested rather than typed. A pre-bound route retains its identity-pinned
|
|
245
|
+
binding, and a name alone never restores or retargets a durable route.
|
|
246
|
+
|
|
247
|
+
`embassy status` is the single pane for the human, and it is read-only: it
|
|
248
|
+
makes exactly one call, `list_snapshot`, and never `refresh_discovery`, so the
|
|
249
|
+
scan it reports is the broker's own and a status loop cannot journal anything.
|
|
250
|
+
Its `sessions` block is the sanitized `availablePeers` inventory — every live
|
|
251
|
+
Claude session the last scan found, by current name, marked `routed` once a
|
|
252
|
+
route exists for it — and its header says how old that scan is, offering
|
|
253
|
+
`embassy refresh` when it is older than a minute — that age is read from the
|
|
254
|
+
newest discovered session's own stamp, because the connector's `lastSeenAt`
|
|
255
|
+
also moves on a delivery. Below the sessions come the
|
|
256
|
+
routes: routed Claude aliases and explicitly registered Codex aliases, with
|
|
257
|
+
provider, current state, queue depth, and last-seen age. The same
|
|
258
|
+
pane also carries the bounded ledger's retained message bodies, so its output
|
|
259
|
+
is as sensitive as the messages themselves.
|
|
277
260
|
The thin skill/CLI exposes the same safe alias list to either provider.
|
|
278
261
|
|
|
262
|
+
That pane has two forms of the same snapshot. Piped, or with `--json`, it is
|
|
263
|
+
the snapshot verbatim — the form every script and the skill read. On a
|
|
264
|
+
terminal it is rendered by `status-view.ts`, a pure function of the snapshot
|
|
265
|
+
and the reader's clock: it derives one of four plain words per connector
|
|
266
|
+
(`ok`, `stale`, `degraded`, `offline`) and pairs every word that is not `ok`
|
|
267
|
+
with its safe code and a one-line remedy. Two clocks govern staleness, and
|
|
268
|
+
they are deliberately far apart. The broker's own connector window is 35
|
|
269
|
+
seconds (`CONNECTOR_OBSERVATION_STALE_AFTER_MS`), and it is crossed routinely
|
|
270
|
+
and innocently — the Codex observer polls one route at a time every 15
|
|
271
|
+
seconds, and Claude routes are not polled at all: their evidence is
|
|
272
|
+
edge-triggered, written when a discovery scan or a delivery observes the
|
|
273
|
+
session, so a quiet Claude session's `lastSeenAt` stops advancing while the
|
|
274
|
+
session is perfectly alive. The view therefore keeps the broker's word until
|
|
275
|
+
a route has gone unobserved for ten minutes, and only then calls it `stale`;
|
|
276
|
+
past that backstop a Codex route earns the succession remedy only when it
|
|
277
|
+
also carries a code that says the task itself is gone (`THREAD_NOT_OBSERVED`)
|
|
278
|
+
— bare silence says the task may be busy or the app-server slow. A Claude
|
|
279
|
+
route whose alias the latest scan still lists is never `stale`: the scan is
|
|
280
|
+
fresher evidence than the route's own observation, so the discovered state is
|
|
281
|
+
shown with `discovered <age>` as its last-seen cell, and a Claude route past
|
|
282
|
+
the backstop that the scan no longer lists says the session exited or renamed.
|
|
283
|
+
A connector that merely has nothing to observe is `stale`, never `degraded`,
|
|
284
|
+
and a shell peer with unclaimed mail never moves the overall word at all:
|
|
285
|
+
silence in a pull mailbox is a fact about the operator's other terminal.
|
|
286
|
+
`embassy watch` tails the same snapshot through `observe_snapshot` once a
|
|
287
|
+
second, printing each new message row and each settlement at most once — a
|
|
288
|
+
transition passed through entirely between two polls is never seen, and rows
|
|
289
|
+
evicted from the retained window before the tail read them are announced as
|
|
290
|
+
a note. `embassy check` proves the whole path end to end — it registers an
|
|
291
|
+
ephemeral `peer-*` principal of its own, sends one marked body through the
|
|
292
|
+
ordinary send path, waits for `delivered`, then awaits the correlated reply on
|
|
293
|
+
its own mailbox, and releases the registration again; the broker retires the
|
|
294
|
+
registration itself if the check never gets to.
|
|
295
|
+
|
|
279
296
|
## Message flows
|
|
280
297
|
|
|
281
298
|
### Codex to Claude
|
|
@@ -285,10 +302,10 @@ The thin skill/CLI exposes the same safe alias list to either provider.
|
|
|
285
302
|
and bounded text.
|
|
286
303
|
2. The gateway checks thread ownership, selector state, rate and size limits,
|
|
287
304
|
deadline, and dedupe state.
|
|
288
|
-
3. It
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
before every send.
|
|
305
|
+
3. It resolves the selector against a discovery scan run inside this send,
|
|
306
|
+
installing the session's route if this is its first use, then refreshes the
|
|
307
|
+
UUID's current process/socket coordinates and revalidates that Claude
|
|
308
|
+
peer's canonical workspace access and exact generation before every send.
|
|
292
309
|
4. Immediately before the native write, it composes one broker-owned canonical
|
|
293
310
|
`cross-session-message` textual frame with bounded sender attribution and a
|
|
294
311
|
first-child reply hint containing the full conversation token, exact aliases,
|
|
@@ -325,15 +342,12 @@ final reply.
|
|
|
325
342
|
2. A real Claude session uses native `ListAgents` and `SendMessage`; the
|
|
326
343
|
gateway validates that exact live registry/socket generation and treats the
|
|
327
344
|
text as untrusted user-role input. This inbound observation grants only a
|
|
328
|
-
transient, in-memory capability for the correlated reply.
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
aliases, the byte count, and the safe error code, and increments the
|
|
335
|
-
rejected counters on the accounting, the source route, and any matching
|
|
336
|
-
pair.
|
|
345
|
+
transient, in-memory capability for the correlated reply. The sending
|
|
346
|
+
session's own route is installed here, from the exact identity the adapter
|
|
347
|
+
attested, so the Codex task's reply travels the ordinary path; the alias the
|
|
348
|
+
adapter reports must be the one discovery shows for that UUID, and a
|
|
349
|
+
mismatch is refused rather than silently renamed. Installing the route
|
|
350
|
+
authorizes nothing beyond what addressing already implied.
|
|
337
351
|
3. The Claude process's inherited messaging-socket value may be accepted as a
|
|
338
352
|
transient reply address after strict validation. Claude Code exports
|
|
339
353
|
`CLAUDE_CODE_MESSAGING_SOCKET` as a raw absolute socket path; the CLI
|
|
@@ -367,7 +381,7 @@ final reply.
|
|
|
367
381
|
deliberate: stall visibility must not scale with the deadline, so under the
|
|
368
382
|
default four-hour deadline the notice fires at two minutes, not two hours.
|
|
369
383
|
`quiet` suppresses this gateway-authored frame without changing native status
|
|
370
|
-
or
|
|
384
|
+
or public snapshot state.
|
|
371
385
|
8. A later bounded attempt opens a new transport and starts the held message
|
|
372
386
|
after it observes the exact task idle. A route retains at most three queued steering
|
|
373
387
|
messages; accepting a fourth atomically cancels the oldest with safe code
|
|
@@ -398,7 +412,7 @@ not uniquely re-observed with peer protocol 1, the write fails closed. A termina
|
|
|
398
412
|
write whose outcome is ambiguous is never replayed; only a proven pre-write
|
|
399
413
|
failure may be retried while the bounded in-memory receipt remains live. The
|
|
400
414
|
receipt correlation does not add the UUID or receipt handle to public output
|
|
401
|
-
or durable state; a separately
|
|
415
|
+
or durable state; a separately installed route may already persist that same
|
|
402
416
|
Claude UUID as its private native route handle.
|
|
403
417
|
|
|
404
418
|
Delivery callback arrival is timestamped at the service boundary. A terminal
|
|
@@ -422,8 +436,8 @@ next-tool-call-boundary rules above.
|
|
|
422
436
|
|
|
423
437
|
### Provenance framing and conversation continuation
|
|
424
438
|
|
|
425
|
-
The broker classifies `STEER:`,
|
|
426
|
-
|
|
439
|
+
The broker classifies `STEER:`, enforces raw-byte body limits, deduplicates,
|
|
440
|
+
and queues before presentation framing.
|
|
427
441
|
The store therefore retains only the raw unframed body, never the composed
|
|
428
442
|
envelope. A pure composer runs at the final semantic provider-write boundary so
|
|
429
443
|
a clean retry produces the same bytes with exactly one authoritative outer
|
|
@@ -445,7 +459,7 @@ broker-owned `cross-session-message` outer element and an
|
|
|
445
459
|
does not accept.
|
|
446
460
|
- In either direction, the first hint carries the full token in `conversation`
|
|
447
461
|
and the exact recipient alias in `reply-as`, followed by an exact stdin-based
|
|
448
|
-
`embassy
|
|
462
|
+
`embassy send --conversation ... --from ...` instruction and the statement
|
|
449
463
|
that caller, conversation, and route policy are rechecked.
|
|
450
464
|
|
|
451
465
|
Embassy does not synthesize `from`, `from-session`, or `from-mode` attributes:
|
|
@@ -463,20 +477,21 @@ consistent structural provenance marker at the model input boundary. A native
|
|
|
463
477
|
Claude wrapper already present in an inbound body is untrusted nested text
|
|
464
478
|
beneath the Embassy wrapper.
|
|
465
479
|
|
|
466
|
-
The full token delivered in the hint lets the recipient
|
|
467
|
-
only a participant-scoped conversation
|
|
480
|
+
The full token delivered in the hint lets the recipient answer with
|
|
481
|
+
`send --conversation`, but it is only a participant-scoped conversation
|
|
482
|
+
locator. The service still validates
|
|
468
483
|
the inherited caller, current conversation membership, and current route
|
|
469
484
|
policy. The full token remains confined to the accepted control result
|
|
470
485
|
and transient provider payload, and is memory-only: it is never persisted,
|
|
471
|
-
journaled, logged, snapshotted,
|
|
486
|
+
journaled, logged, snapshotted, placed in a receipt,
|
|
472
487
|
or returned from suffix-only public correlation. Formatter,
|
|
473
488
|
provenance-metadata, and framed-size failures are clean pre-write terminal
|
|
474
489
|
failures; they can never become ambiguous writes or replay authorizations.
|
|
475
490
|
|
|
476
491
|
The gateway exposes `turn/steer` only through an exact leading `STEER:` body in
|
|
477
492
|
the Claude-to-Codex direction. The global `EMBASSY_STEERING_ENABLED` switch is
|
|
478
|
-
on by default and exact `0` disables classification. The
|
|
479
|
-
requires `expectedTurnId`, rejects a nonmatching active turn, reports a clean
|
|
493
|
+
on by default and exact `0` disables classification. The 0.147.0 schema this
|
|
494
|
+
adapter targets requires `expectedTurnId`, rejects a nonmatching active turn, reports a clean
|
|
480
495
|
`activeTurnNotSteerable` condition, and returns the accepted turn ID. Embassy
|
|
481
496
|
validates all of those temporal correlations before settlement. `turn/interrupt`
|
|
482
497
|
is never called or exposed, and there is no generic App Server RPC escape
|
|
@@ -484,15 +499,14 @@ hatch.
|
|
|
484
499
|
|
|
485
500
|
### Delivery status and bounded waits
|
|
486
501
|
|
|
487
|
-
Every accepted control-plane `
|
|
502
|
+
Every accepted control-plane `send`
|
|
488
503
|
result contains both its conversation ID and a fresh opaque delivery
|
|
489
504
|
correlation handle called a delivery token.
|
|
490
505
|
The token has the closed form `dlv_` followed by exactly 24 base64url
|
|
491
506
|
characters (`A-Z`, `a-z`, `0-9`, `_`, or `-`). It addresses one bounded
|
|
492
|
-
private-
|
|
507
|
+
private schema-5 message/status row and is not a provider receipt handle or a
|
|
493
508
|
provider native identifier. It is stored only in the mode-0600 broker state
|
|
494
|
-
and never appears in a public snapshot, normal log, provider receipt
|
|
495
|
-
dashboard.
|
|
509
|
+
and never appears in a public snapshot, normal log, or provider receipt.
|
|
496
510
|
|
|
497
511
|
The read-only `delivery_status` method accepts only that token and returns one
|
|
498
512
|
of these closed results:
|
|
@@ -539,7 +553,7 @@ never displaced to admit a new send. A pressure-evicted handle returns
|
|
|
539
553
|
Conversation IDs correlate replies, and callback addresses exist only in
|
|
540
554
|
memory, but message bodies and their bounded attempt phase are durable. After a
|
|
541
555
|
gateway restart, queued or reserved work may resume once against the same
|
|
542
|
-
logical route
|
|
556
|
+
logical route. Work that crossed the armed boundary settles
|
|
543
557
|
`ambiguous`; provider-accepted work without terminal evidence settles
|
|
544
558
|
`unconfirmed`. Neither is replayed. Work already past its deadline settles
|
|
545
559
|
`expired`.
|
|
@@ -548,8 +562,8 @@ The delivery token and status of each retained message survive the restart: a
|
|
|
548
562
|
queued or reserved attempt remains inspectable while it resumes, and armed or
|
|
549
563
|
accepted work remains inspectable after it settles ambiguous or unconfirmed.
|
|
550
564
|
Pending replies, callbacks, native receipt handles, and conversation
|
|
551
|
-
capabilities do not survive. Logical registrations
|
|
552
|
-
|
|
565
|
+
capabilities do not survive. Logical registrations and installed Claude routes
|
|
566
|
+
remain, while each subsequent provider operation must attest its
|
|
553
567
|
own current transport facts.
|
|
554
568
|
|
|
555
569
|
## Gateway control plane
|
|
@@ -559,78 +573,97 @@ controller-owned mode-0700 state directory. The socket and state files are
|
|
|
559
573
|
mode 0600. Frames are size-bounded and closed against unknown keys, methods,
|
|
560
574
|
versions, and enum values.
|
|
561
575
|
|
|
562
|
-
The closed version
|
|
576
|
+
The closed version 3 method family is exactly these fourteen methods:
|
|
563
577
|
|
|
564
578
|
- `health` and `list_snapshot`, a safe public snapshot;
|
|
565
579
|
- `observe_snapshot`, a read-only projection that may settle already-due
|
|
566
580
|
delivery deadlines before projecting;
|
|
567
|
-
- `register_codex
|
|
568
|
-
`
|
|
569
|
-
`--succeeds` replacement, owner unregister, and confirmed operator removal;
|
|
570
|
-
- `select_claude` and `unselect_claude`, from the current sanitized
|
|
571
|
-
available-peer inventory;
|
|
572
|
-
- `pair` and `unpair`, the two-endpoint permission edge;
|
|
581
|
+
- `register_codex` and `unregister_codex` — explicit Codex registration with
|
|
582
|
+
atomic `--succeeds` replacement, and owner unregister;
|
|
573
583
|
- `delivery_status`, a lookup by an opaque correlation handle retained only in
|
|
574
|
-
bounded private
|
|
575
|
-
- `
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
`
|
|
584
|
+
bounded private v5 state;
|
|
585
|
+
- `send`, whose direction follows the inherited principal — who is sending —
|
|
586
|
+
rather than the route table, and which installs a discovered Claude
|
|
587
|
+
session's route on its first use. It addresses either a route by name
|
|
588
|
+
(`toAlias`) or an open conversation by its token (`conversationId`), never
|
|
589
|
+
both: the conversation form is the correlated reply operation, and the
|
|
590
|
+
caller must already own one end of that conversation;
|
|
591
|
+
- `refresh_discovery`, which rescans for Claude sessions;
|
|
592
|
+
- `peer_catalog` and `peer_handoff`, the private federation catalog and
|
|
593
|
+
destination-owned handoff operations; and
|
|
594
|
+
- `register_peer`, `unregister_peer`, `await_peer`, and `peer_receipt`, the
|
|
595
|
+
shell-peer registration, mailbox, and flush-before-receipt operations. A
|
|
596
|
+
first registration may ask to be `ephemeral` with a bounded `ttlMs`
|
|
597
|
+
(default five minutes): the route is real in memory — it routes, queues,
|
|
598
|
+
and settles like any other — but it is projected out of the durable state
|
|
599
|
+
document together with every row that names it (its messages, dedupe and
|
|
600
|
+
rate rows, and journal entries), excluded from the federation catalog, and
|
|
601
|
+
retired by the broker's own clock, so it cannot survive a restart or be
|
|
602
|
+
restored on another node. Removal — by `unregister_peer` or by that clock —
|
|
603
|
+
takes the same rows out of the live state in the same write, so nothing of
|
|
604
|
+
it is written afterwards either; a retirement that fails is retried twice,
|
|
605
|
+
five seconds apart, then left to the next restart. The clock is guarded by
|
|
606
|
+
the registration's identity, so a durable route that later takes the same
|
|
607
|
+
alias is never retired by it. `embassy check` uses one.
|
|
583
608
|
|
|
584
609
|
The installed binary is `embassy`, and it is the only installed binary. Its
|
|
585
|
-
|
|
586
|
-
`serve`, `health`, `status`, `
|
|
587
|
-
`
|
|
588
|
-
`
|
|
589
|
-
`
|
|
590
|
-
|
|
591
|
-
|
|
610
|
+
seventeen implemented commands are
|
|
611
|
+
`serve`, `service`, `health`, `status`, `watch`, `check`, `delivery-status`,
|
|
612
|
+
`wait-delivery`, `refresh`, `register-codex`, `unregister-codex`, `send`,
|
|
613
|
+
`reply`, `register-peer`, `unregister-peer`, `await`, and
|
|
614
|
+
`peer-stdio`. `reply --conversation <token> --alias <own-alias>` is a
|
|
615
|
+
deprecated alias for `send --conversation <token> --from <own-alias>`: it
|
|
616
|
+
builds the same `send` request and is kept only until the reply hints already
|
|
617
|
+
delivered in older envelopes have aged out. Message bodies are non-empty
|
|
592
618
|
UTF-8 from standard input only, with a 16 KiB ceiling; they are never accepted
|
|
593
|
-
in an argument or file. The client emits one bounded normalized JSON line and
|
|
594
|
-
never returns a thread ID,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
619
|
+
in an argument or file. The client emits one bounded normalized JSON line, and
|
|
620
|
+
for every broker-protocol command it never returns a thread ID,
|
|
621
|
+
provider-native ID, path, or address, and only `status` and `watch` return
|
|
622
|
+
message bodies — the snapshot's own. There are three deliberate
|
|
623
|
+
exceptions, each of them about something the operator alone is looking at.
|
|
624
|
+
`service` reports its own plist path, its log path, and any program path in
|
|
625
|
+
the plist that is no longer on disk, because managing local files is what it
|
|
626
|
+
does. `status` on a terminal, `watch`, and `check` render for a person instead
|
|
627
|
+
of emitting that JSON line: `status` and `watch` show the snapshot's own
|
|
628
|
+
retained bodies (previewed to one control-free line) and the resolved state
|
|
629
|
+
directory, and `check` prints its own hops. Piped or with `--json`, `status`
|
|
630
|
+
and `watch` are machine-readable again, and every other command is unchanged. Every command but `serve` and `service` requires a running
|
|
631
|
+
broker: `serve`
|
|
632
|
+
starts one in the current terminal, and `service install|uninstall|status`
|
|
633
|
+
manages the macOS launchd agent that runs one, contacting no broker itself
|
|
634
|
+
apart from the bounded health check `install` reports at the end. The launcher
|
|
635
|
+
never daemonizes itself.
|
|
602
636
|
|
|
603
637
|
`register-codex --alias <new> --succeeds <current>` is one atomic logical-route
|
|
604
638
|
transaction. It verifies the inherited identity of the replacement task,
|
|
605
639
|
settles the outgoing route's work according to recorded write phase, removes
|
|
606
|
-
its
|
|
640
|
+
its transient capabilities, and publishes only the
|
|
607
641
|
new registration. There is no prepared, activated, endpoint-generation, or
|
|
608
642
|
manual-recovery state.
|
|
609
643
|
|
|
610
|
-
`
|
|
611
|
-
|
|
612
|
-
`send-to-claude --to` accepts either form only after explicit selection. UUID
|
|
644
|
+
`send --to <current-name@host>` and `send --to <uuid>` address the same logical
|
|
645
|
+
session, and either form installs its route on first use. UUID
|
|
613
646
|
input is normalized to lowercase. No command returns the
|
|
614
647
|
UUID, and no historical name remains routable after a rename.
|
|
615
648
|
|
|
616
|
-
Provider-authorized
|
|
649
|
+
Provider-authorized registration and send operations require one exclusive inherited principal.
|
|
617
650
|
Codex registration, unregister, and Codex-to-Claude send require only a valid
|
|
618
651
|
`CODEX_THREAD_ID`; they fail if a non-empty Claude messaging socket is also
|
|
619
652
|
inherited. Claude-to-Codex send requires only the raw inherited Claude socket
|
|
620
|
-
path and fails if a non-empty Codex thread ID is also present.
|
|
621
|
-
fails with both identities or neither.
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
`
|
|
632
|
-
|
|
633
|
-
|
|
653
|
+
path and fails if a non-empty Codex thread ID is also present. A
|
|
654
|
+
conversation-addressed send likewise fails with both identities or neither.
|
|
655
|
+
|
|
656
|
+
Installing a Claude route is a side effect of a send, not a command: the
|
|
657
|
+
sending principal is already attested, the addressed session is resolved
|
|
658
|
+
against a discovery scan performed inside that send, and the store binds the
|
|
659
|
+
route under the live-peer registration mode. A session already bound under the
|
|
660
|
+
same (host, session UUID) keeps its registration — and therefore its in-flight
|
|
661
|
+
conversations — and is renamed in place if its display name changed; a route
|
|
662
|
+
whose alias now names a different session is displaced, its work settled
|
|
663
|
+
`cancelled` with `ENDPOINT_RETIRED`, and both outcomes are journaled so
|
|
664
|
+
`embassy status` shows them. Agents are instructed to send only where the user
|
|
665
|
+
pointed them; that is an operating norm, not an additional gateway identity
|
|
666
|
+
check.
|
|
634
667
|
|
|
635
668
|
The foreground command is:
|
|
636
669
|
|
|
@@ -638,15 +671,8 @@ The foreground command is:
|
|
|
638
671
|
embassy serve
|
|
639
672
|
```
|
|
640
673
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
```text
|
|
644
|
-
embassy serve --inbound open
|
|
645
|
-
```
|
|
646
|
-
|
|
647
|
-
The default is `paired`. `open` is the explicit opt-out that lets any exact
|
|
648
|
-
compatible live same-UID Claude session send inbound without a pair edge; it is
|
|
649
|
-
never implied and cannot be set through an environment variable.
|
|
674
|
+
`serve` takes no options. There is no inbound mode to choose: the broker has
|
|
675
|
+
one posture, and it is the OS boundary.
|
|
650
676
|
|
|
651
677
|
Before provider validation, listener creation, or App Server attachment, the
|
|
652
678
|
launcher acquires one fixed host-wide crash-reclaimable owner lease under the
|
|
@@ -655,8 +681,8 @@ controllers cannot be started for the same login account by choosing different
|
|
|
655
681
|
state roots. It is the only instance lock Embassy takes: the pre-rename
|
|
656
682
|
prototype state root is no longer read, locked, or mutated.
|
|
657
683
|
|
|
658
|
-
It emits one normalized ready line
|
|
659
|
-
|
|
684
|
+
It emits one normalized ready line and holds the process until `SIGINT` or
|
|
685
|
+
`SIGTERM`, when exact-owned resources are
|
|
660
686
|
closed. Startup validates exact owned provider paths and binds controller-owned
|
|
661
687
|
UDS listeners. Missing optional providers or a provider-local interface failure
|
|
662
688
|
degrades only that surface. Unsafe ownership, path, symlink, lease, state,
|
|
@@ -668,54 +694,28 @@ does not publish candidates, select or connect to a peer, write a provider
|
|
|
668
694
|
socket, request provider history, start a model turn, or contact a remote host.
|
|
669
695
|
Validated target bindings may retain private native and socket-derived evidence
|
|
670
696
|
memory-only until rescan or close, but none enters public state or persistence.
|
|
671
|
-
Its ready result reports local host `
|
|
672
|
-
|
|
673
|
-
paths.
|
|
697
|
+
Its ready result reports the exact local host — from `nodes.json`, or this
|
|
698
|
+
host's own hostname when that file is absent — and `codexMode: "native_messaging"`
|
|
699
|
+
without exposing paths.
|
|
674
700
|
|
|
675
701
|
There is no arbitrary filesystem operation, shell command, SSH command, App
|
|
676
702
|
Server method, Claude registry mutation, credential argument, approval reply,
|
|
677
703
|
or raw diagnostic method.
|
|
678
704
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
records `settled` / `gateway` / `idle_timeout` only in watch history and emits
|
|
690
|
-
no runtime stall alert. `n` is an integer from 1 through 1440 and defaults to 5;
|
|
691
|
-
supplying it without `--track` is an argument error. A body with
|
|
692
|
-
an exact leading `TRACK:` prefix opens the same watch at the default idle window
|
|
693
|
-
without the flag.
|
|
694
|
-
|
|
695
|
-
`untrack --conversation conv_<token>` closes an active watch explicitly, and a
|
|
696
|
-
body with an exact leading `DONE:` prefix closes it as completed; one message
|
|
697
|
-
may not both open and complete a watch (`PROGRESS_WATCH_SIGNAL_CONFLICT`). The
|
|
698
|
-
global `EMBASSY_TRACKING_ENABLED` switch is on by default and exact `0` disables
|
|
699
|
-
the surface; `EMBASSY_MAX_WATCHES` bounds concurrent watches at 32 by default
|
|
700
|
-
(hard cap 256).
|
|
705
|
+
Reaching the same-UID private control socket is the permission to message —
|
|
706
|
+
and it is a local containment boundary, not proof of a trusted agent process.
|
|
707
|
+
Every mutation additionally checks route ownership, exact
|
|
708
|
+
thread/session generation, source alias, bounds, and conversation state. A name
|
|
709
|
+
currently shared by more than one live Claude session is refused with
|
|
710
|
+
`PEER_ALIAS_COLLISION` inside the send that addressed it BY NAME; the broker
|
|
711
|
+
never resolves an ambiguous name by picking first. The fence is a fence on
|
|
712
|
+
names only: a session UUID is unambiguous, so a UUID selector still reaches its
|
|
713
|
+
session, and a sender is never fenced by its own display name because its
|
|
714
|
+
identity was attested rather than typed.
|
|
701
715
|
|
|
702
|
-
|
|
703
|
-
may outlive an opener whose own delivery expired, so check the opener's
|
|
704
|
-
`delivery-status` separately before assuming the assignment text arrived.
|
|
716
|
+
## Codex connector and federation
|
|
705
717
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
In the target multi-host design, each allowlisted execution host has a separate
|
|
709
|
-
connector because each host has its own App Server and native state:
|
|
710
|
-
|
|
711
|
-
- `this-mac`: the managed local App Server shared with Desktop;
|
|
712
|
-
- `build-mac`: a host-local remote App Server reached through an attach-only SSH
|
|
713
|
-
proxy; and
|
|
714
|
-
- `lab-mac.example`: the same design, still unprobed and disabled by default.
|
|
715
|
-
|
|
716
|
-
The shipped foreground launcher accepts only `this-mac`; it rejects any remote
|
|
717
|
-
host configuration. The two SSH connectors above remain planned rather than
|
|
718
|
-
runnable v1 routes.
|
|
718
|
+
Each broker's local connector has an explicit host identity, from `nodes.json` when federating or from this host's own hostname otherwise; `this-mac` has no reserved meaning. Configured peers exchange only body-free local catalogs and destination-owned handoffs over fixed SSH.
|
|
719
719
|
|
|
720
720
|
The local connector resolves the managed standalone Codex release by exact
|
|
721
721
|
owned path; it does not use `PATH`. That installation is separate from
|
|
@@ -731,7 +731,7 @@ unsubscribe, interrupt, archive,
|
|
|
731
731
|
delete, history, shell, configuration, authentication, plugin,
|
|
732
732
|
approval-response, and generic RPC methods remain excluded everywhere.
|
|
733
733
|
|
|
734
|
-
The App Server
|
|
734
|
+
The App Server 0.147.0 schema this adapter targets gates the privacy-preserving
|
|
735
735
|
`thread/resume.excludeTurns` field behind initialization capability
|
|
736
736
|
`experimentalApi: true`. The transport therefore hard-codes that one
|
|
737
737
|
non-configurable capability solely to suppress history retrieval. The attempt's
|
|
@@ -750,9 +750,9 @@ does not participate. Embassy does not read or retain reported
|
|
|
750
750
|
working-directory or policy fields, and a transport failure cannot discard the
|
|
751
751
|
registration or its accepted queue.
|
|
752
752
|
|
|
753
|
-
|
|
754
|
-
sandbox policy. Offline `TurnStartParams` schema evidence from
|
|
755
|
-
Server 0.147.0 shows that
|
|
753
|
+
Embassy never changes or independently classifies a Codex task's approval or
|
|
754
|
+
sandbox policy. Offline `TurnStartParams` schema evidence from the App
|
|
755
|
+
Server 0.147.0 schema this adapter targets shows that
|
|
756
756
|
policy overrides persist for the current and subsequent turns, so using them
|
|
757
757
|
as per-message restrictions would silently mutate the native task. Embassy
|
|
758
758
|
therefore starts the turn without overrides and leaves approval, sandbox, and
|
|
@@ -760,37 +760,24 @@ tool enforcement to the registered task's native Codex configuration. Explicit
|
|
|
760
760
|
`codex-*` registration plus exact per-operation task and transport validation is the
|
|
761
761
|
gateway reachability boundary; native task policy remains Codex's concern.
|
|
762
762
|
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
confirmed the current task was already loaded. It emitted normalized
|
|
782
|
-
booleans and an aggregate count, then confirmed cleanup of only its own
|
|
783
|
-
proxy process.
|
|
784
|
-
- An authorized remote probe attached through a second SSH proxy to the
|
|
785
|
-
already-running `build-mac` App Server (remote Codex CLI 0.145.0), initialized,
|
|
786
|
-
and validated a schema-correct `thread/loaded/list`. It printed no task IDs,
|
|
787
|
-
payloads, remote diagnostics, history, or credentials and left Desktop's
|
|
788
|
-
original proxy alive.
|
|
789
|
-
|
|
790
|
-
Both proxy processes required their exact-owned forced-cleanup fallback after
|
|
791
|
-
the bounded graceful-close window; final cleanup was confirmed. These probes
|
|
792
|
-
prove attach and loaded-task discovery on the tested versions. They do not
|
|
793
|
-
prove notification fanout, approval routing, or writable task control.
|
|
763
|
+
### Federation
|
|
764
|
+
|
|
765
|
+
Federation is the only cross-machine path. Each entry in `nodes.json` is an
|
|
766
|
+
OpenSSH `Host` alias; the broker dials `ssh <node> embassy peer-stdio` and
|
|
767
|
+
speaks the fixed peer protocol — version 2, three methods: `initialize`,
|
|
768
|
+
`catalog/get`, `handoff`. A peer's catalog is body-free (aliases, providers,
|
|
769
|
+
states), and its routes appear locally as `alias@host` mirrors behind opaque
|
|
770
|
+
references; a handoff is `delivered` when the destination durably accepts it,
|
|
771
|
+
after which the destination owns provider delivery, and anything lost after
|
|
772
|
+
that acceptance settles ambiguous and is never replayed. One hop only, no
|
|
773
|
+
forwarding. A node answering `initialize` with another protocol version
|
|
774
|
+
surfaces `PEER_PROTOCOL_MISMATCH` on its mirrored routes and in `embassy
|
|
775
|
+
status` instead of a tunnel fault. SSH aliases are fixed operator
|
|
776
|
+
configuration, never model-provided strings; normal OpenSSH host-key
|
|
777
|
+
validation applies, your SSH configuration owns keys, users, and ports, and
|
|
778
|
+
Embassy opens no listener of its own.
|
|
779
|
+
|
|
780
|
+
### Offline App Server schema evidence
|
|
794
781
|
|
|
795
782
|
The connector requires turn notifications to carry the exact `threadId` and
|
|
796
783
|
correlates the exact `turn.id`; `item/completed` must carry the exact
|
|
@@ -818,122 +805,29 @@ next-tool-call timing boundary to App Server, treats a clean refusal as normal
|
|
|
818
805
|
queue fallback, and treats malformed or write-ambiguous results as terminally
|
|
819
806
|
uncertain without replay.
|
|
820
807
|
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
directory: `gateway-dashboard.html` and `gateway-dashboard.zh-CN.html`, both
|
|
835
|
-
rendered from one typed catalog and both atomically replaced, mode 0600, on
|
|
836
|
-
every publish. Each page links to the other; that in-page link is the only
|
|
837
|
-
static language switch, and `refresh-dashboard` takes no `--lang`. Each page
|
|
838
|
-
has inline CSS and a restrictive Content Security Policy, with no JavaScript,
|
|
839
|
-
external assets, CDN, cookies, local storage, service worker, telemetry,
|
|
840
|
-
mutation endpoint, or network listener.
|
|
841
|
-
|
|
842
|
-
A static page is a point-in-time snapshot and never refreshes itself: it emits
|
|
843
|
-
no meta refresh and the page tells the operator to re-run
|
|
844
|
-
`embassy refresh-dashboard` and reload, or to use `embassy dashboard --live`.
|
|
845
|
-
|
|
846
|
-
Each page assembles seven sections:
|
|
847
|
-
|
|
848
|
-
- **Exchange** — aggregate gateway health plus every explicit cross-provider
|
|
849
|
-
pair and its per-edge counters.
|
|
850
|
-
- **Attention** — allowlisted alerts such as an unavailable route, protocol mismatch,
|
|
851
|
-
queue full, or ambiguous delivery.
|
|
852
|
-
- **Transit** — queued-message depth and bytes in flight.
|
|
853
|
-
- **Progress supervision** — active progress watches and their state.
|
|
854
|
-
- **Operator activity** — the broker's bounded public journal of accepted
|
|
855
|
-
operator actions.
|
|
856
|
-
- **Sessions** — first-class Claude, Codex, DeepSeek, Grok, and shell-peer provider rows,
|
|
857
|
-
aliases, host, route state, and queue depth.
|
|
858
|
-
- **Diagnostics** — best-effort observed metadata, per-host connector health,
|
|
859
|
-
last safe code, deadline-pressure buckets, accounting totals, and the
|
|
860
|
-
omission counters below. Normalized message direction and delivery state,
|
|
861
|
-
timestamp, latency, byte count, and a short opaque message-ID suffix appear
|
|
862
|
-
with the delivery rows.
|
|
863
|
-
|
|
864
|
-
It never shows message content, prompts, replies, transcripts, titles, working
|
|
865
|
-
directories, native IDs, PIDs, socket paths, endpoint paths, tool data, raw
|
|
866
|
-
events, stderr, credentials, or configuration contents — retained bodies reach
|
|
867
|
-
only the live companion, never these files. This is a controller-owned UI
|
|
868
|
-
artifact, not a shared task file. The public snapshot has a 240 KiB projection
|
|
869
|
-
budget and reports explicit omission counters whenever bounded rows are
|
|
870
|
-
truncated: connectors, available peers, routes, pairs, progress watches,
|
|
871
|
-
upstream and projected progress-watch events, upstream message events, message
|
|
872
|
-
groups, message events, upstream alerts, attention items, and upstream and
|
|
873
|
-
projected activity events.
|
|
874
|
-
|
|
875
|
-
### Live dashboard companion
|
|
876
|
-
|
|
877
|
-
`embassy dashboard --live` is the opt-in browser view of broker state,
|
|
878
|
-
including bounded retained bodies in delivery detail; the static dashboard's
|
|
879
|
-
public projection remains metadata-only.
|
|
880
|
-
It is a separate foreground process, not a mode of `embassy serve`: it holds no
|
|
881
|
-
provider capability, owns no registry record, and reaches the broker over the
|
|
882
|
-
same private control socket every other client command uses, so it reports the
|
|
883
|
-
gateway as unavailable when nothing is serving.
|
|
884
|
-
|
|
885
|
-
- **Bind.** One `http.createServer` listener binds exact `127.0.0.1` on stable
|
|
886
|
-
port `41961` by default, or the integer from the per-invocation `--port <n>`
|
|
887
|
-
option in the closed range 1024 through 65535. The direct root URL is
|
|
888
|
-
`http://127.0.0.1:<port>/`. A collision fails with
|
|
889
|
-
`LIVE_DASHBOARD_PORT_IN_USE` and directs the operator to `--port`; there is no
|
|
890
|
-
ephemeral-port fallback. No other interface is bound.
|
|
891
|
-
- **Access.** The root URL is usable concurrently from multiple windows, tabs,
|
|
892
|
-
and browsers. There is no capability token, URL fragment, cookie, browser
|
|
893
|
-
session, random instance path, or bootstrap file.
|
|
894
|
-
- **Request checks.** The exact Host header is validated on every request.
|
|
895
|
-
Navigation GETs may omit Origin; every POST requires the exact Origin plus
|
|
896
|
-
`X-Embassy-Request: 1`. `OPTIONS` is not accepted, there are no CORS headers,
|
|
897
|
-
and cross-origin reads are unavailable.
|
|
898
|
-
- **Projection and actions.** The companion observes through
|
|
899
|
-
`observe_snapshot`. Its only mutations are exact two-endpoint `pair`,
|
|
900
|
-
`unpair`, `refresh_dashboard`, and `remove_codex_registration`
|
|
901
|
-
control calls behind one closed `/action` route. The removal action carries
|
|
902
|
-
only a canonical public `codex-*` alias; native task IDs never enter the
|
|
903
|
-
browser contract. In one fencing commit it cancels queued or reserved work,
|
|
904
|
-
settles armed work ambiguous and accepted work unconfirmed, removes the
|
|
905
|
-
route's consent edges, and never replays uncertain work. The browser shows
|
|
906
|
-
the consequence and requires
|
|
907
|
-
explicit confirmation; the server rejects bodies over 1 KiB and limits the
|
|
908
|
-
companion to six actions per minute. It cannot create a registration,
|
|
909
|
-
succeed,
|
|
910
|
-
send, reply, approve, interrupt, change settings, or invoke a generic/provider
|
|
911
|
-
method. Each mutation touches only the edge it names: adding an edge never
|
|
912
|
-
retires another, and removing one settles its accepted work before the
|
|
913
|
-
change is published. Every action is followed by a
|
|
914
|
-
fresh observation. An observation may
|
|
915
|
-
settle already-due lifecycle deliveries before projecting, which is a broker
|
|
916
|
-
timer effect, not additional browser authority.
|
|
917
|
-
- **Containment.** The loopback server deliberately performs no local-process
|
|
918
|
-
or UID authentication. It assumes a trusted single-user machine: any local
|
|
919
|
-
software that can reach or spoof loopback can read the live view and invoke
|
|
920
|
-
the bounded actions. Host, Origin, and sentinel checks constrain ambient
|
|
921
|
-
browser-origin requests; they do not authenticate local software.
|
|
922
|
-
|
|
923
|
-
`--lang en|zh-CN` selects the companion's display language. It has no effect on
|
|
924
|
-
the static pair, which is always written in both languages.
|
|
808
|
+
## Protocol and schema versions
|
|
809
|
+
|
|
810
|
+
Each number below is bumped once per release line, at first need, and a
|
|
811
|
+
mismatch is refused rather than adapted to:
|
|
812
|
+
|
|
813
|
+
| Surface | Version | On mismatch |
|
|
814
|
+
| --- | --- | --- |
|
|
815
|
+
| Private state schema (`gateway-state.json`) | 5 | An older or unknown schema refuses with `GATEWAY_STATE_SCHEMA_UNSUPPORTED`; reset only, never rewritten |
|
|
816
|
+
| Private control protocol (CLI ↔ broker) | 3 | `CONTROL_VERSION_MISMATCH` at the client; keep the CLI and broker on one installation. A method the broker does not implement is `UNKNOWN_METHOD`, and the CLI says to rebuild or update the client |
|
|
817
|
+
| Federation peer protocol (`peer-stdio`) | 2 | `PEER_PROTOCOL_MISMATCH` on that node's mirrored routes and in `embassy status` |
|
|
818
|
+
| Native Claude helper IPC protocol | 2 | Internal to one installation; the helper and broker ship together |
|
|
819
|
+
| Public snapshot schema (`embassy status --json`) | 2 | Unchanged across the 3.0 line |
|
|
820
|
+
| Claude peer protocol (consumed, not owned) | 1 | A session record declaring another value is rejected in isolation and counted |
|
|
925
821
|
|
|
926
822
|
## Persistence and privacy
|
|
927
823
|
|
|
928
824
|
The private store may retain:
|
|
929
825
|
|
|
930
|
-
- schema-
|
|
826
|
+
- schema-5 logical registrations with aliases, registration IDs, and exact
|
|
931
827
|
provider-native route handles inside the closed private binding schema;
|
|
932
|
-
- consent edges tied to exact registration IDs, so alias reuse cannot inherit
|
|
933
|
-
permission;
|
|
934
828
|
- bounded messages with explicit `queued`, `reserved`, `armed`, `accepted`, or
|
|
935
829
|
`terminal` attempt phase and normalized activity used for accounting and
|
|
936
|
-
|
|
830
|
+
public projection;
|
|
937
831
|
- timestamps, counters, dedupe/rate-limit records, and safe error codes.
|
|
938
832
|
|
|
939
833
|
It also retains message bodies under bounded caps — the queued body of every
|
|
@@ -945,19 +839,18 @@ snapshot is a
|
|
|
945
839
|
strict projection that removes private route handles, registration IDs, and
|
|
946
840
|
operation-local endpoint evidence. The state directory is mode 0700 and state is mode 0600;
|
|
947
841
|
provider-native identifiers never enter normalized events, public snapshots,
|
|
948
|
-
|
|
949
|
-
logical routes
|
|
950
|
-
may resume once only after their exact registration
|
|
842
|
+
CLI arguments/output, aliases, logs, or error text. On restart,
|
|
843
|
+
logical routes remain unchanged. Queued and reserved bodies
|
|
844
|
+
may resume once only after their exact registration authority is
|
|
951
845
|
rechecked; armed and accepted work settles without replay. Callback, native
|
|
952
846
|
receipt, conversation, and reply capabilities are not reconstructed.
|
|
953
847
|
|
|
954
|
-
Private schema
|
|
955
|
-
snapshot deliberately remains schema version 2.
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
ordinary strict corrupt-state error.
|
|
848
|
+
Private schema 5 is the binary's only native store format; the bounded public
|
|
849
|
+
snapshot deliberately remains schema version 2. The runtime performs no
|
|
850
|
+
migration or best-effort rewrite. An old or unknown private schema refuses with
|
|
851
|
+
`GATEWAY_STATE_SCHEMA_UNSUPPORTED` without mutating the state file; the operator
|
|
852
|
+
must follow the reset-only runbook in `docs/CONFIGURATION.md`. A malformed
|
|
853
|
+
schema-5 document produces the ordinary strict corrupt-state error.
|
|
961
854
|
|
|
962
855
|
## Minimum filesystem and process access
|
|
963
856
|
|
|
@@ -969,11 +862,12 @@ user's interactive Claude history. The narrow live boundary is:
|
|
|
969
862
|
directory;
|
|
970
863
|
- create and later remove only its exact-owned callback socket inside the
|
|
971
864
|
accessible Claude peer-socket directory, with inode/generation checks;
|
|
972
|
-
- create its control socket plus metadata
|
|
865
|
+
- create its control socket plus metadata files only inside its
|
|
973
866
|
separate controller-owned mode-0700 state directory;
|
|
974
|
-
- attach to
|
|
975
|
-
- optionally execute fixed `ssh
|
|
976
|
-
no shell and no model-supplied command or
|
|
867
|
+
- attach to the managed local Codex App Server; and
|
|
868
|
+
- optionally execute the fixed `ssh <node> embassy peer-stdio` argv for each
|
|
869
|
+
node listed in `nodes.json`, with no shell and no model-supplied command or
|
|
870
|
+
hostname.
|
|
977
871
|
|
|
978
872
|
It does not read Claude transcripts, settings, project state, credentials,
|
|
979
873
|
Keychain, shell history, or unrelated user files. It does not copy, print,
|
|
@@ -994,27 +888,26 @@ paths, peers, and transports:
|
|
|
994
888
|
| `/tmp/cc-socks` | At foreground startup, validate the private directory and create/remove only `/tmp/cc-socks/<gateway-pid>.sock` after inode/generation checks; search/stat genuine peers at passive discovery and connect one validated target only at the separately authorized send gate |
|
|
995
889
|
| `~/.local/state/agent-embassy/.agent-embassy-state` | Validate or establish the exact ownership marker before creating the fixed host lease; an existing non-empty unmarked root is rejected without mutation |
|
|
996
890
|
| `/usr/bin/lockf` and `/bin/cat` | Hold one fixed, non-waiting macOS advisory lease for the foreground controller; the helper receives no shell text, provider data, or model-supplied argument |
|
|
997
|
-
| `/usr/bin/open` | Executed only by the opt-in `embassy dashboard --live` companion, to open the loopback dashboard URL in the operator's browser; no shell, a scrubbed fixed environment, and a bounded timeout and output cap |
|
|
998
891
|
| `~/.local/state/agent-embassy/.gateway-host.lock` | Fixed per-login kernel-held lease acquired before provider setup; it remains here even when `EMBASSY_STATE_DIR` is overridden. Its bounded PID/token record is exact-cleanup metadata, not a path-only stale-lock authority; a crash releases the kernel lock and the next foreground process may acquire the existing file |
|
|
999
|
-
| `~/.local/state/agent-embassy` (or explicit `EMBASSY_STATE_DIR`) | Default controller-owned store, control UDS, state lock
|
|
892
|
+
| `~/.local/state/agent-embassy` (or explicit `EMBASSY_STATE_DIR`) | Default controller-owned store, control UDS, and state lock; an explicit absolute configuration may replace only these state surfaces |
|
|
1000
893
|
| `~/.codex/packages/standalone` and `~/.codex/app-server-control/app-server-control.sock` | Resolve the exact owned managed Codex binary and attach to the already-running private local App Server; never bootstrap or unlink it |
|
|
1001
894
|
|
|
1002
895
|
No grant to `~/.claude/projects`, the rest of
|
|
1003
896
|
`~/.claude`, Keychain APIs, the full home directory, or
|
|
1004
|
-
unrelated temporary files is required.
|
|
1005
|
-
|
|
897
|
+
unrelated temporary files is required. Cross-machine reach is federation over
|
|
898
|
+
`ssh <node> embassy peer-stdio`, configured only in `nodes.json`.
|
|
1006
899
|
|
|
1007
|
-
|
|
1008
|
-
filesystem root and configured temporary roots are still
|
|
1009
|
-
deliberately broad Claude workspaces
|
|
900
|
+
A routed Claude session's workspace may contain the private controller-state
|
|
901
|
+
directory. The filesystem root and configured temporary roots are still
|
|
902
|
+
rejected as deliberately broad Claude workspaces, and that refusal happens
|
|
903
|
+
before any route is installed. The user's home is addressable with the
|
|
1010
904
|
default controller-state root beneath it. A narrower project directory remains
|
|
1011
905
|
the preferred least-context setup, but it is not mandatory.
|
|
1012
906
|
|
|
1013
907
|
## Failure and upgrade policy
|
|
1014
908
|
|
|
1015
909
|
- Provider versions are best-effort metadata and never grant or remove routing
|
|
1016
|
-
authority.
|
|
1017
|
-
limitations, and dates without entering runtime. A session record whose peer
|
|
910
|
+
authority. A session record whose peer
|
|
1018
911
|
protocol is not 1 is rejected per record and counted without stopping the
|
|
1019
912
|
broker; interface drift degrades only its responsible provider.
|
|
1020
913
|
- Unsafe ownership, path, symlink, lease, state, or generation evidence for
|
|
@@ -1026,8 +919,8 @@ the preferred least-context setup, but it is not mandatory.
|
|
|
1026
919
|
gateway-owned state, unexpected paths, queue overflow, deadline expiry, and ambiguous writes are
|
|
1027
920
|
normalized failures, never raw diagnostics.
|
|
1028
921
|
- A provider disconnect fails or defers only the current operation. The next
|
|
1029
|
-
eligible attempt opens and attests a new transport; logical registration
|
|
1030
|
-
|
|
922
|
+
eligible attempt opens and attests a new transport; logical registration
|
|
923
|
+
does not depend on a connector lifecycle.
|
|
1031
924
|
- The first successful Codex registration locks its exact alias, task, and host
|
|
1032
925
|
until that registration is explicitly replaced or unregistered. Exact
|
|
1033
926
|
re-registration remains idempotent.
|
|
@@ -1036,15 +929,15 @@ the preferred least-context setup, but it is not mandatory.
|
|
|
1036
929
|
the one atomic transaction that changes the registered Codex identity. A
|
|
1037
930
|
replacement must name the exact current registration on the same host, with
|
|
1038
931
|
a different alias and thread. Embassy settles the outgoing registration's
|
|
1039
|
-
work from its durable attempt phase, removes its
|
|
932
|
+
work from its durable attempt phase, removes its transient
|
|
1040
933
|
capabilities, and publishes only the replacement. No conversation, reply
|
|
1041
|
-
capability, queued body
|
|
934
|
+
capability, or queued body transfers to the new identity, and no
|
|
1042
935
|
intermediate generation or manual-recovery state exists.
|
|
1043
936
|
- No ambiguous mutation is retried automatically.
|
|
1044
937
|
- A queued or reserved body survives process loss under bounded retention and
|
|
1045
938
|
may resume once after exact logical authority is rechecked. Armed or accepted
|
|
1046
939
|
work settles `ambiguous` or `unconfirmed` and is never replayed.
|
|
1047
|
-
- A provider
|
|
940
|
+
- A provider update that changes an internal interface degrades its
|
|
1048
941
|
responsible route while the broker and other providers remain available. A
|
|
1049
942
|
Claude record outside peer protocol 1 is rejected per record, and every
|
|
1050
943
|
current provider artifact used for an operation is re-attested before effect.
|
|
@@ -1053,11 +946,10 @@ the preferred least-context setup, but it is not mandatory.
|
|
|
1053
946
|
|
|
1054
947
|
Routine validation is deterministic and synthetic: it does not inspect live
|
|
1055
948
|
provider state, connect a provider socket, attach to App Server, invoke SSH, or
|
|
1056
|
-
make a model request.
|
|
1057
|
-
|
|
1058
|
-
connectors remain a separately reviewed future capability.
|
|
949
|
+
make a model request. Live validation is a separately authorized operator
|
|
950
|
+
action — `embassy check` is its everyday form — and is never part of CI.
|
|
1059
951
|
|
|
1060
|
-
Only the synthetic layer is routine validation. Server
|
|
952
|
+
Only the synthetic layer is routine validation. Server startup,
|
|
1061
953
|
discovery, and callback binding remain no-send operations; step 4 is the first
|
|
1062
954
|
provider write. A real provider message is never enabled in CI.
|
|
1063
955
|
|