Commit 6f094b6
fix(programs): trigger scope-watch immediately when user searches a program
Closes the gap where Ryan-BBP's new scope wasn't alerting on Discord even after the
user could see it in HackerOne: the warmer was rate-limiting on that program, so its
cached row stayed stale, and the passive watch only fires on warmer refresh — so a
stale row that never gets re-fetched can't trigger an alert.
Fix: when the Programs page on-search debounce force-fetches a program's scope
(POST /api/scope/program-summaries with force=true), the server now also feeds the
fresh summary into ProgramWatchCheckProgram(p). If its latest_target_updated_at is
newer than the watermark, Discord alert fires immediately and the watermark advances
(so the next warmer refresh doesn't re-alert on the same update).
Net effect: searching "ryan-bbp" in the Programs page = wake the watch up for it.
Force-fetches reach H1 directly (no internal 15-min cache to keep masking the new
scope), so a real new asset shows up in Discord within seconds of the search.
Bypasses the boot intro and per-cycle cap so a single force-fetch can fire exactly
one alert per program. No-op when watch disabled or no watermark yet (lets the
warmer establish baseline first).
Verified: go build/vet clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 8d6f824 commit 6f094b6
2 files changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
145 | 174 | | |
146 | 175 | | |
147 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
310 | 317 | | |
311 | 318 | | |
312 | 319 | | |
| |||
0 commit comments