Skip to content

feat(dupscore): ignore forced adapter overrides and compare call targets - #807

Merged
kvlonge merged 5 commits into
mainfrom
feat/dupscore-noise
Sep 24, 2026
Merged

kvlonge merged 5 commits into
mainfrom
feat/dupscore-noise

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Why

dupscore clones ranked adapter overrides that the strict-adapter contract test forces to exist as its top duplication, and treated different call targets as identical, so the top of the report was mostly noise. The bundled docs also lagged the 0.115.0 docs site, and the SQL test coverage rules page did not describe the shipped empty-input detection.

Changes

  • [[contract_exemption]]: overrides that test_strict_adapter.py forces (contract methods that would otherwise be inherited from BaseAdapter/StrictAdapter) are derived statically from source, marked [forced], listed last and not counted toward ranking. Links are hidden only when both ends are forced, and overrides with unresolved repository ancestors are never exempt.
  • Normalisation keeps call-target names in Python and Rust; short near-miss pairs need similarity >= 0.9.
  • JSON members gain forced_override; the summary reports hidden contract-exempt members.
  • Refresh the bundled docs from sqlbuild-docs and correct docs/sql-test-coverage-rules.md.

Verification

  • Repository report: 449 -> 344 clusters; top-30 precision 11/30 -> 29/30; an independent random sample of 12 judged 12/12 genuine; about 8 s.
  • tests/unit/scripts/dupscore (155 passed) and make check-ci.

Hide similarity links between methods that the strict adapter contract forces every adapter to define itself, keep call-target names in normalised token streams so same-layout functions that call different helpers no longer match as renamed clones, and require a 0.9 ratio for near-miss pairs of units under 80 tokens.
…copies

List forced contract overrides after the other cluster members, mark them [forced] in text and forced_override in JSON, and leave them out of the duplicated-token estimate that ranks clusters.
…nresolved

A base that names a repository module but cannot be resolved to a class (a
package re-export or a module-qualified base) might supply the method before
the forbidden owner, so the override is no longer treated as forced.
@kvlonge
kvlonge enabled auto-merge (squash) September 24, 2026 12:28
@kvlonge
kvlonge merged commit 5f0dbb5 into main Sep 24, 2026
21 checks passed
@kvlonge
kvlonge deleted the feat/dupscore-noise branch September 24, 2026 12: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