Skip to content

feat(atlas): close-out reminders + Ready to publish after sign-off - #367

Merged
UgaTheDev merged 2 commits into
mainfrom
atlas-closeout-followups
Dec 3, 2026
Merged

UgaTheDev merged 2 commits into
mainfrom
atlas-closeout-followups

Conversation

@UgaTheDev

Copy link
Copy Markdown
Contributor

Two follow-ups to the semester close-out (#364).

1. Reminders

  • POST /api/closeout/reminders: Bearer DIGEST_TOKEN with a constant-time compare, and the team comes from DIGEST_ORG (config, never the request). It emails the PM of every close-out that is still open, was emailed, and has a link expiring within 7 days. Each request gets at most one reminder: reminded_at is claimed before the send, so overlapping runs can't double-mail, and the claim is released only for sends that failed.
  • ?dry=1 lists who would be emailed and sends nothing.
  • Uses the existing Resend batch machinery with a short reminder template and the same link.
  • Scheduled as a second step of weekly-digest.yml (no new cron or secret; the URL is derived from DIGEST_URL). The step logs counts only, because the body lists PM emails and Actions logs on this repo are public.
  • Weekly Slack digest: one line per program lead, "N close-outs waiting on ", for submitted but unapproved close-outs. Names only. A lead missing from Settings shows as "a lead not in Settings", never as an email.

2. Ready to publish

  • New approval kind publish: the latest close-out is approved, visibility is hidden or internal, and the project passes publishBlockers (mirrored in SQL like draft).
  • /admin/approvals gets one-click Publish, which goes through PATCH /api/projects/[id] so the server-side publish gate and team scoping apply, plus Not now, which stamps publish_dismissed_at on that close-out row. The next approved close-out is a new row, so it prompts again.
  • HomeTodo labels for publish and closeout.

Migration

009_closeout_followups.sql (+ rollback) adds two nullable timestamps to upload_requests. It is also added lazily in ensureUploadRequestsTable, and schema.sql is updated by hand. Not applied.

Decisions to check

  • restricted projects are excluded from Ready to publish (a deliberate closed choice).
  • A hidden project with an approved close-out shows both as a draft row and a publish row.
  • Reminders go only to links that were actually emailed (last_emailed_to), matching the nudge rule.

Tests

vitest covers the lead-name mapping and digest lines (fictional data) and the reminder email template. tsc --noEmit is clean and the full vitest run passes (261).

🤖 Generated with Claude Code

https://claude.ai/code/session_0152aazG7AAEF6rWPWCedVgY

- /api/closeout/reminders (Bearer DIGEST_TOKEN, DIGEST_ORG): emails the PM of each
  open, emailed close-out expiring within 7 days, once (reminded_at claimed before
  send, released on failure). ?dry=1 lists without sending. Runs as a second step
  of weekly-digest.yml; the step logs counts only.
- Weekly digest: one line per program lead, by name, for submitted close-outs.
- New approval kind 'publish': latest close-out approved, hidden/internal, no
  publish blockers. Publish uses the project PATCH (server gate + team check);
  Not now persists publish_dismissed_at until the next approved close-out.
- Migration 009_closeout_followups (+ rollback, schema.sql, lazy DDL).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0152aazG7AAEF6rWPWCedVgY
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 034ff077-9110-4072-a0ce-f4118ef3f47a
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The digest text now names program leads, and this repo's Actions logs are public.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0152aazG7AAEF6rWPWCedVgY
@UgaTheDev
UgaTheDev merged commit c72a1fb into main Dec 3, 2026
4 checks passed
@UgaTheDev
UgaTheDev deleted the atlas-closeout-followups branch December 3, 2026 21:44
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.

1 participant