Repository navigation
fix(ownership): fold repo casing in the ownership-inspect pr-fix read (#1357) - #1371
Conversation
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: MiniMax-M3.1-Flash (anthropic) — primary route · pr-reviewer-action v3.7.0
Recommendation: approve. No blocking or major findings.
- Claims: Held, 3/3. The changed lookup uses the shared canonicalizer, and the five regression cases cover folded lookup values, uppercase-cache discovery, already-folded discovery, no-row behavior, and preservation of the raw casing for the live forge read.
- Change-by-change:
ownership-inspect.tsnow queries the PR-fix queue withnormalizeQueueRepo(repoFullName), matching the queue's persisted identity while leaving the operator-visible and forge-facing repository casing unchanged. - Linked Issue Fit: The implementation directly satisfies PR 1357’s requested source and test changes; the regression coverage demonstrates that uppercase cached repository names no longer suppress open-PR-fix evidence. No migration or schema change is required for this read-side correction.
- Standards Compliance: No documented repository convention is violated; CI at
89c8937reports successful lint, typecheck, tests, and build checks.
Tool Harness Findings
The harness confirmed that normalizeQueueRepo trims and lowercases repository identities, that the changed lookup uses it, and that REVIEW_OWNED with open_pr_fix_queue is derived from the recovered evidence. It also found separate raw-cased reconciliation reads outside this PR's changed path and issue scope. The 24-call budget was exhausted, but the decision-relevant implementation, canonicalizer, state derivation, live-label consumer, and regression tests were inspected.
Sources
Linked issue PR 1357; src/lib/ownership-inspect.ts; src/lib/ownership-inspect.test.ts; src/lib/pr-fix-queue.ts; src/lib/ownership-state.ts; src/lib/claim-gate.ts; CI results for 89c8937.
joryirving
left a comment
There was a problem hiding this comment.
Secondary hard-blocker review on exact head 89c893758c4ee50bb78cbee1d5f2b7082d5b5a1d: APPROVE. This is the exact read-side correction #1357 asks for: only the PrFixQueueItem.repo lookup is normalized through the shared normalizeQueueRepo, matching the queue's persisted lowercase+trim identity, while the cached/operator-visible repository name and live forge read retain the original GitHub-shaped casing. The new fake uses case-sensitive equality like PostgreSQL, so the uppercase-cache regression is load-bearing rather than vacuous; it also pins already-folded, no-row, and live-read casing behavior. The separate reconciliation reads with the same casing issue are outside this narrow path and tracked as #1370. Exact-head primary review is clean and CI/security/image/smoke checks are green; only the AI workflow wrapper's final bookkeeping was still in progress when I submitted this approval. No independent blocker found.
Fixes #1357.
The bug
PrFixQueueItem.repois canonicalized lowercase+trim on every write (normalizeQueueRepo, #1145), butinspectIssueOwnershipread the open-PR-fix evidence with the raw cachedissue.repository.fullName. For a repo cached with uppercase casing (GitHub's canonical casing can carry it), theprFixQueueItem.findFirstread matched nothing and the derived ownership state degraded silently — no error, just a missing open-PR-fix signal.The fix
src/lib/ownership-inspect.ts— theprFixQueueItem.findFirstlookup now folds the repo throughnormalizeQueueRepobefore matching, like every other queue lookup.src/lib/ownership-inspect.test.ts(new) — hermetic regression test: the query receives the folded value, the open-PR-fix evidence is found (derived stateREVIEW_OWNED/open_pr_fix_queue), and the operator-visibleissue.repoFullNameplus the live forge label read keep the cache's raw casing (the fold applies to the queue identity only).No data migration: migration
20261008000000backfolded the legacy rows.Local validation
Run by the coordinator in
/workspaceat89c8937:npx vitest run src/lib/ownership-inspect.test.ts→ 5 passednpm run typecheck→ cleannpm run lint→ 0 errors (1 pre-existing warning in the untouchedsrc/app/login/page.tsx)npm test→ 205 test files passed, 5266 tests passed, 0 failedCI/checks, AI review and human review are explicitly pending — the operator verifies them after this run exits.
Out of scope (follow-up)
src/lib/ownership-reconciliation.tscarries the same raw-casing read in two places (the §8.7 commit-time re-check and the bounded ladder scan). That is a release-gating path, so it is tracked separately as #1370 rather than widened into this fix.Review
A bounded adversarial review of the final diff was run before publishing: APPROVE WITH NITS. It confirmed the fix restores the intended read semantics and the test is non-vacuous; the in-scope nits (a fold-only-the-lookup case, a faithful
agentWorkstate filter in the fake, and the issue-number citation) are fixed in this diff, and the out-of-scope reconciliation sites are filed as #1370. All roles in this run use the same model family, so this review provides no model-family diversity.