Skip to content

Mirror pull-request review requests in the public delivery contract - #13

Merged
ewhauser merged 1 commit into
mainfrom
review-requests
Aug 3, 2026
Merged

Mirror pull-request review requests in the public delivery contract#13
ewhauser merged 1 commit into
mainfrom
review-requests

Conversation

@ewhauser

@ewhauser ewhauser commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Fixes #9 — consumers can now list the currently requested users and teams for a pull request from the public Postgres contract alone.

  • Schema: pull_request_review_requests (migration 0006), replace-set semantics within the PR observation, tombstoned removals, indexed current-request listing query documented in db/CONTRACT.md with grants.
  • Age semantics: requested_at is NULL (GitHub's reviewRequests connection exposes no timestamp); documented COALESCE(requested_at, first_seen_at) with first_seen_at preserved across identical refreshes and reset on re-request.
  • Correctness: atomic with the PR row under the entity lock (C-C3), monotonic against out-of-order fetches (C-C2, with a delayed-fetch regression test), exactly one pull_request.changed on 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.
  • Convergence: backfill, C-R1 sweeps, and webhook-triggered refreshes share one fetch path; drift detects and heals divergent request sets, with set comparisons sorted in Go (the collation lesson).

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=3 on changed packages, lint (nilaway), gen, tidy.

🤖 Generated with Claude Code

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>
@ewhauser
ewhauser merged commit 614e309 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 pull request review requests in the public delivery contract

1 participant