You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: production hardening round 2 — migrations, prometheus, restore, CI
Database
- Versioned schema migrations replace the flat SCHEMA list. Each
migration runs inside BEGIN IMMEDIATE and is recorded in a new
schema_version table; partial failures roll back atomically.
- Database.restore_from() closes the live connection, atomically swaps
the database file via a *.restoring temp + os.replace, reopens, and
re-runs migrations. BackupManager.restore_latest()/restore_from()
expose the higher-level helpers.
Observability
- New GET /metrics/prom endpoint emits Prometheus text exposition
(counters as _total, gauges, histograms as summaries with quantiles).
- Service / oracle cache prune wired into the gateway cleanup loop via
duck-typed prune_caches() chain (ToolDispatcher → ServiceDispatcher →
ServiceRegistry → OracleGateway). Evictions reported as caches.evicted.
- MatrixBridge balance lookups now go through a lazily constructed
Web3Manager, falling back gracefully when the chain isn't configured.
Packaging
- pyproject.toml is now the source of truth for metadata, build config,
optional dependency groups, and tool config (pytest/coverage/mypy/
interrogate).
- requirements.txt is runtime-only with ~= pins. Dev tooling moved to
requirements-dev.txt; optional Sentry monitoring extras live in
requirements-monitoring.txt and the [opnmatrx[monitoring]] extra.
CI / repo hygiene
- New CI jobs: mypy, interrogate, pytest-cov, pip-audit, and a Docker
smoke test that builds the image and curls /health.
- New release workflow cuts a GitHub Release on v* tags, builds sdist
+ wheel, and pulls the matching CHANGELOG section as the release body.
- .github/CODEOWNERS, .github/PULL_REQUEST_TEMPLATE.md, and
docs/RUNBOOK.md added.
- ROADMAP.md notes that MTRX iOS lives in a separate repo.
Tests (216 total, all passing)
- New test_db_migrations.py (12 tests): schema versioning, idempotency,
additive migrations, rollback on failure.
- New test_metrics.py (14 tests): counter/gauge/histogram + Prometheus
format.
- New test_websocket.py (8 tests): handle_websocket happy path,
conversation persistence across frames, validation errors, graceful
failure when the ReAct loop raises.
- Extended test_backup.py (5 new tests) and test_graceful_degradation.py
(1 new test) for restore flow and cache eviction.
0 commit comments