refactor(guardrails): end the record scope match with a final assert_never

CodeQL does not treat a case _ arm as making the match exhaustive, so it
flagged a possible implicit None return. The match now covers the three
scopes and returns assert_never after it, as other matches in the repo do
This commit is contained in:
Caduri Katzav 2026-10-01 17:54:56 +03:00
parent 290ec6f5c9
commit a765188dc7

View file

@ -85,8 +85,7 @@ class RecordScope:
return False
case "per_session":
return session_id is None or self._claim_session(json.dumps((*caller, session_id, input_type)))
case _:
return assert_never(self._scope)
return assert_never(self._scope)
def _claim_session(self, key: str) -> bool:
if self._recorded_sessions.get_cache(key) is True: