Nested Proteome layer metadata can leave a stale cached identity

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

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

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

評価

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

調査の方向性

Start with the Proteome identity, layers, save/load, and composition implementations, then inspect tests covering identity and metadata snapshots. Reproduce the supplied example and check other identity-bearing fields for shared mutable input. Done means nested metadata and supplied dictionaries cannot leave a stale identity, while save/load and composition preserve exact metadata and consistent identities.

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

説明

On published ORFdata 0.42.6, nested dictionaries in Proteome.layers remain mutable after Proteome.identity has been cached. Mutating them changes the serialized content, but the identity property continues returning the old hash. This contradicts the documented contract that identity changes whenever content does.

Reproduction (no downloads):

from pathlib import Path
from tempfile import TemporaryDirectory
from orfdata import Proteome, ReferenceContext

context = ReferenceContext(10090, "mus_musculus", "GRCm39", "ensembl", "115")
proteome = Proteome(context, [], [dict(
    role="host", kind="extra_orf", source="fixture", reference=context.key,
    catalog={"records": 1},
)])
before = proteome.identity
proteome.layers[0]["catalog"]["records"] = 2
with TemporaryDirectory() as directory:
    saved = proteome.save(Path(directory) / "host.json.gz")
assert proteome.identity == before
assert saved != before

The top-level layer mapping is read-only, but its nested JSON is not. Source provenance or selection metadata can therefore diverge from an already consumed/cached identity without any sequence change. Please make identity-bearing nested metadata immutable, or otherwise ensure supported mutations invalidate the identity. Preserve deterministic snapshots and the ordinary composition API.

Acceptance: nested catalogue/evidence/selection changes cannot leave a stale identity; supplied input dictionaries cannot mutate a constructed proteome; save/load and composition retain exact source metadata and consistent identities. Check other identity-bearing fields for the same aliasing issue.

Found during review of openvax/vaxrank#761. That PR makes an independent deep copy of its frozen coverage record; it does not change ORFdata's identity model. Vaxrank already rejects a snapshot whose saved identity differs from the identity it validated.

主要言語
Python
スター
1
フォーク
1
平均マージ
10時間 11分
マージ済み PR(30日)
51

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

openvax/orfdata のほかの issue

openvax/orfdata の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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