Skip to content

feat(static-loader): retire stale Section rows without deleting user data #468

Description

@tiankaima

Problem

The current importer upserts rows present in the snapshot but does not retire Sections that disappeared. Production currently has 132 Section rows in the four synchronized semesters that are absent from the latest complete snapshot. Hard deletion would risk comments, descriptions, homeworks, subscriptions, and historical references.

Proposed migration

  • Add explicit source lifecycle metadata such as sourceLastSeenAt/retiredAt.
  • Mark missing in-scope Sections retired only after snapshot completeness validation.
  • Hide retired rows from current catalog/calendar surfaces while keeping direct historical/user-content access intentionally defined.
  • Preserve all user-generated content and audit every retirement/reactivation.

Acceptance criteria

  • No hard deletion of stale Sections or children.
  • Re-importing a Section clears retirement and restores it.
  • Current catalog/calendar queries exclude retired rows; historical/direct access behavior is contract-tested.
  • Production rollout includes before/after counts and a reversible backfill.

Evidence

Latest complete snapshot has 7,918 Sections; production has 8,049 rows across the same four semesters, with 132 production rows absent from the snapshot and one new snapshot row absent from production.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions