interplane-forge
INTERPLANE Forge
Brought by drakestapleton
interplane-forge / docs / COMMUNITY.md
| 1 | # Community machines (the runner hub) |
| 2 | |
| 3 | People 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. |
| 5 | The runner is spark-connector (rad:z2LKDxnAK3EFfqgr7HTZh6djts65P); its wire contract is |
| 6 | spark-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 | |
| 23 | The salvage part page (`/salvage/<id>`) shows the same "Ran again by N community runners: K agree" |
| 24 | line with a link to the developer view. |
| 25 | |
| 26 | A runner is a key, and one computer can hold several (Interplane's own Spark runs one directly and |
| 27 | one in a container), so the pages count runners, never machines. Which keys share a computer is |
| 28 | known 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 | |
| 32 | Checks 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 |
| 34 | the message), clock (300 s), signature (ECDSA P-256 / SHA-256, om/tls `ecdsa_verify_raw`), deny |
| 35 | list, replay (the SHA-256 of the signed bytes already stored, so a malleated signature is a replay |
| 36 | too), then the kind. Volume is counted, not refused: signed messages (after the signature and replay checks) per key and in all, and |
| 37 | refusals, per hour; when a count first passes its threshold (150 per key, 3600 in all, 3600 |
| 38 | refusals) 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 |
| 40 | ago, for the same part and compiler, and each job is used once. A key counts once per part: the |
| 41 | first counted result; later ones are stored and answered `duplicate`. Nothing a runner sends is |
| 42 | executed, compiled or used as a path; every file name built from a message is lowercase hex of |
| 43 | fixed length. |
| 44 | |
| 45 | ## Two roots |
| 46 | |
| 47 | The record store, `INTERPLANE_COMMUNITY_DIR` (production `~/forge-data/community/`, writable by the |
| 48 | server): `keys/<key id>`, `jobs/<job id>`, `used/<job id>`, `msgs/<message id>` (all written once, |
| 49 | O_EXCL, except a key file, which is replaced on register and leave), `parts/<part>/k/<key>` (the |
| 50 | counted 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 |
| 53 | file-size limit), `writer.lock`. |
| 54 | |
| 55 | The read-only root, `INTERPLANE_COMMUNITY_PUB` (production: the host folder `~/forge-community/`, |
| 56 | outside forge-data, seen by the server at `/community/`): `dist/` (the files of `/community/join` |
| 57 | and `/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 |
| 59 | most 2048 bytes shown, escaped), shown on `/community/` under the runner count, e.g. "Both runners |
| 60 | are 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/` |
| 65 | exists. It binds `~/forge-community/` (`FORGED_COMMUNITY_PUB`) read-only at `/community` directly |
| 66 | under the sandbox's read-only root, so no path the server can write or rename leads to what |
| 67 | volunteers download or to the deny list (a read-only mount inside a writable directory would move |
| 68 | with it when that directory is renamed). The folder, its `dist/` and `deny` must be real (a link |
| 69 | stops the sandbox). On: create `~/forge-community/` (0700) with `dist/` (spark-connector `dist.sh`) |
| 70 | and an empty `deny`, create `~/forge-data/community/` (0700), deploy a build whose `community/READY` |
| 71 | exists, restart forged. Off: rename `~/forge-data/community/` and restart; nothing is deleted. |
| 72 | Without it every `/community/` page is 404 and the API answers `off`. `infra/test/sandbox.sh` checks |
| 73 | the layout with a probe (store writable; dist and deny not; `/community` cannot be renamed; moving |
| 74 | the store away and recreating `community/dist/join.sh` in it does not change the served file), a |
| 75 | mutant wrapper that binds the folder writable (caught), and a link in place of `deny` (refused). |
| 76 | It then requests every route above through forged inside the wrapper (`infra/test/sandbox-community.sh`) |
| 77 | with the live store's shapes: a part whose `k/` lists `.` or `..` last (the shape that made the live |
| 78 | forged exit 103 on 2026-11-11), empty lists, one runner, a disagreeing runner, registered and left |
| 79 | keys; 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 | |
| 83 | Decision 2026-11-11 (lead, under Drake's delegation, `briefs/decisions-20261111.md` point 2): no |
| 84 | app-level caps on the hub beyond the public edge's request-rate limiting (nginx, per address); |
| 85 | volume is watched by the alarms above and handled with the deny list. What stays is protocol: a |
| 86 | message is at most 4096 bytes (the longest valid one is under 1 KiB), clock skew 300 s (the replay |
| 87 | window of signed messages), a job is answered within 3600 s. Logs are set aside at 4 MiB so no file |
| 88 | nears forged's file-size limit (a sandbox containment limit). |
| 89 | Our own code holds no fixed table: the deny list, the directories and the salvage index are read as |
| 90 | streams; 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 |
| 96 | runner; the forge's own pin for the hub). It builds a test hub from this tree on a private port with |
| 97 | scratch data and runs every case with its negative control. |