Spaces:
Build error
Build error
| """In-memory store for recent incident reports. | |
| Bounded (maxlen), not persisted across restarts -- exists to give the | |
| causal explainer and GET /history recent context, not as a durable audit | |
| trail. The cap protects against unbounded memory growth from | |
| POST /report_incident, which can be called repeatedly by anything holding | |
| a valid internal key. | |
| Shared by app.api.routes_incidents (writes, via report_incident) and | |
| app.api.routes_history (reads, via GET /history) -- both must import this | |
| same object rather than declaring their own list, or writes and reads | |
| silently operate on two different lists. | |
| """ | |
| from collections import deque | |
| incident_history: deque = deque(maxlen=10_000) | |