ExpirySignal — Spec Sheet
Primitive type: Temporal validity fact emitter
Execution model: Read-time lookup + time comparison
Hosting model: Self-hosted
Determinism: Deterministic given stored state and time source
Inputs
- Entity identifier such as user, account, token, scope, or custom key
- Expiry timestamp or expiry window written by your system
- Optional context identifier such as scope, feature, or environment
- Time source used at read time
- Optional cause code or renewable metadata written by your system
Outputs
- expired boolean
- expires_at timestamp
- cause_code if present
- renewable boolean if present
- Read-time JSON response for application evaluation
Renewable field
- renewable is operator-provided metadata stored alongside the expiry record.
- It is not computed from rules.
- It does not grant permission to renew.
- If renewal is allowed, your application must implement the renewal workflow and write a new expiry record explicitly.
Guarantees
- Returns stored expiry state as of read time
- Compares stored expiry state against the configured time source
- Does not mutate state on read
- Does not execute side effects on read
Non-guarantees
- Clock correctness or clock synchronization
- Timeliness of expiry writes
- Consistency across distributed systems
- Authorization correctness
- Session invalidation, token revocation, or renewal correctness
- Security, safety, or compliance outcomes
Invariants
- Not expired is not authorized
- Expiry state is not permission
- Absence of an expiry record is not permission
- Renewable metadata is not renewal authorization
- Returned state is application-evaluated
Failure modes
- Clock skew or time mismatch → readers can disagree across deployments
- Missing or delayed expiry write → reads can be wrong
- Identifier mismatch → wrong entity state returned
- Partial writes or database inconsistency → stale or incorrect reads
- Network or database failure → reads can fail or time out
- Application treats “not expired” as automatic permission
Performance characteristics
- Read latency: typically a PostgreSQL point lookup plus time comparison
- Concurrency: limited by your PostgreSQL connection pool and indexes
- Scheduling: none
- Background execution: none
- Time source: your clock; correctness and synchronization are your responsibility
Out of scope
- Session invalidation
- Token revocation
- Request blocking
- Background execution
- Policy definition
- Automatic enforcement
- Renewal workflow execution
Implementation details
- Language: TypeScript (Node.js)
- Interface: HTTP or embedded application call depending on deployment
- Database: PostgreSQL
- Deployment: self-hosted service or embedded local component