interplane-forge
INTERPLANE Forge
Brought by drakestapleton
interplane-forge / README.md
| 1 | # INTERPLANE Forge web (`forged`) |
| 2 | |
| 3 | Agents express intent. The forge retains authority. |
| 4 | |
| 5 | `forged` is the web layer of INTERPLANE Forge: one seeded-Omega HTTP server that shows the public |
| 6 | Radicle repositories of this node the way a code forge does: explore, repository home, tree / blob / |
| 7 | raw, source archives (zip, tar.gz), releases, Radicle patches and issues, stars, favorites, follows |
| 8 | and Radicle-key sign-in. Pages are server-rendered HTML and CSS; there is no JavaScript. Every page |
| 9 | wears the interplane.io header and footer (one site): `./run.sh units` generates them at every build from the |
| 10 | site's own source with `server/chromegen.om`, and `server/tests/sitechrome.sh` checks the result. |
| 11 | Projects (the link to `/explore`) is marked current; forge controls remain a separate row. The |
| 12 | three-column footer keeps its site structure around forge-specific fine print. The decorative rope |
| 13 | band outside the site's footer is not copied. Header/footer rules include responsive and Strand-system |
| 14 | overrides, including the sticky header and primary button. The dark navy palette comes from the |
| 15 | generated site `:root`; forge aliases refer to its tokens, not a second palette (only the favicon and |
| 16 | the two diff-row tints keep their own values). The galaxy tokens asset is only routed on the root |
| 17 | base, not under /forge/, so forge.css stays self-contained for both bases. visits/visits.css |
| 18 | already reads galaxy/tokens.css and needs no separate palette. |
| 19 | |
| 20 | The same server is reached at `https://interplane.io/` and `https://www.aienos.com/forge/`. The edge |
| 21 | (nginx on the hub, through the spark→hub tunnel) sends `X-Forge-Base: /` or `X-Forge-Base: /forge/`, |
| 22 | and every link, form action and redirect is built from it. |
| 23 | |
| 24 | What works and what does not: `docs/FEATURES.md` (one row per feature, honest status). |
| 25 | How the pieces fit together: `docs/CONTRACT.md`. What replaces the GitHub annoyances: `docs/ANNOYANCES.md`. Edge deploy: `infra/DEPLOY.md`. |
| 26 | |
| 27 | ## Layout |
| 28 | |
| 29 | | Dir | Owner | Content | |
| 30 | |---|---|---| |
| 31 | | `server/` | ForgeServer | request parsing, routing, layout, explore / profile / search, allow-list, seams | |
| 32 | | `browse/` | ForgeBrowse | repo home README, tree, blob, raw | |
| 33 | | `dl/` | ForgeDownloads | archives, releases, clone panel | |
| 34 | | `collab/` | ForgePatches | Radicle patches and issues (read-only) | |
| 35 | | `social/` | ForgeSocial | sign-in, sessions, stars, favorites, watch, follows | |
| 36 | | `infra/` | ForgeInfra | service supervisor, tunnel, nginx, smoke tests | |
| 37 | | `quiet/` | simplify (L1008 D) | one digest per subscriber, patch evidence receipt | |
| 38 | | `door/` | AgentDoor | the public event stream (`events.json`) and the feed page; `agents.json` is `server/agents.om` | |
| 39 | | `docs/` | shared | CONTRACT.md, FEATURES.md, ANNOYANCES.md | |
| 40 | |
| 41 | ## Build and run (on spark) |
| 42 | |
| 43 | ``` |
| 44 | ./run.sh units # list the units in compose order |
| 45 | ./run.sh seams # tests only: the same list with every slice as its seam server/no<slice>.om |
| 46 | ./run.sh build # compose and compile with the pinned omc -> server/forged (clean tree only) |
| 47 | ./run.sh deploy # build HEAD in a fresh git worktree, install server/forged, log it in infra/DEPLOY.md |
| 48 | ./run.sh start | stop | status | reload |
| 49 | ``` |
| 50 | |
| 51 | - Live deploys only from a commit: `./run.sh deploy [commit]`, then `pkill -x forged` (the |
| 52 | supervisor restarts it), then commit the `<UTC> <commit> <sha256>` line it appended to |
| 53 | `infra/DEPLOY.md`. `./run.sh build` refuses to write `server/forged` while `git status --porcelain` |
| 54 | is non-empty; trial builds write elsewhere with `FORGED_OUT`. |
| 55 | |
| 56 | - Compiler: omega-mv `seed/out/omc` at spark `~/work/flux/omega-mv`; run.sh refuses any omc whose |
| 57 | sha256 differs from the pin in run.sh. |
| 58 | - A slice dir is composed only when it holds a `READY` file; otherwise its seam |
| 59 | `server/no<slice>.om` is used and its routes answer 501 "Coming soon". Trial-compose an unready |
| 60 | slice with `FORGE_TRY="<dir> ..." FORGED_OUT=/tmp/x.try ./run.sh build`. |
| 61 | - The service runs as the systemd user unit `interplane-forged.service` (`infra/spark/`), whose |
| 62 | supervisor is `infra/spark/forged-service.sh` on cores 4-5 at nice 10, listening on |
| 63 | `127.0.0.1:18480` only. The supervisor restarts forged if it exits; systemd restarts the supervisor. |
| 64 | - `./run.sh reload` (or SIGHUP to the supervisor) touches `~/forge-data/reload`; forged then re-reads |
| 65 | the allow-list and the social log without a restart. |
| 66 | - Store-reading build (interplane-native DESIGN.md step 2, not deployed): |
| 67 | `FORGE_STORE=<store root> FORGED_OUT=<path> ./run.sh build` (optionally |
| 68 | `FORGE_CLONE_BASE=https://<host>/<path>/`) reads the project list from the store's `catalog.tsv` |
| 69 | and Git from `projects/NAME/repo.git` (`store/`, docs/CONTRACT.md section 1); `deploy` and |
| 70 | `restart` refuse it. Acceptance: `bash store/tests/compare.sh STORE KEY IPL_DIR`. |
| 71 | On the repository home, the store clone panel names the displayed commit: |
| 72 | `git clone --no-checkout <url> <name> && git -C <name> checkout --detach <40-hex>`. |
| 73 | Its ZIP and tar.gz links use `/<owner>/<repo>/archive/commits/<40-hex>.zip|.tar.gz`. |
| 74 | That address is answered by the public Git edge (`infra/bazinga/omega-read`), not forged's |
| 75 | `dl/dl.om`: only full lower-case commit IDs reachable from a public head or tag are accepted. |
| 76 | The old `/archive/refs/heads/<branch>` addresses remain branch archives; forged's |
| 77 | `/archive/<sha>` still redirects only when a canonical head or tag points exactly at that commit. |
| 78 | Checks: `bash store/tests/pinned-clone.sh` and `bash dl/tests/pinned-archives.sh` (private fixtures). |
| 79 | |
| 80 | ## Data |
| 81 | |
| 82 | - Repositories: Radicle storage `~/.radicle/storage/<RID>`, read with `git` (argv exec, no shell). |
| 83 | Only the 28 rows of the public table in `~/handoffs/radicle/RIDS.md` exist; everything else is 404. |
| 84 | `server/repos.om` `fdeny` refuses the withdrawn private projects and their RIDs |
| 85 | even if a table row lists them (in the store-reading build, by name and by the old id in record 1). |
| 86 | - Forge data dir `~/forge-data/`: the social append-only log and key, `archives/` (archive cache, |
| 87 | 512 MiB cap per file), `logs/forged.log` (access log and supervisor log), `counts.log` (append-only |
| 88 | journal of the counted clone and download events and the log positions, `server/counts.om`), |
| 89 | `growth/seeds.log` (one line when a routing-table read gives a repo a new seeding count, `growth/`). |
| 90 | |
| 91 | ## Machine form |
| 92 | |
| 93 | `<base>explore.json` and `<base><owner>/<repo>.json` (or `Accept: application/json`) answer the |
| 94 | same data as the HTML pages as JSON: schemas `forge/explore/1` and `forge/repo/1` in `docs/API.md`. |
| 95 | `<base>trending` and `<base>explore?order=trending|new` order the public list. |
| 96 | `<base><owner>/<repo>/insights` is the per-repo numbers page. Schemas and sources: `docs/GROWTH.md`. |
| 97 | `<base>agents.json` lists every machine-readable address (from `server/agents.tsv`); `<base>events.json` |
| 98 | is the public activity stream and `<base>feed` its page: `docs/AGENT-DOOR.md`. |
| 99 | |
| 100 | ## Host dependencies (production path) |
| 101 | |
| 102 | | binary | version on spark | what forged uses it for | Omega replacement | |
| 103 | |---|---|---|---| |
| 104 | | `/usr/bin/git` | 2.43.0 (Ubuntu 1:2.43.0-1ubuntu7.3) | read-only object, ref and archive reads on allow-listed storage (argv exec, empty environment). Code search stops each `git grep` once the page has the lines it can still show (`nodes/srch.om`). The default branch (HEAD) is read by `nodes/head.om`; `git symbolic-ref` is no longer started | git is kept as a read-only oracle; a seeded-Omega loose/pack object reader (zlib inflate, pack index, tree walk) would remove it from the request path. Done so far: HEAD (`nodes/head.om`, byte-equal pages for every public repository, `nodes/tests/ab.sh check`). Next: loose and packed refs (`for-each-ref`, `rev-parse` of a branch name) | |
| 105 | | `/usr/bin/ssh-keygen` | OpenSSH 9.6p1 (Ubuntu 1:9.6p1-3ubuntu13.19) | `ssh-keygen -Y verify` of the Radicle-key sign-in signature (social) | Ed25519 verify in Omega (edwards25519 on the field code of omega-mv `om/tls/x25519.om`, SHA-512 from `om/tls/sha2.om`) plus an SSHSIG blob parser; omega-mv f4df8239 has no Ed25519 yet | |
| 106 | | `/usr/bin/sqlite3` | 3.45.1 (Ubuntu 3.45.1-1ubuntu2.8) | not forged: `server/nodes-snap` (`nodes/snap.om`) reads the Radicle node's `node.db` and `policies.db` with `-readonly` for the `/status` snapshot | a seeded-Omega reader of the SQLite file format (b-tree pages, WAL frames) for the two tables; until then sqlite3 is the node database's own reader | |
| 107 | | `rad` | 1.10.3 (7e1cb406) | not forged: `nodes-snap` runs `rad node status` (connected peers) and follows `rad node events` (its change signal) through `/usr/bin/env HOME=...` | speak the node's control socket (`~/.radicle/node/control.sock`) from Omega; its protocol is not yet read from the heartwood source | |
| 108 | | `~/.radicle/bin/rad` (via `/usr/bin/env HOME=...`) | rad 1.10.3 (7e1cb406) | `rad node routing --rid <RID> --json`: the number of nodes seeding a repo, for the repo home counts (`server/counts.om`); read-only, run only when the node database changed | a seeded-Omega reader of the node's routing table, or the node announcing seed counts to a file forged reads | |
| 109 | | `/usr/bin/getent` | glibc 2.39 (Ubuntu GLIBC 2.39-0ubuntu8.9) | `getent hosts www.aienos.com`: the home address, so our own requests are left out of the visitor counts | an Omega DNS lookup, or the edge marking our own requests itself | |
| 110 | |
| 111 | Logs forged reads for the counts (read-only, `docs/API.md`): `/var/log/nginx/aienos-dl.log` and |
| 112 | `/var/log/nginx/aienos.access.log` (the front-door nginx on spark; after a daily rotation the rest of |
| 113 | `<log>.1` is read first; forged's group `adm` can read the rotated `0640 www-data adm` files) and |
| 114 | `~/forge-data/logs/forged.log`. |
| 115 | |
| 116 | ## Checks |
| 117 | |
| 118 | ``` |
| 119 | bash infra/smoke.sh local # both bases against 127.0.0.1:18480 |
| 120 | bash infra/smoke.sh # the public domains |
| 121 | bash dl/tests/http-check.sh 18480 # archives and releases |
| 122 | bash collab/tests/check.sh http://127.0.0.1:18480 |
| 123 | SOCIAL_TEST_CORES=4,5 SOCIAL_TEST_PORT=18483 bash social/tests/run.sh # isolated test build |
| 124 | bash server/tests/counts.sh # JSON form and counts: isolated build, fixture logs, HTML equal to the base build |
| 125 | bash server/tests/trial-real.sh # the same build on the real logs (read-only), smoke against it |
| 126 | ``` |