Release & CD Cycle
Release & CD Cycle
Section titled “Release & CD Cycle”This runbook covers cutting a product release: the local quality gates, the tag-triggered Docker publish, and the checks after publish. Workspace crates are not published to crates.io. Product delivery is GHCR Docker images, built when you push a vX.Y.Z tag.
Product: v0.40.13 · Contract: OpenAPI · Spec ops: Ingestion cancel & fairness
Upgrade: upgrade-to-0.40.13.md (release-integrity cut: v0.40.8–v0.40.12 are merged back into the mainline, so it can serve 231 again; linear inline-HTML merge; no per-row document scan; schema stays 231). Previous: upgrade-to-0.40.12.md (hybrid vector search uses the 15s graph statement budget; a graph read fails closed until the plain-graph ledger is ready; schema stays 231). Previous: upgrade-to-0.40.11.md (a saved Vertex project is what a Normal or image query embeds with; schema stays 231). Previous: upgrade-to-0.40.10.md (same Edit as v0.40.9; the release job can finish a cold compile; schema stays 231). Previous: upgrade-to-0.40.9.md (Edit on Deployment › Providers; schema stays 231). Previous: upgrade-to-0.40.8.md (a saved Vertex project is used for queries; schema 231). Previous: upgrade-to-0.40.7.md (creating a Vertex workspace uses the saved service account; schema stays 227). Previous: upgrade-to-0.40.6.md (a saved Vertex connection serves vision and embeddings without
GOOGLE_CLOUD_PROJECT; schema stays 227). Previous: upgrade-to-0.40.5.md (Add, Remove, and Update models on Organization › Providers; schema stays 227). Previous: upgrade-to-0.40.4.md (Test connection on a saved provider offers it to organizations; schema stays 227). Previous: upgrade-to-0.40.3.md (a signed-in admin can save a deployment connection, including a Vertex service-account file; schema stays 227). Previous: upgrade-to-0.40.2.md (a stored Vertex credential, current Hugging Face/Cohere/Azure endpoints, honest Base URL; schema stays 227). Previous: upgrade-to-0.40.1.md (honest provider settings, verified Vertex identity, Documents upload UX; schema stays 227), upgrade-to-0.40.0.md (default questions from the corpus, a Normal relevance floor, BM25 counts that ignore empty image chunks; schema 227), upgrade-to-0.39.1.md (picture search citations and a bounded health probe; schema stays 226), upgrade-to-0.39.0.md (Normal RAG workspaces and the rebuilt admin surface; schema 226), upgrade-to-0.38.4.md (provider refresh on/v1bases and lineage pending recovery; schema stays 224), upgrade-to-0.38.3.md (decision-engine model on workspace create; schema stays 224), upgrade-to-0.38.2.md (embedding size and offer revision; schema stays 224), upgrade-to-0.38.1.md (document clearance, secret manager, and one model choice; schema 224), upgrade-to-0.38.0.md (signed MCP upload; schema 219), upgrade-to-0.37.0.md (original bytes in a private bucket; schema 218), upgrade-to-0.36.0.md (members, invitations, access links, and query migrations 208–212; schema 214), upgrade-to-0.35.7.md (admin organization switch and plain-graph search without Apache AGE; schema 207), upgrade-to-0.35.5.md (Postgres images without Apache AGE; schema 207), upgrade-to-0.35.0.md (SPEC-164 plain graph; schema 206).SPEC-001 Acc: not re-scored on this cut. Mix retrieval is unchanged: the fixes are a linear inline-HTML merge and a single-pass highlight mapping, neither of which touches ranking. The latest valid medical-mid n=200 pack remains
medical-mid-20261024T031725Z(valid: true): EdgeQuake 0.8084, LightRAG 0.7681, delta +0.0403, 95% CI [-0.0241, +0.1036] (n_paired 72). The interval includes 0, so this is a statistical tie. EdgeQuake does not claim a win. Decision mode is unscored.Pinned crates.io versions (
edgequake/Cargo.toml):edgequake-llm0.10.9,edgequake-pdf2md0.9.11,edgeparse-core0.3.2. The Rust SDK insdks/rustis version 0.4.1.
Release pipeline
Section titled “Release pipeline”%%{init: {"theme":"base","themeVariables":{"primaryColor":"#E0E7FF","primaryBorderColor":"#6366F1","primaryTextColor":"#1E1B4B","secondaryColor":"#D1FAE5","secondaryBorderColor":"#10B981","secondaryTextColor":"#064E3B","tertiaryColor":"#FEF3C7","tertiaryBorderColor":"#F59E0B","tertiaryTextColor":"#6B7A90","lineColor":"#7A889C","clusterBkg":"rgba(99,102,241,0.07)","clusterBorder":"#A5B4FC","noteBkgColor":"#FEF9C3","noteTextColor":"#422006","textColor":"#6B7A90","titleColor":"#6B7A90","signalColor":"#7A889C","signalTextColor":"#6B7A90","loopTextColor":"#6B7A90","edgeLabelBackground":"#F1F5F9","actorLineColor":"#94A3B8"}}}%%
%% eq-theme:v1
flowchart TB
A["Local gates pass (section 1)"] --> B["Version bump and OpenAPI refresh"]
B --> C["Push tag vX.Y.Z"]
C --> D["release-docker.yml"]
C --> H["release-keycloak.yml"]
D --> E["API image: edgequake"]
D --> F["Frontend image: edgequake-frontend"]
D --> G["Postgres images: pg16, pg17, pg18"]
H --> I["Keycloak image"]
E --> J["Verify: gh release view and imagetools inspect"]
F --> J
G --> J
I --> J
%% eq-classes
classDef eqStore fill:#D1FAE5,stroke:#10B981,color:#064E3B
class G eqStore
One tag push publishes every image. Run the verification step only after both workflows are green.
1) Local Release Gates (must pass before tag)
Section titled “1) Local Release Gates (must pass before tag)”make ops17-smoke # PG pin SSOT (fast, no Docker)make spec046-acc # SPEC-046 Hybrid RAG ACC + JSON artifactmake codegen-openapi-refresh # OpenAPI snapshot + schema.d.ts from ApiDoccd edgequake && cargo test -p edgequake-api --test spec027_api_contract && cd ..make release-gates # fmt + workspace clippy + SPEC-006/018 + WebUI + version/OpenAPI parity # + migration checksum lock + epoch coverage + schema train paritymake test-e2e-lint # Playwright flake anti-patterns# SPEC-001 LightRAG Acc (local mandatory — see section below; not in release_gates.sh / CI):make bench001-doctormake bench # or: make bench-warm# Optional deeper proofs:make spec020-qc-proof-strict # SPEC-020 E2E (migration-038 strict)make spec020-qc-proof-full # SPEC-020 + require Ollama (0 skips)make spec150-matrix-quick # key epochs → HEAD on PG16/17/18 (FORCE_REPLAY)make stopmake spec013-proof-prcd edgequake && cargo clippy -p edgequake-pipeline -p edgequake-core -p edgequake-api --all-targets --features postgres -- -D warningscd ../edgequake_webui && bunx tsc --noEmit -p tsconfig.release.jsoncd .. && make backend-bg frontend-bg && make spec013-proof-uiDoes this release change the schema?
Section titled “Does this release change the schema?”Every upgrade guide and CHANGELOG entry must answer these questions:
| Question | Where to record |
|---|---|
| New numbered migration(s)? | Highest NNN_*.sql; manifest.toml compat_serve_max |
| Epoch coverage? | Add [[epoch]] to scripts/spec150/epochs.toml when the tag exists. Until then, pin the working set under [unreleased] (hash, max, file count). |
| Operator steps? | Link upgrading.md; note if migrate is a no-op |
| Acc re-score needed? | Honest residual in the cut notes |
scripts/release_gates.sh fails if checksums drift, if a published tag lacks an epoch, or if the docs claim a schema maximum other than the highest numbered migration.
Gate options
Section titled “Gate options”- Clippy:
make release-gatesruns workspace clippy. It also runs a slower per-crate clippy loop unlessRELEASE_SKIP_PER_CRATE_CLIPPY=1is set. - Lib tests: the script runs the workspace lib tests unless
RELEASE_SKIP_LIB_TESTS=1is set. - CI: the release workflows set both variables, because
ci.ymlalready runs the lib suite and per-crate clippy is redundant with workspace clippy.
OpenAPI / Swagger (required before tag): regenerate with make codegen-openapi-refresh, then run cargo test -p edgequake-api --test spec027_api_contract. On a running API, curl -s http://localhost:8080/api-docs/openapi.json | jq -r '.info.version' must equal VERSION.
Package dry-run (not a crates.io upload):
cd edgequakefor c in edgequake-observability edgequake-storage edgequake-pdf edgequake-pipeline \ edgequake-query edgequake-tasks edgequake-auth edgequake-audit \ edgequake-rate-limiter edgequake-core edgequake-api; do cargo package -p "$c" --allow-dirty --no-verify 2>/dev/null || cargo package -p "$c" --list >/dev/nulldone2) CI Validation (GitHub Actions)
Section titled “2) CI Validation (GitHub Actions)”CI(fmt, clippy, nextest lib, docs, build) must be green.Test Quality Gates(invariants, test-count floor, e2e lint and UI) must be green.Release Gatesmust be green, or the tag push runs the same preflight insiderelease-docker.yml.SPEC-046 ACCmust be green when query, storage, or spec paths change.SPEC-013 PR Proofand the PostgreSQL integration tests must be green when those paths change.Migration GuardLayer 4 must be green before a schema cut. It runse2e_spec164_v034_large_upgrade: a real v0.34.0 database (schema 169, the published checksum of migration 167) with 80,000 documents, upgraded byedgequake migratethrough 202. Rawsqlx migrate runin Layer 2 does not fold a split ledger or repair that checksum.- Ignore unrelated external automation failures (for example Dependabot noise) only when all required project gates are green.
Speed knobs: a shared Swatinem cache (shared-key: edgequake-ci), sparse crates.io index, no incremental builds, --locked, cancel-in-progress, and no duplicate workspace lib compile across Quality Gates and Release Gates.
Docker CD anti-flake gates (run by make release-gates and scripts/release_gates.sh):
scripts/check_docker_api_context.sh: Cargo[[bench]]and[[example]]paths must exist, the Dockerfile mustCOPYthem, and.dockerignoremust not exclude them.next.config.tssize-limit guard:proxyClientMaxBodySizemust be numeric (DEFAULT_MAX_UPLOAD_BYTES).- The README badge version must match
VERSION, Cargo, andpackage.json. - Per-crate package versions must be
version.workspace = trueor equalVERSION. edgequake_webui/openapi/openapi.snapshot.jsoninfo.versionmust equalVERSION.
3) Cut the Release
Section titled “3) Cut the Release”Push the version tag after the local gates pass:
git tag vX.Y.Zgit push origin vX.Y.ZThe tag triggers two workflows:
.github/workflows/release-docker.ymlbuilds multi-arch API, frontend, and triple-track Postgres images. It pushes:VERSIONand:latesttags, plus:VERSION-pg16,:VERSION-pg17, and:VERSION-pg18, to GHCR. It creates or updates the GitHub Release notes for the tag..github/workflows/release-keycloak.ymlbuilds the Keycloak image after smoke-testing it withscripts/keycloak_smoke.py.
Both linux/amd64 (ubuntu-latest) and linux/arm64 (native ARM64 runner, no QEMU) are built in parallel and merged into one multi-arch manifest. The same tag works on x86 servers, Apple Silicon Macs, and AWS Graviton instances.
Manual run and republish:
- To run the Docker workflow without a new tag, use Actions → Release — Docker (GHCR) → Run workflow and enter
tag_name. - To republish after a CD fix on a release branch, run
gh workflow run "Release — Docker (GHCR)" --ref release/vX.Y.Z -f tag_name=vX.Y.Z. The workflow builds from the branch and still publishes theX.Y.Zandlatesttags.
Do not use make version-tag. It commits, tags, and pushes in one step, so it skips the review of the local gates. Use the explicit git tag and git push commands above.
4) Post-Publish Verification
Section titled “4) Post-Publish Verification”gh release view vX.Y.Zdocker buildx imagetools inspect ghcr.io/raphaelmansuy/edgequake:X.Y.Zdocker buildx imagetools inspect ghcr.io/raphaelmansuy/edgequake-frontend:X.Y.Zdocker buildx imagetools inspect ghcr.io/raphaelmansuy/edgequake-postgres:X.Y.Zdocker buildx imagetools inspect ghcr.io/raphaelmansuy/edgequake-postgres:X.Y.Z-pg16docker buildx imagetools inspect ghcr.io/raphaelmansuy/edgequake-postgres:X.Y.Z-pg17docker buildx imagetools inspect ghcr.io/raphaelmansuy/edgequake-postgres:X.Y.Z-pg18docker buildx imagetools inspect ghcr.io/raphaelmansuy/edgequake-keycloak:X.Y.ZDocker Images Published Per Release
Section titled “Docker Images Published Per Release”| Image | Tags | Description |
|---|---|---|
ghcr.io/raphaelmansuy/edgequake |
VERSION, latest |
Backend API server |
ghcr.io/raphaelmansuy/edgequake-frontend |
VERSION, latest |
Next.js web UI |
ghcr.io/raphaelmansuy/edgequake-postgres |
VERSION, VERSION-pg16, VERSION-pg17, VERSION-pg18, latest |
PostgreSQL with pgvector and AGE |
ghcr.io/raphaelmansuy/edgequake-keycloak |
VERSION, latest |
Keycloak 26.8 or later, with the EdgeQuake realm (SPEC-158) |
Building the Image Locally
Section titled “Building the Image Locally”The Dockerfile is edgequake/docker/Dockerfile. It uses a two-stage build (Rust builder, then Debian slim runtime). The build context is the monorepo root. edgequake-pdf2md is pulled from crates.io at compile time, so no sibling checkout is needed. pdfium is embedded through pdfium-auto, so no external shared library is needed.
# Build for host architecture (from repo root)docker build -f edgequake/docker/Dockerfile . -t edgequake:local
# Multi-platform build (requires docker buildx)docker buildx build \ --platform linux/amd64,linux/arm64 \ -f edgequake/docker/Dockerfile . \ -t edgequake:local --loadDevelopment Workflow
Section titled “Development Workflow”See AGENTS.md for the full developer workflow, including Make commands, database migrations, resource safety, and the specification workflow.
PostgreSQL Version Tiers
Section titled “PostgreSQL Version Tiers”| Tier | PostgreSQL | pgvector | Apache AGE | Notes |
|---|---|---|---|---|
| PG16 | 16.x | 0.8.5 | 1.6.0 | Legacy, stable |
| PG17 | 17.x | 0.8.5 | 1.7.0 | Modern supported |
| PG18 | 18.x | 0.8.5 | 1.8.0 | Default and recommended (SPEC-068 pin) |
See the PostgreSQL migration guide for tier details. The pin matrix lives in edgequake/docker/extension-pins.sh.
SPEC-042 Verification (before tag)
Section titled “SPEC-042 Verification (before tag)”make check-extension-pins # pg16 + pg17 + pg18 pin SSOTmake spec042-battle-test-all # docker battle suite (all tiers + #275)make dev-e2e-proof-all # dev-stack /health proof per profileSPEC-001 LightRAG Acc (before tag)
Section titled “SPEC-001 LightRAG Acc (before tag)”Mandatory local gate before tagging a product cut. Dual-SUT GraphRAG-Bench Acc (EdgeQuake mix vs LightRAG mix, medical-mid n=200) is not part of make release-gates or GitHub Actions. It needs Mistral keys, Postgres, LightRAG, and roughly 1 to 3 hours or more of wall time. It is the same class as the SPEC-042 battle tests: required at cut time, not in CI.
Not substitutes: make spec046-acc (deterministic Hybrid ACC, no LightRAG) · make bench001-smoke-acc (n=40 daily only; not the release Acc score) · an “EQ beats LightRAG” claim (the promote checklist stops it unless CI excludes 0).
Prerequisites
Section titled “Prerequisites”MISTRAL_API_KEYfor the SUT and the judge. Also exportLLM_API_KEY=$MISTRAL_API_KEYif needed.- Postgres running, and an Acc-pinned backend (
make benchstarts it throughbench001-acc-backend). - LightRAG importable, either as the pip package or through
BENCH001_LIGHTRAG_REPO=/path/to/LightRAG. - Optional warm reuse:
BENCH001_EQ_WORKSPACE_ID=<full-corpus-uuid>.
Protocol: SPEC-001 index · runbook 010 · public source of truth eq-vs-lightrag-acc-bench.
Commands
Section titled “Commands”export MISTRAL_API_KEY=...make bench001-doctor # EQ /health, keys, LightRAG, fixture preflightmake bench # Acc backend → doctor → medical-mid n=200 → publish/latest/# Warm query-only (full-corpus workspace already ingested):# export BENCH001_EQ_WORKSPACE_ID=<uuid> # or omit for auto-resolve# make bench-warmAn optional early fail is make bench001-smoke-acc (n=40). It does not replace make bench.
Pass criteria (fail-closed)
Section titled “Pass criteria (fail-closed)”| Check | Requirement |
|---|---|
| Validity | specs/001-benchmark/e2e/artifacts/publish/latest/scorecard.json → valid: true (dual-SUT, official judge, L2, empty-answer and empty-context rate ≤ 5%) |
| Pins | Fair Acc profile (P0_mistral_small_mix_chunk1200_*), EQ and LR mix, chunk 1200/100, extract 40/100 + EDGEQUAKE_EXTRACT_CAPS_SELECTION=fifo (SPEC-117), retrieve top-k 30 |
| Artifacts | publish/latest/: BUSINESS_REPORT.md, EXEC_SUMMARY.txt, SUMMARY.md, scorecard.json |
| Claims | Peer or statistical-tie language only, unless the 080 promote checklist is green |
After a successful run, refresh docs/comparisons/eq-vs-lightrag-acc-bench.md if the Acc numbers or archive pointers moved. Do not tag until this gate is green, or until an explicitly attested, current valid: true pack exists for the cut.
Upgrade notes: SPEC-091 (v0.22.0 to v0.23.0)
Section titled “Upgrade notes: SPEC-091 (v0.22.0 to v0.23.0)”Published v0.22.0 stops at migration 105. v0.23.0 adds migrations 106–141, including irreversible drops (125 KV, 126 chunk-vector, 131 fleet-vector). Do not treat a routine image bump as safe until the soak gate is green.
- Short guide: migrate-to-0.23.md
- Operator runbook: spec091-upgrade-from-v0.22.0.md
- Automated multi-tenant soak:
make spec93-migration-assessment(PG16, 17, and 18 realism; seespecs/93-migration-assessment/). Smoke:make spec091-upgrade-soak. - Spec status:
specs/091-simplify-data-layer/README.md - Boot migration gating (LD-15, behavior change): images built from HEAD never auto-migrate at container start. Boot exits 78 with a dry-run or migrate hint when the schema is behind or newer. Release notes must call this out. Deploys need a one-shot migrate step (a Compose service or a Kubernetes Job; examples are in the runbook) before new replicas can start. Spec:
specs/091-simplify-data-layer/17-boot-migration-gating.md
Lessons from past cuts
Section titled “Lessons from past cuts”- OpenAPI refresh is mandatory after
version-bump.openapi.snapshot.jsoninfo.versionmust equalVERSION, or the release gates fail. - The workspace is not crates.io. Bump all members together, dry-run
cargo package, and ship through the GHCR tag only. - Do not use
make version-tag. It pushes automatically. Tag explicitly after the local gates pass. - Frontend CD builds
edgequake_webui/Dockerfile, notedgequake/docker/Dockerfile.frontend. It mustCOPY openapi/, and it should prefer relative imports forschema.d.ts, because@/*shadows@/openapi/*. - Vision timeouts (X-30): vision stall messages must carry
Operation timed outandfailure_class=.from_processing_errormust use the timeout factory, or the progress-aware breaker never trips. - Benchmark artifacts: keep scorecards only. The medical-full raw JSON exceeds GitHub’s 100 MB limit, so gitignore
artifacts/medical-full*andhistory/medical-full-*. Smoke artifacts may be committed for reproducibility, but cite publish-pack pointers for Acc claims. - Acc language: cite a statistical tie (about 1.01× on a fair cold run). Do not claim an Acc win. The warm LightRAG speed advantage was cache, not algorithm (see 063).
- Baseline flakes: AGE neighbor tests and the SPEC-013 AGE
LOADcheck can stay red when triaged as baseline. Never merge past SPEC-006, clippy, workspace lib, or release-gates failures. - Soft labels: clean opaque AGE node IDs still need a re-ingest.