Skip to content

Mirror changed-file and ownership inputs for reviewer selection - #17

Merged
ewhauser merged 1 commit into
mainfrom
ownership-inputs
Aug 3, 2026
Merged

Mirror changed-file and ownership inputs for reviewer selection#17
ewhauser merged 1 commit into
mainfrom
ownership-inputs

Conversation

@ewhauser

@ewhauser ewhauser commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Fixes #11 — consumers can relate a PR's current diff to effective user/team owners without a live GitHub read.

  • Changed files: replace-set snapshots fenced by exact base/head SHAs (race-proofed against mid-hydration synchronize), rename tracking, and explicit truncation state at GitHub's 3,000-file cap with documented resync semantics — boundary-tested at 101/3,000/3,001/omitted.
  • CODEOWNERS: effective-source mirroring with GitHub precedence and ref/SHA provenance; a hand-written, dependency-free resolver verified against GitHub's documented sample plus the sharp edges (ownerless rules clearing ownership, * vs **, anchoring, emails as explicit owner_type=email facts, CRLF, renames). Missing/oversized files are documented states.
  • Blame: deliberately not mirrored — CONTRACT.md documents the bounded consumer-side recent-author computation, keeping ranking policy out of the engine. The documented diff-to-owner SQL join runs verbatim as a contract test.
  • Pipeline: refresh wiring across synchronize/force-push/base-change/reopen/reconciliation plus default-branch codeowners pushes (fanout bounded to cached live open PRs, queue-coalesced); one reference event per changing observation; drift heals all three fact families; sampler stays sublinear; recordings additive-compatible.
  • Also hardens a twice-flaked migration-lock leak assertion (async backend teardown → bounded polling).

Built and adversarially reviewed by paired Codex sol-xhigh agents (10 findings fixed). Full gate green locally: build, vet, DB-backed suite, -race -count=3 on changed packages, lint, gen, tidy.

🤖 Generated with Claude Code

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>
@ewhauser
ewhauser merged commit dcc83bd into main Aug 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mirror changed-file and ownership inputs for reviewer selection

1 participant