[Stack 15/17] Fix D8: match Clojure repful classification (rat > rdt)#2522
Open
jucor wants to merge 1 commit intospr/edge/80eaa87cfrom
Open
[Stack 15/17] Fix D8: match Clojure repful classification (rat > rdt)#2522jucor wants to merge 1 commit intospr/edge/80eaa87cfrom
jucor wants to merge 1 commit intospr/edge/80eaa87cfrom
Conversation
This was referenced Mar 30, 2026
Open
Open
581bff8 to
9077d18
Compare
a19fe4a to
cfd57d1
Compare
9077d18 to
7f80704
Compare
## Summary
Simplifies the repful ("representative for agree or disagree?") classification
to match Clojure's `finalize-cmt-stats` (repness.clj:175-177).
**Before (Python):** 3-branch conditional:
1. `pa > 0.5 AND ra > 1.0` → agree
2. `pd > 0.5 AND rd > 1.0` → disagree
3. Fallback: whichever metric is higher
**After (Clojure):** `rat > rdt` → agree, else disagree.
The old thresholds were redundant — `rat` and `rdt` (two-proportion z-scores)
already encode whether the group's agree/disagree rate is significantly higher
than other groups. The simple comparison is both correct and clearer.
## Changes
- `repness.py`: `finalize_cmt_stats()` — 3-branch logic → `rat > rdt`
- `repness.py`: Vectorized — `np.select` with conditions → `np.where(rat > rdt)`
- `test_discrepancy_fixes.py`: Expanded from 2 to 6 tests (including edge cases:
equal rat/rdt, both negative, both zero)
- Golden snapshots re-recorded (repful direction changes for some comments)
## Test plan
- [x] 6 targeted D8 tests pass (rat>rdt, rat<rdt, equal, both negative, both zero, old-vs-new divergence case)
- [x] Full test suite passes (excluding DynamoDB/MinIO tests)
- [x] Private dataset tests pass (--include-local)
- [x] Golden snapshots re-recorded for all 7 datasets
- [x] 19/19 regression tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Squashed commits
- Journal: add review session entry (2026-03-17)
commit-id:9ec28252
7f80704 to
8c7b7f7
Compare
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.
Summary
Simplifies the repful ("representative for agree or disagree?") classification
to match Clojure's
finalize-cmt-stats(repness.clj:175-177).Before (Python): 3-branch conditional:
pa > 0.5 AND ra > 1.0→ agreepd > 0.5 AND rd > 1.0→ disagreeAfter (Clojure):
rat > rdt→ agree, else disagree.The old thresholds were redundant —
ratandrdt(two-proportion z-scores)already encode whether the group's agree/disagree rate is significantly higher
than other groups. The simple comparison is both correct and clearer.
Changes
repness.py:finalize_cmt_stats()— 3-branch logic →rat > rdtrepness.py: Vectorized —np.selectwith conditions →np.where(rat > rdt)test_discrepancy_fixes.py: Expanded from 2 to 6 tests (including edge cases:equal rat/rdt, both negative, both zero)
Test plan
🤖 Generated with Claude Code
Squashed commits
commit-id:9ec28252
Stack: