Skip to content

Add yearly reset dry-run summary and explicit admin confirmation #134

@HunteRoi

Description

@HunteRoi

Summary

Implement a safe yearly reset workflow that previews changes in a dry-run summary and requires explicit admin confirmation before execution.

Problem

The MVP requires an annual reset flow where users are prompted to refresh roles and guild configuration can be updated ahead of the new school year.

This is a high-impact operation because it can affect:

  • role assignments
  • year/group structure
  • announcement behavior
  • eligibility assumptions across the guild

The specification requires that the reset must not execute blindly. A dry-run and explicit confirmation are mandatory.

Why This Matters

This is a safety-critical MVP workflow.

It protects against:

  • accidental destructive resets
  • stale or incorrect academic-year configuration
  • unintended mass role changes
  • unreviewed announcement execution

Without this guard, the yearly reset is operationally risky.

Required Behavior

  1. Admin can initiate a yearly reset preparation flow.
  2. System produces a dry-run summary of proposed changes.
  3. Reset does not execute until explicit confirmation is received.
  4. Execution and confirmation are audited.
  5. Reset remains tied to the configured year-start workflow already defined in the MVP.

Acceptance Criteria

  1. Dry-run preview is generated before any reset side effect is applied.
  2. Reset cannot run without explicit confirmation.
  3. Preview includes enough information for an admin to review the impact.
  4. Confirmation and execution are both audited with actor and timestamp.
  5. Cancellation path leaves the current guild state unchanged.

Dry-Run Should Include

At minimum:

  • target guild
  • effective reset date
  • current config summary
  • proposed config summary
  • affected role categories
  • affected reset actions
  • announcement intent or preview summary

Suggested Implementation Targets

  • src/commands/admins/announce.ts or a new yearly reset command
  • new scheduler or reset service under src/services
  • prisma/schema.prisma for audit persistence if needed
  • src/services/PostgresDatabaseService.ts

Suggested Technical Direction

Separate yearly reset into two phases:

  1. Plan phase

    • read config
    • compute intended reset actions
    • return preview summary
  2. Execute phase

    • require explicit confirmation token or command path
    • apply changes
    • emit audit records
    • trigger announcement flow

Validation

  • unit test: dry-run computes expected actions without side effects
  • unit test: execute path is blocked without confirmation
  • integration test: confirmed reset applies intended changes
  • integration test: cancelled reset leaves system unchanged
  • audit test: dry-run, confirmation, and execution are all traceable

Traceability

  • Spec: docs/specs/issue-93-specification.md
  • Matrix rule: TRC-014
  • Related docs:
    • docs/specs/traceability-matrix.md
    • docs/specs/issue-drafts.md
    • docs/specs/mvp-scope.md

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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