Skip to content

Add paper 解读 (critical review) to Papers UI - #11

Merged
znsoftm merged 3 commits into
cursor/papers-translate-concurrency-7d3bfrom
cursor/papers-review-31a2
Sep 14, 2026
Merged

znsoftm merged 3 commits into
cursor/papers-translate-concurrency-7d3bfrom
cursor/papers-review-31a2

Conversation

@znsoftm

@znsoftm znsoftm commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Add a per-paper 解读 (critical reading) feature on the public Papers catalog so readers can generate, view, and rate a structured Chinese analysis.

UI

  • After the arXiv button on each card: 生成解读 / 查看解读 (EN: Generate review / View review)
  • Click opens a modal (not a full page) with:
    1. 方法原理与创新
    2. 方法本质
    3. 实验完整性
    4. 论文质量总评
  • Star rating 1–5; average and rating count are shown
  • Stars stay disabled / locked with a hint while generate is in flight; they enable only after the four sections are displayed
  • Generate button shows a loading state while the LLM runs
  • ZH/EN i18n; analysis text stays Chinese

API (search-service)

  • GET /papers/review/{id} — public review + avg stars (no raw rater list)
  • POST /papers/review/{id}/generate — Hub OpenAI-compatible LLM from translate-config.json (same as BabelDOC). Public if the LLM is configured. Idempotent unless force
  • POST /papers/review/{id}/rate — {stars:1-5}; upsert by Hub session or anonymous rs_papers_rater cookie
    • 409 review is not ready if no completed review exists (does not create a ratings-only stub)
    • 409 review is still generating if generate is in-flight (fail closed; does not wait on the LLM lock)
  • GET /papers/api includes has_review, avg_stars, rating_count

Persistence

  • $PAPERS_DIR/reviews/<paper_id>.json (gitignored runtime data)
  • Force regenerate keeps existing ratings
  • Generate holds a per-id in-flight flag; persist lock is only taken for the short JSON write

Tests

  • Average rating upsert (same rater updates, second rater changes avg)
  • Generate skips the LLM when a review already exists (unless force)
  • Rate-before-review → 409 and no stub file
  • Generate then rate → ok
  • Rate while generate is in-flight → 409 immediately (fail closed)
  • Catalog flags, public GET hides rater keys, anonymous generate + cookie

PDF / translate flows are unchanged. No API keys or review dumps are committed.

Open in Web Open in Cursor 

Persist structured Chinese critical readings under PAPERS_DIR/reviews,
expose catalog flags plus public GET/generate/rate endpoints, and add
a papers UI modal with i18n labels after the arXiv button.

Co-authored-by: Daniel <znsoft@163.com>
@znsoftm
znsoftm marked this pull request as ready for review September 14, 2026 09:46
cursoragent and others added 2 commits September 14, 2026 10:53
Keep stars locked in the modal while 解读 is in flight, fail POST /rate
closed with a clear 409 if no completed review exists or generate is
running, and avoid creating a ratings-only JSON stub that races writes.

Co-authored-by: Daniel <znsoft@163.com>
Co-authored-by: Daniel <znsoft@163.com>
@znsoftm
znsoftm merged commit adfbfbb into cursor/papers-translate-concurrency-7d3b Sep 14, 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.

2 participants