Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
🤖 CI report
|
| File | Comment lines | Added lines |
|---|---|---|
products/alerts_platform/backend/facade/contracts.py |
2 | 3 |
products/alerts_platform/backend/facade/scheduling.py |
2 | 22 |
products/logs/backend/alert_source_cycle.py |
2 | 16 |
products/alerts_platform/backend/tests/test_platform_lifecycle.py |
1 | 37 |
products/logs/backend/alert_utils.py |
1 | 4 |
This check does not block merging. It updates on every push and clears when the share drops.
|
Risk: No findings This increment replaces the TEAM_BATCHED_SOURCES set with a Sentinel reviewed |
There was a problem hiding this comment.
Not approved — this change needs a human reviewer.
Re-add the stamphog label to request another review once you have addressed this.
The current-head review has an unresolved scheduling-correctness concern confirmed by the code. Address @PostHog's comment in platform_lifecycle.py by ensuring all due cohorts are handled within the scheduled tick, then request another review from @PostHog/team-apm before re-requesting.
- Author wrote 19% of the modified lines and has 15 merged PRs in these paths (familiarity MODERATE).
- PostHog Review (Standard) reviewed the current head: 1 finding, posted on the PR.
- posthog[bot] reviewed the current head.
- @PostHog on products/alerts_platform/backend/logic/platform_lifecycle.py: The cohort-cap concern remains unaddressed. Logs configurations now share a team scheduling slot, but products/logs/backend/alert_source_cycle.py:637–655 still groups checks by cohort and evaluates only the first four cohorts. Evaluation periods are part of the cohort key, so five alerts with distinct periods can leave one unchecked until a later tick even without exhausting the query budget.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 60L, 4F substantive, 107L/6F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (107L, 6F, two-areas, fix) |
| stamphog 2.5.0 | .stamphog/policy.yml @ 3672b21 · reviewed head 3672b21 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| query_duration_ms=query_duration_ms, | ||
| muted_notification=muted_notification, | ||
| disable=disable, | ||
| schedule_group=_schedule_group(check), |
There was a problem hiding this comment.
P1 · Avoid deriving query shapes for broken configurations
When a configuration has filterGroup.values = null, _triage detects the invalid filter and calls _held to record BROKEN. The new _schedule_group call invokes is_projection_eligible, which iterates that null value and raises TypeError. This aborts the entire batch, leaving valid checks and the broken configuration due on every retry; skip query-shape grouping for broken configurations.
There was a problem hiding this comment.
Not approved — this change needs a human reviewer.
Re-add the stamphog label to request another review once you have addressed this.
@PostHog's substantive concern remains unfixed and can abort a logs alert batch. Skip query-shape grouping for broken configurations, add a regression test covering null filter values alongside valid checks, and address that thread before re-requesting.
- Author wrote 32% of the modified lines and has 15 merged PRs in these paths (familiarity MODERATE).
- PostHog Review (Standard) reviewed the current head: 1 finding, posted on the PR.
- posthog[bot] reviewed the current head.
- @PostHog's unresolved concern in products/logs/backend/alert_source_cycle.py is confirmed: _held calls _recorded for invalid configurations, but _recorded unconditionally computes a schedule group. That calls is_projection_eligible in products/logs/backend/alert_check_query.py, which iterates filterGroup.values without handling null, raising TypeError and aborting batch triage instead of recording the broken configuration and processing valid checks.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 82L, 5F substantive, 138L/8F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (138L, 8F, two-areas, fix) |
| stamphog 2.5.0 | .stamphog/policy.yml @ f396747 · reviewed head f396747 |
Problem
Changes
schedule_grouponPlatformAlertOutcome. The platform puts a team's checks with one group in one slot, and spreads checks without a group by configuration, as before._cohort_keyreads the same helper, so the group and the cohort cannot drift apart.MAX_COHORTS_PER_CYCLE(4), and its extra cohorts would run a tick late on every cycle.compute_team_shard_offset_secondsmoves into the platform facade with the existing uuid5 namespace. Production logs calls it without a group, so its slots do not change.Note
The platform no longer checks a team in the same minute as production logs. The comparison harness already classifies that phase skew separately from real disagreements.
How did you test this code?
Test rationale:
test_platform_lifecycle.py: two configurations whose per-configuration offsets differ land in one slot with a shared group and in two without one. It fails ifrecord_outcomesignoresschedule_group. No existing test checked whererecord_outcomesputs a team's alerts.test_alert_evaluate.py: two same-shape logs alerts carry one group, while a longer window and more evaluation periods each carry their own. It fails if logs stops setting the group, which would silently fall back to the per-configuration spread.test_platform_lifecycle.py,test_alert_evaluate.py,test_scheduling.py,test_grid_scheduling.py,test_shard_offset.py.Release status
Docs update
Updated
docs/internal/alerts-platform-temporal.md.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (
claude-opus-5-5)/writing-tests,/writing-code-comments,/simplify,/code-review high --fix,/writing-pr-descriptions,/reviewing-with-coderabbit,/merging-prs./code-reviewalso raised the one-cycle transition delay. It is accepted, as in fix(logs): shard alert checks by team so a team's alerts share a query #109850.--deep) did not run: "You are not a member of the requested organization". The bot reviews the PR instead.🤖 Generated with Claude Code