Repository navigation
Only blame a deploy for drops that started after it - #152
Conversation
query also counts the same length right before the deploy (and in the same 1-4 weeks). analyze flags a website only when it dropped after the deploy and was normal before it, and lists websites that were already down before the deploy separately, such as a site that removed the script earlier that day. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The before window is the hour before the deploy, so a script removed hours earlier isn't diluted by a long window. - A website that was already down is still flagged when it got clearly worse after the deploy (binomial test of the after share). - A before window with too little data is reported as unclear instead of normal. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Walkthrough
Merge Risk:
|
|
SDLC label: |
There was a problem hiding this comment.
🔇 Additional comments: 1
traffic-drop.mts-388-390: 1
388-390:Minor · Functional Correctness · Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Require a practical-size worsening, not only statistical significance, before reporting "worse after the deploy".
The test at Line 388 assumes that
after.baselineandbefore.baselineare exact. It ignores the error in each median-of-weeks baseline, and week-to-week traffic often varies more than Poisson noise. Theafterwindow is also much longer than thebeforehour, so its count is large. For large counts, the binomialspreadis small. A tiny deviation from the baseline ratio can then givez <= -minZ.Example, with large-site numbers:
after.baseline= 24000 andbefore.baseline= 1000.before.count= 400, a 60% drop.after.count= 8800, a 63% drop.- This gives z ≈ -11.8, so the site is labelled "worse after the deploy" for a 3-point difference.
A site that was already down is then flagged and blamed on the deploy. This is the false attribution that issue
#151aims to remove.Add a minimum relative worsening that reuses
minDrop. For example, requireafter.countto be at leastminDropbelow the expected share of the combined count. Use a threshold that is inclusive and matches the>= minDropcheck incompare.Proposed fix
const total = s.after.count + s.before.count; const share = s.after.baseline / (s.after.baseline + s.before.baseline); const spread = Math.sqrt(total * share * (1 - share)); - return spread > 0 && (s.after.count - total * share) / spread <= -minZ + const expected = total * share; + return spread > 0 && + (s.after.count - expected) / spread <= -minZ && + 1 - s.after.count / expected >= minDrop ? "worse after the deploy" : "already down";Check the threshold against the hand-made "already underway" cases from the PR description.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: QUIET
- Plan: Advanced
- Run ID:
8663ef4d-2258-4240-b455-372c2693590f
Files selected for processing: 1-
traffic-drop.mts
Limit details: You’ve used all 10 included reviews currently available.
-
Summary
Fixes #151
pnpm run traffic-drop analyzeflagged ezgif.com after the v12 deploy, but ezgif.com had removed the script hours earlier. The check now also looks at the hour before the deploy, compared with the same hour in the earlier weeks, and says when each drop started:Follow-up requests are printed for the first three labels. The hour before the deploy is used instead of the full length of the comparison window, so a script removed hours earlier isn't diluted in a long window.
These commits were pushed to #144 after it was merged, so they're opened again here.
Security implications
Testing
pnpm run typecheckpasses.GPT-6 Astra reviewed the first version. Its three findings are fixed:
Open workspace in Conductor
Summary by CodeRabbit