on master help sign in
AGENTS.mdnew file+121
since splitsnapshots
unifiedsplit
@@ -0,0 +1,121 @@
1+# Agent guidance
2+
3+## Project
4+
5+`urbit-apps` is a Nix flake that builds Urbit apps' desks into `.deskjam`
6+files, the upload format of [deskjam](https://github.com/iko-soy/deskjam),
7+with each app's frontend glob next to it. `jammer/` is the Rust CLI that packs
8+them. `README.md` documents the apps for users: read it before changing what
9+the flake builds.
10+
11+## Code map
12+
13+- `flake.nix`: one input per app, plus any dependencies an app's own build
14+ pins. Each app is an `<app>-desk` built with `mkDeskjam` and exposed as
15+ `packages.<system>.<app>`; frontends are `packages.<system>.<app>-glob`.
16+ - `mkDeskjam { desk, src, glob ? null }` packs the desk folder `src` into
17+ `$out/<desk>.deskjam` and copies `glob` next to it as `$out/<desk>-glob`.
18+ - `names-glob` reads a `desk.docket-0` with `urbit eval`, as the docket mark
19+ does. `mkDeskjam` fails the build when the docket names a glob (a
20+ `glob-http` or `glob-ames` clause, and no `site` clause) but has no
21+ `glob`, when it has a `glob` for a docket that names none, and when the
22+ docket isn't valid Hoon.
23+ - `mkGlob` builds a frontend with `buildNpmPackage` (`npm run build`, then
24+ its `dist/`), for apps whose own flakes don't build their globs.
25+ - `harness-git` and `harness-src` run harness' own `zig build` offline; see
26+ the README's "How the desks are built".
27+- `flake.lock`: the revision of every app and dependency.
28+- `jammer/`: the packer. Its build takes only `Cargo.toml`, `Cargo.lock`,
29+ `src/` and `tests/`, and runs its tests.
30+- `README.md`: the apps table, installing and updating with deskjam,
31+ frontends, and how each desk is built.
32+
33+## Working conventions
34+
35+- Use jj, not git, and pass `--git` to `jj diff` and `jj show`. Commit or push
36+ only when asked. Nix only sees files jj tracks. Never write to `/nix` by
37+ hand.
38+- Don't change the app repos from here. When one needs a change, write a
39+ prompt the user can give an agent in that repo: the problem, with evidence,
40+ the change, and how to check it.
41+- Add an app by the first route its repo allows:
42+ 1. Its flake follows the convention: `packages.<system>.desk` is the full
43+ desk, `.glob` is the built frontend if its docket names a glob, and
44+ `default` is `desk`. Add it as a flake input, with
45+ `src = app.packages.${system}.desk` and
46+ `glob = app.packages.${system}.glob`. Have its `nixpkgs` follow this
47+ flake's only if its flake builds no frontend; otherwise keep the nixpkgs
48+ it pins, so its glob is the same build as in its own repo.
49+ 2. It has no flake, and its `desk/` is the whole desk: a `flake = false`
50+ input, with `src = "${app}/desk"`.
51+ 3. Its own build tool assembles the desk: run that build in Nix, with its
52+ fetches pinned as inputs, as for harness. Don't reimplement its steps,
53+ and make the build fail loudly when upstream pins something new.
54+- Before adding an app, check:
55+ - that its `sys.kelvin` lists the current kernel, `[%zuse 408]`. Kernel
56+ numbers count down, so 411 is older than 408. Don't package an app that
57+ only supports older kernels.
58+ - its desk name, from its README or its docket's `base`.
59+ - whether its docket names a glob, and where else its frontend could come
60+ from, such as files its own agent serves from the desk.
61+ - that `jammer jam -v` reports no missing marks, and that the desk has the
62+ libraries its Hoon imports.
63+- The flake supports `x86_64-linux`, `aarch64-linux` and `aarch64-darwin`;
64+ nixpkgs 26.11 dropped `x86_64-darwin`. An app's flake must provide its
65+ outputs on all three.
66+- Keep `README.md` in step with the flake: the app's row in the Apps table
67+ (description, source link, `nix build github:iko-soy/urbit-apps#<app>`), the
68+ glob and build-all commands, the Frontends section for an app with a glob,
69+ and its bullet in "How the desks are built". Write in its voice: short,
70+ plain sentences. In a table cell, escape `|` as `\|`, even inside backticks.
71+- Format `flake.nix` with `nix run --inputs-from . nixpkgs#nixfmt -- flake.nix`.
72+- `nix flake update` moves every input except those pinned by a commit in
73+ their URL, such as `harness-grubbery` and `harness-tlon`; move those by
74+ editing the URL.
75+- When a frontend's `package-lock.json` changes, its build stops on a hash
76+ mismatch. Set its hash (`npmDepsHash`, or the `hash` of harness' `npmDeps`)
77+ to `pkgs.lib.fakeHash`, build, and use the hash shown after `got:`.
78+
79+## Validation
80+
81+Run from the repository root:
82+
83+```sh
84+nix run --inputs-from . nixpkgs#nixfmt -- --check flake.nix
85+nix flake check --all-systems --no-build
86+nix build --no-link --print-out-paths .#<app>
87+```
88+
89+For a change that shouldn't change a desk, `cmp` each app's new `.deskjam`
90+with its old one. For one that should, `jammer unjam` both, `diff -r` them,
91+and check that only the expected files changed. `nix build --rebuild` of a
92+glob checks that it's reproducible.
93+
94+For a new app, also compare its deskjam with what the app's own procedure
95+makes. deskjam's `tests/fakezod/pack.sh` packs a desk folder with
96+`urbit eval`, byte for byte as jammer does. Then render the README with
97+`nix run --inputs-from . nixpkgs#pandoc -- -f gfm -t html README.md`, and
98+check that every table row has four cells.
99+
100+To test an app on a ship, use deskjam's fake-ship harness, `tests/fakezod` in
101+iko-soy/deskjam. `bootstrap.sh` boots a fake `~zod` with deskjam, and
102+`smoke-test.sh` shows how to drive deskjam's pages with curl. Set `HTTP_PORT`
103+and `AMES_PORT`, and don't pick 31337 plus a galaxy's number as the Ames
104+port: the fake ship sends that galaxy's packets there, so they loop back.
105+Upload a glob at `/docket/upload` as a browser does: a `desk` part, then one
106+`glob` part per file, named `<folder>/<path>`, with its content type. Stop
107+the ship with `stop.sh` when done.
108+
109+Quirks:
110+
111+- `urbit eval` colors its output, ends lines with CRLF, and exits 0 even when
112+ the Hoon crashes. Check its output, not its exit status.
113+- In the build sandbox, npm packages' `#!/usr/bin/env node` scripts only run
114+ after `patchShebangs`, which `npmHooks.npmConfigHook` does once. Another
115+ `npm ci` puts the unpatched scripts back.
116+- `nix build` of several targets writes `result`, then `result-1` and so on.
117+ Nix reuses a `github:` flake it fetched within the last hour, unless given
118+ `--refresh`.
119+
120+In the final report, summarize the change, the checks run, and anything left
121+unchecked.
CLAUDE.mdnew file+1
@@ -0,0 +1 @@
1+AGENTS.md
README.md+78−63
@@ -10,28 +10,31 @@ files.
10
10
11| App | Description | Source | Build |
11| App | Description | Source | Build |
12|---|---|---|---|
12|---|---|---|---|
13−| `%accountability` | Watches all 256 galaxies from your ship. Every 10 minutes it checks each one's keys on chain, whether it answers, and which `%kids` OTA it serves, and logs every change. A dashboard at `/apps/accountability` and a public JSON API show the results. It needs `%azimuth` running, as on a livenet ship. | [sigilante/accountability](https://github.com/sigilante/accountability) | `nix build .#accountability` |
13+| `%accountability` | Watches all 256 galaxies from your ship. Every 10 minutes it checks each one's keys on chain, whether it answers, and which `%kids` OTA it serves, and logs every change. A dashboard at `/apps/accountability` and a public JSON API show the results. It needs `%azimuth` running, as on a livenet ship. | [sigilante/accountability](https://github.com/sigilante/accountability) | `nix build github:iko-soy/urbit-apps#accountability` |
14−| `%deskjam` | Install and update apps, and upload and download desks, as deskjam files, in your ship's web interface at `/apps/deskjam`. A fork of [tinnus-napbus/deskjam](https://github.com/tinnus-napbus/deskjam). | [iko-soy/deskjam](https://github.com/iko-soy/deskjam) | `nix build .#deskjam` |
14+| `%deskjam` | Install and update apps, and upload and download desks, as deskjam files, in your ship's web interface at `/apps/deskjam`. A fork of [tinnus-napbus/deskjam](https://github.com/tinnus-napbus/deskjam). | [iko-soy/deskjam](https://github.com/iko-soy/deskjam) | `nix build github:iko-soy/urbit-apps#deskjam` |
15−| `%harness` | Runs AI agents on your ship. Talk to them in its web app at `/apps/harness`, in Tlon, or from an editor, while the ship keeps the conversations, permissions and work. Models come from providers you configure, such as OpenRouter, OpenAI or Anthropic. Its Tlon features need `%groups`. | [mopfel-winrux/urbit-agent-harness](https://github.com/mopfel-winrux/urbit-agent-harness) | `nix build .#harness` |
15+| `%harness` | Runs AI agents on your ship. Talk to them in its web app at `/apps/harness`, in Tlon, or from an editor, while the ship keeps the conversations, permissions and work. Models come from providers you configure, such as OpenRouter, OpenAI or Anthropic. Its Tlon features and its documents need `%groups`. Installing it takes a few minutes, while Clay builds it. | [mopfel-winrux/urbit-agent-harness](https://github.com/mopfel-winrux/urbit-agent-harness) | `nix build github:iko-soy/urbit-apps#harness` |
16−| `%hits` | Ranks apps by how many installs they have among the ships around you, which gossip their installs to their Pals and the ships they chat with in Tlon. There's no central server. It works without `%pals`, but then hears only from the ships you chat with. It only counts apps installed from another ship with `|install`, not ones installed from a deskjam file. Its frontend is a glob: see [Frontends](#frontends). A fork of [urbit/hits](https://github.com/urbit/hits). | [iko-soy/hits](https://github.com/iko-soy/hits) | `nix build .#hits` |
16+| `%hits` | Ranks apps by how many installs they have among the ships around you, which gossip their installs to their Pals and the ships they chat with in Tlon. There's no central server. It works without `%pals`, but then hears only from the ships you chat with. It only counts apps that kiln syncs from another ship, as after `\|install`: not ones installed from a deskjam file, or ones you stop kiln syncing. Its frontend is a glob: see [Frontends](#frontends). A fork of [urbit/hits](https://github.com/urbit/hits). | [iko-soy/hits](https://github.com/iko-soy/hits) | `nix build github:iko-soy/urbit-apps#hits` |
17−| `%shelf` | A public web page that lists the apps your ship publishes, so anyone can install them on their own ship. It answers at `/shelf`, for a reverse proxy to serve at the root of its own domain, and needs `%landscape`, which fresh ships have. | [iko-soy/shelf](https://github.com/iko-soy/shelf) | `nix build .#shelf` |
17+| `%shelf` | A public web page that lists the apps your ship publishes, so anyone can install them on their own ship. It answers at `/shelf`, for a reverse proxy to serve at the root of its own domain, and needs `%landscape`, which fresh ships have. | [iko-soy/shelf](https://github.com/iko-soy/shelf) | `nix build github:iko-soy/urbit-apps#shelf` |
18−| `%silo` | A file manager for the S3 storage your ship uploads to: add a bucket's credentials, then browse its files and upload new ones. It has no agents of its own, and uses `%storage` from `%landscape`, which fresh ships have. | [arthyn/silo](https://github.com/arthyn/silo) | `nix build .#silo` |
18+| `%silo` | A file manager for the S3 storage your ship uploads to: add a bucket's credentials, then browse its files and upload new ones. It has no agents of its own, and uses `%storage` from `%landscape`, which fresh ships have. Its frontend is a glob: see [Frontends](#frontends). A fork of [arthyn/silo](https://github.com/arthyn/silo). | [iko-soy/silo](https://github.com/iko-soy/silo) | `nix build github:iko-soy/urbit-apps#silo` |
19−
19+| `%vita` | Tracks how your published apps spread: how many ships sync each of your desks, and the daily active users that apps using its `vita-client` library report, with a dashboard for creating and maintaining apps. Its frontend is a glob: see [Frontends](#frontends). A fork of [assemblycapital/vita](https://github.com/assemblycapital/vita), updated for kernel 408. | [iko-soy/vita](https://github.com/iko-soy/vita) | `nix build github:iko-soy/urbit-apps#vita` |
20−Run the build commands in a checkout of this repo, with Nix and flakes
20+
21+The build commands need Nix with flakes enabled, but no clone of this repo:
22+Nix fetches it from GitHub, and each app's source at the version `flake.lock`
21−enabled. If flakes aren't enabled, put
23+pins. If flakes aren't enabled, put
22−`--extra-experimental-features 'nix-command flakes'` after `nix`. Without a
24+`--extra-experimental-features 'nix-command flakes'` after `nix`. In a
23−checkout, give the repo's address instead of `.`, such as
25+checkout of this repo, `.` builds your working copy instead, as in
24−`nix build github:iko-soy/urbit-apps#shelf`. Nix fetches each app's source
26+`nix build .#shelf`.
25−itself, at the version `flake.lock` pins.
26
27
27Each build writes `result/<desk>.deskjam`, such as `result/shelf.deskjam`, in
28Each build writes `result/<desk>.deskjam`, such as `result/shelf.deskjam`, in
28place of the last build's `result`. For an app whose web frontend is a glob,
29place of the last build's `result`. For an app whose web frontend is a glob,
29such as hits, it also writes the glob's files next to it, as
30such as hits, it also writes the glob's files next to it, as
30`result/<desk>-glob`, and the build fails if `flake.nix` doesn't build them,
31`result/<desk>-glob`, and the build fails if `flake.nix` doesn't build them,
31−so a deskjam never comes without its glob. `nix build .#hits-glob` or
32+so a deskjam never comes without its glob.
33+`nix build github:iko-soy/urbit-apps#hits-glob`, or `#silo-glob` or
34+`#vita-glob`, builds just a glob. In a checkout,
32−`.#silo-glob` builds just a glob. `nix build .#accountability .#deskjam
35+`nix build .#accountability .#deskjam .#harness .#hits .#shelf .#silo .#vita`
33−.#harness .#hits .#shelf .#silo` builds all six, into `result` and `result-1`
36+builds all seven, in that order, into `result` and `result-1` to `result-6`.
34−to `result-5`.
37+The steps below assume one app's `result`.
35
38
36You can install these files on your ship with
39You can install these files on your ship with
37[iko-soy/deskjam](https://github.com/iko-soy/deskjam): see
40[iko-soy/deskjam](https://github.com/iko-soy/deskjam): see
@@ -79,9 +82,10 @@ After that, update deskjam like any other app, as below.
792. Under **upload deskjam**, choose the file, such as `result/shelf.deskjam`,
822. Under **upload deskjam**, choose the file, such as `result/shelf.deskjam`,
80 and click **upload**.
83 and click **upload**.
813. Under **Install it as a new desk**, keep the name and click **next**.
843. Under **Install it as a new desk**, keep the name and click **next**.
85+4. On the confirm page, if the app's frontend is a glob, first click **set**
86+ in the glob box, as [Frontends](#frontends) says. Then tick
82−4. On the confirm page, tick **start its agents after uploading** (for an app
87+ **start its agents after uploading** (for an app without agents, such as
83− without agents, such as silo, **mark it running after uploading**), and
88+ silo, **mark it running after uploading**), and click **confirm**.
84− click **confirm**.
855. The status page says whether the app runs.
895. The status page says whether the app runs.
86
90
87Once it runs, see the app's README for how to set it up.
91Once it runs, see the app's README for how to set it up.
@@ -90,19 +94,26 @@ Once it runs, see the app's README for how to set it up.
90
94
91Apps installed this way don't update on their own. To update one:
95Apps installed this way don't update on their own. To update one:
92
96
93−1. Move its pin to the latest commit of its repo, such as with
97+1. Build it again. Nix reuses a copy of this repo it fetched in the last hour,
98+ so add `--refresh` to get the pins it has now:
99+ `nix build --refresh github:iko-soy/urbit-apps#shelf`. To build an app's
100+ newest commit before this repo pins it, add
101+ `--override-input shelf github:iko-soy/shelf`. In a checkout,
94− `nix flake update shelf`, and build it again. `nix flake update` moves
102+ `nix flake update shelf` moves the pin, and `nix flake update` moves every
95− every app, and nixpkgs.
103+ app, and nixpkgs.
962. Upload the new file as above. Under **Update an existing desk**, choose the
1042. Upload the new file as above. Under **Update an existing desk**, choose the
97 app's desk, select **replace it**, and click **next**. Replace makes the
105 app's desk, select **replace it**, and click **next**. Replace makes the
98 desk exactly the upload, so files a new version removed don't linger.
106 desk exactly the upload, so files a new version removed don't linger.
993. The confirm page offers a download of the desk as it is now. Keep it if
1073. The confirm page offers a download of the desk as it is now. Keep it if
100− you might want to go back, then click **confirm**.
108+ you might want to go back. If your ship serves the app's glob, click
109+ **set** in the glob box first. Then click **confirm**.
101
110
102Uploading the kept copy with **replace it** puts the old version back. If the
111Uploading the kept copy with **replace it** puts the old version back. If the
103update changed the state an agent keeps, that usually fails, and nothing
112update changed the state an agent keeps, that usually fails, and nothing
104changes. But some agents start afresh from state they can't read, and lose it
113changes. But some agents start afresh from state they can't read, and lose it
105−instead: deskjam's does.
114+instead: deskjam's does. If your ship serves the app's glob, also copy its old
115+`result/<desk>-glob` somewhere before you build the new version, and upload it
116+at `/docket/upload` after putting the old version back.
106
117
107If the app came from another ship with `|install`, kiln, the part of your
118If the app came from another ship with `|install`, kiln, the part of your
108ship that installs and updates apps, keeps it in sync with that ship. That
119ship that installs and updates apps, keeps it in sync with that ship. That
@@ -120,18 +131,20 @@ folder is what you upload at `/docket/upload`: choose the app's desk and the
120folder, and click **glob!**. Use a browser other than Safari, which can't
131folder, and click **glob!**. Use a browser other than Safari, which can't
121upload folders.
132upload folders.
122
133
123−- silo's docket has `%docket` download its glob from a url, so `silo.deskjam`
134+hits', silo's and vita's dockets have `%docket` get their globs from
124− works on any ship, with nothing to upload.
125−- hits' docket has `%docket` get its glob from `~donmec-sallud` over Ames,
126− with a placeholder hash. On your ship, click **set** in the glob box on the
135+`~donmec-sallud` over Ames, with a placeholder hash. On your ship:
136+
137+1. When you install the deskjam, click **set** in the glob box on the confirm
127− confirm page when you install `hits.deskjam`, so your ship serves the glob
138+ page first, so your ship serves the glob instead. **set** reloads the page
139+ and clears the boxes below it, so tick **start its agents after uploading**
140+ after it, then confirm.
128− instead, and once hits runs, upload `result/hits-glob`. On
141+2. Once the app runs, upload its `result/<desk>-glob`.
142+
129− `~donmec-sallud`, hits' docket already names your ship, so just upload the
143+On `~donmec-sallud`, their dockets already name your ship, so skip **set**,
130− glob. Without its glob, hits runs, but has no frontend.
144+and just upload the glob. Without its glob, an app runs, but has no frontend.
131−- To serve silo's frontend from your own ship too, click **set** the same way
145+deskjam's
132− and upload `result/silo-glob`, as deskjam's
133− [Serving a glob from your ship](https://github.com/iko-soy/deskjam/blob/main/docs/globs.md#serving-a-glob-from-your-ship)
146+[Serving a glob from your ship](https://github.com/iko-soy/deskjam/blob/main/docs/globs.md#serving-a-glob-from-your-ship)
134− says.
147+has the details.
135
148
136When you update an app whose glob your ship serves, click **set** in the glob
149When you update an app whose glob your ship serves, click **set** in the glob
137box on the confirm page first, which keeps the glob your ship serves now.
150box on the confirm page first, which keeps the glob your ship serves now.
@@ -163,10 +176,16 @@ has the details, including what to do when an upload goes wrong.
163
176
164## How the desks are built
177## How the desks are built
165
178
166−- deskjam's, hits' and shelf's own flakes build their desks, so each
179+- deskjam's, hits', shelf's, silo's and vita's own flakes build their desks,
167− `.deskjam` file has the files that repo's own build makes. jammer leaves
180+ so each `.deskjam` file has the files that repo's own build makes. jammer
168− out the files a `|commit` would skip too, such as hits' `LICENSE`, which has
181+ leaves out the files a `|commit` would skip too, such as hits' `LICENSE`,
169− no extension.
182+ which has no extension. silo's and vita's flakes build their globs too, and
183+ this flake takes them as they are, with the nixpkgs those flakes pin: so
184+ `github:iko-soy/urbit-apps#silo-glob` is the same build as
185+ `github:iko-soy/silo#glob`. Their desks
186+ include all of urbit's base-dev, so deskjam's confirm page warns about a
187+ few of its libraries that import files the desks lack, but the apps don't
188+ use them.
170- accountability has no flake, and its `desk/` is the whole desk, which
189- accountability has no flake, and its `desk/` is the whole desk, which
171 `flake.nix` packs as it is.
190 `flake.nix` packs as it is.
172- harness' repo builds its desk with `zig build`. It builds `fe/`, its
191- harness' repo builds its desk with `zig build`. It builds `fe/`, its
@@ -175,28 +194,24 @@ has the details, including what to do when an upload goes wrong.
175 grubbery's desk under harness' own. `flake.nix` runs the same `zig build`
194 grubbery's desk under harness' own. `flake.nix` runs the same `zig build`
176 with npm's packages fetched ahead, and a stand-in `git` that answers from
195 with npm's packages fetched ahead, and a stand-in `git` that answers from
177 inputs pinned to the same commits, and fails if the build asks for any
196 inputs pinned to the same commits, and fails if the build asks for any
178− other: when a new version of harness pins other commits, move
197+ other. When a new version of harness pins other commits, change the commit
179− `harness-grubbery` or `harness-tlon` to them. The build also fails if the
198+ in `harness-grubbery`'s or `harness-tlon`'s url in `flake.nix` to the one
199+ the error names: `nix flake update` won't move them. The build also fails
180− desk has no `web/index.html`, so it can't come out without its frontend.
200+ if the desk has no `web/index.html`, so it can't come out without its
181−- silo has no flake. Its CI deploys all of urbit's `pkg/base-dev`, then
201+ frontend. Two of grubbery's libraries in it, `lib/verb.hoon` and
182− landscape's `desk-dev`, then its own `desk/`, and `flake.nix` builds the
183− same, with landscape at `master`, as the CI takes it. The CI's urbit tag
184− isn't public, so `flake.nix` takes `408k-2`, the release of the newest
185− kernel silo lists; when silo lists a newer one, move `silo-urbit` to its
186− tag. A few of base-dev's libraries import files the desk lacks, so
202+ `lib/xray.hoon`, import files the desk lacks, so deskjam's confirm page
187− deskjam's confirm page warns about them, but silo doesn't use them. silo's
203+ warns about them, but harness doesn't use them.
188− old esbuild names two unused variables at random, so `silo-glob` can differ
189− by a few bytes from one build to the next, and
190− `nix build --rebuild .#silo-glob` can fail. The page works the same either
191− way.
192−- A desk whose docket names a glob, however the docket is laid out, only
204+- A desk whose docket names a glob only builds with its glob, and a glob for
193− builds with its glob, which `flake.nix` builds from the app's `ui/`. A glob
194− for a desk whose docket names none fails the build too.
205+ a desk whose docket names none fails the build too. `flake.nix` reads each
206+ docket as the docket mark does, with Hoon's own parser in `urbit eval`, so
207+ this holds however the docket is laid out, and a docket that isn't valid
208+ fails the build.
195−- A hash in `flake.nix` pins each frontend's npm packages: each glob's
209+- A hash in `flake.nix` pins the npm packages of the frontends it builds
196− `npmDepsHash`, and the `hash` of harness' `npmDeps`. When moving an app's
210+ itself: `hits-glob`'s `npmDepsHash`, and the `hash` of harness' `npmDeps`.
211+ silo's and vita's are in their own flakes. When moving an app's pin changes
197− pin changes its `package-lock.json`, its build stops with a hash mismatch,
212+ its `package-lock.json`, its build stops with a hash mismatch, or
198− or `npmDepsHash is out of date`. Set that hash to `pkgs.lib.fakeHash`,
213+ `npmDepsHash is out of date`. Set that hash to `pkgs.lib.fakeHash`, build
199− build again, and put the hash the error shows after `got:` in its place.
214+ again, and put the hash the error shows after `got:` in its place.
200
215
201## jammer
216## jammer
202
217
flake.lock+138−49
@@ -29,11 +29,11 @@
29 "urbit": "urbit"
29 "urbit": "urbit"
30 },
30 },
31 "locked": {
31 "locked": {
32− "lastModified": 1792565467,
32+ "lastModified": 1792584136,
33− "narHash": "sha256-kkNjvyRPQf1CS+cYHDAuUK7LuEJJkT3Q9e4swcfh1Xc=",
33+ "narHash": "sha256-YnMsLXViNtQi+B029JFuVFYM8IzjGxPQLUCOPjlaktQ=",
34 "owner": "iko-soy",
34 "owner": "iko-soy",
35 "repo": "deskjam",
35 "repo": "deskjam",
36− "rev": "0da5be5e86de673dc8c5f8586b48143d7d9a3d67",
36+ "rev": "d0bb6b31803336e66a19ee6daeedd98a02813bd4",
37 "type": "github"
37 "type": "github"
38 },
38 },
39 "original": {
39 "original": {
@@ -135,11 +135,11 @@
135 "urbit": "urbit_2"
135 "urbit": "urbit_2"
136 },
136 },
137 "locked": {
137 "locked": {
138− "lastModified": 1792571528,
138+ "lastModified": 1792579499,
139− "narHash": "sha256-OC1Yg4iinINxUmRfYD6b+615tsIfM62Uq4szkWshUpc=",
139+ "narHash": "sha256-DVg1FSxZd2kZrwCebUWirVWTaya6NpqLAgI5dkk9r9I=",
140 "owner": "iko-soy",
140 "owner": "iko-soy",
141 "repo": "hits",
141 "repo": "hits",
142− "rev": "deaf7b9eaf51bd6a0df96cf74ee5a81126ba6608",
142+ "rev": "49f410ce92c29e8e1029e4302aa1f5d7a7e2b19d",
143 "type": "github"
143 "type": "github"
144 },
144 },
145 "original": {
145 "original": {
@@ -165,13 +165,47 @@
165 "type": "github"
165 "type": "github"
166 }
166 }
167 },
167 },
168+ "landscape_2": {
169+ "flake": false,
170+ "locked": {
171+ "lastModified": 1781809004,
172+ "narHash": "sha256-jRsjR0oOcXFWOZZwNg7Fi946IxuYGUrktNcF/aZIHz4=",
173+ "owner": "tloncorp",
174+ "repo": "landscape",
175+ "rev": "46c6ed8738082b6a94558710b1e3619befa83057",
176+ "type": "github"
177+ },
178+ "original": {
179+ "owner": "tloncorp",
180+ "ref": "develop",
181+ "repo": "landscape",
182+ "type": "github"
183+ }
184+ },
185+ "landscape_3": {
186+ "flake": false,
187+ "locked": {
188+ "lastModified": 1781809004,
189+ "narHash": "sha256-jRsjR0oOcXFWOZZwNg7Fi946IxuYGUrktNcF/aZIHz4=",
190+ "owner": "tloncorp",
191+ "repo": "landscape",
192+ "rev": "46c6ed8738082b6a94558710b1e3619befa83057",
193+ "type": "github"
194+ },
195+ "original": {
196+ "owner": "tloncorp",
197+ "repo": "landscape",
198+ "rev": "46c6ed8738082b6a94558710b1e3619befa83057",
199+ "type": "github"
200+ }
201+ },
168 "nixpkgs": {
202 "nixpkgs": {
169 "locked": {
203 "locked": {
170− "lastModified": 1792208399,
204+ "lastModified": 1792506237,
171− "narHash": "sha256-mN15cwddbOOIzzXSSwYUeRfOYeizz47Vy6y3Hzq6DuY=",
205+ "narHash": "sha256-Q/8KLB6jNfpaUN1HAedE/u/Et9feE/zYSsutBLKrCFk=",
172 "owner": "NixOS",
206 "owner": "NixOS",
173 "repo": "nixpkgs",
207 "repo": "nixpkgs",
174− "rev": "7a6522c868711d06e3a520bbcdfafe9806f4337f",
208+ "rev": "5adc50831c259f87faeb09ddf930d43597197473",
175 "type": "github"
209 "type": "github"
176 },
210 },
177 "original": {
211 "original": {
@@ -181,6 +215,38 @@
181 "type": "github"
215 "type": "github"
182 }
216 }
183 },
217 },
218+ "nixpkgs_2": {
219+ "locked": {
220+ "lastModified": 1792503283,
221+ "narHash": "sha256-vhe2jyvRCgufWPqDuDq1S3t3ypE+ka46IFutV02xKso=",
222+ "owner": "NixOS",
223+ "repo": "nixpkgs",
224+ "rev": "cd4ea8d57de16f4810bc5f14207bac45fbf19f67",
225+ "type": "github"
226+ },
227+ "original": {
228+ "owner": "NixOS",
229+ "ref": "nixos-26.05",
230+ "repo": "nixpkgs",
231+ "type": "github"
232+ }
233+ },
234+ "nixpkgs_3": {
235+ "locked": {
236+ "lastModified": 1792502884,
237+ "narHash": "sha256-IoNisKcGbUjdd45qCqywGMCYmZ5EnkxezvLII0FWwNA=",
238+ "owner": "NixOS",
239+ "repo": "nixpkgs",
240+ "rev": "02c087f3fe673c9e317f206a627cb6b910336dbe",
241+ "type": "github"
242+ },
243+ "original": {
244+ "owner": "NixOS",
245+ "ref": "nixos-unstable",
246+ "repo": "nixpkgs",
247+ "type": "github"
248+ }
249+ },
184 "root": {
250 "root": {
185 "inputs": {
251 "inputs": {
186 "accountability": "accountability",
252 "accountability": "accountability",
@@ -193,8 +259,7 @@
193 "nixpkgs": "nixpkgs",
259 "nixpkgs": "nixpkgs",
194 "shelf": "shelf",
260 "shelf": "shelf",
195 "silo": "silo",
261 "silo": "silo",
196− "silo-landscape": "silo-landscape",
262+ "vita": "vita"
197− "silo-urbit": "silo-urbit"
198 }
263 }
199 },
264 },
200 "shelf": {
265 "shelf": {
@@ -204,11 +269,11 @@
204 ]
269 ]
205 },
270 },
206 "locked": {
271 "locked": {
207− "lastModified": 1792533784,
272+ "lastModified": 1792580705,
208− "narHash": "sha256-5NHB+yqWIG/heOrp1YJ1FLQ9CvbwHUisMj28vSNNJPI=",
273+ "narHash": "sha256-LHPVjGLwQX6arH3N28HpW7L6bqxNcNrLQEnckXOhrBo=",
209 "owner": "iko-soy",
274 "owner": "iko-soy",
210 "repo": "shelf",
275 "repo": "shelf",
211− "rev": "868b75a07af54e5ecab8db21cae33e9b7d2869d4",
276+ "rev": "7bd213ef50331e5c1a483519beab6a5411300d61",
212 "type": "github"
277 "type": "github"
213 },
278 },
214 "original": {
279 "original": {
@@ -218,88 +283,92 @@
218 }
283 }
219 },
284 },
220 "silo": {
285 "silo": {
221− "flake": false,
286+ "inputs": {
287+ "landscape": "landscape_2",
288+ "nixpkgs": "nixpkgs_2",
289+ "urbit": "urbit_3"
290+ },
222 "locked": {
291 "locked": {
223− "lastModified": 1782065203,
292+ "lastModified": 1792581195,
224− "narHash": "sha256-kzP/ArfkVr5hguMldPYzWfBDlOvQ42rYV062LesFoX4=",
293+ "narHash": "sha256-ZNqCGv5+l5RtiEdT77dbYIlD4roYbQbG1uKnNeN+Vcw=",
225− "owner": "arthyn",
294+ "owner": "iko-soy",
226 "repo": "silo",
295 "repo": "silo",
227− "rev": "912b7caf56a2b9d037ca0ae9a152013631bab72e",
296+ "rev": "2d145ca828134f0ab94103089cdd54776cc67b1d",
228 "type": "github"
297 "type": "github"
229 },
298 },
230 "original": {
299 "original": {
231− "owner": "arthyn",
300+ "owner": "iko-soy",
232 "repo": "silo",
301 "repo": "silo",
233 "type": "github"
302 "type": "github"
234 }
303 }
235 },
304 },
236− "silo-landscape": {
305+ "systems": {
237− "flake": false,
238 "locked": {
306 "locked": {
239− "lastModified": 1711487686,
307+ "lastModified": 1681028828,
240− "narHash": "sha256-Tm76Hb7hO5+LgMTZSJKor6Bla+L2Qto84i2a+I4FfUc=",
308+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
241− "owner": "tloncorp",
309+ "owner": "nix-systems",
242− "repo": "landscape",
310+ "repo": "default",
243− "rev": "90a17528a938eebda57e837b7fec76d543f5f7cf",
311+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
244 "type": "github"
312 "type": "github"
245 },
313 },
246 "original": {
314 "original": {
247− "owner": "tloncorp",
315+ "owner": "nix-systems",
248− "ref": "master",
316+ "repo": "default",
249− "repo": "landscape",
250 "type": "github"
317 "type": "github"
251 }
318 }
252 },
319 },
253− "silo-urbit": {
320+ "urbit": {
254 "flake": false,
321 "flake": false,
255 "locked": {
322 "locked": {
256− "lastModified": 1785851358,
323+ "lastModified": 1784122708,
257− "narHash": "sha256-eHoGwqirk7zMpOn/y8dKqozz5IiQ7nqek/ypxIOaRiU=",
324+ "narHash": "sha256-9lrulpAMdMtc9OZ7LeRWHkAgnibLSiDiB+BVwcffiCs=",
258 "owner": "urbit",
325 "owner": "urbit",
259 "repo": "urbit",
326 "repo": "urbit",
260− "rev": "5a187fededc4582a34fcd6055c67bb63e0917b94",
327+ "rev": "0a9a312e133891937de9c4df1ebecad5cf669c7c",
261 "type": "github"
328 "type": "github"
262 },
329 },
263 "original": {
330 "original": {
264 "owner": "urbit",
331 "owner": "urbit",
265− "ref": "408k-2",
266 "repo": "urbit",
332 "repo": "urbit",
333+ "rev": "0a9a312e133891937de9c4df1ebecad5cf669c7c",
267 "type": "github"
334 "type": "github"
268 }
335 }
269 },
336 },
270− "systems": {
337+ "urbit_2": {
338+ "flake": false,
271 "locked": {
339 "locked": {
272− "lastModified": 1681028828,
340+ "lastModified": 1785851358,
273− "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
341+ "narHash": "sha256-eHoGwqirk7zMpOn/y8dKqozz5IiQ7nqek/ypxIOaRiU=",
274− "owner": "nix-systems",
342+ "owner": "urbit",
275− "repo": "default",
343+ "repo": "urbit",
276− "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
344+ "rev": "5a187fededc4582a34fcd6055c67bb63e0917b94",
277 "type": "github"
345 "type": "github"
278 },
346 },
279 "original": {
347 "original": {
280− "owner": "nix-systems",
348+ "owner": "urbit",
349+ "ref": "408k-2",
281− "repo": "default",
350+ "repo": "urbit",
282 "type": "github"
351 "type": "github"
283 }
352 }
284 },
353 },
285− "urbit": {
354+ "urbit_3": {
286 "flake": false,
355 "flake": false,
287 "locked": {
356 "locked": {
288− "lastModified": 1784122708,
357+ "lastModified": 1785851358,
289− "narHash": "sha256-9lrulpAMdMtc9OZ7LeRWHkAgnibLSiDiB+BVwcffiCs=",
358+ "narHash": "sha256-eHoGwqirk7zMpOn/y8dKqozz5IiQ7nqek/ypxIOaRiU=",
290 "owner": "urbit",
359 "owner": "urbit",
291 "repo": "urbit",
360 "repo": "urbit",
292− "rev": "0a9a312e133891937de9c4df1ebecad5cf669c7c",
361+ "rev": "5a187fededc4582a34fcd6055c67bb63e0917b94",
293 "type": "github"
362 "type": "github"
294 },
363 },
295 "original": {
364 "original": {
296 "owner": "urbit",
365 "owner": "urbit",
366+ "ref": "408k-2",
297 "repo": "urbit",
367 "repo": "urbit",
298− "rev": "0a9a312e133891937de9c4df1ebecad5cf669c7c",
299 "type": "github"
368 "type": "github"
300 }
369 }
301 },
370 },
302− "urbit_2": {
371+ "urbit_4": {
303 "flake": false,
372 "flake": false,
304 "locked": {
373 "locked": {
305 "lastModified": 1785851358,
374 "lastModified": 1785851358,
@@ -315,6 +384,26 @@
315 "repo": "urbit",
384 "repo": "urbit",
316 "type": "github"
385 "type": "github"
317 }
386 }
387+ },
388+ "vita": {
389+ "inputs": {
390+ "landscape": "landscape_3",
391+ "nixpkgs": "nixpkgs_3",
392+ "urbit": "urbit_4"
393+ },
394+ "locked": {
395+ "lastModified": 1792581006,
396+ "narHash": "sha256-6dr0bBsj1nY8YFZJshqhLaeqDZDFvPSXIw3MOJN8Bm0=",
397+ "owner": "iko-soy",
398+ "repo": "vita",
399+ "rev": "dc3554e22e7e68ccb36efcc8cc149561fe95afb8",
400+ "type": "github"
401+ },
402+ "original": {
403+ "owner": "iko-soy",
404+ "repo": "vita",
405+ "type": "github"
406+ }
318 }
407 }
319 },
408 },
320 "root": "root",
409 "root": "root",
flake.nix+70−50
@@ -12,7 +12,7 @@
12 inputs.flake-utils.follows = "flake-utils";
12 inputs.flake-utils.follows = "flake-utils";
13 };
13 };
14
14
15− # Its packages.<system>.default is the full desk: it vendors its lib/,
15+ # Its packages.<system>.desk is the full desk: it vendors its lib/,
16 # mar/ and sur/ files.
16 # mar/ and sur/ files.
17 shelf = {
17 shelf = {
18 url = "github:iko-soy/shelf";
18 url = "github:iko-soy/shelf";
@@ -26,21 +26,10 @@
26 inputs.nixpkgs.follows = "nixpkgs";
26 inputs.nixpkgs.follows = "nixpkgs";
27 };
27 };
28
28
29− silo = {
29+ # silo's and vita's flakes build their desks and their globs, with the
30− url = "github:arthyn/silo";
30+ # nixpkgs they pin, so both come out as their own repos build them.
31− flake = false;
31+ silo.url = "github:iko-soy/silo";
32− };
32+ vita.url = "github:iko-soy/vita";
33− # Desk dependencies, as silo's .github/helpers/deploy.sh takes them. It
34− # takes urbit at a tag from a repo variable; 408k-2 is the release of the
35− # 408 kernel, the newest silo's sys.kelvin lists.
36− silo-urbit = {
37− url = "github:urbit/urbit/408k-2";
38− flake = false;
39− };
40− silo-landscape = {
41− url = "github:tloncorp/landscape/master";
42− flake = false;
43− };
44
33
45 # Its desk/ is the full desk: it vendors its lib/, mar/ and sur/ files.
34 # Its desk/ is the full desk: it vendors its lib/, mar/ and sur/ files.
46 accountability = {
35 accountability = {
@@ -71,8 +60,7 @@
71 shelf,
60 shelf,
72 hits,
61 hits,
73 silo,
62 silo,
74− silo-urbit,
63+ vita,
75− silo-landscape,
76 accountability,
64 accountability,
77 harness,
65 harness,
78 harness-grubbery,
66 harness-grubbery,
@@ -108,15 +96,42 @@
108 };
96 };
109 };
97 };
110
98
111− # Exits 0 if the docket file it's given names a glob: a glob-ames or
99+ # Reads the docket file it's given as the docket mark does, with
112− # glob-http term outside the docket's cords, tapes and comments,
100+ # `ream` and `slap` in `urbit eval`, so any layout Hoon accepts reads
113− # however the docket is laid out.
101+ # the same. Exits 0 if it names a glob: a glob-http or glob-ames
114− names-glob = pkgs.writers.writePerlBin "names-glob" { } ''
102+ # clause, and no site clause, which lib/docket prefers. Exits 1 if
115− local $/;
103+ # it doesn't, and 2 if it isn't a valid docket.
116− my $docket = <>;
104+ names-glob = pkgs.writeShellApplication {
117− $docket =~ s/'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|::[^\n]*//g;
105+ name = "names-glob";
118− exit($docket =~ /(?<![\w-])glob-(?:ames|http)(?![\w-])/ ? 0 : 1);
106+ runtimeInputs = [
107+ pkgs.urbit
108+ pkgs.util-linux
109+ ];
110+ excludeShellChecks = [ "SC2016" ];
111+ text = ''
112+ # the file's bytes as a Hoon @ux literal: an atom, first byte
113+ # lowest, with a dot between each group of four hex digits
114+ hex=$(od -An -v -tx1 -w1 "$1" | tac | tr -d ' \n' | sed 's/^0*//')
115+ atom=0x$(printf '%s' "''${hex:-0}" | rev | sed -E 's/([0-9a-f]{4})/\1./g; s/\.$//' | rev)
116+ out=$(
117+ {
118+ printf '=/ tex `@t`%s\n' "$atom"
119+ echo '=/ cls ;;((list [@tas *]) q:(slap !>(~) (ream tex)))'
120+ echo '=/ has |=(t=@tas (lien cls |=([h=@tas *] =(h t))))'
121+ echo '?&(!(has %site) |((has %glob-http) (has %glob-ames)))'
122+ } | urbit eval 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | tr -d '\r'
123+ )
124+ case $(printf '%s\n' "$out" | tail -n 1) in
125+ '%.y') exit 0 ;;
126+ '%.n') exit 1 ;;
127+ *)
128+ echo "$1 isn't a valid docket: Hoon can't read it as a list of clauses" >&2
129+ printf '%s\n' "$out" >&2
130+ exit 2
131+ ;;
132+ esac
119− '';
133+ '';
134+ };
120
135
121 # Pack the desk `src` into $out/<desk>.deskjam.
136 # Pack the desk `src` into $out/<desk>.deskjam.
122 #
137 #
@@ -141,13 +156,19 @@
141 ''
156 ''
142 cp -r --no-preserve=mode ${src} ${desk}
157 cp -r --no-preserve=mode ${src} ${desk}
143 glob=${pkgs.lib.optionalString (glob != null) "${glob}"}
158 glob=${pkgs.lib.optionalString (glob != null) "${glob}"}
159+ names=
160+ if [ -f ${desk}/desk.docket-0 ]; then
144− if [ -f ${desk}/desk.docket-0 ] && names-glob ${desk}/desk.docket-0; then
161+ if names-glob ${desk}/desk.docket-0; then
145− if [ -z "$glob" ]; then
162+ names=yes
146− echo "The docket of %${desk} names a glob: give mkDeskjam the built frontend as glob" >&2
163+ elif [ $? != 1 ]; then
147 exit 1
164 exit 1
148 fi
165 fi
166+ fi
149− elif [ -n "$glob" ]; then
167+ if [ -n "$names" ] && [ -z "$glob" ]; then
168+ echo "The docket of %${desk} names a glob: give mkDeskjam the built frontend as glob" >&2
169+ exit 1
170+ elif [ -z "$names" ] && [ -n "$glob" ]; then
150− echo "The docket of %${desk} names no glob, but mkDeskjam got one" >&2
171+ echo "%${desk} has no docket that names a glob, but mkDeskjam got one" >&2
151 exit 1
172 exit 1
152 fi
173 fi
153 mkdir $out
174 mkdir $out
@@ -159,12 +180,12 @@
159
180
160 deskjam-desk = mkDeskjam {
181 deskjam-desk = mkDeskjam {
161 desk = "deskjam";
182 desk = "deskjam";
162− src = deskjam.packages.${system}.deskjam;
183+ src = deskjam.packages.${system}.desk;
163 };
184 };
164
185
165 shelf-desk = mkDeskjam {
186 shelf-desk = mkDeskjam {
166 desk = "shelf";
187 desk = "shelf";
167− src = shelf.packages.${system}.default;
188+ src = shelf.packages.${system}.desk;
168 };
189 };
169
190
170 # Build a frontend: `npm run build` in its npm project `src`, whose
191 # Build a frontend: `npm run build` in its npm project `src`, whose
@@ -197,23 +218,16 @@
197 glob = hits-glob;
218 glob = hits-glob;
198 };
219 };
199
220
200− silo-glob = mkGlob {
221+ silo-desk = mkDeskjam {
201 desk = "silo";
222 desk = "silo";
202− src = "${silo}/ui";
223+ src = silo.packages.${system}.desk;
203− npmDepsHash = "sha256-kZaVn4+ORa9Cm100f8/VS1sCWwHOC6rxDvLnz4S5+p0=";
224+ glob = silo.packages.${system}.glob;
204 };
225 };
205
226
206− # The desk silo's deploy.sh commits: all of urbit's pkg/base-dev, then
207− # landscape's desk-dev, then silo's desk/ over them.
208− silo-desk = mkDeskjam {
227+ vita-desk = mkDeskjam {
209− desk = "silo";
228+ desk = "vita";
210− src = pkgs.runCommand "silo-desk" { } ''
229+ src = vita.packages.${system}.default;
211− mkdir $out
230+ glob = vita.packages.${system}.glob;
212− cp -rL --no-preserve=mode ${silo-urbit}/pkg/base-dev/. $out/
213− cp -rL --no-preserve=mode ${silo-landscape}/desk-dev/. $out/
214− cp -rL --no-preserve=mode ${silo}/desk/. $out/
215− '';
216− glob = silo-glob;
217 };
231 };
218
232
219 accountability-desk = mkDeskjam {
233 accountability-desk = mkDeskjam {
@@ -247,7 +261,7 @@
247 case $1 in
261 case $1 in
248 init | remote) ;;
262 init | remote) ;;
249 cat-file) pinned "''${3%"^{commit}"}" ;;
263 cat-file) pinned "''${3%"^{commit}"}" ;;
250− checkout) for arg; do :; done; pinned "$arg" ;;
264+ checkout | fetch) for arg; do :; done; pinned "$arg" ;;
251 show) pinned "''${2%%:*}"; cat "$src/''${2#*:}" ;;
265 show) pinned "''${2%%:*}"; cat "$src/''${2#*:}" ;;
252 *) echo "git: unexpected command: $*" >&2; exit 1 ;;
266 *) echo "git: unexpected command: $*" >&2; exit 1 ;;
253 esac
267 esac
@@ -286,12 +300,16 @@
286 runHook postBuild
300 runHook postBuild
287 '';
301 '';
288 installPhase = ''
302 installPhase = ''
303+ runHook preInstall
289 if [ ! -f zig-out/web/index.html ]; then
304 if [ ! -f zig-out/web/index.html ]; then
290 echo "harness' desk has no web/index.html: its frontend is missing" >&2
305 echo "harness' desk has no web/index.html: its frontend is missing" >&2
291 exit 1
306 exit 1
292 fi
307 fi
293 cp -r zig-out $out
308 cp -r zig-out $out
309+ runHook postInstall
294 '';
310 '';
311+ # the output is a desk: leave its files as they are
312+ dontFixup = true;
295 };
313 };
296
314
297 harness-desk = mkDeskjam {
315 harness-desk = mkDeskjam {
@@ -307,7 +325,9 @@
307 hits = hits-desk;
325 hits = hits-desk;
308 inherit hits-glob;
326 inherit hits-glob;
309 silo = silo-desk;
327 silo = silo-desk;
310− inherit silo-glob;
328+ silo-glob = silo.packages.${system}.glob;
329+ vita = vita-desk;
330+ vita-glob = vita.packages.${system}.glob;
311 accountability = accountability-desk;
331 accountability = accountability-desk;
312 harness = harness-desk;
332 harness = harness-desk;
313 default = jammer;
333 default = jammer;