Skip to content

Simplify codebase, add CI, rename packages to crates - #2

Merged
alexanderattar merged 3 commits into
mainfrom
production-hardening
Jan 16, 2026
Merged

Simplify codebase, add CI, rename packages to crates#2
alexanderattar merged 3 commits into
mainfrom
production-hardening

Conversation

@alexanderattar

@alexanderattar alexanderattar commented Jan 8, 2026

Copy link
Copy Markdown
Owner

Summary

Refactored codebase for clarity and removed over-engineering. Key changes:

  • Removed circuit breaker: Was triggering on normal business logic (no route found), added complexity without benefit for a simulation with no external services
  • Removed rate limiter: No external clients to protect against in this context
  • Renamed BookMeta to OrderbookHealth: Clear field names (last_updated, has_valid_spread) instead of vague ones (updated_at, healthy)
  • Project structure: Renamed packages/ to crates/ to follow Rust conventions
  • CI pipeline: GitHub Actions with fmt, clippy, and test stages
  • Test coverage: Added llvm-cov instructions to README

What remains

The core architecture is unchanged:

  • scc::HashMap for lock-free concurrent orderbook access
  • Point-in-time snapshots for consistent BFS routing
  • Staleness detection (30s TTL) and crossed spread validation
  • Atomic metrics counters

Test plan

  • All 19 unit tests pass
  • All 5 integration tests pass
  • cargo clippy clean
  • cargo fmt --check passes

- Fix TOCTOU race in CircuitBreaker by replacing RwLock with Mutex
- Add token-bucket RateLimiter with configurable rate and burst
- Sanitize error messages to avoid leaking token existence info
- Add GitHub Actions CI pipeline (fmt, clippy, test, build)
- Add cargo-deny config for dependency auditing
- Optimize routing with Arc-wrapped snapshots and arena-based BFS
- Add rustdoc to public APIs
- Add integration tests for end-to-end flows
- Rename packages/ to crates/ (idiomatic Rust structure)
- Remove rust-toolchain.toml (was pinning to 1.82.0)
- Remove CircuitBreaker (trips on normal business logic, not infrastructure failures)
- Remove RateLimiter (no external clients to rate limit in simulation)
- Rename BookMeta to OrderbookHealth with clearer field names
- Add CLAUDE.md for AI tooling context
- Update README with coverage instructions

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread crates/aggregator/src/core/state.rs
@alexanderattar alexanderattar changed the title Add rate limiting, circuit breaker fixes, and CI pipeline Simplify codebase, add CI, rename packages to crates Jan 16, 2026
@alexanderattar
alexanderattar merged commit edd42c2 into main Jan 16, 2026
6 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

Development

Successfully merging this pull request may close these issues.

1 participant