Commit 6c1870c
authored
fix(orb): stop a conclusion-derived verdict from overwriting a recorded close (#8826)
Both gate_decision writers key the same deterministic row id
(gate:<source>:<project>#<pr>@<sha>) with ON CONFLICT DO UPDATE, so the
last writer wins. One caller records the ACTUAL disposition the bot
acted on; the other derives the verdict from the gate-check conclusion
alone, where success maps to merge.
On a PR the bot closed for a downstream reason (CI failure, policy) the
conclusion-only writer runs last and clobbers the real close with a
merge. On #5861 the close landed at 20:23:31 and the
contradicting merge verdict was written at 20:23:44 -- 13 seconds after
the PR was already closed.
Fleet calibration reads the latest gate_decision as the gate's
prediction, so every such row is scored as a merge prediction that
ended closed: a false positive that never happened. Measured on the
live self-host, 59 rows carry a verdict timestamped after the close
action it contradicts, out of 210 in that class -- biasing published
accuracy DOWNWARD, opposite to the reversal under-counting in #8823.
Advances #8825 (the recording half; scoring policy closes as their own
class is the remaining part).
The DO UPDATE now skips when the incoming write is conclusion-derived
and the stored decision is already 'close'. A close is a terminal
action that already happened and no later conclusion can un-close it.
An explicit action still replaces it, and non-close rows keep
latest-finalize-wins.1 parent df370e4 commit 6c1870c
2 files changed
Lines changed: 47 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
169 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
170 | 182 | | |
171 | 183 | | |
172 | 184 | | |
173 | | - | |
| 185 | + | |
| 186 | + | |
174 | 187 | | |
175 | | - | |
| 188 | + | |
176 | 189 | | |
177 | 190 | | |
178 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 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 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
150 | 182 | | |
151 | 183 | | |
152 | 184 | | |
| |||
0 commit comments