max / makenotwork
| 1 | -- Release artifact identity: make build_runs.id the identity object and demote |
| 2 | -- `version` to a label. Design: wiki [[release-artifact-identity]] (decided |
| 3 | -- 2026-07-21). The defect it closes: `version` (a semver read from Cargo.toml) |
| 4 | -- was simultaneously the artifact identity, the gate-evidence key, the |
| 5 | -- deployed-state key, and the staging directory name. Versions bump at release, |
| 6 | -- not per commit, so dev rebuilds overwrote releases/<version>/ in place while |
| 7 | -- the gate rows and burn-in clock from an earlier build stayed green — promote |
| 8 | -- shipped a binary that never passed the gates it was credited with. |
| 9 | -- |
| 10 | -- build_runs (migration 007) is already one row per /rebuild and carries `sha`. |
| 11 | -- It is the right identity object. Everything below is ADDITIVE and nullable: |
| 12 | -- legacy rows keep NULL and are treated as "pre-identity". One fresh |
| 13 | -- build-and-promote cycle re-anchors each tier. An honest NULL beats a |
| 14 | -- fabricated backfill for live prod state. |
| 15 | |
| 16 | -- Identity lives on the build row. |
| 17 | -- bundle_digest: sha256 of the bundle MANIFEST, full 64 hex. Answers "what |
| 18 | -- bytes" — identity. Distinct from `sha` (provenance: "what source"), which |
| 19 | -- already exists on build_runs. Cargo builds are not bit-reproducible, so a |
| 20 | -- digest match across hosts is a strictly stronger claim than a sha match. |
| 21 | -- staged_path: releases/<digest16> — the content-addressed dir the bundle was |
| 22 | -- renamed into. Replaces versions.artifact_path as the source of truth. |
| 23 | build_runs ADD COLUMN bundle_digest TEXT; |
| 24 | build_runs ADD COLUMN staged_path TEXT; |
| 25 | |
| 26 | -- The evidence binds to the build it vouched for, not to a version string. |
| 27 | gate_runs ADD COLUMN build_id INTEGER REFERENCES build_runs(id); |
| 28 | deploys ADD COLUMN build_id INTEGER REFERENCES build_runs(id); |
| 29 | |
| 30 | -- Deployed state points at build rows. previous_build_id keeps exactly one step |
| 31 | -- of rollback history, mirroring the existing (current|previous)_version pair. |
| 32 | tier_state ADD COLUMN current_build_id INTEGER REFERENCES build_runs(id); |
| 33 | tier_state ADD COLUMN previous_build_id INTEGER REFERENCES build_runs(id); |
| 34 | |
| 35 | ON gate_runs(build_id, gate_kind); |
| 36 | ON deploys(build_id); |
| 37 |