Skip to content

Erase terminal-only review activity clocks at result expiry #1232

Description

@jeremi

An automated review of #1189 flagged a retention gap in the review retention pass. In crates/registry-casework/src/review.rs, casework_review_clock_occurrences rows are deleted only where accountability_retained_until <= now, while the request context, tasks, drafts and history are scrubbed at the earlier result expiry.

Failure scenario: a review kind configured with terminalDays < accountabilityDays keeps completed activity-clock rows until the later accountability deadline. Those rows still carry the source, subject type and subject identifiers, the clock policy and the evaluated effects, so source-linked review data survives well past the declared terminal retention, potentially by years at the allowed bounds.

Suggested fix:

  • Delete terminal-only activity occurrences at result expiry, keeping the existing carve-out for subject clocks that genuinely continue across review rounds (those move their request binding to the latest round).
  • Add a Postgres retention test for a kind with terminalDays < accountabilityDays.

Filed from the review of #1189; not merge-blocking.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions