This document defines how we verify the ratelord system at different layers of abstraction, ensuring adherence to ACCEPTANCE.md.
- Scope: Pure functions and isolated logic (Policy Engine, Event Serializers, Projection Reducers).
- Approach:
- Test
PolicyEvaluator: Given a set of Inputs + Rules, verify Decision (Approve/Deny). - Test
ForecastModel: Given a time-series of usage, verify P99 calculation. - Test
EventNormalization: Given a raw provider payload, verify canonical Event struct.
- Test
- Goal: High coverage of business logic without IO.
- Scope:
ratelord-dinteractions with SQLite. - Approach:
- Store Test:
- Initialize fresh DB.
- Append 100 events.
- Close DB.
- Re-open and Read events.
- Assert Read == Appended.
- Concurrency Test: Multiple writers (if supported) or rapid serial writes to verify WAL integrity.
- Store Test:
- Goal: Prove
D-01(Clean Start),D-02(Crash Recovery), andD-04(Immutability).
- Scope: The running
ratelord-dprocess and its API. - Tooling:
curl,jq, or a custom test harness script. - Procedure:
- Setup: Start
ratelord-d(clean env). - Register: Call
POST /identities(or CLI) -> Verify 200 OK. - Traffic: Loop
POST /intent100 times. - Verify: Call
GET /events-> Assert count >= 101. - Recovery:
kill -9daemon -> Restart -> CallGET /health.
- Setup: Start
- Goal: Prove
A-01,A-02,D-03,T-01.
| Epic | Test Level | Acceptance Criteria |
|---|---|---|
| Storage | Integration | D-01, D-02, D-04, D-05 |
| API | E2E | A-01, A-02 |
| Identity | E2E | D-06, T-03 |
| Lifecycle | E2E | D-03 |