Skip to content

Fix retraction filter bypass and leading-NOT eligibility parsing#212

Merged
imaurer merged 2 commits intomainfrom
fix-retraction-filter-leading-not
Mar 14, 2026
Merged

Fix retraction filter bypass and leading-NOT eligibility parsing#212
imaurer merged 2 commits intomainfrom
fix-retraction-filter-leading-not

Conversation

@imaurer
Copy link
Collaborator

@imaurer imaurer commented Mar 14, 2026

Summary

  • PubTator retraction bypass: is_retracted was hardcoded to false in from_pubtator_search_result, so --exclude-retracted silently passed retracted articles from the PubTator leg. Changed to Option<bool> with None for PubTator rows; unwrap_or(true) conservatively excludes unknowns. Duplicate PMID merge now propagates retraction status from Europe PMC when a PubTator-first row is deduplicated.
  • Leading NOT dropped in eligibility expressions: essie_escape_boolean_expression skipped operators[0] when emitting, so inputs like NOT MSI-H became MSI-H, inverting user intent. Fixed to detect and emit the leading unary operator before the first term.

Both fixes include new unit tests. All existing tests continue to pass.

Test plan

  • cargo test retract — 6 retraction-related tests pass
  • cargo test essie_escape — 3 boolean expression tests pass (including leading-NOT and AND-NOT cases)
  • cargo test — all tests pass
  • make spec — spec suite passes

@imaurer imaurer closed this Mar 14, 2026
@imaurer imaurer reopened this Mar 14, 2026
@imaurer imaurer merged commit dde13bb into main Mar 14, 2026
8 of 10 checks passed
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