Skip to content

fix(engine): weight local-scorer totalTokenScore with TEST_FILE_CONTRIBUTION_WEIGHT - #9072

Closed
andriypolanski wants to merge 3 commits into
JSONbored:mainfrom
andriypolanski:fix/8875-local-scorer-test-file-weight
Closed

fix(engine): weight local-scorer totalTokenScore with TEST_FILE_CONTRIBUTION_WEIGHT#9072
andriypolanski wants to merge 3 commits into
JSONbored:mainfrom
andriypolanski:fix/8875-local-scorer-test-file-weight

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npx vitest run test/unit/local-scorer.test.ts — 7 passed
  • npm run test --workspace @loopover/engine -- test/local-scorer.test.ts — passed
  • npx vitest run test/unit/mcp-cli-plan-scorer-tools.test.ts -t "loopover_run_local_scorer computes" — passed
  • CI-scoped Codecov simulation — 100% patch lines (4/4) on packages/loopover-engine/src/local-scorer.ts
  • npm run typecheck
  • npm run actionlint
  • npm run test:coverage
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

Narrow engine scoring alignment fix; full test:ci left for CI. Targeted local-scorer + MCP tool tests cover the weighted total and preview agreement path.

Notes for reviewers / gate

  • No secrets, wallets, hotkeys, trust scores, or reward values.
  • Does not touch site/, CNAME, **/lovable/**, or CHANGELOG.md.
  • No UI Evidence (backend-only).

Made with Cursor

andriy-polanski and others added 2 commits July 26, 2026 16:31
…IBUTION_WEIGHT (JSONbored#8875)

Apply the same test-file discount preview.ts uses when deriving totalTokenScore
so feeding localScorer totals back into buildScorePreview no longer bypasses
the gate's contribution-bonus weighting on test-heavy diffs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot closed this Jul 26, 2026
@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

This repository reviews pull requests one-shot: the PR must be correct as originally opened. Pushing an additional commit closes it automatically instead of restarting review — open a fresh pull request with every fix included.

@loopover-orb loopover-orb Bot added review-evasion Gittensor contributor context gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@7e52ae4). Learn more about missing BASE report.
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9072   +/-   ##
=======================================
  Coverage        ?   95.17%           
=======================================
  Files           ?      714           
  Lines           ?    58095           
  Branches        ?    20563           
=======================================
  Hits            ?    55293           
  Misses          ?     1615           
  Partials        ?     1187           
Flag Coverage Δ
backend 95.17% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-engine/src/local-scorer.ts 100.00% <100.00%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. review-evasion Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(engine): local-scorer's totalTokenScore bypasses the TEST_FILE_CONTRIBUTION_WEIGHT discount when fed back into the score preview

2 participants