Skip to content

Rulesets are live references; editing one silently restates completed seasons #114

Description

@alchemydc

Deferred from the PR #99 review. This is a product decision, not a bug — filing it so the current behavior is chosen rather than inherited.

The inconsistency

Two halves of one concern ended up with opposite immutability policies:

  • Season.rulesetId is a live reference. Editing a ScoringSystem immediately restates standings for every season pointing at it. A dropCount edit silently rewrites prior championship results.
  • PAX factors went the opposite way and were frozen per entry (Entry.paxIndexApplied, read via appliedPaxIndex()), specifically so history can't be rewritten by accident. A PAX-table edit only affects existing entries after an explicit per-season re-apply.

Defaults amplify it

Both createSeason (apps/web/src/lib/create-season.ts) and resolveOrCreateSeason (apps/web/src/lib/season-resolve.ts) attach the league's oldest ScoringSystem row when none is named. So sharing one ruleset across every season is the default state, and a single edit reaches all of them.

The preset.update audit does snapshot before/after, which is good and clearly deliberate — but there is no freeze on completed seasons and no copy-on-write.

Proposal

For a club championship archive: refuse a ruleset edit that would alter a season whose status is completed, and provide an explicit clone-and-re-point path (duplicate the ruleset, assign the copy to the active season, edit the copy).

Alternative worth considering: snapshot the policy onto the Season at completion, mirroring what Entry.paxIndexApplied already does for PAX.

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions