Skip to content

fix(api): flag only retractions in the retraction check - #217

Closed
L4XB wants to merge 3 commits into
mainfrom
fix/216-api-retraction-nature
Closed

L4XB wants to merge 3 commits into
mainfrom
fix/216-api-retraction-nature

Conversation

@L4XB

@L4XB L4XB commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Closes #216.

Summary

The community API's copy of the Retraction Watch loader (sixsentences_server/connectors/retractions.py) added the OriginalPaperDOI of every row of the dataset. The dataset also lists corrections, expressions of concern and reinstatements, in its RetractionNature column. So a paper that had only been corrected was flagged as retracted:

  • the integrity stage ranked it down and counted it among "retracted works flagged";
  • the living-review monitor reported it as newly retracted.

The engine's loader has always kept only RetractionNature "Retraction". This applies the same rule in the API copy: trimmed and case-insensitive, so " retraction " counts. The file is also read as utf-8-sig, as the engine reads it, so a byte-order mark cannot rename the first column.

Behavior and compatibility

  • API only: load_retracted_dois() returns fewer DOIs, namely only those of retracted papers. Every caller inherits the fix: the integrity stage in pipeline/run.py, the routes in api/app.py, and recheck_retractions in living/monitor.py.
  • No schema, event or migration change. A run that has already finished keeps the flags it recorded. The next run or living recheck uses the corrected set.

Validation

  • tests/test_retractions_connector.py (new): 3 passed.
    • With the previous loader, two of them fail: corrections, expressions of concern and reinstatements were flagged, and a BOM-prefixed file lost every DOI.
  • cd services/api && uv run --frozen --no-sync pytest -q: 3454 passed, 2 skipped (the PostgreSQL tests that need the CI service).
  • ruff check src tests: all checks passed. ruff format --check on both files: formatted. mypy on the connector: no issues.
  • python scripts/audit_community_export.py .: passed (423 files) after --refresh-manifest. The refresh recorded only the new test file and the changed connector.
  • check_dco.py: DCO sign-offs validated for both commits.

The engine, web app, browser extension, Companion and self-hosting are unaffected.

Review boundaries

The loader reads the same local CSV, so there is no new data flow, dependency, network call or processor, and no UI change. On the research side, the integrity signal now means "retracted", which is what it was labelled.

Source-release hygiene

No data is committed: the tests write their CSV files into a temporary directory. CHANGELOG.md has an entry under Unreleased → Fixed. Both commits are signed and carry my DCO sign-off, and the CLA acceptance sentence follows as a standalone comment.

Visual evidence

None (no UI change).

The community API's copy of the Retraction Watch loader added the
OriginalPaperDOI of every row. The dataset also lists corrections,
expressions of concern and reinstatements in RetractionNature, so a
paper that was only corrected was flagged as retracted, ranked down in
the integrity stage and reported by the living-review monitor.

It now keeps only rows whose RetractionNature is "Retraction"
(trimmed, case-insensitive), as the engine's loader always has, and
reads the file as utf-8-sig like the engine, so a byte-order mark
cannot rename the first column.

Closes #216

Signed-off-by: L4XB <lukas.buck@e-mail.de>
@L4XB

L4XB commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

I have read and agree to the SixSentences CLA v1.0.

@github-actions

Copy link
Copy Markdown

Thanks for the pull request. One required step is still open, and it is not one
a maintainer can complete for you.

Contributor License Agreement. This project records acceptance as a public
comment on the pull request itself: there is no external CLA service and no
separately stored token. Read CLA.md and post this exact
sentence as a standalone comment here:

I have read and agree to the SixSentences CLA v1.0.

The CLA / acceptance status is bound to the exact head commit and is
re-evaluated when you post the comment or push again, so nothing else is needed.

Two further gates apply to every contribution and are described in
CONTRIBUTING.md: every commit carries your own
Signed-off-by trailer (git commit -s) and is signed with your own key. A
maintainer must not add either on your behalf.

The retraction loader changed and its connector test is new, so the
manifest records their hashes:

  python scripts/audit_community_export.py . --refresh-manifest

Signed-off-by: L4XB <lukas.buck@e-mail.de>
@L4XB

L4XB commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

…n-nature

# Conflicts:
#	CHANGELOG.md

Co-authored-by: L4XB <103962359+L4XB@users.noreply.github.com>

Copilot AI commented Oct 20, 2026

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

Resolved: I merged origin/main into this branch and fixed the conflict in CHANGELOG.md in commit 228203b.

@L4XB

L4XB commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Superseded by #220. The automated merge commit on this branch has no Signed-off-by trailer, and check_dco.py checks every commit in the range. #220 carries the same two commits, signed off, on top of current main.

@L4XB L4XB closed this Oct 21, 2026
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.

api: the retraction check counts corrections and expressions of concern as retractions

2 participants