Skip to content

[Stack 15/17] Fix D8: match Clojure repful classification (rat > rdt)#2522

Open
jucor wants to merge 1 commit intospr/edge/80eaa87cfrom
spr/edge/9ec28252
Open

[Stack 15/17] Fix D8: match Clojure repful classification (rat > rdt)#2522
jucor wants to merge 1 commit intospr/edge/80eaa87cfrom
spr/edge/9ec28252

Conversation

@jucor
Copy link
Copy Markdown
Collaborator

@jucor jucor commented Mar 30, 2026

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

  • 6 targeted D8 tests pass (rat>rdt, rat<rdt, equal, both negative, both zero, old-vs-new divergence case)
  • Full test suite passes (excluding DynamoDB/MinIO tests)
  • Private dataset tests pass (--include-local)
  • Golden snapshots re-recorded for all 7 datasets
  • 19/19 regression tests pass

🤖 Generated with Claude Code

Squashed commits

  • Journal: add review session entry (2026-03-17)

commit-id:9ec28252


Stack:


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

@jucor jucor changed the title Fix D8: match Clojure repful classification (rat > rdt) [Stack 15/17] Fix D8: match Clojure repful classification (rat > rdt) Mar 30, 2026
@jucor jucor force-pushed the spr/edge/9ec28252 branch from 581bff8 to 9077d18 Compare March 30, 2026 22:39
@jucor jucor force-pushed the spr/edge/80eaa87c branch from a19fe4a to cfd57d1 Compare March 30, 2026 22:39
@jucor jucor force-pushed the spr/edge/9ec28252 branch from 9077d18 to 7f80704 Compare March 30, 2026 22:47
## 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
@jucor jucor force-pushed the spr/edge/9ec28252 branch from 7f80704 to 8c7b7f7 Compare March 31, 2026 00:35
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