Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# The documentation site on GitHub Pages, rebuilt on every push to main:
# The documentation site on GitHub Pages: built on every pull request, which
# fails if agents/ is not what the pages write, and deployed from main.
# odoc's reference from the .mli files, then Starlight's pages around it.
name: docs

on:
push:
branches: [main]
pull_request:

# A build reads the repository and nothing more; the deploy job alone is
# given the rights to publish.
permissions:
contents: read
pages: write
id-token: write

# A newer push to a pull request replaces its build; main's deploys queue
# and always finish.
concurrency:
group: pages
cancel-in-progress: true
group: pages-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
deploy:
build:
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v6
- uses: actions/checkout@v5
- uses: ocaml/setup-ocaml@v3
with:
Expand All @@ -38,8 +38,23 @@ jobs:
# the token, past its limit for a runner's shared address.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The build writes agents/ from the pages: a page changed without it
# differs here.
- run: git add --intent-to-add agents/ && git diff --exit-code agents/
- uses: actions/upload-pages-artifact@v5
with:
path: _build/docs
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v6
- uses: actions/deploy-pages@v5
id: deployment
16 changes: 14 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ make test # starts the test Postgres in Podman, runs every test
make lint # formatting, odoc, the release build, litany, and the dashboard's bundle rebuilt and compared
make fmt # format in place
make dashboard # the dashboard's page built into dashboard/assets, to commit
make docs # the documentation site into _build/docs, as Pages publishes it; docs-serve serves it
make docs # the documentation site into _build/docs, as Pages publishes it, and
# agents/ from its pages; docs-serve serves it
make release VERSION=1.2.3 # tag and release
```

`make test` needs `podman compose`, and `make docs`, `make dashboard` and
so `make lint` Bun 1.3 or later.
Without `SPOOL_TEST_PG` the cases that need a server are skipped, and the
test output says so. CI runs `make lint` and `make test` on OCaml 5.5.
`docs.yml` publishes the site to GitHub Pages on every push to `main`.
`docs.yml` builds the site on every pull request and publishes it to GitHub
Pages from `main`.

## Layout

Expand Down Expand Up @@ -52,6 +54,10 @@ dashboard/ spool-dashboard, its own package over spool, spindle and
into assets/
test/ the routes in-process against a real Postgres: who may do
what, sensitive payloads, paging, actions, the live stream
agents/ the documentation for a user's agent, generated by
starlight-hypha-agents from the pages, `make docs`:
llms.txt, the catalogue; pages/, each page as Markdown;
installed by the spool package
examples/ the programs the site shows, each built, and run against a
Postgres by hand
test/
Expand Down Expand Up @@ -141,6 +147,12 @@ you broke it. Cite an entry by its bold phrase.
installs the package with OCaml alone, and never edited by hand. Symptom:
`make lint`, which builds it again, finds a file that differs, or one
more or fewer.
- **`agents/` is generated, never edited.** starlight-hypha-agents writes
it from the documentation's pages and its options in
`docs/astro.config.mjs`: a page changed is `make docs` run in the same
commit. Why: a user's agent reads what the release installs, offline,
and a page it reads must be the release's. Test: the docs workflow builds
the pages on every pull request and fails if `agents/` then differs.
- **The queue names no driver.** It runs over `rowtype-postgres`, which
hands it a listener as it hands it a pool, so a second backend is a
second adapter. Symptom: `postgres-eio` named in `src/` or in its
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changes

## Unreleased

- The spool package installs its documentation for agents: each page as
Markdown and `llms.txt`, at `$(opam var spool:doc)`. The README's *With an
agent* gives the line for a project's `AGENTS.md` that sends an agent there.

## 0.7.0 (2026-11-17)

- A new package, `spool-dashboard`: a live dashboard for the queue, as
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ The runner claims the job once the transaction commits, under a lease, and
runs its handler outside every transaction; `Spool.Runner.start` starts it
and `Spool.Runner.stop` stops it.

## With an agent

Each release installs its documentation for an agent with it, at
`$(opam var spool:doc)`: `llms.txt`, and every page in Markdown. An agent
reads it when your project's `AGENTS.md` tells it to:

```md
Before writing code with spool, read `$(opam var spool:doc)/llms.txt` and
the pages it lists for the parts you need, and use those parts rather than
writing your own.
```

## Contributing

See [AGENTS.md](AGENTS.md).
Expand Down
28 changes: 28 additions & 0 deletions agents/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# spool

> Durable jobs for modern OCaml, backed by Postgres.

## Start here

- [Getting Started](pages/index.md): Durable jobs for modern OCaml, backed by Postgres.
- [Quick start](pages/quick-start.md)

## Guides

- [The table](pages/guide/table.md)
- [Kinds](pages/guide/kinds.md)
- [Enqueueing](pages/guide/enqueueing.md)
- [Handlers](pages/guide/handlers.md)
- [The runner](pages/guide/runner.md)
- [In a Spindle application](pages/guide/spindle.md)
- [Operating a queue](pages/guide/operating.md)
- [The dashboard](pages/guide/dashboard.md)
- [Limiting a queue](pages/guide/limiting.md)
- [Recurring jobs](pages/guide/schedules.md)
- [Workflows](pages/guide/workflows.md)
- [Testing](pages/guide/testing.md)
- [What it does not do yet](pages/guide/limits.md)

## Reference

- [Reference](pages/reference.md)
Loading