interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / docs / COMMUNITY.md

97 lines · 7267 bytes Raw Blame History Rendered
1# Community machines (the runner hub)
2
3People connect their own Linux aarch64 computers (a DGX Spark, for example) with one line,
4`curl -fsSL https://interplane.io/community/join | sh`, and rerun published salvage parts there.
5The runner is spark-connector (rad:z2LKDxnAK3EFfqgr7HTZh6djts65P); its wire contract is
6spark-connector `docs/PROTOCOL.md` (ipcc1). This slice, `community/`, is the hub side.
7
8## Routes
9
10| Path | Method | What |
11|---|---|---|
12| `/community/` | GET | what joining does, the line, which computers can join, how to stop and leave, the counting rule, the registered runners (count, Interplane's note on its own runners, each key), every published part with its record, file fingerprints |
13| `/community/api` | POST | one signed ipcc1 message: register, next, result, leave |
14| `/community/join` | GET | the join script (`<read-only root>dist/join.sh`) |
15| `/community/dl/<name>` | GET | a file of `<read-only root>dist/` (runner, compiler, SHA256SUMS) |
16| `/community/part/<id>` | GET | developer view: every counted key with time, exit, binary and stdout hashes, signed message |
17| `/community/msg/<message id>` | GET | one accepted signed message, as stored; the id is the SHA-256 of its signed bytes |
18| `/community/key/<key id>` | GET | one key file: public key, declared rate, time, joined or left |
19| `/community/ledger` | GET | one line per accepted message |
20| `/community/alarms` | GET | one line each time a volume counter first passes its threshold in an hour (key or `all` or `refused`, and the count) |
21| `/community/refused` | GET | one line per refusal (time, reason, key, message hash) |
22
23The salvage part page (`/salvage/<id>`) shows the same "Ran again by N community runners: K agree"
24line with a link to the developer view.
25
26A runner is a key, and one computer can hold several (Interplane's own Spark runs one directly and
27one in a container), so the pages count runners, never machines. Which keys share a computer is
28known only to the operator, who says so in `runners-note` (below); the hub cannot tell from outside.
29
30## What the hub does with a message
31
32Checks in this order, each refusal answered with `ipcc1 refused <reason>` and appended to
33`refused`: size (4096 bytes), exact form, key (registered and not left; for register the key in
34the message), clock (300 s), signature (ECDSA P-256 / SHA-256, om/tls `ecdsa_verify_raw`), deny
35list, replay (the SHA-256 of the signed bytes already stored, so a malleated signature is a replay
36too), then the kind. Volume is counted, not refused: signed messages (after the signature and replay checks) per key and in all, and
37refusals, per hour; when a count first passes its threshold (150 per key, 3600 in all, 3600
38refusals) one line naming the key (or `all`, `refused`) and the count goes to `alarms`, served at
39`/community/alarms`. A result must answer a job issued to that key less than an hour
40ago, for the same part and compiler, and each job is used once. A key counts once per part: the
41first counted result; later ones are stored and answered `duplicate`. Nothing a runner sends is
42executed, compiled or used as a path; every file name built from a message is lowercase hex of
43fixed length.
44
45## Two roots
46
47The record store, `INTERPLANE_COMMUNITY_DIR` (production `~/forge-data/community/`, writable by the
48server): `keys/<key id>`, `jobs/<job id>`, `used/<job id>`, `msgs/<message id>` (all written once,
49O_EXCL, except a key file, which is replaced on register and leave), `parts/<part>/k/<key>` (the
50counted result), `parts/<part>/g/<hash of the result>/<key>` and `.v` (agreement groups),
51`rate/<key>`, `rate/all` and `rate/refused` (hourly volume counters), `alarms` (one line when a counter first passes its threshold in an hour, served at `/community/alarms`), `ledger` and `refused` (append only; at 4 MiB each of the three logs is set aside as
52`<name>.<seconds>`, kept and served at `/community/<name>.<seconds>`, so no file nears forged's
53file-size limit), `writer.lock`.
54
55The read-only root, `INTERPLANE_COMMUNITY_PUB` (production: the host folder `~/forge-community/`,
56outside forge-data, seen by the server at `/community/`): `dist/` (the files of `/community/join`
57and `/community/dl/`, made by spark-connector `dist.sh`) and `deny` (written by the operator: lines
58`key <64 hex>` or `part <64 hex>`). Optional: `runners-note` (written by the operator, plain text, at
59most 2048 bytes shown, escaped), shown on `/community/` under the runner count, e.g. "Both runners
60are on the same host". The hub needs both roots; without either the slice is off.
61
62## Switching it on and off
63
64`infra/spark/forged-sandbox.sh` passes both roots when salvage is on and `~/forge-data/community/`
65exists. It binds `~/forge-community/` (`FORGED_COMMUNITY_PUB`) read-only at `/community` directly
66under the sandbox's read-only root, so no path the server can write or rename leads to what
67volunteers download or to the deny list (a read-only mount inside a writable directory would move
68with it when that directory is renamed). The folder, its `dist/` and `deny` must be real (a link
69stops the sandbox). On: create `~/forge-community/` (0700) with `dist/` (spark-connector `dist.sh`)
70and an empty `deny`, create `~/forge-data/community/` (0700), deploy a build whose `community/READY`
71exists, restart forged. Off: rename `~/forge-data/community/` and restart; nothing is deleted.
72Without it every `/community/` page is 404 and the API answers `off`. `infra/test/sandbox.sh` checks
73the layout with a probe (store writable; dist and deny not; `/community` cannot be renamed; moving
74the store away and recreating `community/dist/join.sh` in it does not change the served file), a
75mutant wrapper that binds the folder writable (caught), and a link in place of `deny` (refused).
76It then requests every route above through forged inside the wrapper (`infra/test/sandbox-community.sh`)
77with the live store's shapes: a part whose `k/` lists `.` or `..` last (the shape that made the live
78forged exit 103 on 2026-11-11), empty lists, one runner, a disagreeing runner, registered and left
79keys; with controls (ids under the other route, same-length wrong prefixes) and an eager-read mutant.
80
81## Limits and what kind of limit each is
82
83Decision 2026-11-11 (lead, under Drake's delegation, `briefs/decisions-20261111.md` point 2): no
84app-level caps on the hub beyond the public edge's request-rate limiting (nginx, per address);
85volume is watched by the alarms above and handled with the deny list. What stays is protocol: a
86message is at most 4096 bytes (the longest valid one is under 1 KiB), clock skew 300 s (the replay
87window of signed messages), a job is answered within 3600 s. Logs are set aside at 4 MiB so no file
88nears forged's file-size limit (a sandbox containment limit).
89Our own code holds no fixed table: the deny list, the directories and the salvage index are read as
90streams; the developer view lists every key.
91
92## Gate
93
94`sh community/tests/run.sh` runs spark-connector's `gates/run.sh` against this checkout
95(`RUNNER_SRC`, default `../spark-connector`; `OMEGA_SRC` default `../omega-mv` at b2ad967e for the
96runner; the forge's own pin for the hub). It builds a test hub from this tree on a private port with
97scratch data and runs every case with its negative control.