fix(cohorts): bound parity testing harness - #69816
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
This reworks an offline parity-testing/diagnostic management command (not production ingestion code, data models, or APIs), is well covered by 90 parameterized unit tests exercising the new logic paths, and the author is on the owning team with STRONG familiarity (100% of touched lines, all files previously modified).
- Author wrote 100% of the modified lines and has 1 merged PRs in these paths (familiarity STRONG).
- 👍 on the PR from hex-security-app[bot].
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 214L, 6F substantive, 433L/8F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (433L, 8F, single-area, fix) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ bf52e45 · reviewed head 6d9cfa9 |
matheus-vb
enabled auto-merge (squash)
July 9, 2026 20:23
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.
Problem
The
compare_cohort_membershipparity harness compares full converged snapshots, but the comparison is asymmetric.The old side is always the complete snapshot while the new side only holds persons the pipeline has emitted for since the store wipe, so every untouched person counts as a divergence.
A cohort level warmup fast path hid this by declaring whole long window cohorts un gatable, so nothing meaningful actually gated.
Changes
This PR reworks how the existing harness diffs and gates membership.
How did you test this code?
90 pure unit tests, no services needed.
They pin the new fold
observedhelper and every classifier verdict path (excluded, fresh, stale, suspect FAIL on a covered window, WARMUP on a long one, the probe skip, the probe cutoff including the inf window overflow guard, the residual threshold, and the raw diff mode).Docs update
No.