Skip to content

repo-fleet-hygiene: merged-pr-tip-drift evidence asserts the commits may never have been pushed when all of them are on GitHub #2603

Description

@kyle-sexton

Context: #2597

Problem

Every merged-pr-tip-drift finding carries evidence wording to the effect that the drifting commits may never have been pushed. On the fleet this was measured against, that is false for every instance checked, and the wording is the kind that makes an operator hesitate over branches that are provably safe.

Evidence

98 merged-pr-tip-drift findings were emitted. Independent verification took a deterministic sample of 5 spanning 3 repositories. All 5 drifts are real — local tip does not equal the merged PR's headRefOid, as claimed. All 5 local tips exist on GitHub (gh api repos/{owner}/{repo}/commits/{tip} → 200).

Characterised:

Repo :: branch Relationship to merged head
ci-runner :: fix/reconcile-watchdog-deadline diverged — ahead 1, behind 17
claude-code-plugins :: docs/row234-newrules-citations behind by 1
claude-code-plugins :: fix/555-prune-worktrees-nonstandard-names behind by 40
claude-code-plugins :: fix/typos-format-disclose-corrections behind by 3
medley :: feat/issue-type-template-defaults behind by 2

The actual mechanism is post-merge remote-branch deletion followed by local pruning, not unpushed work. Note also that in 4 of 5 the PR head object was absent from the local object store, so merge-base was unusable for characterisation and gh api .../compare/{pr_oid}...{local_tip} was required — worth knowing for whatever computes the ahead/behind figures.

The finding itself is correct. Only the explanation is wrong.

Proposed change

  • Replace the "may never have been pushed" wording with the ahead/behind characterisation actually available: whether the local tip is ahead of, behind, or diverged from the merged head.
  • Where the local tip can be confirmed present on the remote, say so — that is the fact that distinguishes "safe but stale" from "unpushed work at risk".
  • Where the PR head object is absent locally, state that the comparison was made via the API rather than silently falling back to a weaker local answer.

Acceptance criteria

  • No merged-pr-tip-drift evidence line asserts an unpushed-work cause without evidence for it.
  • The finding states the direction of drift (ahead / behind / diverged) and the counts.
  • A local tip that exists on the remote is reported as such.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions