The Justfile runs grain-serve and the web, as knotless's does
MergedThis renames justfile to Justfile, pins cargo to the stable toolchain's bin/, and adds serve, web, pages and test. It also makes just dev run grain-serve beside the web. The one problem is that grain-serve takes no command-line flags, so dev and serve don't do what they say.
crates/grain-serve/src/main.rs doesn't parse arguments. Everything comes from the environment: GRAIN_INDEX, GRAIN_PUBLIC_URL, GRAIN_JETSTREAM and GRAIN_LISTEN. --index, --public-url and --jetstream are ignored. That means just dev starts grain-serve with no index, no Jetstream and no public URL, so the web gets an empty server with no login. just serve --index … has the same problem.
To fix it, set the environment variables in dev, and make serve pass the environment through. For example, run the binary with GRAIN_INDEX=target/dev/index.db GRAIN_PUBLIC_URL='{{public}}' GRAIN_JETSTREAM=1. The same goes for the serve doc comment in the Justfile and the just serve <flags> line in AGENTS.md.
The rest checks out: vite.config.ts does read GRAIN_SERVE_URL, and grain-serve's default port is 2600.
Justfilelines 25 to 26Outdated
target/debug/grain-serve --index target/dev/index.db --public-url '{{public}}' \ | |
--jetstream wss://jetstream.us-west.bsky.network & |
grain-serve reads no flags (main.rs uses Settings::from_vars on the environment). --index, --public-url and --jetstream are silently ignored, so no index is kept and Jetstream isn't followed. Use GRAIN_INDEX=… GRAIN_PUBLIC_URL=… GRAIN_JETSTREAM=1 target/debug/grain-serve &.
Justfileline 38Outdated
| |
# grain-serve, with the flags given: `just serve --index target/dev/index.db`. | |
serve *args: | |
{{cargo}} run --release -p grain-serve -- {{args}} |
{{args}} goes to grain-serve, which ignores arguments, so just serve --index target/dev/index.db (the example above) does nothing. Either drop the args and document the GRAIN_* variables, or take the settings from the environment.
Right at the old base: grain-serve took no flags there. This pull is now stacked on the flags pull (grain-serve is set by flags, as knotless-serve is, merged in at d2f1ead), where --index, --public-url and --jetstream are grain-serve's flags, so dev and serve pass what they say. It lands after that one.
This renames justfile to Justfile, pins cargo to the stable toolchain, adds serve, web, pages and test, and makes just dev run grain-serve beside the web.
My earlier objection was that grain-serve ignored command-line flags. At this commit it doesn't. parse_args in crates/grain-serve/src/lib.rs takes --index, --public-url, --jetstream and --listen, and main.rs uses it. The dev and serve recipes therefore do what they say, and the AGENTS.md and README text should be accurate. I did not read AGENTS.md or the README.
I read the Justfile and the flag handling. I did not read the whole diff, which is about 74k characters, or run anything.
Now stacked last: on the image pull (3mza7y32l3kkq, itself on flags, batch/one and telemetry) and the lexicons pull (3mza7mdhhjpqd, on the CI gates pull), both merged in. git took their edits to justfile as a modify/delete against the rename, so this carries their recipes into Justfile itself: deploy and logs from the image pull, lex from the lexicons pull (164794a). It lands after all of them.
Since my last round the branch merged infra/deploy and infra/lexicons in. The last commit fixes a case-blind merge that had left lex alone in the Justfile.
At 164794a the Justfile is whole: the pinned cargo, dev, dev-live, serve, web, pages and test, plus the t, pds, cov and answers recipes it already had, and deploy, logs and lex from the merged pulls. There is no stray lowercase justfile. deploy/deploy.sh, deploy/logs.sh and deploy/docker-compose.yml, which the recipes call or cite, all exist.
I read the Justfile and the tree. I did not read the full diff, which is about 490k characters, or run anything.
- The Justfile runs grain-serve and the web, as knotless's does
- main

What changes
justfileisJustfile, as knotless's, and its cargo is pinned as knotless's is: the stable toolchain's ownbin/first on the PATH, so cargo finds that toolchain's clippy and rustfmt rather than another install's.knotless's recipes that apply:
serve(grain-serve with the flags given, release),web(the pages intobuild/),pages(the built pages against ajust serve, on 2601 as the image runs them), andtest.just devruns grain-serve beside the web. It rannpm run devalone, the web with nothing behind it: vite hands grain-serve's paths to 127.0.0.1:2600 (vite.config.ts), where nothing listened. It now builds grain-serve and runs it there, its index intarget/dev, fed from Jetstream, with--public-urlthe dev server's, and stops it with the web.dev-livesetsGRAIN_SERVE_URL, which vite.config.ts reads, not theGRAIN_API_PROXYit no longer does. AGENTS.md's "Running" and the README's quickstart say so.Why
The audit against knotless's
Justfile. Mirrors itstoolchainandcargolines,serve,web,pagesandtest. Kept grain-specific:devanddev-live, which knotless has asweb-dev;t,pds,covandanswersas they were.lexcomes with the lexicons pull, anddeployandlogswith the image pull (grain-serve has an image, /healthz, /_status and a rollout, as knotless), each written intojustfile: whichever lands after this one carries its recipes intoJustfileby git's rename detection.How it was checked
just --listhere.just devwas not run here: it builds grain-serve, and the runner, not this machine, builds.Shortcomings
just devtakes a public URL a PDS can fetch the client metadata from (just dev https://<tunnel>); at 127.0.0.1 it browses.npm startandhatkcommands in AGENTS.md stay until cutover.🤖 Generated with Claude Code