Skip to content

fix: remove archive format bias from asset scoring#1

Draft
sgargel wants to merge 1 commit into
mainfrom
remove-archive-score-bias
Draft

fix: remove archive format bias from asset scoring#1
sgargel wants to merge 1 commit into
mainfrom
remove-archive-score-bias

Conversation

@sgargel

@sgargel sgargel commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Problem

score_asset gives a +2 bonus to archive formats (.tar.gz, .zip, etc.) based on the assumption that "archives contain the full release".

Why this is wrong

The bonus introduces unjustified bias. Consider a project that publishes both:

tool_linux_amd64 → score: +10 (OS) +5 (arch) = 15
tool_linux_amd64.tar.gz → score: +10 (OS) +5 (arch) +2 (archive) = 17 ← wins

The archive wins not because it's a better match for the platform, but simply because it's an archive. In many cases both assets contain
exactly the same binary — the archive is just an alternative distribution format.

Cases where the bonus might seem useful:

  • A tool that ships completions, man pages, or config templates only inside the archive — but gri doesn't install those files anyway;
    find_binary only looks for the executable.

Cases where the bonus is harmful:

  • A project publishes tool_linux_amd64 (ready-to-use binary) and tool_linux_amd64.tar.gz (archive wrapping the same binary) → the archive
    wins, adding unnecessary extraction complexity.
  • An archive with a less specific name beats a more precisely named raw binary.

Fix

Remove the three lines. The correct signal for asset selection is OS + arch; format is irrelevant when both assets target the same platform.

Open for discussion — do not merge

Left as a draft until we decide whether there is a real use case that justifies the archive preference. If one exists, it should be an
explicit rule, not a silent +2 bias.

The +2 score bonus for archive formats (.tar.gz, .zip, etc.) was
intended to prefer "full releases" over raw binaries, but in practice
it causes the wrong asset to be picked when a project publishes both
a raw binary and an archive of the same binary.

Example: if a release has both `tool_linux_amd64` and
`tool_linux_amd64.tar.gz`, both score +10 (OS) +5 (arch) = 15, and
the archive wins by +2. But the archive often contains exactly the
same binary — the format preference adds no value and introduces
unintended bias.

OS+arch match is the correct signal for asset selection. Format
should be irrelevant when both assets target the same platform.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sgargel sgargel marked this pull request as draft June 20, 2026 05:00
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