Skip to content

fix: K6 leaves rate and coefficient columns alone - #105

Merged
svedbg merged 1 commit into
mainfrom
fix/k-checker-rate-columns
Sep 6, 2026
Merged

fix: K6 leaves rate and coefficient columns alone#105
svedbg merged 1 commit into
mainfrom
fix/k-checker-rate-columns

Conversation

@svedbg

@svedbg svedbg commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

_NOT_MONEY excluded day/percentage/hour columns from K5/K6 but not rate or coefficient columns, so a legitimate „Часова ставка" (1000/21/8 = 5.9524) or a чл. 9б НРВПО СИРВ coefficient (25/24 = 1.0417) read as an unrounded accrual on every row. proverki.md's K6 is explicit that it means a sum paid out, not a rate a sum is computed from. Reproduced on a two-row fixture with a four-decimal „Часова ставка" column.

_NOT_MONEY now excludes \bставк[аи]\b and \bкоеф(\.|ициент(и|а)?)?\b, whole word only — the same style as the час/част fix in 2.14.2. K5 gives up the same rate/coefficient columns for a totals row, matching the existing day/percentage trade.

Added a MONEY_LIKE_CASES table pinning _is_money_like() against specific header strings directly, so the next regex fix is checked against every case already handled.

Test plan

  • python test/k_checker_test.py (60 seeds) — K5 28/28, K6 20/20 unchanged, all new cases pass
  • Proved the test has teeth: reverted _NOT_MONEY, watched 11 checks fail, restored it
  • python test/run_tests.py --seeds 25, python test/skill_test.py — green

🤖 Generated with Claude Code

https://claude.ai/code/session_01XvbzEbQwxwxxHAtXfPMrno

К6's exclusion filter (_NOT_MONEY) covered day/percentage/hour columns but not
rate or coefficient columns, so a legitimate „Часова ставка" (1000/21/8 =
5.9524) or a чл. 9б НРВПО СИРВ coefficient (25/24 = 1.0417) read as an
unrounded accrual on every row. proverki.md's K6 is explicit that it means a
sum paid out, not a rate a sum is computed from - reproduced on a two-row
fixture with a four-decimal "Часова ставка" column.

_NOT_MONEY now excludes \bставк[аи]\b and \bкоеф(\.|ициент(и|а)?)?\b, whole
word only, the same way "час" was corrected in 2.14.2 against matching inside
"**час**т". K5 gives up the same rate/coefficient columns for a totals row,
matching the day/percentage trade already made.

test/k_checker_test.py's hand-built fixture now carries a "Часова ставка"
column with four legitimate decimals throughout, left out of the totals row
the way a real export leaves it - the clean fixture must stay silent on it.
A new MONEY_LIKE_CASES table pins _is_money_like() against specific header
strings directly, so the next fix to the exclusion regex is checked against
every case already handled, not only the one it's fixing.

Verified against test/generate_wide.py at 60 seeds: K5 28/28, K6 20/20
unchanged. Confirmed the new test has teeth by reverting to the pre-fix
_NOT_MONEY and watching 11 checks fail before restoring it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XvbzEbQwxwxxHAtXfPMrno
@svedbg
svedbg merged commit 4bc2c25 into main Sep 6, 2026
12 checks passed
@svedbg
svedbg deleted the fix/k-checker-rate-columns branch September 6, 2026 07:45
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