You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/test_scoring/test_manipulation_index.py lacks test coverage for the full rollup path (weight × flag → index contribution) for 6 annotate flags that were added after the original test suite was written.
Missing test coverage
The following flags have weight constants in FLAG_WEIGHTS in compute/scoring/manipulation_index.py but no corresponding rollup-path test in test_manipulation_index.py:
Constructs a StockMetrics object with that flag set to True (all others False)
Calls compute_manipulation_index()
Asserts the returned index equals the expected weight contribution (i.e., the FLAG_WEIGHTS[flag_name] value, scaled to 0–100)
This follows the existing pattern in test_manipulation_index.py for the older flags.
Why this matters
The rollup is additive and capped at 100. A mistake in FLAG_WEIGHTS (wrong sign, wrong scale, duplicate key) would silently produce a wrong index. Tests pin the weights against the literature-anchored provenance documented in PR #162.
Summary
tests/test_scoring/test_manipulation_index.pylacks test coverage for the full rollup path (weight × flag → index contribution) for 6 annotate flags that were added after the original test suite was written.Missing test coverage
The following flags have weight constants in
FLAG_WEIGHTSincompute/scoring/manipulation_index.pybut no corresponding rollup-path test intest_manipulation_index.py:loss_avoidance_pattern_size_invariant— added in PR feat(defense): add loss_avoidance_pattern_size_invariant annotate (Phase 4b + Phase 3.x WARN polish) #180 (LOSS_AVOIDANCE_SIZE_INVARIANT_WEIGHT = 5)share_count_extraction_missing— added in PR feat(defense): add share_count_extraction_missing annotate (closes #176) #181 (weight in FLAG_WEIGHTS)insider_sell_cluster— added in PR feat(scoring): Phase 4.5e PR 3 — insider_sell_cluster + c_suite_unusual_sell annotates #222 (INSIDER_SELL_CLUSTER_WEIGHT = 5.0)c_suite_unusual_sell— added in PR feat(scoring): Phase 4.5e PR 3 — insider_sell_cluster + c_suite_unusual_sell annotates #222 (C_SUITE_UNUSUAL_SELL_WEIGHT = 3.0)restatement_high_confidence— added in PR feat(restatement): Epic #150 Phase 2.2 — add restatement_high_confidence annotate #165 (RESTATEMENT_HIGH_CONFIDENCE_WEIGHT = 3.0)extreme_estimate_majority— added in PR feat(defense): add extreme_estimate_majority annotate (issue #177) #183 (weight in FLAG_WEIGHTS)What's needed
For each flag, add a test that:
StockMetricsobject with that flag set toTrue(all othersFalse)compute_manipulation_index()FLAG_WEIGHTS[flag_name]value, scaled to 0–100)This follows the existing pattern in
test_manipulation_index.pyfor the older flags.Why this matters
The rollup is additive and capped at 100. A mistake in
FLAG_WEIGHTS(wrong sign, wrong scale, duplicate key) would silently produce a wrong index. Tests pin the weights against the literature-anchored provenance documented in PR #162.Related
compute/scoring/manipulation_index.pyFLAG_WEIGHTSdict@givenproperty test