feat(math): participant-ban leak replication in clojure-legacy mode (Q1)#2644
Draft
jucor wants to merge 1 commit into
Draft
feat(math): participant-ban leak replication in clojure-legacy mode (Q1)#2644jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
The Clojure math worker NEVER honored participants.mod = -1: its ingest path has no mod filter, so banned participants keep influencing user-vote-counts, in-conv, PCA, clustering and repness. Python's real ban feature (mod_out_ptpts row drop in _apply_moderation, 2026-06-10) is correct but a certification divergence. clojure-legacy mode now stores mod_out_ptpts without applying it (rows kept; single choke point: the _apply_moderation row drop is gated on improved mode). Everything downstream then leaks exactly like Clojure. improved mode keeps the ban byte-for-byte. Supersedes the legacy-mode premise of #2623's T1 carry-prune test: banning can no longer shrink the legacy clustering pool, so the stale-carry trap cannot arise; the vote_counts intersection stays as belt-and-braces (comment updated) and the test now pins ban-invariance (TestCarryUnderParticipantBan). TDD: tests/test_mod_ptpt_leak_parity.py — 4 legacy tests RED on old code (rows dropped / not clustered / not counted / not in-conv), GREEN after; improved-mode pin green throughout. Neighbors green: greedy-carry + degenerate-tick suites (22 passed), discrepancy moderation subset (19 passed, 6 pre-existing data skips). commit-id:d4116474
This was referenced Jul 22, 2026
Draft
Draft
docs(delphi): R1-parity goal docs, journal (2026-07-18 → 07-24 s5), quirks + divergence ledger
#2626
Draft
jucor
marked this pull request as draft
July 22, 2026 00:52
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns Delphi’s clojure-legacy engine mode with the historical Clojure math worker behavior where participant bans (participants.mod = -1 / mod_out_ptpts) are stored but not applied, ensuring certification parity, while keeping improved mode’s ban enforcement intact.
Changes:
- Gate
mod_out_ptptsrow-dropping in_apply_moderation()so it only happens inimprovedmode;clojure-legacyretains banned rows to replicate the Clojure leak. - Add a focused parity test suite asserting legacy-mode ban leakage and improved-mode ban enforcement.
- Update the prior greedy-carry “ban prune” test to reflect the new legacy semantics (ban-invariant carry/clustering).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
delphi/polismath/conversation/conversation.py |
Gates participant-row removal on engine mode to replicate Clojure legacy ban leakage while preserving improved behavior. |
delphi/tests/test_mod_ptpt_leak_parity.py |
Adds explicit tests pinning legacy leak semantics vs improved ban enforcement. |
delphi/tests/test_in_conv_greedy_carry.py |
Updates the carry/ban test scenario to assert legacy ban-invariance (superseding the prior prune expectation). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+508
to
512
| if resolve_engine_mode() == ENGINE_MODE_LEGACY: | ||
| keep_ptpts = list(self.raw_rating_mat.index) | ||
| else: | ||
| keep_ptpts = [p for p in self.raw_rating_mat.index if p not in self.mod_out_ptpts] | ||
| self.rating_mat = self.raw_rating_mat.loc[keep_ptpts].copy() |
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.
The Clojure math worker NEVER honored participants.mod = -1: its ingest path
has no mod filter, so banned participants keep influencing user-vote-counts,
in-conv, PCA, clustering and repness. Python's real ban feature
(mod_out_ptpts row drop in _apply_moderation, 2026-06-10) is correct but a
certification divergence.
clojure-legacy mode now stores mod_out_ptpts without applying it (rows kept;
single choke point: the _apply_moderation row drop is gated on improved
mode). Everything downstream then leaks exactly like Clojure. improved mode
keeps the ban byte-for-byte.
Supersedes the legacy-mode premise of #2623's T1 carry-prune test: banning
can no longer shrink the legacy clustering pool, so the stale-carry trap
cannot arise; the vote_counts intersection stays as belt-and-braces
(comment updated) and the test now pins ban-invariance
(TestCarryUnderParticipantBan).
TDD: tests/test_mod_ptpt_leak_parity.py — 4 legacy tests RED on old code
(rows dropped / not clustered / not counted / not in-conv), GREEN after;
improved-mode pin green throughout. Neighbors green: greedy-carry +
degenerate-tick suites (22 passed), discrepancy moderation subset
(19 passed, 6 pre-existing data skips).
commit-id:d4116474
Stack: