Flag idle software seats before they renew

Agent buildEasy10 minServiceNow style

Your task

Software subscriptions pile up: seats nobody uses, renewals that fire unnoticed. An agent flags idle seats for each tool's owner, but only when the renewal is close enough to act on.

Write flag_renewal_window_idle_seats(seat_lines, idle_threshold_days, renewal_lead_days): the rule your agent follows for each seat.

  • seat_lines (list of str): one seat each, written tool|user|idle_days|kind|days_to_renewal, for example "figma|alice|95|human|40". A kind of service marks a service account. idle_days and days_to_renewal are whole numbers.
  • idle_threshold_days (int): how long a seat must be idle to count.
  • renewal_lead_days (int): how far ahead of a renewal the agent starts flagging.
  • Return "tool:user" for every flagged seat, sorted in ascending order. A row that appears twice is flagged twice.

Rules, for each row:

  1. Skip a row that does not split on | into exactly 5 fields.
  2. Skip a service account (kind exactly service).
  3. Skip a seat idle for fewer than idle_threshold_days.
  4. Skip a seat whose days_to_renewal is 0 or less, or above renewal_lead_days.
  5. Flag the rest.

Examples

flag_renewal_window_idle_seats(seat_lines: list[str], idle_threshold_days: int, renewal_lead_days: int) -> list[str]
Example 1
Inputflag_renewal_window_idle_seats(["figma|alice|95|human|40", "figma|bob|3|human|40", "figma|ci-bot|400|service|40"], 60, 45)
Output["figma:alice"]
Example 2
Inputflag_renewal_window_idle_seats(["slack|carol|120|human|120", "slack|dan|120|human|-2", "slack|erin|120|human|30"], 60, 45)
Output["slack:erin"]
Example 3
Inputflag_renewal_window_idle_seats(["zoom|zoe|70|human|10", "asana|amy|80|human|10", "zoom|abe|90|human|10"], 60, 45)
Output["asana:amy", "zoom:abe", "zoom:zoe"]