state-hub/api/routers
tegwick 97c8762a71
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 27s
feat(deploy): run migrations as part of the release, and report schema state
Central was serving two revisions behind the code it shipped: review_contracts
did not exist there although its migration was inside the running image. There
was no migration mechanism at all — bare uvicorn CMD, nothing chart-declared —
and nothing surfaced the mismatch. The API starts happily against a schema it
was not built for and only fails when a request touches a missing table.

Adds a chart-managed Helm pre-install/pre-upgrade hook running alembic upgrade
head, weighted to complete before the API rolls. A hook rather than an init
container: init containers run per pod, so more than one replica means
concurrent alembic upgrade with no locking. Failed jobs are deliberately
retained — a migration that fails and vanishes is how this drifted in the first
place.

/state/health now reports applied and expected revisions. "unknown" is
deliberately not "ok": an instance that cannot establish agreement must not
claim it, the same principle as instance_role defaulting to unknown.

Refs STATE-WP-0083-T07

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 2583210@bnt-lap001
Assistant-Session: f2bff2d5-e9b2-4338-92ca-10282a927006
2026-08-26 00:00:09 +02:00
..
__init__.py
capability_requests.py
consistency_sweep.py
contributions.py
decisions.py feat(review): add multi-owner contracts and receipts 2026-08-22 20:57:51 +02:00
domain_goals.py
domains.py
execution.py fix(retirement): close projection and launch contract gaps 2026-08-23 00:52:18 +02:00
extension_points.py
fabric.py
flows.py
identifier_migrations.py fix(retirement): close projection and launch contract gaps 2026-08-23 00:52:18 +02:00
intake.py CUST-WP-0061-T01: intake work-record entity (stage 3) 2026-07-21 00:27:45 +02:00
interface_changes.py
legacy_meter.py Add 8-hour default window for legacy-meter deploy monitoring 2026-07-09 01:36:02 +02:00
messages.py
ops_runs.py Prepare State Hub retirement baseline 2026-08-09 16:19:53 +02:00
policy.py
progress.py
recently_on_scope.py
reconciliation.py
repo_goals.py
repos.py fix(classification): harden registration updates 2026-08-23 11:30:36 +02:00
review_contracts.py feat(review): add multi-owner contracts and receipts 2026-08-22 20:57:51 +02:00
sbom.py feat: route SBOM writes to Nexus behind flag 2026-08-22 19:55:08 +02:00
services.py
state.py feat(deploy): run migrations as part of the release, and report schema state 2026-08-26 00:00:09 +02:00
suggestions.py feat(STATE-WP-0079): retire the suggestion-backlog surface (slice E1) 2026-08-20 08:11:14 +02:00
tasks.py feat: dual-run config file, bulk writeback, writeback_push 2026-08-16 02:53:13 +02:00
technical_debt.py
token_events.py
topics.py
tpsc.py
workstream_dependencies.py feat(api): retire phase-1/2 /workstreams REST aliases with 410 stranglers 2026-07-10 13:31:57 +02:00
workstreams.py feat(api): retire phase-1/2 /workstreams REST aliases with 410 stranglers 2026-07-10 13:31:57 +02:00