Skip to content

Feature/testing coverage hibernation bench integration migration rollback - #450

Merged
maugauwi-hash merged 5 commits into
ethos-protocol:mainfrom
Mac-5:feature/testing-coverage-hibernation-bench-integration-migration-rollback
Aug 31, 2026
Merged

Feature/testing coverage hibernation bench integration migration rollback#450
maugauwi-hash merged 5 commits into
ethos-protocol:mainfrom
Mac-5:feature/testing-coverage-hibernation-bench-integration-migration-rollback

Conversation

@Mac-5

@Mac-5 Mac-5 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor
  • Hibernation (ttl-vault): hibernation_consistency_tests.rs verifies TTL freeze stability mid-hibernation, the wake-boundary interval grant, early-exit TTL budget preservation, and a pending admin/credential transition spanning a concurrent hibernation cycle. Guarantees documented in docs/hibernation.md.
  • Benchmark regression detection (ttl-vault): contracts/ttl_vault/benches/baseline.json + scripts/compare_bench_baseline.py compare trigger_release CPU cost against a tracked baseline with a 15% tolerance; wired into CI right after the test step. Update process documented in docs/benchmarking-guide.md.
  • Cross-cutting integration tests (backend): cross_cutting_integration_tests.rs covers 5 previously-untested interactions between auth, rate limiting, and caching (e.g. failed auth never warms the cache, cache/rate-limiter TTL clocks are independent, cache invalidation + audit logging happen together). Backend tests now run in CI for the first time. Documented in docs/integration-testing-guide.md.
  • Migration rollback testing (backend): Db::rollback() with reverse SQL for every existing migration, plus a new data-transformation migration (normalized_frequency backfill) as a non-trivial example. migration_rollback_tests.rs verifies full apply→rollback→reapply schema restoration, per-migration rollback/restore, and that seed data survives a rollback of a data-transforming migration. New docs/migration-testing.md documents the rollback contract and a checklist for future migrations.

Closes #408
Closes #409
Closes #410
Closes #411

Mac-5 added 4 commits August 29, 2026 14:48
Add hibernation_consistency_tests.rs covering the hibernate -> advance
ledger clock -> wake cycle: TTL freeze stability mid-window, the wake
boundary granting a fresh check-in interval, early-exit TTL budget
preservation, and a pending admin (credential) transition spanning a
concurrent hibernation cycle. Document the verified guarantees in
docs/hibernation.md.
Track trigger_release CPU/memory costs in a baseline.json, add
scripts/compare_bench_baseline.py to run bench_trigger_release and
diff results against the baseline within a tolerance threshold, and
wire it into CI right after the test step. Fails the build on
regressions beyond tolerance. Document the baseline update workflow
in docs/benchmarking-guide.md.
Add cross_cutting_integration_tests.rs covering 5 gaps not exercised by
the existing per-module unit tests: auth failures never warm the vault
cache, the rate limiter's budget is independent of auth outcome, both
authorized and unauthorized attempts are audited, cache TTL and rate
limiter window clocks don't interfere, and cache invalidation +
audit logging happen together on a state change. Widen
MessageRateLimiter to pub(crate) so it's testable from a sibling
module. Wire backend tests into CI (previously never run) and document
the new scenarios and required checks in
docs/integration-testing-guide.md.
Add Db::rollback(version) with a DOWN_MIGRATIONS table reversing every
existing up migration, plus a new migration "10" that demonstrates a
data-transformation migration (adds normalized_frequency and backfills
it from frequency, not just a schema change). Add
migration_rollback_tests.rs verifying: a full apply->rollback->reapply
cycle restores the exact schema, each migration's rollback removes and
reapply restores its own table/column, and the data-transformation
migration correctly preserves and re-derives seed data across a
rollback. Wire a dedicated CI step for these tests and document the
rollback-testing requirements and new-migration checklist in the
previously-missing docs/migration-testing.md. Also fixes a private
AuditLogQuery import in the earlier cross-cutting integration tests
(should come from crate::models, not crate::db).
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Mac-5 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@maugauwi-hash
maugauwi-hash merged commit e5a9c48 into ethos-protocol:main Aug 31, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants