BOHICA-LABS / BOHICA-LABS/writescore

bug: Test expectations out of sync with dimension weights

Open
#4 2 comments 0 reactions 0 assignees View on GitHub
area: scoring priority: medium scope: tech-debt type: bug
Dominant language
Python
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

4 tests in `tests/unit/scoring/test_dual_score_calculator.py` have hardcoded weight expectations that don't match actual dimension weights, causing consistent test failures.

## Failing Tests

| Test | Expected Score | Actual Score | Difference |
|------|---------------|--------------|------------|
| `test_gltr_dimension_high` | 17.195 | 17.68 | +2.8% |
| `test_gltr_dimension_low` | 4.525 | 4.65 | +2.8% |
| `test_mattr_dimension_excellent` | 12.16 | 12.51 | +2.9% |
| `test_mattr_dimension_poor` | 3.2 | 3.29 | +2.8% |

## Steps to Reproduce

```bash
uv run pytest tests/unit/scoring/test_dual_score_calculator.py -k "test_gltr or test_mattr" -v
```

## Root Cause

The test comments reference specific weight values that don't match the actual dimension weights:

```python
# Test comment says:
# Predictability weight is 18.1 (rebalanced to 100% total), high_quality has score=95.0
# normalized = (95.0 / 100.0) * 18.1 = 17.195

# But actual calculation produces 17.68, suggesting actual weight is ~18.61
```

The tests were written assuming specific weight values (18.1 for predictability, 12.8 for advanced_lexical) but the actual weights in the dimension implementations differ.

## Suggested Fix

Either:
1. Update test expectations to match actual dimension weights
2. Or update dimension weights to match documented/expected values

Need to investigate which is the source of truth - the tests or the dimension implementations.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.