# Detects SET commands without TTL (Time To Live)
# Corpus claim: cache/ttl required true
# Pattern: conn.set without set_ex or SETEX
#
# Violation: conn.set::<_, _, ()>(key, value) without expiration
# Correct: conn.set_ex::<_, _, ()>(key, value, ttl_seconds)
#
# Consequence: Memory leak - unbounded cache growth leads to OOM

[[extractors.declarative]]
name = "ttl_missing"
description = "Detects SET commands without TTL (causes memory leak)"
languages = ["rust"]
pattern = 'conn\.set::<[^>]+>\([^)]+\)\.await\?;'
claim.subject = "ttl"
claim.predicate = "required"
claim.value = false
confidence = 0.85
