Skip to content

Commit 8bb36ab

Browse files
committed
refactor(squash): layered architecture simplification — extract sub-packages, fix races, add trace/trust-gate
- Extract tunnel sub-packages: envelope (L6), keyexchange (L5), udpio (L2), routing (L4) - Extract plugins: handshake (port 444), gateway, webhook - Extract internal utilities: trustedagents, skillinject, policy, dataexchange, eventstream, tasksfiles - Split pkg/registry into client + server subpackages - Add architecture enforcement tools: check-layers, check-bootstrap, check-globals - CI: architecture-gates workflow (P1/P3/P4/P5/P6/P7/P9) - Add build tags for optional components (no_gateway, no_nameserver, no_updater, etc.) - Invert dependencies: networkSyncLoop via bus events, webhook → bus.Publish - Fix data races: identity in beaconRefreshTick, RetxStop init order, registry shard.Lock - Fix FIN-ACK ping-pong storm, IPC request-ID demux, beacon typed-nil - Plug 48h memory leaks in daemon, handshake plugin, and registry - Add panic boundaries across all layers (L1–L11) - Add --trace flag to pilotctl ping/send-message/inbox with distributed path timing - Add trust-gate UX: WaitForTrust IPC, auto-handshake, public/private gate - Move black-box tests to tests/, tests/daemon, tests/plugins - Add regression tests: rc5-storm, FIN-ACK, self-dial, port-leak, §4.8 stress harness - Wire-format golden corpus (P6 invariance gate) - IPC concurrent dispatch with request-ID demultiplexing - regConn connection pool (4 conns) + Info/RotateKey race fix
1 parent 9d16ff9 commit 8bb36ab

1,284 files changed

Lines changed: 140034 additions & 133293 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.git
22
.github
3-
abpn
43
node_modules
54
**/node_modules
65
*.log

.github/workflows/architecture.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: architecture-gates
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
gates:
7+
name: Architecture gates
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- uses: actions/setup-go@v5
13+
with:
14+
go-version: '1.22'
15+
16+
- name: P1 - layer imports
17+
run: go run ./tools/check-layers ./...
18+
19+
- name: P5 - test imports stay in layer
20+
run: go run ./tools/check-layers --tests ./...
21+
22+
- name: Lock-graph race detection (sec 4.8)
23+
run: go test -race -timeout 5m ./pkg/daemon ./pkg/registry ./pkg/secure
24+
25+
- name: Lock-graph stress harness (sec 4.8) — TestConcurrentDialEncryptDecrypt
26+
# 1000 goroutines × 30 s × 3 reps = ~90 s wall time. Race-clean,
27+
# no panic, no goroutine leak. Skipped by -short; run here without.
28+
run: go test -race -count=1 -timeout 10m -run TestConcurrentDialEncryptDecrypt ./tests/...
29+
30+
- name: P4/P9 - goroutine reaping
31+
run: go test ./tests -run "TestDaemonShutdown|TestStreamLifecycleGoroutines|TestPluginShutdown"
32+
33+
plugin-matrix:
34+
name: Plugin matrix (no_${{ matrix.plugin }})
35+
needs: gates
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
plugin:
41+
- updater
42+
- skillinject
43+
- trustedagents
44+
- nameserver
45+
- dataexchange
46+
- eventstream
47+
- tasks
48+
- gateway
49+
- policy
50+
- webhook
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- uses: actions/setup-go@v5
55+
with:
56+
go-version: '1.22'
57+
58+
- name: Build & test with plugin disabled
59+
run: go test -tags=no_${{ matrix.plugin }} ./pkg/daemon/... ./pkg/coreapi/...

.gitignore

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jetson
2020
/nameserver
2121
/gateway
2222
/updater
23+
/check-layers
2324

2425
# Go workspace
2526
go.work
@@ -59,6 +60,22 @@ web/.wrangler/
5960
# Personal analytics scripts + their reports - never commit
6061
web/scripts/local/
6162

63+
# =============================================================================
64+
# Private / ops — lives in web4-private, never commit here
65+
# =============================================================================
66+
OBSERVABILITY_PLAN.md
67+
SECURITY_PLAN.md
68+
abpn/
69+
mention-exporter
70+
k8s/gcp-vms/
71+
k8s/pilot-exporter/
72+
k8s/pilot-install-canary/
73+
k8s/pilot-probe/
74+
k8s/pilot-release/
75+
k8s/pilot-website/
76+
k8s/network/
77+
web/ANALYTICS.md
78+
6279
# Root-level npm tooling (not the main module)
6380
/package.json
6481
/package-lock.json
@@ -108,14 +125,14 @@ tests/integration/k8s/preloaded/*.tar
108125
tests/integration/local/logs/
109126
tests/integration/local/results/
110127
tests/admin_cli_test.go
111-
cmd/spoof/
112128

113129
# =============================================================================
114130
# Docs (allowlist — only track .tex, .pdf, SPEC.md, media/, ietf/, research/)
115131
# =============================================================================
116132
docs/*
117133
!docs/*.tex
118134
!docs/*.pdf
135+
!docs/*.md
119136
!docs/SPEC.md
120137
!docs/media/
121138
!docs/research/
@@ -129,13 +146,19 @@ AGENTS.md
129146
.mcp.json
130147
cmd/pilot-admin/
131148
cmd/console/
149+
cmd/netsim/
150+
cmd/wire-gen/
132151
console
133152
console-ui/
134153
pkg/console/
154+
pkg/netsim/
135155
newsletter/
136156
web/MESSAGING.md
137157
scripts/publish-worker/src/webhook.ts
138158
scripts/publish-worker/test/webhook.test.ts
159+
tools/check-bootstrap/
160+
tools/check-globals/
161+
RELEASE_NOTES*.md
139162

140163
# =============================================================================
141164
# Web: stale Astro outputs (regenerated at build time)
@@ -166,6 +189,4 @@ k8s/
166189
tests/integration/local/logs.rerun*
167190

168191
# Untracked sandboxes / personal scratch — never commit
169-
abpn/
170192
scripts/pilot-geo-exporter/
171-
/spoof

0 commit comments

Comments
 (0)