Skip to content

ci: let the parity gate see main, so drift stops ambushing other PRs - #2142

Merged
ryanbr merged 2 commits into
mainfrom
fix/parity-gate-sees-main
Sep 12, 2026
Merged

ryanbr merged 2 commits into
mainfrom
fix/parity-gate-sees-main

Conversation

@ryanbr

@ryanbr ryanbr commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

The problem

The gate was path-filtered to Tools/ on both triggers. But one of its tests is not about the scanner at all:

test_checked_metadata_is_compact_v3_and_expands_losslessly
  self.assertEqual(self.compact_map["authority"], self.authority)

That asserts the checked-in authority still reproduces from the current product source. Product changes are exactly what invalidates it, and product changes were the one thing the filter excluded.

So main could carry stale authority indefinitely with nothing red, until some later PR touched Tools/ and inherited the whole accumulated drift.

Four staleness events now, and three of them landed on an outside contributor's PR that had caused none of it. Tonight's was #2141: the same 4308 against 4310, the same hashes, failing on main, on that branch, and at 0b0d206 before any of today's merges. @bhelm's change was a comment-and-preservation follow-up that touched the contract test, and that was enough to inherit it.

The change

A daily schedule on main. Drift is found within a day, on main, where re-deriving is a two-minute maintainer action, instead of weeks later on somebody else's work.

Both path filters are untouched.

Why a schedule and not an unfiltered push

My first attempt removed the push filter so the gate would run on every merge to main. The suite's own test_core_tools_filter_covers_every_governance_tool_path caught it:

self.assertEqual([...five paths...] * 2, governance_paths)
self.assertNotIn("'Packages/**/*.swift'", governance)
self.assertNotIn("'android/**/*.kt'", governance)

It pins both filters and forbids product globs. Not running on product source is a deliberate invariant here, not an oversight, and the * 2 says the two triggers must agree. Overturning that to fix a staleness problem would be the wrong trade, and a periodic check keeps the invariant true while still catching drift.

So the paths stay exactly as they were and that test passes unchanged.

What this does NOT fix

The deeper problem is untouched and worth stating plainly: --refresh-derived cannot repair any of this. It fails with migration required because the checked-in authority cannot be reproduced from the base, so the only route is deleting both snapshots and re-bootstrapping. That is a maintainer action no contributor can perform.

This change does not make drift repairable. It makes the maintainer the one who finds out.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • CI / tooling

How it was tested

yaml.safe_load parses the workflow and reports all four triggers. test_core_tools_filter_covers_every_governance_tool_path passes locally, which is the one that rejected the first attempt. The change touches .github/workflows/parity-governance.yml, inside the gate's own pull_request filter, so this PR runs the suite against itself.

Main was re-derived separately in e1c23005 and is green, so a red result here would be about this file rather than inherited.

Related issues

The governance design is #1534. Tonight's instance is visible on #2141.

The gate was path filtered to Tools/ on BOTH triggers. One of its tests
is not about the scanner at all: the repository acceptance asserts the
checked-in authority still reproduces from the CURRENT product source.
Product changes are exactly what invalidates it, and product changes were
the one thing the filter excluded.

So main could carry stale authority indefinitely with nothing red, until
some later PR touched Tools/ and inherited the whole accumulated drift.
Four staleness events now, and three landed on an outside contributor's
PR that had caused none of it. Tonight's was #2141: the same 4308 against
4310 and the same hashes failed on main, on that branch, and at 0b0d206
before any of today's merges.

The push trigger loses its filter. Drift now surfaces on the merge that
caused it, on main, where re-deriving is a two-minute maintainer action,
rather than weeks later on someone else's work.

The pull_request filter is unchanged on purpose. The reason it exists is
sound, that ordinary product changes should not re-run a multi-minute
self-test of the scanner, and with main kept fresh there is no longer
anything for a PR to inherit.

Cost is ~2.5 minutes of ubuntu Python per push to main.

This does NOT fix the deeper problem, which is that --refresh-derived
cannot repair any of this: it fails "migration required" because the
checked-in authority cannot be reproduced from the base, so the only
route is deleting both snapshots and re-bootstrapping, which no
contributor can do. All this change does is make the maintainer the one
who finds out.
The suite is path filtered to Tools/ on both triggers, but one of its
tests is not about the scanner at all: the repository acceptance asserts
the checked-in authority still reproduces from the CURRENT product
source. Product changes are what invalidates it, and product changes are
exactly what both filters exclude. So main could carry stale authority
indefinitely with nothing red, until some later PR touched Tools/ and
inherited the whole accumulated drift.

Four staleness events now, three of them landing on an outside
contributor's PR that caused none of it. Tonight was #2141: the same 4308
against 4310 and the same hashes failing on main, on that branch, and at
0b0d206 before any of today's merges.

A daily run on main finds it within a day, where re-deriving is a
two-minute maintainer action.

Deliberately a schedule rather than an unfiltered push. My first attempt
removed the push filter, and the suite's own
test_core_tools_filter_covers_every_governance_tool_path caught it: that
test pins BOTH filters and forbids product globs, so not running on
product source is a deliberate invariant rather than an oversight. A
periodic check keeps it true. Both path lists are therefore untouched and
that test passes unchanged.

This does NOT make drift repairable. --refresh-derived still fails
"migration required" because the checked-in authority cannot be
reproduced from the base, so the only route remains deleting both
snapshots and re-bootstrapping, which no contributor can do. All this
does is make the maintainer the one who finds out.
@ryanbr
ryanbr merged commit ea5f5bb into main Sep 12, 2026
3 checks passed
@ryanbr
ryanbr deleted the fix/parity-gate-sees-main branch September 12, 2026 12:47
ryanbr added a commit that referenced this pull request Sep 13, 2026
Eight PRs went in together and the authority moved with them: 4313
functions to 4315, one Swift and one Kotlin, which paired (declared twin
references 830 to 831, all resolved). Findings are unchanged at 295, so
no new debt is accepted.

Caused by merging that batch without re-deriving behind it, which is the
risk I flagged before doing it. Sixth staleness event, and the second in
a row that reached nobody else: the ledger's own findings check still
read OK, because it does not compare the pinned authority, and only the
acceptance test does. The daily run added in #2142 would have caught this
tomorrow morning.

Also verified on this tree while here: the full Android unit suite, 708
suites and 6049 tests with 0 failures and 6 skips, after
syncRoomSchemaSnapshot in its own invocation. Those eight merges had all
been tested against d6ad093, before the sidecar rewrite and six
adjacent Oura changes, so a green check on each did not say the batch was
green together. It is.

Regenerated from a PRISTINE clone. parity_ledger_baseline.json came back
byte-identical and is untouched.
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Sep 13, 2026
…e hazard

Invariant 25: fix the test-only identities a branch ADDS; never refresh the parity
map in a feature PR, which ryanbr#2142 made a daily maintainer job. Three dead APIs
removed, rawPart kept with its reason. Both PR descriptions were stale and are
corrected, including an unticked design-token box and an honest statement that
the widened double-tap de-dup has not been through a gym session yet.

Records that the fork testing workflow deletes the release before building, so a
GitHub 502 left the page with no .ipa at all: verify assets, not the title.
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.

1 participant