# Releases

What each release shipped, so **"the previous release's schema"** is a fact rather than
a guess. Every migration must be one the previous release's binary can run against —
the rule, and why, is in [`architecture.md`](architecture.md#migrations).

Add a row when a release is cut, in the same commit that bumps `Cargo.toml`, together
with its `RELEASES` row, which `cargo test` now enforces
([below](#where-each-releases-set-actually-lives)).

| Version | Date | Commit | Migrations it shipped |
|---|---|---|---|
| 0.1.0 | 2026-07-31 | `1111df1` | *(none — no `migrations/` directory yet)* |
| 0.2.0 | 2026-09-04 | `7fb0b5e` | `…093030_create_orgs` · `…093031_create_users` · `…093032_create_memberships` · `…093033_create_sessions` · `…093034_add_org_bio` · `…093035_create_repositories` · `20260828120000_create_tokens` · `20260829090000_add_repository_recency` |
| 0.3.0 | 2026-09-06 | `768d679` | *(none new — same set as 0.2.0)* |
| 0.4.0 | 2026-09-06 | `219c396` | `20260906120100_add_repository_import` · `…120200_create_issues` · `…120201_create_issue_comments` · `…120300_create_push_events` · `…120301_create_webhooks` · `…120302_create_webhook_deliveries` · `…120400_add_repository_archived` · `…140100_add_token_lifecycle` · `…140200_create_labels` · `…140201_create_issue_labels` · `…180100_create_pull_requests` · `…180101_create_pull_request_comments` · `…190000_create_pull_request_labels` |
| 0.5.0 | 2026-09-10 | `b942dad` | `20260908090500_create_password_resets` *(see [which bytes](#which-bytes-each-release-shipped))* |
| 0.6.0 | 2026-09-20 | `c3543e3` | *(none new — same set as 0.5.0)* |
| 0.7.0 | 2026-09-26 | `3f411b5` | *(none new — same set as 0.5.0)* |
| 0.8.0 | 2026-09-27 | `bac1a59` | `20260927100000_create_instance_settings` |
| 0.8.1 | 2026-10-04 | `df6e734` (cut); built from `7a8e8a7`, test-only after it; tag `v0.8.1` | *(none new — same set as 0.8.0)* |
| 0.8.2 | 2026-10-21 | *cut, not published — the commit that sets `Cargo.toml` to 0.8.2* | *(none new — same set as 0.8.0)* |

The `…` stands for the leading `202609061` / `20260804` of the timestamp; the full file
names are in `migrations/`.

0.6.0 is the first release published from **`https://releases.steid.dev`**
([decision 0009](decisions/0009-releases-from-releases-steid-dev.md)) and the first
version cloud-init can install headlessly. `Cargo.toml` and `install.sh` have said
0.6.0 since the boot-time owner landed (2026-09-13); the release was not cut until the
host existed, so no artefact has ever carried 0.6.0 and the number is published as-is
rather than bumped. `jpgill.dev` still serves up to 0.5.0 at the old path and mirrors
0.6.0 onwards.

0.7.0 is the control plane's three asks — `steid restore --replace`,
`install.sh --operator-token`, and `disk` on `/api/instance` — and is the upgrade target
the control plane's own upgrade step needs in order to have ever run against a box.
It was cut on 2026-09-26 and **published on 2026-09-27**.

0.8.0 is organisations and home, the first slice of milestone 7. It was cut on
2026-09-27 and **published on 2026-09-28**, both architectures; `install.sh`'s default
moved to it in `b0c6058`.

**0.8.0 adds one migration** — `20260927100000_create_instance_settings.sql`, the
single-row table holding `home_org_id`. It is an **expand** step and nothing else: a
`create table` plus the one `insert` that seeds the row, no column added to an existing
table, nothing dropped or renamed. The previous release's binary neither reads nor
writes it, and reads nothing it changes, so the old process can keep serving while the
new one migrates — which is the rule `architecture.md` states. Everything before it
shipped with 0.5.0; 0.6.0 and 0.7.0 add none.

> **Correction, 2026-10-01: that does not make a rollback safe.** An old process that is
> *already running* keeps serving, but a 0.7.0 binary *started* against this database
> refuses to boot: sqlx's default `ignore_missing: false` exits with `VersionMissing` on
> an applied migration it does not know. So 0.8.0 → 0.7.0 can never roll back, and the
> first rollback that can work is from the release after **0.8.1**, which is to carry
> `set_ignore_missing(true)`. See
> [launch 1.2](../../plans/launch.md#phase-1-before-anything-else).

0.8.1 is that fix. `migrate()` now ignores an applied migration it does not know and
still refuses an edited one it does (`set_ignore_missing(true)`), so a box upgraded
across a migration can be rolled back onto 0.8.1 or anything later. It ships no
migration. **Cut on 2026-10-02 and not published**: publishing is the author's
(`./release.sh --all`, then `./deploy.sh --publish-s3-only`). `install.sh`'s default
moved to 0.8.1 in the cut, as it did for 0.7.0, so a publish uploads the script that
matches it. Re-publishing the root `install.sh` on its own before the 0.8.1 artefacts are
up would send every fresh install to a 404.

0.8.2 is launch phase 2's Steid fixes, the ones a Steid Cloud tenant takes: 2.14 (the
whole boot seed is checked before the first write), decision 4 (`install.sh` writes every
`steid.env` value so systemd and sh read it alike), 2.18 (login CSRF, and DNS rebinding
on webhooks and imports, with imports refused on git older than 2.37) and 2.15 (a backup
of a live instance is consistent, with the 2026-10-21 follow-ups: a push's `.keep` is
never archived, and each file is copied exactly as large as it was when opened). It also
carries the rustls, rustls-webpki and webpki-roots patch releases for October's
advisories. **It ships no migration**, so launch 1.2's upgrade-and-rollback proof waits
for the first release that does. **Cut on 2026-10-21 and not published**: publishing is
the author's (`./release.sh --all`, then `./deploy.sh --publish-s3-only`). `install.sh`'s
default moved to 0.8.2 in the cut, so a publish uploads the script that matches it, and
re-publishing the root `install.sh` on its own before the 0.8.2 artefacts are up would
send every fresh install to a 404.

## Unreleased

Nothing since 0.8.2.

## Where each release's set actually lives

Every release since 0.5.0 is a row of `RELEASES` in
`src/infrastructure/database_compat_tests.rs`: its version, its **cumulative** file list
(`RELEASED_0_5_0`, `RELEASED_0_8_0`) and a SHA-256 over those files' bytes. That is the
authoritative copy. Three tests read it:

- `a_shipped_migration_is_never_edited` re-hashes each set, so editing any migration that
  has shipped — a comment counts, because sqlx checksums the whole file — fails the build
  and names the first release that shipped it. 0.5.0's set holds everything earlier, so
  every migration that has ever shipped is covered.
- `every_released_set_is_a_prefix_of_the_migrations_on_disk` catches a mistyped name and
  a migration back-dated in front of a released one.
- `the_version_in_cargo_toml_has_a_releases_row` fails while `Cargo.toml` names a version
  with no row (since 2026-10-02). The other two check only the rows that exist, which is
  how 0.8.0 shipped unpinned until 0.8.1's step added its row after the fact. So the
  version moves only in the cut commit, and no longer runs ahead of the cut as it did for
  0.6.0.

The table above is the human record and must agree with it. **When a release is cut**,
in the cut commit: add its row here, and add a `RELEASES` row with the digest of its set
at that commit. A release that shipped no migration reuses the previous list — 0.6.0 and
0.7.0 point at `RELEASED_0_5_0`, 0.8.1 and 0.8.2 at `RELEASED_0_8_0` — and one that shipped any gets a new
`RELEASED_<version>` with the full cumulative list. A digest is never changed to make the
test pass. The `RELEASES` row is enforced; the row in this table is not.

The replay test (`the_current_reads_work_against_the_last_released_schema`) still
replays 0.5.0's set, not 0.8.0's; see `current.md`.

## Which bytes each release shipped

There are no tags, so each release's migration bytes were established on 2026-10-02 from
git and, where the artefact is still in the author's `dist/`, from the binary itself:
`sqlx::migrate!` embeds each migration's SQL and its SHA-384, so a binary says exactly
which bytes it will check a database against.

- **Git.** `git log --diff-filter=M --follow` on every migration finds two edits ever,
  both to `20260906120200_create_issues.sql` and both to one comment line: `640bbc8`
  (2026-09-08) renamed `SqliteIssueRepo::next_number` to `SqliteRepoRepo::next_number`,
  and `a6819c2` (2026-09-10 22:58) put the 0.4.0 bytes back. No migration was ever
  deleted or renamed. Comparing `git show <release>:migrations/<file>` with HEAD, every
  file at `219c396` (0.4.0), `a6819c2`, `c3543e3` (0.6.0), `3f411b5` (0.7.0) and
  `bac1a59` (0.8.0) is byte-identical to HEAD.
- **The binaries.** The local 0.4.0, 0.5.0, 0.7.0 and 0.8.0 tarballs (each matching its
  `.sha256`) embed the SHA-384 of HEAD's bytes for every migration they carry, and no
  migration SQL beyond those files.

| Release | Set | SHA-256 pinned | Evidence | Settled? |
|---|---|---|---|---|
| 0.5.0 | 22 files | `e94827d7…` | The cut commit `b942dad` still held `640bbc8`'s edited comment (that tree hashes to `01521714…`). Both local 0.5.0 artefacts — aarch64 built 22:59 on 2026-09-10, a minute after `a6819c2`, and x86_64 built overnight — embed the **restored** bytes, not the edited ones. | **Yes, published too** (2026-10-02). The `.sha256` files `jpgill.dev` serves read `20844e9e…` (aarch64) and `ed6b4a60…` (x86_64), the local artefacts' own. So a box first installed at 0.5.0 holds the restored bytes and upgrades without `VersionMismatch`. |
| 0.6.0 | 0.5.0's | `e94827d7…` | Git only: `c3543e3`'s tree, and no commit between `a6819c2` and `a140f84` touches `migrations/`. No 0.6.0 artefact is on the laptop. | From the committed tree. A build from an uncommitted tree cannot be ruled out, though the 0.5.0 and 0.7.0 binaries on either side embed the same bytes. |
| 0.7.0 | 0.5.0's | `e94827d7…` | Every commit from the cut `3f411b5` to `1e37af7`, the last before 0.8.0's migration (`a140f84`), holds the same 22 files at the same bytes, and `20e5b4e` touches no migration. Both local artefacts (16:25 and 16:27 BST, 2026-09-27) embed exactly those 22 and not `instance_settings`. They also carry the copy `20e5b4e` replaced ("Currently building", no new meta description), and the console's D7 record puts the publish at 15:22–15:27 UTC, before `20e5b4e` was committed at 19:12 UTC. So `20e5b4e` is not in these binaries. | **Yes, published too** (2026-10-02): `releases.steid.dev`'s `.sha256` files read `e7fec909…` (aarch64) and `8dcd8c00…` (x86_64), the local artefacts' own. The x86_64 tarball was uploaded twice, five minutes apart (launch 5.2). What is served now is the local build, and the earlier object version was not checked. |
| 0.8.0 | 23 files | `6761cb04…` | `bac1a59`'s tree; both local artefacts (2026-09-28) embed the same 23. | Yes, for the local artefacts. |

Comparing a published `.sha256` with the local one is a read of the release host, which
was not done here.
