Repository navigation
Audit fixes: cross-timezone prompting, mrkdwn escaping, creator gating, scheduler hardening - #1
Merged
Merged
Conversation
…g, scheduler hardening Prompting is now keyed on each participant's OWN local date and weekday (new participants.last_prompt_date, one prompt per person per local day), mapped onto the first channel run whose digest hasn't posted. A Tokyo member of an LA channel gets Monday's prompt on Tokyo's Monday morning; an LA member of a Tokyo channel gets prompted at LA 09:00 for the next undigested run instead of never. Bare /sunup resolves the same way. Every user-supplied string is escaped before it reaches Slack mrkdwn. remove / config / questions are gated on the creator (new standups.created_by) or a Slack admin; removals are logged. Scheduler: reminders skip snoozed users; transient DM failures (429/5xx) retry next tick instead of being marked prompted; the digest is claimed atomically and re-read after posting; reminder floor of 10 minutes; participant tz refreshes on every check-in. Retention purges resolved blockers; kudos leaderboards in reports and the retro are per channel; links are signed with LINK_SECRET or a key derived from the signing secret and verified with crypto.subtle.verify; wrangler ships a placeholder database_id; README and .gitignore updated; hono bumped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the code items from the 2026-11-19 audit (four lenses: claims vs code, fresh install, Slack security, scheduling). Companion site PR: best-coast/sunup.sh#1.
Closed
1. BLOCKING — cross-timezone participants never / wrongly prompted.
computeDuePromptsis now judged purely by each participant's own clock (local weekday is scheduled, local time pastpromptTime, not yet handled for that local day — newparticipants.last_prompt_date). The target run is their local date, advanced past any channel run whose digest already posted but never past the channel's own current date (so a same-day late check-in stays a late check-in). Bare/sunupresolves the run the same way (resolveCheckinRunDate), with off-days falling back to the channel's run. Migration0006.Tests: full-week 10-minute-tick simulations for Tokyo channel + LA member, LA channel + Tokyo member, same-tz baseline, and London channel + LA member across both the US spring-forward (03-08) and the US/UK fall-backs (10-25, 11-01). Every prompt lands at local 09:00–09:09, once per weekday, before its run's digest.
2. MEDIUM — mrkdwn injection.
escapeMrkdwn(& < >) on every user-supplied string (answers, blocker text, kudos, names, questions) at everymrkdwn/message-textcall site;plain_textleft alone. Tested per builder.3. MEDIUM — no authorization.
standups.created_bystored at setup;remove,config(modal and quick edits), andquestionsgated on creator or Slack admin/owner (users.info). Legacy rows withNULLcreator stay open to anyone (documented). Removals and reconfigurations are logged with the actor. README section "Who can manage a check-in".4. Scheduler should-fixes. Reminder loop skips snoozed users. Transient DM failures (429 / 5xx / network / non-JSON body) are not marked prompted and retry next tick; only definite Slack errors give up. Digest is claimed atomically (
UPDATE … WHERE digest_posted_at IS NULL), released if the post fails, and responses are re-read after posting to fold in a racing submission. Reminder must be 0 or ≥ 10 minutes (config and modal). Participant tz refreshes on every check-in submission (setParticipantTzis live).computeStreakignores unanswered future-dated runs.5.
RETENTION_DAYSalso purges resolved blockers in both adapters (open ones kept). Kudos leaderboard in reports and the weekly retro is per channel; App Home stays workspace-wide.6.
wrangler.jsoncshipsREPLACE-WITH-YOUR-D1-DATABASE-ID(dry-run bundle still passes). README: Node 22+ / 24+,db:migrateinteractive confirm, audit-advisories-are-dev-only note, users:read for timezones and display names, adapter size, "no database server to run", retro "up to eight", export "most recent 10,000"..gitignore:*.db*.7. MAC compare via
crypto.subtle.verify(plus strict hex decoding).LINK_SECREToptional; fallback key is HMAC(signing secret, "sunup:link-secret:v1") so the Slack secret is never used directly.hono→ 4.13.19 and@hono/node-server→ 1.19.19 within existing ranges.Deliberately skipped
@hono/node-serveradvisory GHSA-rmxm-3fg6-px4f (serveStatic double-decode) only clears at 2.x; sunup never usesserveStatic, so the major bump wasn't worth it here.users.info), CSV bare-CR edge case, and thesnooze 1nits from the audit.promptTimeare still prompted that same day (pre-existing behaviour, now consistent across timezones).Verification
npm run typecheckclean across all workspaces;npm test73 passing (core 63 incl. 16 new scheduler tests, node storage 10 incl. 5 new);wrangler deploy --dry-runbundles with the placeholder id.🤖 Generated with Claude Code