Skip to content

Editing a REUSED_SNIPPET's shared text reads as a new finding #292

Description

@realmarcin

Found in the final review of #290, and flagged there as a tradeoff to document rather than a defect to fix.

_magnitude_key folds the snippet text in, so a REUSED_SNIPPET whose shared snippet is edited — not diversified, just reworded — produces an unseen key, and baseline.magnitudes.get(mkey, 0) returns 0. Any magnitude beats 0:

baseline:  cellulolysis_cellulase_systems:*  3 items share 'Complete degradation of cellulose…'
after:     cellulolysis_cellulase_systems:*  3 items share 'Complete degradation of cellulose to glucose…'
           count unchanged (1 <= 1), mkey unseen, 3 > 0  ->  new  ->  qc exits 1

Nothing got worse, and the curator is told it did. The remedy they reach for is --write-baseline, which is the rot #270 was about.

The obvious repair — fall back to the graph's per-key max magnitude when the exact key is unseen — reintroduces the sheltering #291 removed, since an edited snippet could then grow up to whatever the graph's worst already was.

Fails closed, so not urgent. A real fix probably needs the magnitude keyed on something more stable than the full snippet text — a normalized prefix, or the snippet's identity within the graph rather than its content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions