Repository navigation
fix(onboarding): make the silence detector observably alive - #955
Merged
Merged
Conversation
Caught during live verification of #954, minutes after it deployed: the first real pass produced no output at all. The cron logged only when it found something, so "ran, everything is fine" and "is dead" were indistinguishable from outside. That is the pod-summarizer failure — a cron failing every six hours for a month while every component reported success — reproduced inside the service written to catch it. An empty result from an unobservable detector is not evidence of a healthy funnel. Three changes, all about making absence readable: - a heartbeat written every pass to SystemSetting `onboardingSilence.lastScan`, whatever the pass found - one log line per pass, unconditionally. 288/day against this log volume is free, and it is what makes the thing greppable in `kubectl logs` - `GET /api/admin/analytics/silence` returns `lastScanAt` and `staleScan`, so a reader can tell "nothing is broken" from "nothing is watching" The heartbeat is best-effort and never suppresses an alert: a Mongo failure while writing it must not turn a real stranded user into silence. Tested. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
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.
Follow-up to #954, found by verifying it live rather than trusting the deploy.
What happened
#954 deployed successfully at 04:35. The cron registered, the startup line was there, the collection and its three indexes were created. Then the first pass ran and produced no output whatsoever — because the code logged only when it found something.
So from outside, these were identical:
That is the
pod-summarizerfailure — a cron failing every six hours for a month while every component reported success — reproduced inside the service written to catch it. I could only establish it was alive by invoking the deployed service by hand, which is exactly the "a human decides to look" problem #954 exists to end.An empty result from an unobservable detector is not evidence of a healthy funnel.
Fix
SystemSetting: onboardingSilence.lastScanevery passkubectl logslastScanAt+staleScanonGET /api/admin/analytics/silenceThe heartbeat is best-effort and explicitly cannot suppress an alert — a Mongo failure while writing it must not turn a real stranded user into silence. There's a test for that specific ordering.
Verified live before writing this
Ran the deployed service against production (image
3e4a5c3f):So detection works — it scanned 14 real messages and correctly found nobody stranded in the live window, and reproduces the same 10 episodes as the pre-merge dry run when given a wider lookback.
Also worth recording: my pre-deploy prediction was wrong. I told Sam the first pass would retroactively alert on ~6–9 historical users. It found zero, because the signup window is 7 days but the message lookback is 24 hours, and the most recent stranded message was ~25 hours old. The two windows are independent and I conflated them. No retroactive batch happens — which is arguably better, but it wasn't what I said.
Those 10 episodes did get written to production by my 21-day verification pass, and I deleted them: they were true, but produced by a hand-run configuration the live cron would never use, and leaving them would make
/silenceimply the alert had been watching since 08-09. Reproducible on demand withscan({ lookbackHours: 24 * 21 }).49 tests green,
tsc:checkclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8