Repository navigation
Registry: compare a pull request's own commits from its fork point - #582
Merged
Merged
Conversation
history_problems started every walk from the registry at base. On a pull_request event the base is the merge base with master, so once #560 landed, every open pull request branched before it reported each of its own commits as deleting the registry. Any pull request branched after it reported its commits too, as soon as master added an entry: each own commit lacks the entries master added since the fork. The walk now starts from the registry at the first listed commit's first parent, where the listed commits leave landed history: a pull request's fork point. At a merge whose other parent brings in landed history (an ancestor of base that the first parent lacks), the predecessor becomes that parent's registry, and the merge must extend it. A merge bringing in more than one line of landed history is reported. A git failure while reading parents or ancestry raises LookupError. On a push to the base branch the first listed commit's first parent is the before commit, as before. Tests: a pull request from before the registry, unmerged and after a master merge; one built on the registry while master grows; own commits after a master merge that rewrite, delete or drop a landed entry, and a merge that drops one; modify-then-restore on a pull request; a merge of unlanded history; two landed lines; injected git failures; and a property test over generated commit graphs that only the own commits whose registry removes or rewrites an entry of their predecessor are reported. Tiers: unit 18,271 (+17). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Eleven targeted mutants of b6ecd8d's new lines; eight were killed. These tests kill the other three. src/ is unchanged. - test_a_merge_of_contained_history_keeps_its_own_predecessor: a crafted merge of the fork point, already in its first parent, drops an entry a master merge brought in, and a later commit restores it. Without the guard that such a parent brings nothing in, the merge would be compared with the fork's older registry and pass. - test_a_first_commit_that_merges_unlanded_history_starts_at_the_fork: the walk starts from the first listed commit's first parent, so a rewrite carried by an unlanded branch that the first commit merges is reported at the merge. - test_an_unreadable_predecessor_is_reported: a non-JSON registry at the fork point or at a landed parent a merge brings in is reported under its commit. All 11 mutants are now killed. Tiers: unit 18,275 (+4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round-1 review fixes for #582. - A merge among a pull request's own commits that brings in landed history is compared with the union of its own predecessor and the landed parent's registry (_landed_union), not with the landed registry alone. A stale landed branch (another pull request's tip, which lacks master's later growth) can no longer drop an entry the pull request held, and a merge cannot drop the pull request's own registration or its additions to a landed entry. Entries and rules are ordered as the base registry lists them, then the pull request's, then the landed line's, so a landed branch whose own registry is [H001, H003] is merged in master's [H001, H002, H003] order. Fields that differ, and lists that each extend beyond the other, are reported at the merge. - The fork-point start and landed-merge handling apply only with the new pull_request=True, which the committed pull-request check passes. Push walks (pull_request=False) start at the event's before commit and chain first parents, exactly as on master, so a push whose before commit is not on the tip's first-parent line is still checked from it. - Tests: Sol's stale-branch, landed-order and push scenarios as regressions; own extensions kept, dropped and diverged; a dropped own entry; an octopus of a landed and a contained parent (one line); the first-commit start with an unlanded addition; the union's order, sources, rules and conflicts. The property test now generates multi-merge graphs with stale landed side branches (each merge step builds what it merges; 2/3 of examples have 3+ merges). - Tier counts: +16 unit tests (18,291 unit, 24,840 total). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two tests that kill the survivors of the 22-mutant run on aa769ab: - a push whose tip merges a side branch that master dropped an entry of is compared with its first-parent predecessor only, so treating landed merges apart on pushes is caught; - the landed union is complete when the pull request's own registry is, not only when the landed one is. Tiers: unit 18,293, total 24,842. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 2 of review at ac6dfe1 (the coordinator's Opus delta review and Sol) found the landed union failing open. When either line was not union-ready it returned the landed registry silently, and it keyed entries by id and rules by text, so an id or rule listed twice collapsed. Three histories could then hide a change to an own entry's units, and a dropped copy of a repeated rule went unreported. - _union_ready requires each entry id once, as validate does. A line that is not union-ready is reported at the merge, naming it. - Rules are counted in the union: each is keyed by its text and its occurrence, so every copy is kept and dropping one is a removal. validate is unchanged. - A landed merge may also extend the union in the pull request's own order, so a stacked pull request that merged its base request before it landed stays valid once it lands. The endpoint test still requires the base's order at the head. Tests cover the reviews' histories and each surviving mutant: every immutable and extending field as a conflict, malformed rules, counted rules, stacked and own-order merges, own entries reordered at a landed merge, an entry a landed merge adds, a conflicting merge's union as predecessor, and stale landed sides pinned as property examples. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An own commit that fails is reported and is not a predecessor, so a master merge right after it is compared with the union of the last valid registry. No history test had a failing own commit just before a landed merge, so a walk that formed the union from the merge's first parent passed them all. Only the property test could catch it, and whether it does on every run is unconfirmed (the coordinator's round-3 reviewer found Sol's mutant for it surviving the targeted tests at 14c68e4). The test pins both directions: after a rewrite of H001's units, a merge resolved to master's registry passes; after a commit that dropped H006, a merge without it is reported. Tiers: unit 18,332, total 24,881 (the registry module's 2 new items). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
force-pushed
the
trackb-registry-pr-history-fork-point
branch
from
October 25, 2026 04:15
103510d to
789978f
Compare
MaxGhenis
marked this pull request as ready for review
October 25, 2026 05:19
Contributor
Author
|
Merged at Gates at that head
Reviews
The round-3 details are in the body's "Review round 3" and "Mutations" sections. Follow-up: #580 reruns the registry's mutation record on the merged source. |
This was referenced Oct 25, 2026
MaxGhenis
added a commit
that referenced
this pull request
Oct 25, 2026
Brings in #582, the pull-request history check from the fork point. It changed history_problems and the landed union; this branch changes _event and base_commit, so git merged both cleanly. The tier counts are master's until the recount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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 a false positive from #560's
test_a_pull_requests_own_commits_append_only, which is failing CI on open pull requests branched before #560 merged. It failed #567's shard 4 with nine "the registry was deleted" problems, one per own commit.Cause
history_problems(base, head, full=False)walksrev-list --first-parent --reverse base..headand starts fromregistry_at(base). On apull_requestevent,baseis the merge base with master, now a master that has the registry. That breaks two kinds of pull request:Change (
src/populace_dynamics/track_b/holdout_registry.py)history_problemstakes a new keyword,pull_request(defaultFalse). The committed pull-request check passespull_request=True; the push check does not.With
pull_request=True(a pull request's own commits):Start at the fork point. The walk starts from the registry at the first listed commit's first parent, where the listed commits leave landed history. If the fork point has no registry, own commits without one are fine.
Landed merges keep both lines. A merge whose other parent brings in landed history (an ancestor of
basethat the first parent lacks) must extend_landed_unionof its own predecessor and that parent's registry:completeif either line is complete.The merge may instead extend the same union in the pull request's own order: its last valid registry's entries and rules, then the landed line's others. A stacked pull request that merged the request it builds on in its own order, before that request landed, so stays valid once it lands. The endpoint test still requires the base's order at the head, and CI always runs it.
A field that differs between the two lines, or a list that each line extended differently, cannot be kept by any merge, and is reported at the merge. So is a line the union cannot combine: one that lists an entry id twice, or whose entries, rules or sources are malformed. A merge bringing in more than one line of landed history is reported.
Unlanded merges. A merge of history that has not landed is compared with the pull request's own last valid registry.
Without it (pushes), the walk is master's: it starts at
registry_at(base), wherebaseis the push'sbeforecommit, and compares each first-parent commit with its predecessor. Merges are not treated apart.Fail closed. A git failure while reading parents or ancestry raises
LookupError. When one line has no registry, the union is the other line's. When either line repeats an entry id or is malformed, no union is formed: the merge is reported, naming that line ("registry: the pull request's registry cannot be combined at this merge: …", or "the landed registry").Unchanged: the endpoint test (the head extends the base), validation with
full, and the rule that a failing snapshot is not used as the next one's predecessor.Review round 1 (Sol, at b6ecd8d): REQUEST CHANGES, answered in aa769ab
before. Every walk started from the first listed commit's parent, so a push whosebeforeis not on the tip's first-parent line was checked from an older commit. Fixed: push walks start atbefore, exactly as on master. Sol's scenario is a regression.Sol's nonblocking notes are also answered: the property test now reaches multi-merge graphs, and the invariant below states the octopus case.
Review round 2 (at ac6dfe1): the coordinator's Opus delta review and Sol, both REQUEST CHANGES, answered in
3e587ccaThe union failed open (Opus, blocking).
_landed_unionreturned the landed registry, silently, when either line was not union-ready, and keyed entries by id, collapsing an id listed twice. Own commits are not validated (full=False), so three histories could hide a change to an own entry's units:In each, a later commit adds H006 back with other units. Fixed:
_union_readyrequires each entry id once (asvalidatedoes), and a line that is not union-ready is reported at the merge. All three histories are regressions, each reported at its merge.Repeated rules (Sol, medium).
validatelets a rule repeat, but the union keyed rules by text. A master merge that kept a valid [one, one, incomplete] was reported, and [one, incomplete, one] → [one, incomplete] → [one, incomplete, one] passed. Fixed as the coordinator ruled: rules are counted in the union (each keyed by its text and its occurrence), so every copy is kept and dropping one is a removal.validateis unchanged. Both of Sol's histories are regressions, each in both layouts.Stacked pull requests (Opus, nonblocking). B merged an unlanded A in the only order then accepted, its own; once A landed, that merge was reported, and no later commit could repair it. Fixed: a landed merge may also extend the union in the pull request's own order (above). The tradeoff is pinned by a test: an own-first master merge passes the history check, and the endpoint test reports it.
Invariant (1)'s wording (Opus). After a reported landed merge, the predecessor is that merge's union, not the last own snapshot. Corrected below.
Two unmergeable shapes (Opus, Sol; nonblocking, as at round 0 and on master). These are now listed under Limits.
Test gaps (Opus: 6 surviving mutants of
aa769ab7; Sol: 8 scoped survivors of 12). A test now covers each one:status_valuesandcompletion_recordconflicts. The conflict test now runs over every immutable and every extending entry field, from the test module's own lists, soprovenanceandgate_identifiersare included;3e587ccalacked this test: the coordinator's round-3 reviewer found Sol's mutant for it surviving the targeted tests at14c68e4f. Only the property test could catch it, and whether it does on every run is unconfirmed. The test is added in789978f9.Three
@examples pin the stale landed side in the property test: resolved with a drop, resolved correctly, and dropped then restored. The generator reached that class in 0 of 240 examples.Review round 3 (the coordinator's Opus 5.5 delta review, at
14c68e4f, then789978f9): APPROVEEvery round-2 finding, the Opus review's and Sol's, is resolved. Two are now documented limits: u2 and u2b, the two unmergeable shapes.
It reran the round-2 findings:
sources: []is reported at the merge that drops H006;Repeated rules, as a multiset. For both the history check and the endpoint, it checked:
Sol's two layouts pass when kept and are reported when a copy is dropped and later restored.
Regression. Round 1's 39 scenario checks still pass, and push mode matches master's in 1,484 of 1,484 cases.
Replay. Over 389 remote branches, round 3 matches rounds 1 and 2. It differs from master's code only where master reports "the registry was deleted" on branches forked before the registry existed; starting at the fork point removes that by design.
Tests at
789978f9. Both registry modules give 215 passed and 2 skipped (not a pull_request event, and the push-only check). The tier recount matchestier_counts.json.Two nonblocking notes, both applied in this body. Invariant (2)'s wording now says the repeated-id and malformed cases apply when both lines have a registry; when one line has none, the union is the other line's. The round-3 mutation result is below.
Invariants
With
pull_request=True, each own commit is compared with exactly one predecessor:It must extend that predecessor.
A commit is reported if and only if:
A pull request whose own commits never change the registry, and whose merges keep both lines in master's order or its own, reports nothing, however master's registry moves.
With
pull_request=False,history_problemsreturns exactly what master's did, for every history.Tests (
tests/test_track_b_holdout_registry.py, +78 unit over master: 18,332 against 18,254; total 24,881)Round 0 (b6ecd8d, ff29e5e):
gitfailures in the parent and ancestry reads: raise.Round 1 (aa769ab and after):
beforeoff the tip's first-parent line, for delete and rewrite (reported).completefrom either line, missing and malformed inputs, and each kind of conflict.--hypothesis-show-statistics).Round 3 (
3e587cca):789978f9).Mutations
22 targeted mutants of this PR's new lines, each applied to the source alone and run serially against the module's history tests (
-kon pull request, merge, landed, fork, history, push and union tests), then against the property test if those all passed. The source was restored after each one.aa769ab7: 20 of 22 killed. The survivors werelanded_merges_on_pushes(a push walk treating landed merges apart) andcomplete_not_kept(the union complete only when the landed line is).ac6dfe12adds one test for each. Rerun on both: 2 of 2 killed. So 22 of 22 are killed by the tests at the head.Each mutant and the first test that failed
start_at_base_on_pull_requeststest_a_pull_request_from_before_the_registry_passes[False]fork_start_on_pushestest_a_push_is_compared_from_its_before_commit[delete]push_starts_emptytest_a_push_is_compared_from_its_before_commit[delete]no_landed_merges_on_pull_requeststest_a_pull_request_passes_while_master_grows[True]landed_merges_on_pushestest_a_push_compares_a_merge_only_with_its_first_parent_line(survived ataa769ab7; killed byac6dfe12's test)landed_registry_replaces_predecessortest_a_stale_landed_branch_cannot_drop_what_the_pull_request_holdsno_canonical_ordertest_a_pull_request_passes_while_master_grows[True]lists_take_the_landed_versiontest_a_landed_merge_keeps_the_pull_requests_own_extensions[drops]conflicts_ignoredtest_a_landed_merge_keeps_the_pull_requests_own_extensions[diverges]own_extras_left_outtest_a_stale_landed_branch_cannot_drop_what_the_pull_request_holdsstart_at_last_parenttest_a_first_commit_that_merges_unlanded_history_starts_at_the_fork[rewrite]no_containment_exclusiontest_an_octopus_of_a_landed_and_a_contained_parent_is_one_linereversed_containmenttest_an_octopus_of_a_landed_and_a_contained_parent_is_one_linesources_from_landed_onlytest_a_landed_union_orders_by_the_base_and_keeps_both_linescomplete_not_kepttest_a_landed_union_stays_complete_when_the_pull_request_is(survived ataa769ab7; killed byac6dfe12's test)rules_unorderedtest_a_landed_union_orders_by_the_base_and_keeps_both_linesmalformed_returns_previoustest_a_landed_union_orders_by_the_base_and_keeps_both_linesmissing_incoming_returns_nonetest_a_landed_union_orders_by_the_base_and_keeps_both_linesschema_conflicts_skippedtest_a_landed_union_reports_what_no_merge_can_keep[schema]source_conflicts_skippedtest_a_landed_union_reports_what_no_merge_can_keep[source]immutable_conflicts_skippedtest_a_landed_union_reports_what_no_merge_can_keep[unit_keys]divergent_lists_acceptedtest_a_landed_merge_keeps_the_pull_requests_own_extensions[diverges]Round 3, by the coordinator's round-3 reviewer, on the source at
14c68e4fand the tests at789978f9. The source module is byte-identical at3e587cca,14c68e4fand789978f9. There were 21 in-memory mutants: the reviewer's six, Sol's eight scoped survivors and nine on round 3's lines.14c68e4f, the committed tests killed 20 of 21. The survivor wasfailed_own_commit_used_for_union, which forms the union from the merge's first-parent registry instead of the last valid one. It passed the 91 targeted tests. The property test caught it only through a generated example, not a pinned one, so CI could miss it.789978f9addstest_a_landed_merge_after_a_failing_own_commit_unions_the_last_valid[rewrite|drop]. Under that mutant, both cases fail: in rewrite the merge is also reported, and in drop only the drop is. So pinned tests kill all 21 at the head.Replay on the open pull requests
Run at
ac6dfe12on every open pull request's head, with master's tip (fe5ab5ab) as the base. That is CI's base too: on a pull request, the checked-out merge commit's merge base with master is master's tip. Each cell is the number of problems the own-commit check reports: master'shistory_problems, and this PR's withpull_request=True.1f51b60a2d081af94a85f2a1c9c0f4a21ec99fb0bdbd9146bde9d3dd3a07cc1ef78efbc6fda767c2b64705e2a184564b3d69b1fc4f1f70a2f3b9a719f865bb54dc0b63432d0ed992ac6dfe12e1c3c1e6, Track B B0.2: source, exposure, access and power records for B3 through J #554's own first draft of the registry. It added five entries that were not lone candidates, before the registry moved to Track B: held-out data registry for every Track B and open-population gate #560 with its rules. B0.2 will be resubmitted from a fresh branch, without that commit.1e739d32tofe5ab5ab. Master's code and this PR's (pull_request=False) return the same problems on 13 of 13.Limits
Not in this PR
docs/design/track_b_holdout_registry_mutations.jsonstill records the source as of Track B: held-out data registry for every Track B and open-population gate #560. Held-out data registry: round 7's follow-ups (unset event path, record ids, zero push boundary) #580, the round-7 follow-up, reruns the whole record on the merged source after this lands.axiom: n/a: test infrastructure for the held-out data registry
🤖 Generated with Claude Code