interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / docs / OPEN-BUILDS.md

445 lines · 41250 bytes Raw Blame History Rendered
1# Open builds: the shelf of unfinished projects (Open Humanity)
2
3Drake, 2026-11-10: "people can use this as a way for them to complete their broken projects. We
4upload our projects that didn't quite get finished, or are not quite what you want yet. It's not
5ready to publish, but it's still open and we want to work on it. Radicle is the way to do it,
6through Interplane."
7
8A person signed in with a Radicle key gives the Radicle id (RID) of a project. This node seeds and
9fetches it within limits and lists it at `/open/` as open, unfinished and not verified, with its
10`rad clone` line, so other builders and their agents can pick it up and send patches over Radicle.
11
12| Part | Where it runs | What it does |
13|---|---|---|
14| `open/route.om` (in forged) | inside the forged sandbox | `GET /open/` (HTML, or JSON `interplane/open-builds/1` on `Accept: application/json`), `POST /open/` with `action=bring` (`rid`, `note`, `consent=yes`) or `action=withdraw` (`rid`); session, CSRF token and origin are checked as for every forge write; it appends one line to `<data>open/queue` |
15| `open/intake.om` (`./run.sh intake`) | its own service, outside that sandbox | reads the queue, checks every field again, asks the Radicle node (`rad seed <rid> --scope all --fetch`), keeps the free-space reserves, publishes `<data>open/list.tsv` |
16
17forged has no network and cannot run `rad`, so it only leaves a file; the intake polls that file
18once a second.
19
20## The project page
21
22JSON under names of their own: `/open.json` (the shelf) and `/open/<rid>.json` (one project) answer
23the same JSON as the page addresses do with `Accept: application/json`. Use these names from
24outside: the cache in front of forged keys on the address, so an anonymous request with only the
25Accept header can be answered with the cached HTML page (ledger L1139). The forge row carries an
26"Open builds" entry on every page.
27
28`GET /open/<rid>` shows one listed project: its row, then a snapshot of its HEAD that the intake
29took with read-only git commands: the head and its date, the last 10 commits, the top-level files
30(at most 200) and the README (`README.md`, else `README`; at most 32 KiB). JSON
31`interplane/open-build/1` on `Accept: application/json`. The snapshot is the file
32`<data>open/p/<rid>.txt`; forged cannot read a brought repository itself (its sandbox mounts only
33the curated ones). It is written when the project is listed, again when the key that listed it
34brings it again, and removed when it is withdrawn. Every line is cut at 400 bytes, control bytes
35become spaces, bytes that are not UTF-8 become `?`, and forged escapes all of it on output. git
36runs with a cleared environment and no system or user configuration; nothing from the project is
37executed. Only a project on the shelf (open, held or stored) has a page.
38
39The "Unfinished:" line, on the shelf card and on the page, is left out when the note is empty (no
40placeholder); the JSON keeps `"unfinished": ""`. The page of a project the hub stored (the
41one-command bring) ends with a developer section, `<section class="pj-dev" id="For-developers">`
42with `<dl class="pj-terms">` (the curated project page's classes): the Radicle ID, the clone line,
43the download and its SHA-256, the bringer's DID and public key in ssh form (`ssh-ed25519 AAAA...`,
44encoded in forged from the did:key, so the check command can be copied as it stands), the hub's
45key and what each signature shows and how to check it. The hub's key is the node's own DID as the
46intake read it (`rad self --did`, written as line `N` of the snapshot), never a constant in
47forged; a snapshot without that line (taken before this change, or when `rad self` did not
48answer) leaves the key out of the section and the sentence. Every value is escaped.
49
50Parts taken from the project. The page also lists submissions (`docs/SALVAGE.md`) that came from
51this project: a source whose origin field is exactly `rad:<rid>`, and an Omega part derived from
52such a source. The salvage slice publishes a derived part only after its declared example was
53reproduced, so a listed part is a verified one and links to its page and receipt; a source is
54listed as not verified. This is how work on a shelf project gets verified piece by piece: bring
55the project, submit a source from it with that origin, derive a part, verify it. The project line
56itself stays "Not verified": the list states facts, it is not a verdict on the whole project. The
57newest 200 submissions are looked at; nothing is listed while the salvage store is off.
58
59## Rules the intake enforces
60
61- Who may bring: the keys listed in `<work>/allow`, one DID a line. A line that is only `*` admits
62 every signed-in key. No file admits nobody. The file is outside the folder forged can write.
63 On interplane.io the file has carried the `*` line since 2026-11-11 (the owner's decision): the
64 shelf is open to every signed-in key, within the limits below and the operator's remove file.
65- A project already on the shelf is not fetched again.
66- Held: a public project this node already holds and seeds by its own policy (`rad inspect <rid>
67 --visibility` says public and `rad seed` lists it in its first column) is listed in state `held`
68 without any fetch, seed or change, so the node's own unfinished projects can go on the shelf.
69 Only a delegate of the project may list it: the bringing key must be a whole line of `rad inspect
70 <rid> --delegates` (the DID at the start of a line, then a space, CR, LF or the end of the
71 output). Any other key is refused with "refused: only a delegate of this project can list it from
72 this node", and a node that does not answer (or whose answer does not fit 65,535 bytes) with
73 "refused: the Radicle node did not answer; try again". So nobody can put the node's own projects
74 on the shelf under their key. Withdrawing a held
75 row only takes the row away; the repository and its seeding policy stay as they were. A
76 repository on the node that is not public, or that the node does not seed (such as the leftover
77 of the intake's own failed fetch once its refusal row is gone), is refused and never touched or
78 listed.
79- A project the node has a seeding policy for but has not fetched (`rad seed` lists it) is
80 refused and never touched; if the node does not answer that question, nothing is seeded.
81- A folder that appears after the intake's own failed fetch of a project (the node can finish a
82 fetch after `rad` was stopped at the deadline) is that fetch's leftover: the next bring of the
83 same project removes it and tries again. While the row says that fetch failed, a refusal that is
84 not about a fetch (a key that is not invited, the storage reserve before a fetch, a node that does not answer) leaves
85 the row as it is, so it cannot turn the leftover into a refusal for good; the key that asked then
86 sees the row's earlier state. This holds while the refusal row is still in the list.
87- The shelf card says: "There is no limit on how many projects one person brings and no size
88 limit. This computer keeps part of its disk free for its own work; a bring that would use that
89 part is refused with the reason (this computer is nearly full; try again later), and nothing is
90 stored."
91- No number of projects a key, none on the shelf and no size a project (decision of 2026-11-11,
92 `~/handoffs/yourtrained-cortex/briefs/decisions-20261111.md` point 2): the former 8, 200 and
93 50 MiB are alarm thresholds (below), each naming the key and the volume. 90 seconds to fetch (not
94 found: unseeded). The only refusal for room is the machine boundary, the free-space reserves
95 (below): "refused: this computer is nearly full; try again later". Abuse is handled by noticing:
96 the alarms, the remove file (a project or every project of a key) and withdrawal.
97- Withdraw: only the key that brought the project. It unseeds, removes the copy (a fetched or a stored one) and its download, and marks the row.
98- Removal by the operator: `<work>/remove`, one line each, a project (`rad:z...` or `z...`) or a
99 key (`did:key:...`), exactly (a line ending in CR LF names nothing; the file is read to 65,535 bytes and lines past that are not read, so keep it to the names that still matter). The named project, and every
100 project brought by a named key, comes off the shelf one row a pass (about one a second while the
101 queue is idle; a key with 3 projects took 3.2 s): a fetched copy is unseeded and deleted, a held
102 project is left as the node had it, the page snapshot goes, and the row stays under the bringer's
103 key in state `refused: removed by the operator`, which that key sees (a later bring by another
104 key is refused the same way, and the row then names that key). While the line stands the project
105 cannot be brought again and the key cannot bring anything, whatever the allow file says. Take
106 the line out to lift it. A `*` line names nothing. The file is outside the folder forged can
107 write, like the allow file. This is the take-down path the shelf needs before `allow` is opened
108 to every key.
109- The intake acts only on its private list (`<work>/list.tsv`). The copy in `<data>open/` is what
110 forged shows; the intake never reads it back, so a row planted there cannot get anything removed.
111- Name and description come from the project's Radicle identity document, as data: control bytes
112 and escapes become spaces, forged escapes every field on output. Any byte that does not start a
113 well-formed UTF-8 character becomes `?` (name, description, note), so the list and its JSON
114 stay valid UTF-8 even when a text is cut at its cap.
115- The list has no size limit and no row is dropped: every refusal and withdrawal row stays (a
116 later request for the same rid replaces that rid's row). The intake reads `<work>/list.tsv` a
117 row at a time (64 KiB chunks, two read slots) and writes it streamed through `list.tsv.tmp`
118 (fsync, rename), then copies the private file whole into `<data>open/` the same way; forged reads
119 the published copy a row at a time too. A row of any length is kept whole: both programs read
120 the first 4,096 bytes of each field (every field they use or show is shorter), and the intake
121 copies a row it does not hold whole straight from the file. A read or write that fails replaces
122 nothing and the intake says so on stderr; the old list stays whole. The list is bounded by the
123 free space of the work dir's filesystem (a write needs room for one more copy). `list_bytes`
124 alarms at 209,715 bytes (80 percent of the former 262,143-byte read buffer) and `list_row_bytes`
125 at a row of 4,096 bytes or more (the intake writes at most about 900). The gate runs a 1.2 MB list
126 with a 70,000-byte row through two refusals, a withdrawal and a bring (every other row kept byte
127 for byte), forged lists every shelf row of it, and a mutant that reads only the former 262,143
128 bytes cuts it. The HTML shelf and JSON shelf stream chunked in complete-row batches (no
129 pagination); neither response is bounded by forged's 8 MiB body buffer. A read/send failure
130 closes without a final chunk, so clients detect an incomplete response rather than accepting
131 a prefix. HTML keeps its layout/translation hints and `format=text`. The gate plants 10,000
132 rows whose JSON and escaped HTML each exceed 8 MiB and checks every row in order, plus a mutant
133 that accumulates the shelf in the old body buffer again.
134- Once the intake has read the queue to its end past 256 KiB, it renames it to `queue.old`, waits
135 a second, handles any line written during the rename, removes it and starts again at offset 0;
136 forged creates a new queue at the next request. forged has no queue cap: the queue is not a
137 buffer of either program (the intake reads it 64 KiB at a time from a stored offset), so its
138 growth is bounded by the data reserve, and `queue_bytes` alarms at the former 1 MiB.
139- The queue, a spool `.b64` and a `.sig` are opened O_NONBLOCK|O_NOFOLLOW and read only when
140 fstat says they are regular files: a FIFO planted for one of them is skipped and the pass goes on
141 (sweep and takedown included).
142
143## What it does not do yet
144
145- The project page is a snapshot, not a browser: one README, the top-level file names and ten
146 commits. Folders, file contents, history and patches are read with `rad clone`. The snapshot is
147 as old as the last bring by its lister.
148- The project as a whole is never called verified. A receipt for a whole project needs a
149 definition first; what the page shows is each verified part taken from it (above).
150- Nothing from a brought project is executed, compiled or opened by this node; it is stored git
151 data.
152- The open folder is forged's (its sandbox can write `<data>`), so the intake never writes,
153 renames or removes anything there through a path. It opens `<data>open`, and in it `up/`, `a/`
154 and `p/`, itself with O_DIRECTORY|O_NOFOLLOW, makes that folder its working directory (fchdir)
155 and then names only a file inside it. A link planted for one of those folders is refused and
156 nothing is written; a link planted for a file is replaced by the rename of the temp file
157 (created O_EXCL|O_NOFOLLOW), never followed. The queue, the spool and the signature are read the
158 same way, never through a link. Every program the intake starts runs in `/`. The gate plants
159 each of these links (`open/tests/up.sh` part 9) and mutants without the checks overwrite the
160 outside files.
161- Known limit, same class as the salvage collector's: `<data>` is writable by the sandboxed
162 server, so a compromised server could queue requests under any DID (it is the authenticator).
163 It cannot make the intake remove or unseed a repository the intake did not bring, nor write
164 outside the open folder.
165- Known limit, same class: the bring statement carries no nonce or time, so a compromised server
166 that kept a `.b64` and `.sig` pair can queue it again after its bringer withdrew the project, and
167 the intake publishes it again (a new repository, under the same key, within that key's 8). The
168 bringer can withdraw it again; the operator's remove file (the key, or the new project) keeps it
169 down.
170
171## One-command bring and get (hub side)
172
173Contract: `~/handoffs/yourtrained-cortex/briefs/one-command-contract.md` (slice HUB). A person's
174program (`interplane bring`, slice TOOL) makes an Ed25519 key on their machine, signs in like every
175forge sign-in, uploads a canonical ustar archive and signs a five-line bring statement. The hub
176checks it, creates the Radicle repository with its own key and lists it in state `stored`.
177
178What forged does (inside its sandbox; it decodes, unpacks and runs nothing it is sent):
179
180| Request | Answer |
181|---|---|
182| `POST /open/up` `action=chunk`, `sha` (64 lowercase hex), `seq` (from 0), `data` (base64url, no padding) | the same write gate as every forge write (session, CSRF field, Origin, the 30 writes a minute per IP and per key, the store); signed out is 403 here, not a redirect. 200 `next <n>`; 409 `next <n>` when seq is not the next one or the upload was finished; 503 with the reason when there is no room by the intake's measure (below); 400 for a bad field; 503 when the spool cannot be written. Text bodies |
183| `POST /open/up` `action=finish`, `sha`, `files`, `bytes`, `name` ([a-z0-9-], 1 to 64, no leading, trailing or double `-`), `note` (optional, as the bring note), `consent=yes`, `sig` (armored SSH signature) | 200 `queued <sha>`; 409 `next <n>` when fewer bytes than `bytes` arrived; 400 when more did or a field is bad; 503 with the reason when there is no room; 404 when the key has no such upload; a second finish answers `queued` again and queues nothing |
184| `GET /open/up/<sha>.json` | the signed-in key's upload: `{"schema":"interplane/open-upload/1","state":...,"rid":...,"page":...}`; `receiving` (chunks only), `queued` (finished), then the intake's file (`stored` with rid and page, or `refused: <reason>`); 403 signed out, 404 for no upload of that archive under this key |
185| `GET /open/<rid>.tar` | `<data>open/a/<rid>.tar` for a row on the shelf, `application/x-tar`, `attachment; filename="<name>.tar"`; 404 when there is none |
186| `GET /open/alarms.json` | `<data>open/alarms.json` as the intake wrote it |
187| `GET /bring.sh`, `GET /get.sh`, `GET /withdraw.sh` | `<data>open/tools/bring.sh`, `get.sh` and `withdraw.sh` as they are (the TOOL release writes them); 404 when absent |
188
189forged writes only under `<data>open/up/`: `<sha>.<didhash>.b64` (didhash: the first 8 bytes of
190sha256 of the DID, in hex, so a key only ever appends to its own spool; one line a chunk: the
191data, a tab, seq and the running byte total as 20 digits each, so every 64-bit count fits; the
192former 10 digits wrapped at 10^10 bytes), `<sha>.<didhash>.sig` at finish,
193and one queue line `U <tab> sha <tab> did <tab> files <tab> bytes <tab> name <tab> note`.
194A chunk or queue line that is written only in part (a full disk) is cut back to the file's size
195before the write and answered 503, so no fragment joins the next line.
196The shelf JSON and the page JSON carry `stored_by_hub` (true for a stored row), `download`
197(`"/open/<rid>.tar"` or null) and `download_sha256` (from `<data>open/a/<rid>.sha256`, or null).
198A stored row on the shelf says: "Stored on Radicle by the Interplane hub: the hub's key signed the
199Radicle record. The person who brought it signed the list of files."
200
201What the intake does with a U line (outside the sandbox, in this order; every refusal writes the
202status file `<data>open/up/<sha>.<didhash>.json` and removes the spool and scratch):
203
2041. Checks every field again (sha 64 hex, did printable, files and bytes decimal, name with
205 forged's rule: [a-z0-9-], 1 to 64 bytes, no `-` first, last or twice in a row; note without
206 control bytes, exactly seven fields). A line that breaks a rule is ignored.
2072. The remove file (`refused: removed by the operator`) and the allow file. No number a key, on
208 the shelf or a project. The list must have room for the row (above). The storage filesystem
209 must keep its reserve after four times the archive's size (the decoded copy, the unpacked tree,
210 the git objects, the Radicle copy): else "refused: this computer is nearly full; try again later"
211 and the `reserve_refused` alarm names the key and the bytes asked for.
2123. Decodes the spool record by record (each record's seq and running total must match), checks the
213 byte count (`refused: wrong archive byte count`) and the sha256 (`refused: wrong archive sha256`).
2144. Copies the spool's signature into `<work>bring.sig`, writes the statement and an
215 allowed-signers line built from the DID into the work dir and runs `env -i PATH=/usr/bin:/bin
216 /usr/bin/ssh-keygen -Y verify -f <work>signers -I forge-user -n interplane-bring -s
217 <work>bring.sig` with the statement on stdin (`refused: bad bring signature`). The DID must be
218 canonical base58 (no `1` right after `z`, as forged's sign-in requires), so one key has one DID
219 string for its quota and the remove file.
2205. Reads the whole archive once without writing anything: ustar headers with magic `ustar\0` and
221 version `00`, type `0` only (no link, symlink, device, directory or extension entries), mode
222 0644 or 0755, uid, gid and mtime 0, empty uname, gname, linkname and device fields, a correct
223 checksum, zero padding, paths (prefix rule) of 1 to 255 bytes with no empty, `.` or `..`
224 component, no leading `/`, no control byte, in strictly increasing byte order (so no duplicate),
225 the `files` count, two zero blocks and nothing after them (`refused: archive is not canonical
226 ustar`). A component named `.git` in any case is `refused: the archive holds a .git folder`. A
227 file holding `-----BEGIN` and then `PRIVATE KEY-----` on the same line (also across 512-byte
228 blocks) is `refused: the archive holds a private key`.
2296. Unpacks into `<work>upload-tree/` (a fresh folder; files created exclusively, mode kept), writes
230 `.interplane/brought.txt` (the statement, then one line per file: sha256, bytes, path) and
231 `.interplane/brought.sig` (the person's signature as sent).
2327. git, with the git dir `<work>upload.git` outside the tree: `env -i GIT_CONFIG_NOSYSTEM=1
233 GIT_CONFIG_GLOBAL=/dev/null GIT_ALLOW_PROTOCOL=file GIT_NO_LAZY_FETCH=1 GIT_TERMINAL_PROMPT=0
234 PATH=/usr/bin:/bin HOME=<work> GIT_AUTHOR_NAME=<did> GIT_AUTHOR_EMAIL= GIT_COMMITTER_NAME=Interplane
235 hub GIT_COMMITTER_EMAIL= /usr/bin/git -c core.hooksPath=/dev/null -c commit.gpgsign=false
236 --git-dir=... --work-tree=...` then `init --bare --template= --initial-branch=main`, `add --all
237 --force -- <tree>`, `commit --no-verify -m "Project brought through Interplane"`.
2388. `rad init --public --no-confirm --name=<name> --description=<note, else "Project brought through
239 Interplane"> --default-branch main <work>upload.git` (name and description one argument each,
240 so a note that starts with `-` is never read as an option) as the node's user (the same `env -i HOME
241 PATH` as every rad call); the RID is the `rad:z...` in its output (`refused: repository creation
242 failed` otherwise). rad init seeds it.
2439. The row in state `stored` (kilobytes from du of the storage folder, the name, the note), the page
244 snapshot and the download (below), the status `stored` with rid and page, then removes the spool
245 and scratch. The status file stays (so the program can read it); a new upload of the same
246 archive by the same key removes it at its first chunk. The intake is built with the SHA-256 unit
247 `om/tls/sha2.om` of omega-mv composed in front of `open/intake.om` (`./run.sh intake`).
248
249Nothing from the archive is executed, built or opened by anything but the parser and git; the gate
250plants a Makefile, an executable `hooks/post-checkout` and `configure` that would touch a marker,
251and the marker stays absent.
252
253Withdraw and take-down treat a stored row as a fetched one: `rad unseed`, remove the storage
254folder, the snapshot and the download; a withdrawn row keeps its name.
255
256Downloads: for every row on the shelf (open, held, stored) the intake runs `git archive
257--format=tar HEAD` with the snapshot's environment and its stdout on a pipe. The intake counts,
258hashes and copies the bytes into `a/<rid>.tar.tmp` (created O_EXCL|O_NOFOLLOW in the `a/` it
259opened itself, above). It stops when the open dir's filesystem would go below its reserve (the
260free bytes measured just before, minus OPEN_RESERVE_DATA_BYTES, while the archive is written; no
261size limit), after 30 s, or when git fails; then git is stopped and the row has no download
262(`download` and `download_sha256` are null). Else the old hash is removed, the temp file is renamed
263onto `<rid>.tar` and the hash written to `<rid>.sha256`. It is written when a row is listed or
264refreshed, and for every shelf row at each intake start.
265
266No network for git: every git command the intake runs (snapshot, archive, init, add, commit) has
267`GIT_ALLOW_PROTOCOL=file GIT_NO_LAZY_FETCH=1 GIT_TERMINAL_PROMPT=0` beside `GIT_CONFIG_NOSYSTEM=1
268GIT_CONFIG_GLOBAL=/dev/null`. The gate builds a partial clone whose blob is missing and whose
269promisor remote is a listener on a private port; snapshot and archive fail cleanly and the
270listener counts 0 connections. Without the environment (a mutant) git connects.
271
272### Free-space reserves (the machine boundary)
273
274The only refusal for room on intake. Two settings, in `<work>reserve` (outside the folder forged
275can write; one `NAME=digits` line each; a missing file or a malformed line keeps the default):
276
277| Setting | Default | Filesystem | Reasoning (measured 2026-11-11) |
278|---|---|---|---|
279| `OPEN_RESERVE_STORAGE_BYTES` | 100,000,000,000 | the one holding the Radicle storage (and, on the Spark, the work dir and the hive builds): `/`, 4,031,871,553,536 bytes | 283,988,869,120 bytes free at 14:31:10Z (7 percent). It fell from 293 GB at 12:49Z and 287 GB at 14:08Z, about 6.4 to 7.8 GB an hour, all hive builds (Radicle storage is 1.04 GB in all). 12 hours at the faster rate is 94 GB; rounded up. The `storage_free_bytes` alarm fires at twice it (200 GB), about 12 hours before refusals at that rate. Measured again at 16:22:52Z: 191,542,358,016 bytes free, 92 GB used in 1 h 52 min (about 50 GB an hour, hive builds); at that rate the alarm already fires and refusals start in about 2 hours, so the rate, not the reserve, is what needs a person now. **What it protects:** everything else on that filesystem, the live sites (forged and the site trees it serves), the Radicle storage and the hive builds; a bring never takes the last 100 GB from them. **Today's swing (2026-11-11):** free space moved between 178 and 184 GB within minutes (16:24-16:29Z), and 92 GB was lost between 14:31 and 16:22Z. `~/handoffs/BOARD.md` has no DiskAlarm report (checked 17:04Z); its nearest basis is the disk emergency of 15:07:01Z and 15:08:42Z: one runaway pipeline took free space from 268 to 155 GB at about 514 GB an hour (by df, 182 GB at 15:03:10Z to 155 GB at 15:06:19Z), so a single fault can use 100 GB in about 12 minutes. The reserve is the floor that keeps the sites and Radicle writing while a person looks; the `storage_free_bytes` alarm at twice it is the signal to look. |
280| `OPEN_RESERVE_DATA_BYTES` | 1,073,741,824 | the one holding `<data>` (the spool `open/up/`, the downloads `open/a/`, forged's logs and stores): `~/forge-data`, its own 8,350,298,112-byte filesystem | 6,821,240,832 bytes free at 14:31Z. forged's log grew 43.6 MB in 18 hours (about 58 MB a day; 325 MB of logs, 1.47 GB of download cache in all), so 1 GiB is about 17 days of the log at that rate, 13 percent of the filesystem: room for forged and the site to keep running after uploads stop. `data_free_bytes` fires at twice it. |
281
282Where each is checked:
283- intake, upload (U line): free(storage) − 4 × the archive's bytes ≥ the storage reserve, before
284 anything is decoded.
285- intake, fetch (B line): free(storage) ≥ the storage reserve before `rad seed`, and again after
286 the fetch (if it crossed: unseeded and removed, a failed fetch).
287 What one fetch can write is bounded by radicle-node itself, and that bound is part of this
288 design: `node.limits.fetchPackReceive` is `500.0 MiB` in `~/.radicle/config.json` on the Spark
289 (radicle-node 1.10.3, with `fetchConcurrency` 1 and `fetchTimeout` 30 s; read 2026-11-11), so a
290 single fetch can take at most about 500 MiB, 0.5 percent of the storage reserve. This is NOT a
291 total repository limit or a lifetime reserve guard: a repository seeded with scope all keeps
292 fetching from peers after it is listed. The storage reserve is not checked for those later
293 fetches; only the `storage_free_bytes` alarm notices their consumption. Keep that setting far
294 below the reserve (at most a tenth of it) and record any change here. This was chosen over
295 watching free space during the fetch: the node does the writing, in its own process, and can
296 finish a fetch after the intake has stopped `rad` at its 90 s deadline, so a watch inside the
297 intake would not see those writes, while the node's limit holds for every fetch however it was
298 started; the check after the fetch still unseeds and removes one that crossed the reserve. A
299 project whose pack is larger than 500 MiB cannot be fetched by this node (a failed fetch); that
300 is radicle's limit, kept (no-hard-caps point 5, containment of outsiders).
301- intake, download: when HEAD has moved, the stale download (`<rid>.tar`, `.sha256`, `.head`) is
302 removed first, then the archive stops at free(data) − the data reserve, so the old and the new
303 file never take room together and free space stays at or above the reserve (gated with a
304 deterministic stand-in for dfree: a 200 MiB old tar in a modeled 300 MiB data filesystem, 64 MiB
305 reserve; a probe checks old tar + temp bytes at every write; the add-back mutant crosses the
306 reserve). It is made from the commit `git rev-parse
307 HEAD` names, recorded in `<rid>.head`; while `<rid>.tar` and `<rid>.sha256` are regular files and
308 `<rid>.head` names the commit HEAD is at, the download is current and is not made again (a second
309 bring line of the lister and every pass of the intake cost one `git rev-parse`, not an archive).
310- forged, every write under `open/` (a chunk, the signature and U line at finish, a B or W line):
311 forged cannot measure free space itself. The pinned omc (omega-mv f4df8239, sha256 3ad9f10f...)
312 has no statfs/fstatfs host word (OMEGESE section 10 lists fstat, stat and lstat only); the
313 sandbox's seccomp filter would allow the call. So the intake writes `<data>open/space`
314 (`free <bytes> reserve <bytes> at <ns>`, by wr, in the pinned open dir) at start, at every alarm
315 pass and after each download. forged opens it O_NOFOLLOW|O_NONBLOCK, requires a regular file of at
316 most 80 bytes, parses it strictly (digits only, 1 to 19 each) and counts the bytes it wrote
317 since that measure (a new `at` starts the count again). It refuses a write that would leave less
318 than the reserve: 503 "this computer is nearly full; try again later". No file, or a malformed
319 one: a chunk or finish gets 503 "the hub is not ready to take files; try again later"; a B or W
320 line (at most 400 bytes) is still queued when there is no file, and refused when the file says
321 there is no room. The folder is forged's own, so this is advisory for forged only; the intake's
322 checks above are the guard.
323- **Request for the omega-mv lane:** a `statfs`/`fstatfs` host word (Linux AArch64 syscalls 43
324 and 44, the 120-byte `struct statfs`), so forged can measure the data filesystem itself and the
325 space file can go.
326
327### Alarms
328
329No-hard-caps point 5: a measurement beside each former cap and each buffer. Nothing here refuses
330anything. Measured after every intake pass that did something, at start, and at least every 60
331passes (about a minute when idle); the queue is also measured before each pass.
332`<work>alarms.txt` holds one line per firing alarm (`name <tab> value <tab> threshold <tab> source
333<tab> key <tab> volume_bytes`; the key is `-` when the alarm names none), the same lines go to
334stderr (the journal) under an `ALARM` line, and `<data>open/alarms.json`
335(`interplane/open-alarms/1`) lists every check with `key` (or null), `volume_bytes` and `firing`.
336
337| Alarm | Fires at | Measures | Key, volume |
338|---|---|---|---|
339| `key_shelf_rows` | 8 or more | the most rows this intake fetched or stored for one key | that key, the KiB of its rows |
340| `shelf_rows` | 200 or more | rows on the shelf (held too) | the key with the most rows, the KiB of the shelf |
341| `largest_project_kib` | 51200 or more | the largest row | its key, its bytes |
342| `queue_bytes` | 1048576 or more | `<data>open/queue` | -, the bytes |
343| `spool_bytes` | 1073741824 or more | all files in `<data>open/up/` (lstat) | -, the bytes |
344| `rad_seed_output_bytes` | 52428 or more | the output of `rad seed` (no arguments) | the intake's 65,535-byte command buffer (policy() answers "node did not answer" at or above it; live 2026-11-11: 9,022 bytes for 93 rows, the edge near 690 seeded repositories) |
345| `storage_free_bytes` | 2 × OPEN_RESERVE_STORAGE_BYTES or less | free bytes of the storage filesystem | -, the reserve |
346| `rad_delegates_output_bytes` | 52428 or more | the largest `rad inspect --delegates` output seen by this process | the same 65,535-byte buffer |
347| `data_free_bytes` | 2 × OPEN_RESERVE_DATA_BYTES or less | free bytes of the open dir's filesystem | -, the reserve |
348| `list_bytes` | 209715 or more | the private list's bytes (no size limit: read and written a row at a time) | -, the bytes; the threshold is 80 percent of the former 262,143-byte read buffer |
349| `list_row_bytes` | 4096 or more | the longest row of the private list (the intake writes at most about 900 bytes) | -, its bytes; every row is kept whole, the intake and forged read the first 4,096 bytes of each field |
350| `reserve_refused` | while the last reserve check refused (until a later check finds room) | free bytes then, against the reserve | the key refused, the bytes it asked for |
351
352### Caps met (no-hard-caps point 6)
353
354| Where | Number | What it is | What was done |
355|---|---|---|---|
356| projects a key (intake) | 8 | an arbitrary shelf number | removed (2026-11-11); `key_shelf_rows` alarm |
357| projects on the shelf (intake) | 200 | an arbitrary shelf number | removed; `shelf_rows` alarm |
358| size of a project (intake fetch, upload, decode, download; forged chunk and finish 413) | 50 MiB | an arbitrary shelf number | removed; `largest_project_kib` alarm; the reserves bound it |
359| forged's queue | 1 MiB | not a buffer (read 64 KiB at a time from an offset) | removed; `queue_bytes` alarm; the data reserve bounds it |
360| free space | the two reserves | the machine boundary | kept, stated and measured (above); refusal with the reason; alarms at twice each |
361| the intake's list read buffer (and forged's) | 262,143 bytes | a fixed buffer holding the whole list; past it the list was cut without a word | removed (2026-11-11): both read the list a row at a time in 64 KiB chunks and the intake writes it streamed through a temp file; no size limit; gate at 1.2 MB with a 70,000-byte row, and a mutant cut at 262,143 bytes is caught; `list_bytes` and `list_row_bytes` alarms |
362| the "shelf list is full" refusal (`lfits`) | 262,143 − 900 bytes | kept new rows inside that buffer | removed with the buffer |
363| refusal and withdrawal rows in the list (`keep`) | 65,536 bytes, oldest dropped | kept the list under that buffer | removed with the buffer; every row stays (retention tests) |
364| forged's list scans (shelf page, `/open.json`, project page) | 4,096 rows | a loop bound: past it forged trapped | removed: a scan is bounded by the file |
365| the intake's output buffer `ob` in a stream | 524,288 bytes | a write buffer | the list is written through it streamed (flushed when full); outside a stream (snapshot, status, alarms) it still holds one small file and drops past it: not changed in this slice |
366| forged's reply buffer `fob` for `/open/` and `/open.json` | 8 MiB | a whole-response buffer; an overflowing shelf answered 500 | removed as a response limit: both URLs now stream chunked, in complete-row batches through `fob`; no pagination or whole-response allocation. A read/send failure closes without the final HTTP chunk (never a successful prefix). Other routes retain their existing buffer behavior. Gated with 10,000 rows, HTML and JSON each past 8 MiB, every row in order, and a mutant that fills `fob` again. |
367| the spool's running total | 10 digits | a format width that wrapped at 10^10 bytes | widened to 20 digits (every 64-bit count) |
368| one fetch (radicle-node `fetchPackReceive`) | 500 MiB | radicle's own limit | kept (point 5); recorded as part of the reserve design (above) |
369| the intake's command buffer `cb` | 65,535 bytes | a real buffer of our own (point 1 would remove it) | not changed in this slice; two alarms |
370| forged's per-IP and per-key write limits | 30 a minute | edge rate limiting | kept (decision 2) |
371| forged's sandbox limits | nproc 256, as 4 GiB, fsize 1 GiB, nofile 1024 | containment of untrusted input | kept (decision 2) |
372
373## Install on the Spark (after review)
374
375```sh
376C=$(git rev-parse --short=8 HEAD); D=$HOME/.local/lib/interplane-open/$C
377mkdir -p "$D" "$HOME/forge-open-work" && chmod 700 "$HOME/forge-open-work"
378INTAKE_OUT="$D/open-intake" ./run.sh intake
379ln -sfn "$D" "$HOME/.local/lib/interplane-open/current"
380rad self --did > "$HOME/forge-open-work/allow" # the owner's key only; add DIDs, or one line * for everyone
381cp infra/spark/interplane-open-intake.service ~/.config/systemd/user/
382systemctl --user daemon-reload && systemctl --user enable --now interplane-open-intake.service
383```
384
385The reserves keep their measured defaults unless `~/forge-open-work/reserve` names others, for
386example `printf 'OPEN_RESERVE_STORAGE_BYTES=100000000000\nOPEN_RESERVE_DATA_BYTES=1073741824\n' >
387~/forge-open-work/reserve`; the intake reads the file at every check. The forged built from this
388tree takes upload chunks only once the intake has written `<data>open/space`, so start (or keep)
389the intake service before or with the new forged.
390
391The page is served by any forged built from a tree that holds `open/READY` and `salvage/READY`.
392Undo: `systemctl --user disable --now interplane-open-intake.service` (the page stays, requests
393queue and nothing is fetched); remove `open/READY` and rebuild to remove the page. Projects already
394brought stay seeded until withdrawn.
395
396Gate for the one-command bring: `./run.sh check-open-up` (`open/tests/up.sh`, ports 19880 and 19882 by default)
397ends with `RESULT pass=N fail=0` (N in the gate log of the commit). It runs a test copy of forged
398and the intake against a stand-in `rad` whose `init` clones the scratch git dir into a throwaway
399storage folder and prints a RID: a good upload end to end (row, commit, brought.txt and its
400signature, shelf and page JSON, download), every refusal (bad signature, wrong sha256, wrong byte
401count, wrong file count, `..`, absolute path, symlink, device, duplicate and unsorted paths, a
402private key, also across blocks, `.git` in any case, an out-of-order seq, a POST
403without a session, a wrong CSRF token, a foreign Origin, another key's spool, a removed key, a key
404that is not invited, hostile queue lines), an upload into a 1 MiB list (four times the former read buffer, every row kept and listed),
405the ninth project of a key and the 201st on the shelf
406and a 60 MiB project all stored with their alarms naming the key, withdraw and the remove file,
407a Makefile, `hooks/post-checkout` and `configure` that are never run, the partial clone with a
408counting listener, a probe under `infra/spark/forged-sandbox.sh` that cannot write the work dir,
409each alarm at its threshold and one below it with the upload still stored, links planted in the
410open folder (`a/<rid>.tar`, `.sha256` and `.tar.tmp` to outside files; `a/`, `p/`, `up/` and
411`<data>open` itself to outside folders; `alarms.json` and `list.tsv` to outside files), a
412download that would cross the data reserve (none, page JSON null) beside one within it, and with
413room one past the former 50 MiB, a non-canonical DID of the same key, a note `--private` and
414signed names that break the name rule, forged's room (no room, seven malformed space files, a
415linked and a FIFO space file, no file, a B line without room, a stale measure that forged's own
416count refuses), the storage reserve on a tmpfs crossed (refused with the reason, nothing written,
417the alarm naming key and volume) and kept (stored), a fetch under the reserve, a FIFO as the queue,
418a `.b64` and a `.sig` with a takedown in the same pass; then mutants of the intake (signature,
419sha256, byte count, `..`, empty component, entry type, path order, key scan, `.git`, remove
420check, the no-network environment, an alarm threshold, the folder check (a/, p/ and up/), the open
421dir check, the temp file and rename of the download, the data reserve in the download, the
422storage reserve, the old 8-a-key cap, a list read cut at the former 262,143 bytes, the regular-file check, canonical base58, the one-argument
423`--description=`, the name rule) and of forged (seq check, write gate, per-key spool, the space
424file ignored, stored rows on the shelf), each of which must show the failure. The end-to-end runs
425with forged in its real sandbox and the real `rad` in a throwaway HOME are
426`~/handoffs/open-builds/e2e-one-command.sh <tree>` and `e2e-tool-<head8>.sh <tree>`.
427The gate also checks the project page of a stored project (the developer section, the bringer's
428key as the page shows it verifying `brought.sig` and the page's check command run as written, a
429hostile hub-key line escaped, with a mutant that drops that escape) and the empty `Unfinished:`
430label left out on the card and the page. No outcome depends on timing: a POST answered 429 by
431forged's write limits waits (Retry-After, else to the next minute) and is sent again, except in
432the case that tests the limit. `FORGED_CPUS` names the cores (or `off` for no taskset);
433`UP_TEST_PORT` and `UP_TEST_LISTEN_PORT` move the two ports, and the gate stops when either is
434already in use.
435
436Gate: `./run.sh check-open` (`open/tests/run.sh`) ends with `RESULT pass=287 fail=0`. Part 1 runs
437the intake against a stand-in `rad` in a throwaway HOME; part 2 runs the page in a test copy of
438forged with a throwaway key; thirty mutants (no sweep for the remove file, no remove check on a bring, a held project deleted on removal, a .json name that is ignored, no origin check for a part, an unpublished draft listed as a verified part, no control-byte pass in the snapshot, a snapshot kept after withdraw, no escape on the project page, no shelf check for the page, no allow check, a held row treated as fetched,
439no delegate check for a held row, no end-of-key check in the delegate match, no start-of-line
440check in the delegate match, the old 8-a-key cap put back, no first-column check in the policy
441match, no end-of-rid check in the policy match, no
442visibility check, no policy check for a held row, list read from the published copy, no owner
443check on withdraw, no policy check, no leftover rule, refusals that replace the failed-fetch row,
444no UTF-8 pass, a list read cut at the former 262,143 bytes (in the intake and in forged), no queue
445rotation, no HTML escape) must each show the failure.