Agent-mode PyPI variant selection uses one representative file, not the installed wheel's tags, so wheels that share .py files all match

オープン
#2,194 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python, rust
領域
cli

調査の方向性

Start in crates/socket-patch-cli/src/commands/apply.rs at representative_file (around line 1199) and its mirror select_installed_variants in socket-patch-core, then compare with crates/socket-patch-core/src/hosted/wheel_record.rs where the WHEEL Tag: lines are already parsed. Reproduce by building a patch that touches a shared .py file and the compiled extension, then check which variant records match. Done means variant selection uses the installed wheel's tags against artifact_id, with the hash probe kept as a secondary check on a differing file.

索引モデルが issue の本文から書いたものです。

説明

agent:triaged enhancement pm:pip priority:p1

Summary

In agent mode a release variant of a PyPI package (a record keyed ?artifact_id=<wheel filename>) is matched to the installed distribution by the hash state of ONE file: the lexicographically smallest key with a non-empty beforeHash (representative_file, crates/socket-patch-cli/src/commands/apply.rs:1199, mirrored by select_installed_variants in core). The installed wheel's own WHEEL Tag: lines are not consulted; they are read only on the hosted path (crates/socket-patch-core/src/hosted/wheel_record.rs:121).

Why this matters

Platform wheels of one release usually share their .py files byte for byte and differ only in the compiled extension. Measured on pillow 12.3.0: all 97 .py files are identical across the manylinux x86_64, manylinux aarch64, musllinux and macOS arm64 wheels. If a patch changes both a .py file and the extension (or only the extension, with a .py file also listed), the representative file is the shared .py, so every variant record "matches" the install. Each matching variant is then applied; for the variants built for another platform the extension's beforeHash does not match. With the default policy that fails closed, so the user gets a failure for a package that has a correct variant; with --force / --allow-patch-conflicts a library built for another platform can be written.

This is from reading the code; I did not reproduce it end to end.

Suggested direction

Select the variant from what the install says it is: the Tag: lines of *.dist-info/WHEEL (and the gem platform, which agent mode already consults) against the variant's artifact_id. Keep the hash probe as a second check, on a file that actually differs between variants when one exists.

主要言語
Rust
スター
9
フォーク
2
平均マージ
1日 8時間
マージ済み PR(30日)
309

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SocketDev/socket-patch のほかの issue

SocketDev/socket-patch の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。