A retention rule is an approved input to the system, not a duration a model should invent. Boundary dates matter: keeping a record one day too long can contradict the stated policy. Implement the supplied rule and leave legal applicability to the responsible organization and its advisers.
Return record IDs retained under case.retention_days at case.now_day. A record is expired when now_day minus created_day is greater than or equal to the approved duration. Preserve original order. The duration is supplied policy, not a universal legal rule.
The notebook executes your Python against an original local mock. Use the supplied case rather than copying visible values. The hidden checks change identities, revisions and boundary inputs; no provider endpoint or external tool is contacted.
An example implementation of the function contract.