Skip to content

[DRAFT] fix(#21): deprecate paper7 repo (Papers With Code API discontinued)#28

Draft
Vigtu wants to merge 1 commit into
p7dotorg:mainfrom
Vigtu:feat/issue-21-hf-papers
Draft

[DRAFT] fix(#21): deprecate paper7 repo (Papers With Code API discontinued)#28
Vigtu wants to merge 1 commit into
p7dotorg:mainfrom
Vigtu:feat/issue-21-hf-papers

Conversation

@Vigtu

@Vigtu Vigtu commented May 15, 2026

Copy link
Copy Markdown
Contributor

⚠️ Draft for discussion. This PR removes a feature. I want to align on whether deprecation is the right call before merging.

TL;DR

paper7 repo has been broken since Papers With Code's API went away (the brainstorm session originally planned to replace it with the Hugging Face Papers API). After implementing and probing, I confirmed there is no drop-in replacement for the curated paper-to-code mapping PWC published. This PR deprecates the command with a clear notice instead of substituting a worse data source.

The discussion question

Three options were on the table:

  1. Deprecate cleanly ← this PR
  2. Best-effort regex scan for github.com/* in HF Papers summary text (~10–30% coverage)
  3. GitHub Search API (auth required, noisy results)

I went with (1) because (2) is a worse product (silent low coverage looks like bugs) and (3) is a heavier change with mediocre signal. If you'd rather keep the command working with reduced coverage, say so and I'll re-scope to option (2) — happy to add a paper7 repo --best-effort mode.

Evidence the API is gone (all probed live during implementation)

Probe Result
paperswithcode.com/api/v1/* HTTP 302 → huggingface.co/papers/trending
paperswithcode.com/api/v0/, v2/, /graphql, /search, /api/v1/datasets/ All redirect to trending
paperswithcode.com/paper/<slug> (HTML page) All redirect to trending
HF GET /api/papers/<id> (BERT 1810.04805) Fields: id, authors, publishedAt, summary, title. No GitHub field
HF GET /api/papers/<id> (ReAct 2210.03629) Plus ai_summary, ai_keywords, upvotes. No GitHub field
HF GET /api/papers/<id>/repos, /models, /spaces, /datasets 404
HF /api/models?paper=<id> Ignores filter (returns trending global)
Scrape huggingface.co/papers/2210.03629 for github.com/* URLs 0 hits
Semantic Scholar externalIds (Transformer 1706.03762) MAG, DBLP, ArXiv, CorpusId — no GitHub
OpenAlex (ReAct via DOI) Extensive metadata, no code-links field

What this PR changes

  • Deletes src/repo.ts (the PWC client + decoder, 318 lines).
  • src/commands/repo.ts becomes a one-shot deprecation message — no clients, no Effect environment requirements.
  • paper7 repo runs with or without an arxiv/pubmed/doi id (the id arg is now optional and ignored). Existing script invocations like paper7 repo 2210.03629 still work, they just print the deprecation notice.
  • Removes RepositoryDiscoveryClient / RepositoryDiscoveryLive / RepositoryDiscoveryError from cli.ts, including the formatRepositoryDiscoveryError handler and the Effect.provide(RepositoryDiscoveryLive) from main.
  • Strips the unused PWC service mocks from browse.test.ts, cache.test.ts, vault.test.ts (they only ever provided an "unused" stub).
  • Rewrites tests/refs-repo.test.ts: drops the PWC integration tests and the PWC error-class assertions; adds two deprecation tests.

User-facing output

$ paper7 repo 2210.03629
paper7 repo is deprecated.

The Papers With Code API has been discontinued (the domain now redirects to
huggingface.co/papers). Hugging Face acquired the brand but did not republish
the curated paper-to-code mapping, so paper7 has no drop-in source for
automatic repository discovery.

Most papers link their reference implementation in the abstract or first page.
Read the paper directly with:
  paper7 get <id> --abstract-only

Test plan

  • npx vitest run → 165 pass / 0 fail (-3 from baseline: removed 5 PWC integration tests, added 2 deprecation tests).
  • npx tsc --noEmit clean.
  • New tests cover paper7 repo with and without an id, both producing the deprecation notice + exit 0.

CHANGELOG note for next release

  • paper7 repo is now deprecated. The Papers With Code API was discontinued. No drop-in replacement is currently available. Try paper7 get <id> --abstract-only for paper metadata, or check the abstract for a code link.

Closes #21.

…inued

Papers With Code's API is gone. Every paperswithcode.com path I probed
returns HTTP 302 to huggingface.co/papers/trending — the /api/v1
endpoints, /api/v0, /api/v2, /graphql, the per-paper HTML pages, even
/search. The whole site is a CloudFront redirect now. paper7 repo has
returned 'Papers With Code decode failure' for every paper since.

I researched a replacement (the brainstorming session picked the HF
Papers API as the natural successor) and confirmed there is none:

- HF Papers API (/api/papers/<id>) returns metadata only: id, authors,
  publishedAt, summary, title. No githubRepos / repos / code field
  exists on any paper I checked, including BERT and ReAct.
- /api/papers/<id>/repos, /models, /spaces, /datasets all 404.
- /api/models?paper=<id> ignores the paper filter (returns trending
  global models).
- The huggingface.co/papers/<id> HTML page rarely renders github.com
  links — scraping ReAct returned 0 GitHub URLs in the DOM.
- Semantic Scholar externalIds (already in paper7) does not include
  GitHub for any paper I queried.
- OpenAlex has no code_links field.

The paper-to-code mapping PWC published was a curated dataset, not
just an API. Hugging Face acquired the brand but did not republish
the curated data. There is no drop-in replacement.

This PR:
- Deletes src/repo.ts (the PWC client and decoder).
- Rewrites src/commands/repo.ts to print a deprecation notice
  explaining the situation and pointing the user at
  paper7 get <id> --abstract-only.
- Drops the PaperIdentifier argument from the repo CliCommand variant
  (parser.ts) and makes the CLI id argument optional so existing
  invocations like paper7 repo 2210.03629 still work — the id is
  accepted and ignored.
- Removes RepositoryDiscoveryClient / RepositoryDiscoveryLive /
  RepositoryDiscoveryError plumbing from cli.ts, including the
  formatRepositoryDiscoveryError handler.
- Removes the PWC service provision from browse/cache/vault tests
  that only ever provided an 'unused' instance.
- Rewrites tests/refs-repo.test.ts: drops the old PWC integration
  tests and the PWC error-class assertions; adds two deprecation
  tests covering paper7 repo (no id) and paper7 repo <id>.

Closes p7dotorg#21.
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.

bug: paper7 repo returns "Papers With Code decode failure" uniformly

1 participant