Skip to content

Commit 8f16af2

Browse files
committed
Redraw the architecture map, which had five packages missing from it
The layer diagram showed ui, data, net, protocol and subscription. Since it was written the app has grown vpn, routing, dns, apps and nodes — five packages, one of which is the TUN itself — and a map that omits the layer a reader is looking for sends them to read the source instead, which is what the map exists to avoid. It also said the coverage gate is on the wire layer. It is on six packages, and the reason they are all in it is worth stating where somebody deciding where to put new code will read it: they are the same kind of code, where a wrong answer is wrong silently, and in routing and nodes it is wrong in the worst direction.
1 parent 5831e9b commit 8f16af2

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎docs/architecture.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,26 @@ What the layers are, which way they depend, and the rules that keep them apart.
77
```
88
ui/ screens, theme, icons, presentation state
99
↓
10+
vpn/ VpnService · TUN configuration · lwIP bridge · flow handler · tile
11+
↓
1012
data/ NodeStore · SubscriptionStore · NodeRepository
13+
nodes/ NodeHealth · Failover — which node carries the traffic
14+
routing/ rules, the direct path, the reject path
15+
dns/ interception, the fake-IP pool, both families
16+
apps/ which applications the tunnel carries
1117
↓
1218
net/ NowhereDialer — TLS, ALPN, certificate verification
1319
↓
1420
protocol/ the wire. auth · frame · mux · quic · session · target · tls · url
15-
subscription/ the dashboard's HTTP surface
21+
subscription/ the dashboard's HTTP surface, and its scheduled refresh
1622
```
1723

24+
Six of those packages carry the 90% coverage gate rather than one:
25+
`protocol/`, `subscription/`, `dns/`, `apps/`, `routing/` and `nodes/`. They are
26+
not all the wire, but they are all the same *kind* of code — a wrong answer is
27+
wrong silently, and in `routing/` and `nodes/` it is wrong in the worst
28+
direction, with traffic leaving the device somewhere the user did not ask.
29+
1830
**Dependencies point down and never up.** `protocol/` knows nothing about
1931
Android — no `Context`, no resource, no `Log` — which is why every protocol test
2032
runs on the JVM in milliseconds and can be pointed at a real Portal without a

0 commit comments

Comments
 (0)