Skip to content

Show page one of each paper's PDF on X roundup and paper cards - #1159

Merged
NielsRogge merged 4 commits into
mainfrom
claude/weekly-recap-paper-cards
Nov 23, 2026
Merged

NielsRogge merged 4 commits into
mainfrom
claude/weekly-recap-paper-cards

Conversation

@NielsRogge

@NielsRogge NielsRogge commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What

X posts about papers get a 2:3 card (1600×2400) showing page one of the real PDF in a Papers with Code frame, like multi-image paper threads on X.

  • Weekly/monthly roundups (top_papers_week / top_papers_month): one card per arXiv paper, up to 4 (X's per-post limit). Each card is numbered as in the post text (02 / 05), shows page one from the title down to the Introduction, and puts the TL;DR in a "Why read it" line. External papers are skipped. A paper whose PDF can't be fetched or read is left out. With no cards at all, the post falls back to the existing list card.
  • Single-paper posts: new pwc-cron x_post_candidates card --paper-id ID… [--rank N…] prints {"cards": {id: base64 PNG | null}}. This lets the host X agent use the card in place of a page screenshot for trending_paper and "Tweet it" posts. It is a separate command so list doesn't download 24 PDFs on every run, and the host caches each card.
  • list output gains extra_images_png_base64 (a list). image_png_base64 keeps holding the first image, so the current host keeps working unchanged.

Crop: page one from the top of the text down to the "Introduction" heading. A short crop runs on into the page up to the sheet's aspect ratio and fades out. Margin notes, footnotes and page numbers are ignored.

Validation

  • pytest backend/tests/test_x_post_candidates.py backend/tests/test_x_insight_post_service.py: 62 passed (new tests: card numbering and skipping, the 4-card cap, a bad PDF, the split "1 / Introduction" heading).
  • ruff, ruff format, comment ratchet clean.
  • Rendered read-only against the live catalog: the 2026-W47 roundup (3 arXiv cards; Inkling 2 Mini and Gemini 4 Neon are external) and single cards for Depth Pro 2 and π⁴. All checked by eye.

Host follow-up (not in this repo)

/root/x-post-schedule/post_x.py uploads the extra images with the post and fetches cached card images for paper posts. The dashboard shows the extra images.

🤖 Generated with Claude Code


Note

Medium Risk
Roundup gathering now fetches and parses arXiv PDFs over the network (with fallbacks), which adds load and failure modes to the X candidate pipeline but stays scoped to the posting agent.

Overview
Adds 2:3 (1600×2400) branded image cards built from arXiv PDF page one (cropped title through Introduction, with a "Why read it" summary) for X posts about papers.

Weekly/monthly roundup candidates now attach up to four page-one cards—numbered like the post text—with image_png_base64 as the first card and extra_images_png_base64 for the rest; failed or non-arXiv papers are skipped, and the post falls back to the existing list chart when no cards are produced. top_papers facts gain paper_ids (and related metadata) aligned with how many papers actually fit in the tweet.

A new read-only CLI subcommand pwc-cron x_post_candidates card --paper-id … returns per-paper base64 PNGs on demand so list does not download many PDFs every run. Rendering lives in render_paper_page_card / roundup_page_cards with new tests for caps, numbering, and bad PDFs.

Reviewed by Cursor Bugbot for commit 10e39b7. Bugbot is set up for automated code reviews on this repo. Configure here.

NielsRogge and others added 2 commits November 23, 2026 14:23
The weekly and monthly roundups now carry one 1600x2400 card per arXiv
paper (up to four, X's limit): page one of the PDF from the title to the
introduction on a branded sheet, numbered as in the post, with the TL;DR
as a why-read-it line. Candidates gain extra_images, which `list` prints
as extra_images_png_base64. A new `card` command renders the same card for
single-paper posts so the X agent can use it instead of a page screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A queued post can go out hours later, when the rank has moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread backend/services/x_post_candidates.py Resolved
Comment thread backend/services/x_post_candidates.py Resolved
compose_list can drop entries to fit 280 characters, so the card counter
now counts only the papers the post lists. A PDF with no pages or any
MuPDF error now skips that card instead of failing the whole list run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8e13b20. Configure here.

Comment thread backend/tests/test_x_post_candidates.py Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NielsRogge
NielsRogge merged commit 6c4d507 into main Nov 23, 2026
6 checks passed
@NielsRogge
NielsRogge deleted the claude/weekly-recap-paper-cards branch November 23, 2026 14:35
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