prefect-fix-resolve-race-condition

Based on#20106
SegmentInvestigate-and-fix
Typebug
## Task

A few enterprise customers running Prefect Server using compound automations are reporting that under busy event traffic the parent automation sometimes never fires or fires twice when all child events from a single batch came through. Can you please investigate and fix the issue so the parent fire exactly once per legitimate batch?

## General instructions

- The code repo is at /repo/prefect.
- You are inside of a Docker container. You may not be able to perform all operations you would normally be able to do on a local machine. Dependencies have not been pre-installed, and you may need to install them yourself.
- You are expected to act autonomously as a software engineer to complete tasks you are given.
- Do not stop until you feel you have completed the task and your code changes can be merged.
- You may need to use software engineering skills like analyzing the codebase, researching technologies, running services, analyzing logs, etc. to complete the task. Not all tasks will be solvable by reading source code alone.

Agent Results

AgentTastefulBasicVerifierValidationRubricBloatPractTasteCheated
Oracle
3/31.001.0x5.04.0
Opus 4.7
3/31.001.8x4.03.0
Opus 4.8
3/31.001.0x4.04.0
Sonnet 5
3/31.000.8x3.03.0
GLM-5.2
3/31.0x3.02.0
Kimi K2.6
3/31.001.7x2.03.0
Sonnet 4.6
3/31.003.4x3.02.0
Gemini 3.1 Pro
2/31.000.2x3.03.0
Gemini 3.5 Flash
2/30.500.3x4.02.0
GPT-5.4
2/31.001.6x3.02.0
GPT-5.5
2/31.006.2x4.03.0
No-Op
2/30.25
Agent details

Verifier Tests

Gemini 3.1 Pro2/3

Rubric Criteria

Gemini 3.1 Pro4/4
Fail → Pass
serializes_concurrent_compound_trigger_evaluation
atomic_claim_on_clearing_firings
fix_addresses_both_failure_modes
Pass → Pass
preserves_single_child_compound_trigger_semantics

Taste Scores

Patch Bloat0.2x
9 agent / 58 oracle SLOC, 2 / 2 files(raw: 0.5x)
Practice Alignment — 3.0/5
3
style consistency
3
pattern adherence
4
library usage
3
abstraction level
2
documentation fit
Relative Taste — 3.0/5
4
minimality
2
approach quality
3
hygiene
3
fluency
2
craftsmanship

Agent Patch