Skip to content

feat: deliver the LLM summary reader slice - #11

Merged
sommio merged 5 commits into
developfrom
feat/llm-summary-reader
Apr 19, 2026
Merged

feat: deliver the LLM summary reader slice#11
sommio merged 5 commits into
developfrom
feat/llm-summary-reader

Conversation

@sommio

@sommio sommio commented Apr 18, 2026

Copy link
Copy Markdown
Owner

Summary

Add an internal LLM summary pipeline that turns persisted article content
into a prepared translated title and a canonical Markdown summary. The API
now exposes translatedTitle, the reader prefers translatedTitle ?? title,
and the old public POST /article-content/:id/retry repair route is gone.

Transient gateway failures stay fail-open until retries are exhausted, so a
good summary is not cleared on the first retryable miss.

What changed

  • article-summary owns the prompt, gateway call, parser, persistence, and
    bootstrap backfill for rows with contentMarkdown but no complete result.
  • ArticleContentService schedules summary work after body persistence, and
    feed ingestion no longer overwrites prepared summaries with feed text.
  • GET /articles and GET /articles/:id now return translatedTitle so the
    UI can do translatedTitle ?? title without parsing Markdown again.
  • apps/web renders the stored summary Markdown with react-markdown and
    remark-gfm, while keeping stale and empty-state fallbacks visible.
  • Docs, env examples, seed data, and e2e coverage were updated for the new
    contract.

Validation

  • Updated unit and e2e coverage across API and web for the new contract.

Compound Engineering
HARNESS

sommio added 5 commits April 18, 2026 20:54
Introduce an article-summary module that calls an OpenAI-compatible
LLM gateway to produce a translated title and canonical Markdown
summary for each persisted article. Structured output is validated
with zod and persisted alongside a terminal failure reason so the
front end can distinguish pending, succeeded, and failed rows.

- Add article-summary module (gateway, parser, prompt, repository,
  service, bootstrap service) under apps/api/src/article-summary/.
- Add Prisma migrations for translatedTitle and summaryErrorReason
  fields; default summary/translatedTitle/summaryErrorReason to
  empty strings for pending rows.
- Remove the public article-content retry endpoint and controller;
  summary backfill is now handled internally by the bootstrap
  service, not via a user-facing retry route.
- Wire summary scheduling into the feed-ingestion pipeline so new
  articles are enqueued right after content extraction succeeds.
- Expose translatedTitle, summary, and summaryErrorReason in the
  article list and detail DTOs; keep contentMarkdown internal.
- Add LLM_* env vars (base URL, API key, model, concurrency,
  language, timeout) with validation and typed app-config.
- Update web front end to render Markdown summaries with
  react-markdown and remark-gfm; add translated-title display.
- Add brainstorm and plan docs in both en/ and zh-Hans/.
- Update e2e and unit tests to cover summary fields, fail-open
  scheduling, and the removed retry endpoint.
Keep retryable article summary jobs fail-open until the final attempt
fails, then persist the failure state once. Update the plan docs to
match the new summary fallback behavior.
Document the fail-open regression where retryable article-summary
refresh failures could clear usable reader content too early, and note
the paired fix and test coverage in both language trees.
Match the Playwright check to the current reader contract, which strips
summary title markdown before rendering and keeps the Summary section
heading visible.
@sommio
sommio merged commit 1838cf1 into develop Apr 19, 2026
5 checks passed
@sommio
sommio deleted the feat/llm-summary-reader branch April 19, 2026 07:19
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