feat: token economics regression gate with replay tests and perf thresholds #62

Merged
jesse merged 2 commits from feature/token-economics-regression-gate into main 2026-05-04 01:22:18 +02:00
Owner

Summary

  • Adds a hit-rate regression gate (hit_rate_gate.rs) that fails CI when cache hit rate drops below configured thresholds
  • Implements file_cache_replay benchmark and integration-level token_economics_replay test to reproduce Q-07/Q-10 economics conditions
  • Extracts unit tests from check_v2.rs into dedicated check_v2_tests.rs module (~665 lines moved)
  • Updates thresholds.toml with hit-rate floor values and CI workflow to run the gate
  • Adds cross-session search integration test and Q-10 decision evidence

Test Plan

  • cargo test --workspace
  • cargo test -p xtask
  • cargo bench -p cognix-storage --bench file_cache_replay
  • cargo run -p xtask -- perf-check

Self-Review Checklist

  • No hardcoded secrets
  • No unwrap() in library code
  • No println!/dbg!
  • Fail-open degradation preserved
  • Tests cover happy path and error cases
## Summary - Adds a hit-rate regression gate (`hit_rate_gate.rs`) that fails CI when cache hit rate drops below configured thresholds - Implements `file_cache_replay` benchmark and integration-level `token_economics_replay` test to reproduce Q-07/Q-10 economics conditions - Extracts unit tests from `check_v2.rs` into dedicated `check_v2_tests.rs` module (~665 lines moved) - Updates `thresholds.toml` with hit-rate floor values and CI workflow to run the gate - Adds cross-session search integration test and Q-10 decision evidence ## Test Plan - [ ] `cargo test --workspace` - [ ] `cargo test -p xtask` - [ ] `cargo bench -p cognix-storage --bench file_cache_replay` - [ ] `cargo run -p xtask -- perf-check` ## Self-Review Checklist - [x] No hardcoded secrets - [x] No unwrap() in library code - [x] No println!/dbg! - [x] Fail-open degradation preserved - [x] Tests cover happy path and error cases
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
refactor: extract hit rate gate and tests into dedicated modules
All checks were successful
CI / Detect Changes (pull_request) Successful in 9s
CI / Integration Tests (pull_request) Has been skipped
CI / Benchmarks (pull_request) Has been skipped
CI / Format (pull_request) Successful in 16s
CI / Security Scan (pull_request) Successful in 19s
CI / Conventional Validation (pull_request) Successful in 32s
CI / Check file lengths (pull_request) Successful in 30s
CI / Clippy (pull_request) Successful in 2m6s
CI / Check (linux-aarch64 compile-validation) (pull_request) Successful in 2m37s
CI / Documentation (pull_request) Successful in 3m10s
CI / D-02 Clean Build Gate (pull_request) Successful in 6m36s
CI / Deny (pull_request) Successful in 6m59s
CI / Clean Build Sample 1 (pull_request) Successful in 7m7s
CI / Clean Build Sample 3 (pull_request) Successful in 7m12s
CI / Clean Build Sample 2 (pull_request) Successful in 7m15s
CI / Clean Build Summary (pull_request) Has been skipped
CI / Test (pull_request) Successful in 7m38s
CI / Audit (CVEs) (pull_request) Successful in 8m29s
CI / RSS gate (P-15) (pull_request) Successful in 6m23s
CI / Build (release) (pull_request) Successful in 6m43s
CI / PR Size Check (pull_request) Successful in 11s
CI / Coverage (80% gate) (pull_request) Successful in 9m40s
CI / CI Report (pull_request) Successful in 6s
a02379da39
Split check_v2.rs into hit_rate_gate.rs (gate logic) and check_v2_tests.rs
(unit tests), reducing the main module by ~665 lines. Updates CI workflow,
benchmark replay, perf thresholds, and hit_rate test data to match.
jesse merged commit 9ab6a01072 into main 2026-05-04 01:22:18 +02:00
jesse deleted branch feature/token-economics-regression-gate 2026-05-04 01:22:18 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jesse/cognix!62
No description provided.