detached fbbc30c

refactor(ports): own the remote route argv vocabulary in one place

The persisted SSH route argv now uses exported ports constants, and the CLI
parses the hidden mux helpers through the same constants instead of a
duplicated spelling. The session admission comment names the real
admission-less path: the direct local daemon socket.
commit
fbbc30c8ecadd232dcf318ca86ddfb507c98d5b2
author
brice · · 2026-10-08 05:11 UTC
parent
48eff4c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +19 -9
M internal/app/broker_offline_mux.go +3 -3
@@ -65,9 +65,9 @@ import (
6565
6666 const (
6767 // brokerMuxStdioCommand is the hidden remote SSH stdio mux bridge.
68- brokerMuxStdioCommand = "_broker-mux-stdio"
68+ brokerMuxStdioCommand = ports.BrokerMuxStdioCommand
6969 // brokerMuxQUICBootstrapCommand is the hidden remote QUIC mux bootstrap.
70- brokerMuxQUICBootstrapCommand = "_broker-mux-quic-bootstrap"
70+ brokerMuxQUICBootstrapCommand = ports.BrokerMuxQUICBootstrapCommand
7171 // brokerMuxQUICProxyCommand is the hidden detached remote QUIC mux proxy.
7272 brokerMuxQUICProxyCommand = "_broker-mux-quic-proxy"
7373 )
@@ -105,7 +105,7 @@ const brokerDaemonStartArg = "--daemon-start"
105105
106106 // brokerScopeArg is the scope flag carried by every durable remote route argv
107107 // (see ports.BrokerRouteForTransport). Stored routes keep it verbatim.
108-const brokerScopeArg = "--production"
108+const brokerScopeArg = ports.BrokerRouteScopeArg
109109
110110 // brokerMuxOptions is the parsed hidden mux helper invocation.
111111 type brokerMuxOptions struct {
@@ -65,9 +65,9 @@ import (
65 65
66 const (66 const (
67 // brokerMuxStdioCommand is the hidden remote SSH stdio mux bridge.67 // brokerMuxStdioCommand is the hidden remote SSH stdio mux bridge.
68- brokerMuxStdioCommand = "_broker-mux-stdio"68+ brokerMuxStdioCommand = ports.BrokerMuxStdioCommand
69 // brokerMuxQUICBootstrapCommand is the hidden remote QUIC mux bootstrap.69 // brokerMuxQUICBootstrapCommand is the hidden remote QUIC mux bootstrap.
70- brokerMuxQUICBootstrapCommand = "_broker-mux-quic-bootstrap"70+ brokerMuxQUICBootstrapCommand = ports.BrokerMuxQUICBootstrapCommand
71 // brokerMuxQUICProxyCommand is the hidden detached remote QUIC mux proxy.71 // brokerMuxQUICProxyCommand is the hidden detached remote QUIC mux proxy.
72 brokerMuxQUICProxyCommand = "_broker-mux-quic-proxy"72 brokerMuxQUICProxyCommand = "_broker-mux-quic-proxy"
73 )73 )
@@ -105,7 +105,7 @@ const brokerDaemonStartArg = "--daemon-start"
105 105
106 // brokerScopeArg is the scope flag carried by every durable remote route argv106 // brokerScopeArg is the scope flag carried by every durable remote route argv
107 // (see ports.BrokerRouteForTransport). Stored routes keep it verbatim.107 // (see ports.BrokerRouteForTransport). Stored routes keep it verbatim.
108-const brokerScopeArg = "--production"108+const brokerScopeArg = ports.BrokerRouteScopeArg
109 109
110 // brokerMuxOptions is the parsed hidden mux helper invocation.110 // brokerMuxOptions is the parsed hidden mux helper invocation.
111 type brokerMuxOptions struct {111 type brokerMuxOptions struct {
M internal/ports/broker_store.go +13 -4
@@ -90,14 +90,23 @@ func (r BrokerRouteSpec) Clone() BrokerRouteSpec {
9090 return r
9191 }
9292
93-// BrokerRouteForTransport maps the closed legacy policy transport vocabulary
94-// to canonical remote routes.
93+// Remote helper argv vocabulary. Durable SSH routes store this argv verbatim,
94+// so these spellings are part of the persisted route contract; the CLI parses
95+// the same constants.
96+const (
97+ BrokerMuxStdioCommand = "_broker-mux-stdio"
98+ BrokerMuxQUICBootstrapCommand = "_broker-mux-quic-bootstrap"
99+ BrokerRouteScopeArg = "--production"
100+)
101+
102+// BrokerRouteForTransport maps the closed policy transport vocabulary to the
103+// canonical remote route.
95104 func BrokerRouteForTransport(transport, endpoint string) (BrokerRouteSpec, error) {
96105 switch transport {
97106 case "ssh-stdio", "stdio":
98- return BrokerRouteSpec{Kind: BrokerRouteSSHStdio, Target: endpoint, Argv: []string{"vev", "_broker-mux-stdio", "--production"}}, nil
107+ return BrokerRouteSpec{Kind: BrokerRouteSSHStdio, Target: endpoint, Argv: []string{"vev", BrokerMuxStdioCommand, BrokerRouteScopeArg}}, nil
99108 case "ssh-quic", "quic":
100- return BrokerRouteSpec{Kind: BrokerRouteSSHQUIC, Target: endpoint, Argv: []string{"vev", "_broker-mux-quic-bootstrap", "--production"}}, nil
109+ return BrokerRouteSpec{Kind: BrokerRouteSSHQUIC, Target: endpoint, Argv: []string{"vev", BrokerMuxQUICBootstrapCommand, BrokerRouteScopeArg}}, nil
101110 default:
102111 return BrokerRouteSpec{}, fmt.Errorf("ports: unsupported broker transport %q", transport)
103112 }
@@ -90,14 +90,23 @@ func (r BrokerRouteSpec) Clone() BrokerRouteSpec {
90 return r90 return r
91 }91 }
92 92
93-// BrokerRouteForTransport maps the closed legacy policy transport vocabulary93+// Remote helper argv vocabulary. Durable SSH routes store this argv verbatim,
94-// to canonical remote routes.94+// so these spellings are part of the persisted route contract; the CLI parses
95+// the same constants.
96+const (
97+ BrokerMuxStdioCommand = "_broker-mux-stdio"
98+ BrokerMuxQUICBootstrapCommand = "_broker-mux-quic-bootstrap"
99+ BrokerRouteScopeArg = "--production"
100+)
101+
102+// BrokerRouteForTransport maps the closed policy transport vocabulary to the
103+// canonical remote route.
95 func BrokerRouteForTransport(transport, endpoint string) (BrokerRouteSpec, error) {104 func BrokerRouteForTransport(transport, endpoint string) (BrokerRouteSpec, error) {
96 switch transport {105 switch transport {
97 case "ssh-stdio", "stdio":106 case "ssh-stdio", "stdio":
98- return BrokerRouteSpec{Kind: BrokerRouteSSHStdio, Target: endpoint, Argv: []string{"vev", "_broker-mux-stdio", "--production"}}, nil107+ return BrokerRouteSpec{Kind: BrokerRouteSSHStdio, Target: endpoint, Argv: []string{"vev", BrokerMuxStdioCommand, BrokerRouteScopeArg}}, nil
99 case "ssh-quic", "quic":108 case "ssh-quic", "quic":
100- return BrokerRouteSpec{Kind: BrokerRouteSSHQUIC, Target: endpoint, Argv: []string{"vev", "_broker-mux-quic-bootstrap", "--production"}}, nil109+ return BrokerRouteSpec{Kind: BrokerRouteSSHQUIC, Target: endpoint, Argv: []string{"vev", BrokerMuxQUICBootstrapCommand, BrokerRouteScopeArg}}, nil
101 default:110 default:
102 return BrokerRouteSpec{}, fmt.Errorf("ports: unsupported broker transport %q", transport)111 return BrokerRouteSpec{}, fmt.Errorf("ports: unsupported broker transport %q", transport)
103 }112 }
M internal/ports/session_admission.go +3 -2
@@ -165,8 +165,9 @@ func (a SessionAdmission) Clone() SessionAdmission {
165165 // SessionAdmissionProvider is the optional boundary-safe port a typed accepted
166166 // server connection implements when the accepting side stamped admission
167167 // metadata onto it. A daemon-consuming use case asserts it structurally; a
168-// connection built by a legacy constructor that carries no provisioned
169-// admission reports ok=false rather than a zero admission.
168+// connection accepted without provisioned admission (the direct local daemon
169+// socket used by broker-less list and stop commands) reports ok=false rather
170+// than a zero admission, and the daemon applies standard Hello validation.
170171 //
171172 // The returned value is a defensive copy: mutating it never alters the
172173 // connection's admitted authority, and concurrent readers each receive their
@@ -165,8 +165,9 @@ func (a SessionAdmission) Clone() SessionAdmission {
165 // SessionAdmissionProvider is the optional boundary-safe port a typed accepted165 // SessionAdmissionProvider is the optional boundary-safe port a typed accepted
166 // server connection implements when the accepting side stamped admission166 // server connection implements when the accepting side stamped admission
167 // metadata onto it. A daemon-consuming use case asserts it structurally; a167 // metadata onto it. A daemon-consuming use case asserts it structurally; a
168-// connection built by a legacy constructor that carries no provisioned168+// connection accepted without provisioned admission (the direct local daemon
169-// admission reports ok=false rather than a zero admission.169+// socket used by broker-less list and stop commands) reports ok=false rather
170+// than a zero admission, and the daemon applies standard Hello validation.
170 //171 //
171 // The returned value is a defensive copy: mutating it never alters the172 // The returned value is a defensive copy: mutating it never alters the
172 // connection's admitted authority, and concurrent readers each receive their173 // connection's admitted authority, and concurrent readers each receive their

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close