Skip to content

fix(ownership): fold repo casing in the ownership-reconciliation pr-fix reads like every other queue lookup #1370

Closed

Description

@itsmiso-ai

The ask: Fold the repo through normalizeQueueRepo in both prFixQueueItem.findFirst reads in src/lib/ownership-reconciliation.ts so the ownership-reconciliation reads match the queue's canonical repo identity.

PrFixQueueItem.repo is canonicalized lowercase+trim on every write (normalizeQueueRepo, #1145; migration 20261008000000 backfolded the legacy rows), but both ownership-reconciliation reads match on the raw cached repository.fullName:

  • src/lib/ownership-reconciliation.ts — the §8.7 commit-time re-check (repo: input.issue.repository.fullName)
  • src/lib/ownership-reconciliation.ts — the bounded ladder scan (repo: repoFullName)

When the issue cache holds uppercase casing (GitHub's canonical casing can carry it), both reads silently find no row:

  • the commit-time re-check misses an open PR-fix queue row, so a REVIEW_OWNED issue can be released while the queue still owns the PR, and the release path strips the agent/* label — breaking the "never release a review-owned claim" rule in docs/ownership-reconciliation.md;
  • the ladder scan under-reports review ownership, so the derived state degrades without an error.

Issue #1357 fixed the identical read in src/lib/ownership-inspect.ts (fold the cached name through normalizeQueueRepo before the query, with a regression test asserting the query receives the folded value); src/lib/ownership-reconciliation.ts was outside that diff.

Expected file: src/lib/ownership-reconciliation.ts and its test. No data migration is needed (migration 20261008000000 backfolded legacy rows).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions