CacheClassification
Corex\Cache\CacheClassification · enum · Core layer
What a stored value actually is — which decides what is allowed to remove it (spec 078, FR-002). This exists because “cache” is a description of where something is kept, not of what it is worth. CoreX keeps two security controls in transients: ThrottleMiddleware counts requests in corex_throttle_*, and TokenReplayGuard marks spent captcha tokens in corex_captcha_seen_*. Both look exactly like cache from the outside, and a sweep of corex_* transients — the obvious implementation of “clear CoreX’s caches” — would reset brute-force protection and re-open the replay window, at precisely the moment an operator is most likely to press the button, because something is already going wrong. A comment saying “do not clear these” would not have prevented that. A classification the clear path has to consult does.
Public API
Section titled “Public API”mayBeClearedRoutinely(): bool
Section titled “mayBeClearedRoutinely(): bool”Whether an ordinary “clear the caches” may remove this. The single question every clear path asks. PendingOperation is deliberately excluded: it is removable, but only when the operator has been told it will discard an in-flight confirmation (FR-004), which is a decision for the caller and not a default.
mayEverBeCleared(): bool
Section titled “mayEverBeCleared(): bool”Whether this may be removed at all, by any operation in this feature. Security state and records are absolute: no scope, no flag and no confirmation makes them clearable here. Removing a rate limit is a security operation and belongs to whatever deliberately owns that; removing a record is a data operation and belongs to retention.
refusalReason(): string
Section titled “refusalReason(): string”Why an operator was refused, in words that say what the thing is rather than what it is not.