Skip to content

Commit 834754b

Browse files
committed
feat: uncommitted working tree changes — pilotctl send-message flags, daemon/beacon/registry updates
1 parent 92e9d99 commit 834754b

68 files changed

Lines changed: 1570 additions & 5882 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ build/
99
*.so
1010
*.dylib
1111
*-linux
12+
*.bin
1213
jetson
1314

1415
# Root-level Go build outputs
@@ -63,10 +64,7 @@ web/scripts/local/
6364
# =============================================================================
6465
# Private / ops — lives in web4-private, never commit here
6566
# =============================================================================
66-
OBSERVABILITY_PLAN.md
67-
SECURITY_PLAN.md
6867
abpn/
69-
mention-exporter
7068
k8s/gcp-vms/
7169
k8s/pilot-exporter/
7270
k8s/pilot-install-canary/
@@ -184,9 +182,5 @@ survey*.mjs
184182

185183
# Operational manifests — kept local, never committed
186184
k8s/
187-
188-
# Test rerun outputs — should never have been committed
189185
tests/integration/local/logs.rerun*
190-
191-
# Untracked sandboxes / personal scratch — never commit
192186
scripts/pilot-geo-exporter/

CHANGELOG.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,6 @@ project uses [Semantic Versioning](https://semver.org/).
77
Detailed per-release notes are on the
88
[GitHub Releases page](https://github.com/TeoSlayer/pilotprotocol/releases).
99

10-
## [Unreleased] → 1.9.2
11-
12-
### Removed
13-
- Task system (port 1003, `pilotctl task`, `pilot-task` binary, `TaskQueue`, `CmdSetTaskExec`)
14-
- Polo score from base protocol, managed networks, registry wire format, and website
15-
- `score` action and `peer_score` context from the policy engine
16-
- 14 shipped network configs whose only logic was score-based
17-
- 3 blog posts and doc pages for tasks and polo
18-
19-
### Fixed
20-
- Relayed handshake path now checks `trustedagents.IsTrusted()` — NATed clients were getting
21-
~23% reply rates because the trusted-agent auto-approve only fired on direct paths
22-
- Beacon tests: pass `admin_token` in `beacon_register` (required since auth layer was added)
23-
- `trustedagents` parallel tests: replaced `Load()` mutations with `SetForTest()` to fix race
24-
25-
### Added
26-
- 13 new integration test scripts (handshake, trust, message, pubsub coverage)
27-
- Architecture and package reference docs moved to `docs/`
28-
2910
## [1.9.1] - 2026-05-05
3011

3112
- Rekey storm fix: `decryptFailDropGrace` (3 s) prevents tearing down a freshly-installed

articles.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

cmd/beacon/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func main() {
2424
peersFlag := flag.String("peers", "", "comma-separated peer beacon addresses for gossip")
2525
healthAddr := flag.String("health", "", "health check HTTP address (e.g. :8080)")
2626
registryAddr := flag.String("registry", "", "registry address for dynamic peer discovery (e.g. 10.128.0.12:9000)")
27+
registryAdminToken := flag.String("registry-admin-token", "", "admin token for beacon_register auth (required when registry enforces SEC-002)")
2728
logLevel := flag.String("log-level", "info", "log level (debug, info, warn, error)")
2829
logFormat := flag.String("log-format", "text", "log format (text, json)")
2930
flag.Parse()
@@ -56,6 +57,9 @@ func main() {
5657
if *advertiseAddr != "" {
5758
s.SetAdvertiseAddr(*advertiseAddr)
5859
}
60+
if *registryAdminToken != "" {
61+
s.SetRegistryAdminToken(*registryAdminToken)
62+
}
5963

6064
if *healthAddr != "" {
6165
go func() {

cmd/daemon/main.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func main() {
7272
adminToken := flag.String("admin-token", "", "admin token for network operations")
7373
networks := flag.String("networks", "", "comma-separated network IDs to auto-join at startup")
7474
trustAutoApprove := flag.Bool("trust-auto-approve", false, "automatically approve all incoming trust handshakes")
75+
beaconRTTProbe := flag.Bool("beacon-rtt-probe", false, "probe beacon RTT before selection; override hash pick when >2× slower than best (ablation test, default off)")
7576
showVersion := flag.Bool("version", false, "print version and exit")
7677
logLevel := flag.String("log-level", "info", "log level (debug, info, warn, error)")
7778
logFormat := flag.String("log-format", "text", "log format (text, json)")
@@ -138,6 +139,7 @@ func main() {
138139
Networks: parseNetworkIDs(*networks),
139140
Version: version,
140141
TrustAutoApprove: *trustAutoApprove,
142+
BeaconRTTProbe: *beaconRTTProbe,
141143
})
142144

143145
// L11 plugin lifecycle (T7.1): composition root owns the
@@ -167,18 +169,18 @@ func main() {
167169
}
168170
}
169171

170-
policySvc := policy.NewService(policy.NewDaemonRuntime(d))
172+
policySvc := policy.NewService(runtime.NewPolicyRuntime(d))
171173
if err := rt.Register(policySvc); err != nil {
172174
log.Fatalf("register policy: %v", err)
173175
}
174176
d.RegisterPolicyManager(runtime.AsDaemonPolicyManager(policySvc.Manager()))
175177

176178
// Manual trust-handshake (port 444) — extracted from pkg/daemon in T3.3.
177-
hsSvc := handshake.NewService(handshake.NewDaemonRuntime(d))
179+
hsSvc := handshake.NewService(runtime.NewHandshakeRuntime(d))
178180
if err := rt.Register(hsSvc); err != nil {
179181
log.Fatalf("register handshake: %v", err)
180182
}
181-
d.RegisterHandshakeService(hsSvc.AsHandshakeService())
183+
d.RegisterHandshakeService(runtime.NewHandshakeServiceAdapter(hsSvc))
182184

183185
// Webhook (T4.1): the daemon publishes events to the in-process
184186
// bus, the plugin subscribes and POSTs to the configured URL. URL

cmd/gateway/main.go

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,24 @@ import (
1515
"syscall"
1616

1717
"github.com/TeoSlayer/pilotprotocol/pkg/config"
18-
"github.com/TeoSlayer/pilotprotocol/plugins/gateway"
18+
"github.com/TeoSlayer/pilotprotocol/pkg/driver"
1919
"github.com/TeoSlayer/pilotprotocol/pkg/logging"
2020
"github.com/TeoSlayer/pilotprotocol/pkg/protocol"
21+
"github.com/TeoSlayer/pilotprotocol/plugins/gateway"
2122
)
2223

2324
var version = "dev"
2425

26+
// driverDialer wraps *driver.Driver so DialAddr returns net.Conn, satisfying
27+
// gateway.Dialer without importing pkg/driver from within plugins/gateway.
28+
type driverDialer struct{ d *driver.Driver }
29+
30+
func (w driverDialer) DialAddr(dst protocol.Addr, port uint16) (net.Conn, error) {
31+
return w.d.DialAddr(dst, port)
32+
}
33+
34+
func (w driverDialer) Close() error { return w.d.Close() }
35+
2536
func main() {
2637
configPath := flag.String("config", "", "path to config file (JSON)")
2738
socketPath := flag.String("socket", "/tmp/pilot.sock", "daemon socket path")
@@ -64,11 +75,15 @@ func main() {
6475
}
6576
}
6677

78+
d, err := driver.Connect(*socketPath)
79+
if err != nil {
80+
log.Fatalf("connect to daemon: %v", err)
81+
}
82+
6783
gw, err := gateway.New(gateway.Config{
68-
Subnet: *subnet,
69-
SocketPath: *socketPath,
70-
Ports: ports,
71-
})
84+
Subnet: *subnet,
85+
Ports: ports,
86+
}, driverDialer{d})
7287
if err != nil {
7388
log.Fatalf("create gateway: %v", err)
7489
}
@@ -77,20 +92,13 @@ func main() {
7792
case "run":
7893
cmdRun(gw, args[1:])
7994
case "map":
80-
if err := gw.Start(); err != nil {
81-
log.Fatalf("start: %v", err)
82-
}
8395
cmdMap(gw, args[1:])
8496
default:
8597
usage()
8698
}
8799
}
88100

89101
func cmdRun(gw *gateway.Gateway, args []string) {
90-
if err := gw.Start(); err != nil {
91-
log.Fatalf("start gateway: %v", err)
92-
}
93-
94102
// Map any addresses passed as arguments: <pilot-addr> [<local-ip>]
95103
for i := 0; i < len(args); i += 2 {
96104
pilotAddrStr := args[i]

cmd/nameserver/main.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,32 @@ package main
55
import (
66
"flag"
77
"log"
8+
"net"
9+
"time"
810

911
"github.com/TeoSlayer/pilotprotocol/pkg/config"
1012
"github.com/TeoSlayer/pilotprotocol/pkg/driver"
1113
"github.com/TeoSlayer/pilotprotocol/pkg/logging"
14+
"github.com/TeoSlayer/pilotprotocol/pkg/protocol"
1215
"github.com/TeoSlayer/pilotprotocol/plugins/nameserver"
1316
)
1417

18+
// driverPortListener wraps *driver.Driver so its Listen method satisfies
19+
// nameserver.PortListener (returns net.Listener rather than *driver.Listener).
20+
type driverPortListener struct{ d *driver.Driver }
21+
22+
func (w driverPortListener) Listen(port uint16) (net.Listener, error) {
23+
return w.d.Listen(port)
24+
}
25+
26+
// driverDialer wraps *driver.Driver so DialAddrTimeout returns net.Conn,
27+
// satisfying nameserver.Dialer without importing pkg/driver from within the plugin.
28+
type driverDialer struct{ d *driver.Driver }
29+
30+
func (w driverDialer) DialAddrTimeout(dst protocol.Addr, port uint16, timeout time.Duration) (net.Conn, error) {
31+
return w.d.DialAddrTimeout(dst, port, timeout)
32+
}
33+
1534
func main() {
1635
log.Fatal("nameserver is currently disabled (WIP). Use hostname-based discovery via the registry instead.")
1736

@@ -38,6 +57,6 @@ func main() {
3857
}
3958
defer d.Close()
4059

41-
ns := nameserver.New(d, *storePath)
60+
ns := nameserver.New(driverPortListener{d}, *storePath)
4261
log.Fatal(ns.ListenAndServe())
4362
}

0 commit comments

Comments
 (0)