Skip to content

orb(data): merge/close outcomes can be lost with no reconciler — biases the calibration ledger #9026

Description

@JSONbored

pr_outcome (which the fleet calibration export inner-joins on) is written two ways, both in-process best-effort: recordPrOutcome (src/review/outcomes-wire.ts ~404, webhook-only) and recordTerminalActionOutcome (~365) called inside performAction right after the mutation (agent-action-executor.ts ~1055 merge, ~1066 close). The doc comment at ~349-359 documents #8823 and that roughly 55% of closes once had no pr_outcome row, biasing accuracy upward.

#8823 narrowed but did not close the window. A kill between mergePullRequest/closePullRequest and the record call loses the direct write. On re-run the PR is already terminal, so the planner plans nothing and the record never fires. The remaining chance is the inbound closed webhook — which GitHub fired while the container was down and which is never redelivered.

There is no boot or periodic reconciler that scans for merged/closed PRs lacking a pr_outcome row (confirmed by absence — the repair sweep only touches OPEN PRs). Given the calibration work in flight, silent outcome loss corrupts the ground truth the close guarantee is computed from.

Fix

Add a periodic reconciler that lists recently closed/merged PRs (or reads completed agent.action.merge|close audit events) and backfills any missing pr_outcome via recordTerminalActionOutcome — which is already idempotent (~373-378).

Refs #9007.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions