Mirror pull-request review requests in the public delivery contract - #13
Merged
Conversation
Adds pull_request_review_requests to the versioned v1 schema (migration 0006): the current set of requested reviewers per PR with user/team kinds, stable GitHub identities plus current login/slug, the observed head SHA, and standard provenance. GitHub exposes no request timestamp on the reviewRequests connection, so requested_at is NULL today and consumers use COALESCE(requested_at, first_seen_at) for request age; identical refreshes preserve first_seen_at, removals tombstone the row (hidden from the documented listing query), and a re-request starts a new age. All semantics are documented in db/CONTRACT.md with an indexed current-request listing query and updated grants. The set is replaced atomically inside the PR observation under the entity advisory lock (C-C3) with monotonic protection: a delayed out-of-order fetch cannot clobber a newer set, and REST list discovery no longer carries request-set authority -- only the locked detail/GraphQL refresh replaces it. A pure request-set change emits exactly one pull_request.changed reference event; identical refreshes emit none. GraphQL follows reviewRequests through every pagination cursor (no silent truncation; fakegithub covers a 104-request boundary) and projects only complete User and Team identities -- Bot, Mannequin, EnterpriseTeam, and null reviewers are excluded by documented policy across fetch, REST, drift, fakegithub, and the loadgen oracle (which compares request sets, excluding cache-local first_seen_at). Drift detects and heals divergent request sets with comparisons sorted in Go, and backfill, sweeps, and webhook-triggered refreshes converge through the shared fetch path. Built and adversarially reviewed by paired Codex sol-xhigh agents; the review hardened stale-backfill monotonicity and the union policy, and removed an unnecessary 0005 view rewrite. Fixes #9 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 #9 — consumers can now list the currently requested users and teams for a pull request from the public Postgres contract alone.
pull_request_review_requests(migration0006), replace-set semantics within the PR observation, tombstoned removals, indexed current-request listing query documented indb/CONTRACT.mdwith grants.requested_atis NULL (GitHub'sreviewRequestsconnection exposes no timestamp); documentedCOALESCE(requested_at, first_seen_at)withfirst_seen_atpreserved across identical refreshes and reset on re-request.pull_request.changedon a pure set change and none on identical refreshes, authoritative pagination through every cursor (104-request boundary test), and a documented union policy: only complete User/Team identities project; Bot/Mannequin/EnterpriseTeam/null are excluded consistently across fetch, drift, fakegithub, and the loadgen oracle.Built and adversarially reviewed by paired Codex sol-xhigh agents (review findings included stale-backfill clobbering and union-member corruption, both fixed with regression tests). Full gate green locally: build, vet, DB-backed suite,
-race -count=3on changed packages, lint (nilaway), gen, tidy.🤖 Generated with Claude Code