Kimi K3.1 Pro · Heavy

feat-workflow-engine-add-in-hook-for-producing-occurrences-from-the-stateful-det-sentry

Sentry · Python · S · 30–99 lines · 3 files

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.

Gold bugs found
2 of 2
Comments published
3
Comments matching a bug
2
Comments not matching
1
Cost of this PR
$1.269

Published comments (3)

highbugsrc/sentry/incidents/grouptype.py:11-12

MetricAlertDetectorHandler is abstract and cannot be instantiated — `Detector.detector_handler` now raises `TypeError` when instantiating the handler registered on `MetricAlertFire`, breaking metric alert evaluation. Implement `counter_names`, `get_dedupe_value`, `get_group_key_values`, and `build_occurrence_and_event_data` on `MetricAlertDetectorHandler`, or retain the previous concrete `DetectorHandler.evaluate` implementation.

mediumbugtests/sentry/workflow_engine/processors/test_detector.py:536-538

Expected occurrence fingerprint uses the wrong group key — The equality assertion fails even when production code is correct because `evaluate_group_key_value` returns a fingerprint for `group_key`, while the expected occurrence uses `val1`. Build the expected occurrence with `group_key`, or pass that key to `evaluate_group_key_value`.

mediumbugtests/sentry/workflow_engine/processors/test_detector.py:244-275

Mock occurrence builder ignores value, masking incorrect measurement forwarding — Occurrence and Kafka assertions can pass even when `evaluate_group_key_value` forwards the wrong measurement because `build_mock_occurrence_and_event` ignores `value`. Expose `value` in returned data such as `evidence_data` and correct expected measurements, or spy on the hook and assert its `(group_key, value, new_status)` calls.

Gold bugs found (2)

highMetricAlertDetectorHandler subclasses StatefulDetectorHandler without implementing its abstract methods, so instantiating it for metric alert detectors raises TypeError where it previously returned an empty-result handler.
mediumThe mock occurrence builder ignores its value argument, so tests (e.g. group_2 expected with 6 while the packet carries 10) pass regardless of which value is passed to build_occurrence_and_event_data.

Gold bugs missed (0)

None.