Skip to content

Add jobs/station-signup-attempt-prune for 30-day signup-attempt retention - #2374

Merged
jakebromberg merged 1 commit into
mainfrom
feature/station-signup-attempt-prune
Sep 6, 2026
Merged

Add jobs/station-signup-attempt-prune for 30-day signup-attempt retention#2374
jakebromberg merged 1 commit into
mainfrom
feature/station-signup-attempt-prune

Conversation

@jakebromberg

Copy link
Copy Markdown
Member

Summary

station_signup_attempt grows without bound. This adds a jobs/station-signup-attempt-prune workspace, following the jobs/flowsheet-ghost-row-sweep template, that deletes attempt rows older than the 30-day audit window via the already-exported pruneSignupAttempts (shared/authentication/src/station-passcode.ts).

  • job.ts is a thin lifecycle wrapper calling pruneSignupAttempts() with its default 30-day retention, logging the deleted-row count.
  • Standard jobs/* packaging: package.json, tsconfig.json, tsup.config.ts, logger.ts, README.md.
  • Root Dockerfile.station-signup-attempt-prune; deploy wiring is automatic (deploy-base.yml discovers jobs by directory + job-type in package.json).
  • Registered in docs/ops-cron-scheduling.md's "Excluded / DB-only" section, not the LML slot table — this job never calls @wxyc/lml-client.
  • Split out of jobs/station-signup-review because the failure consequences differ: a failed prune just grows a table, a failed review is a silent security gap, and those want separate alerting.

Test plan

  • tests/integration/station-signup-attempt-prune.spec.js pins the 30-day retention boundary against real Postgres: a row exactly at the cutoff survives, a row 1 second older is deleted, and an all-fresh cohort is a no-op.
  • npm run typecheck --workspace=jobs/station-signup-attempt-prune
  • npm run lint / npm run format:check (repo-wide, clean)
  • npm run test:unit (531 suites / 9406 tests, all passing)
  • Added a CI type-check step for the new workspace in .github/workflows/test.yml, mirroring the sibling station-signup-review step.

Closes #2363

…tion

station_signup_attempt grows without bound. Add a daily cron job workspace, following the jobs/flowsheet-ghost-row-sweep template, that deletes attempt rows older than the 30-day audit window via the already-exported pruneSignupAttempts. Split from jobs/station-signup-review since the failure consequences differ enough to want separate alerting: a failed prune just grows a table, a failed review is a silent security gap.

Registers the job in docs/ops-cron-scheduling.md's DB-only section (it never calls @wxyc/lml-client) and pins the 30-day retention boundary with an integration test against real Postgres.

Closes #2363
@jakebromberg
jakebromberg merged commit 9f67caa into main Sep 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Station signup: jobs/station-signup-attempt-prune for 30-day attempt-log retention

1 participant