Skip to content

python-math #16: feat(math): participant-ban leak replication in clojure-legacy mode (Q1) - #2644

Draft
jucor wants to merge 1 commit into
spr/edge/96c1f19efrom
spr/edge/d4116474
Draft

python-math #16: feat(math): participant-ban leak replication in clojure-legacy mode (Q1)#2644
jucor wants to merge 1 commit into
spr/edge/96c1f19efrom
spr/edge/d4116474

Conversation

@jucor

@jucor jucor commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Why

Quirk Q1 (delphi/docs/CLOJURE_QUIRKS.md): the Clojure math worker NEVER honored the participant ban (participants.mod = -1) — its ingest path has no mod filter, so banned participants keep influencing user-vote-counts, in-conv membership (the set of participants admitted to clustering), PCA, clustering, and repness (the per-group representative-comment statistics). Python's real ban feature (the mod_out_ptpts row drop in _apply_moderation, added 2026-06-10) is correct, but it is a certification divergence against Clojure.

What

clojure-legacy mode (the engine setting that reproduces the old Clojure engine's behavior exactly) now stores mod_out_ptpts without applying it: the rows are kept, and the 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.

This 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).

Testing

TDD: tests/test_mod_ptpt_leak_parity.py — 4 legacy tests RED on the old code (rows dropped / not clustered / not counted / not in-conv), GREEN after; the improved-mode pin stayed green throughout. Neighbor suites green: greedy-carry + degenerate-tick (22 passed), discrepancy moderation subset (19 passed, 6 pre-existing data skips).

commit-id:d4116474


Stack:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

This was referenced Jul 22, 2026
@jucor
jucor marked this pull request as draft July 22, 2026 00:52
@jucor
jucor changed the base branch from spr/edge/96c1f19e to edge July 22, 2026 02:01
@jucor
jucor changed the base branch from edge to spr/edge/96c1f19e July 22, 2026 02:02
@jucor
jucor changed the base branch from spr/edge/96c1f19e to edge July 22, 2026 02:10
@jucor
jucor changed the base branch from edge to spr/edge/96c1f19e July 22, 2026 02:10
@jucor
jucor changed the base branch from spr/edge/96c1f19e to edge July 22, 2026 03:54
@jucor
jucor changed the base branch from edge to spr/edge/96c1f19e July 22, 2026 03:54
This was referenced Jul 27, 2026
@jucor
jucor force-pushed the spr/edge/96c1f19e branch from 427982d to b58f018 Compare July 28, 2026 00:11
@jucor
jucor force-pushed the spr/edge/d4116474 branch from ef30521 to 2040fcc Compare July 28, 2026 00:11
@jucor jucor changed the title feat(math): participant-ban leak replication in clojure-legacy mode (Q1) python-math #16: feat(math): participant-ban leak replication in clojure-legacy mode (Q1) Jul 28, 2026
…ure-legacy mode (Q1)

## Why

Quirk Q1 (`delphi/docs/CLOJURE_QUIRKS.md`): the Clojure math worker NEVER honored the participant ban (`participants.mod = -1`) — its ingest path has no mod filter, so banned participants keep influencing user-vote-counts, in-conv membership (the set of participants admitted to clustering), PCA, clustering, and repness (the per-group representative-comment statistics). Python's real ban feature (the `mod_out_ptpts` row drop in `_apply_moderation`, added 2026-06-10) is correct, but it is a certification divergence against Clojure.

## What

clojure-legacy mode (the engine setting that reproduces the old Clojure engine's behavior exactly) now stores `mod_out_ptpts` without applying it: the rows are kept, and the 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.

This 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`).

## Testing

TDD: `tests/test_mod_ptpt_leak_parity.py` — 4 legacy tests RED on the old code (rows dropped / not clustered / not counted / not in-conv), GREEN after; the improved-mode pin stayed green throughout. Neighbor suites green: greedy-carry + degenerate-tick (22 passed), discrepancy moderation subset (19 passed, 6 pre-existing data skips).

commit-id:d4116474
@jucor
jucor force-pushed the spr/edge/d4116474 branch from 2040fcc to e70dd41 Compare July 28, 2026 01:10
@jucor
jucor force-pushed the spr/edge/96c1f19e branch from b58f018 to cfcc9e1 Compare July 28, 2026 01:10
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.

2 participants