Mirror changed-file and ownership inputs for reviewer selection - #17
Merged
Conversation
Adds three ownership-input surfaces to the versioned v1 schema: changed-file snapshots per PR head (path, previous path for renames, status, fenced by the exact base and head SHAs of one observation -- adversarial tests prove a synchronize racing GraphQL pagination or the final REST hydration cannot persist mixed-head facts), the effective CODEOWNERS source with GitHub precedence (.github/, root, docs/) and ref/SHA provenance plus missing/oversized states, and resolved user/team owners for touched paths. Snapshots are replace-sets; GitHub's 3,000-file cap and omitted lists surface as explicit truncation state with documented resync semantics (boundary-tested at 101/3,000/3,001/omitted), never silent omission. CODEOWNERS resolution is a hand-written, dependency-free resolver verified against GitHub's documented sample and the sharp edges: anchoring, * versus ** slash behavior, trailing-slash directories, last-match-wins including ownerless rules clearing ownership, escaped spaces, comments, CRLF, case handling, and rename-new-path matching. Email owners persist as explicit owner_type=email unresolved facts; unknown/deleted identities are distinguished. Blame is deliberately not mirrored: CONTRACT.md documents the bounded consumer-side computation from changed paths, participation, and commit authorship, keeping ranking policy out of the engine. The documented diff-to-owner SQL join runs verbatim as a contract test. Ownership refreshes on head/base changes, force-pushes, reopen, reconciliation, and default-branch pushes touching a codeowners path (fanning out to cached live open PRs with queue-coalesced keys). One pull_request.changed per changing observation; identical refreshes emit none; C-C2 freshness gates cover equal-parent CODEOWNERS-only changes. Drift detects and heals all three fact families with Go-sorted null-safe comparisons and stable truncated-truth handling; the sampler stays sublinear; recordings remain additive-compatible. Also hardens TestMigrationLockWaitFailureClosesHijackedConnection's leak check: backend exit is asynchronous relative to client close, so the pg_stat_activity count now polls with a bound (flaked twice in gate runs), matching the earlier lock-release hardening. Fixes #11 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11 — consumers can relate a PR's current diff to effective user/team owners without a live GitHub read.
*vs**, anchoring, emails as explicitowner_type=emailfacts, CRLF, renames). Missing/oversized files are documented states.Built and adversarially reviewed by paired Codex sol-xhigh agents (10 findings fixed). Full gate green locally: build, vet, DB-backed suite,
-race -count=3on changed packages, lint, gen, tidy.🤖 Generated with Claude Code