Problem or Use Case
This is Phase 3 of entity lifecycle management from #234.
Entities created implicitly via first acquire() (without explicit create_entity()) represent transient usage patterns and can safely expire. However, entities explicitly created via create_entity() represent intentional configuration and should persist indefinitely.
Risk of Naive TTL
# Admin configures VIP customer with 10x limits
await limiter.set_limits("enterprise-client", limits=[Limit.rpm(100000)])
# Customer goes on 3-month hiatus...
# Naive TTL deletes config after 90 days
# Customer returns → gets default limits (100 rpm instead of 100,000)
Proposed Solution
Distinguish between auto-created and explicitly-created entities. Apply TTL only to auto-created entities.
| Creation Method |
TTL Behavior |
Implicit (acquire() first-touch) |
TTL = last_activity + N days |
Explicit (create_entity()) |
No TTL (persists indefinitely) |
Acceptance Criteria
Parent Issue
Implements Phase 3 of #234.
Problem or Use Case
This is Phase 3 of entity lifecycle management from #234.
Entities created implicitly via first
acquire()(without explicitcreate_entity()) represent transient usage patterns and can safely expire. However, entities explicitly created viacreate_entity()represent intentional configuration and should persist indefinitely.Risk of Naive TTL
Proposed Solution
Distinguish between auto-created and explicitly-created entities. Apply TTL only to auto-created entities.
acquire()first-touch)create_entity())Acceptance Criteria
acquire()) is distinguishable from explicit (create_entity())entity_ttl_daysparameter controls TTL for auto-created entities (default: disabled)entity_ttl_dayssettingParent Issue
Implements Phase 3 of #234.