Skip to content

fix(server): separate EPUB block quotes from adjacent text - #43156

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
Lucenx9:fix/epub-block-quote-text
Nov 26, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
Lucenx9:fix/epub-block-quote-text

Conversation

@Lucenx9

@Lucenx9 Lucenx9 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Problem

An EPUB chapter can run a block quotation into the prose before and after it. When all three are written without source whitespace, agents receive a string like Safety noteCheck the gate.Continue to the terminal..

Change

Use the existing line-start marker on both sides of a nonempty block quotation. If the preceding text or the quotation already ends on a new line, the marker adds nothing.

Scope

Server-side EPUB attachment extraction. A targeted issue and PR search found no equivalent open fix. The browser renderer is separate. Inline quotations and empty block quotations keep their current output.

Verification

I reproduced this through extractDocumentText with a synthetic EPUB, then reduced the chapter to A<blockquote>B</blockquote>C.

Before
Safety noteCheck the gate.Continue to the terminal.

After
Safety note
Check the gate.
Continue to the terminal.
  • The extended attachment test failed on base and passed on the patch. The same fixture includes an empty quotation to protect the visible-text guard. The worker replay also passed for a quote containing its own paragraph, an inline quote and an empty quote.
  • Vitest V8 recorded hits on all 4 added worker lines, and 93.94% line coverage for the worker in the focused test. dependency-cruiser resolved all 7 direct imports of the worker.
  • fast-check passed 120 generated EPUBs. Jazzer.js completed 180 bounded runs. Stryker killed 6/6 mutants on the changed branch of a source-derived copy.
  • Fallow and CodeScene flagged the additional condition in paragraphs. Both advisory gates failed on complexity. Fallow used a two-file snapshot with limited dependency coverage.

Linux verification only. vp run check:changed --concurrency 1 passed with 63 tests, typecheck, lint, format, Knip and GraphQL. Normal commit hooks passed. The check also passed with 63 tests after rebasing onto b888f3c.

Opus 5.5 high approved. Gemini 4 Neon medium flagged newline behavior in empty and hidden-only quotations. Before/after replays returned identical output for those cases. The empty-quotation regression was added to the existing test after review.

Reviewed with sol-loop: 1 round with GPT-6.2 Sol on high. Sol verdict: approved.

Created with GPT-6.2 Sol in Codex through T3 Code.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 23:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T23:53:17.700585Z 1cdc179 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 25, 2026
@coderabbitai

ghost commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1cdc179 and 5888417.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The paragraph extractor now adds line boundaries around nonempty blockquotes. The EPUB attachment test covers a nested safety note and an empty blockquote.

Changes: EPUB blockquote extraction

Layer / File(s) Summary
Blockquote extraction and coverage
apps/server/src/provider/documentTextWorker.ts, apps/server/src/provider/userInputAttachments.test.ts
The paragraph extractor recursively extracts nonempty blockquotes between line boundaries. The EPUB test checks safety-note text and surrounding text, including behavior around an empty blockquote.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: stienswout, only21mil

Merge Risk: Minimal · previous review 1cdc1

EPUB block quotes are now separated from adjacent text during server-side attachment extraction, and empty or inline quotes keep their current output. The change is small and covered by an extended test, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: EPUB block quotes are now separated from adjacent text. It follows the conventional commit form, and the raw summary confirms that paragraphs now emits line boundaries…
Description check Passed The description follows the template's main sections: Problem, Change, Scope, and Verification. It gives a clear problem with an example string, explains the line-start marker fix, names the affected …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: EPUB block quotes are now separated from adjacent text. It follows the conventional commit form, and the raw summary confirms that paragraphs now emits line boundaries around nonempty blockquote elements in documentTextWorker.ts.

Full details: Description check

Explanation

The description follows the template's main sections: Problem, Change, Scope, and Verification. It gives a clear problem with an example string, explains the line-start marker fix, names the affected server-side scope, and reports focused reproduction and test results. It also states the Linux-only limit and the advisory complexity failures. Minor gaps: the template asks for a linked issue or a stated reason for no issue, and the Scope section only says a search found no equivalent fix, with no issue link. The template's agent-model line is present, though the description attributes work to a specific model.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 44b787b and 1cdc179.

Files selected for processing: 2

  • apps/server/src/provider/documentTextWorker.ts
  • apps/server/src/provider/userInputAttachments.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 25, 2026
@juliusmarminge

ghost commented Nov 26, 2026

Copy link
Copy Markdown
Member

Evidence

Attached the exact compact EPUB fixture and submitted the reported prompt on fresh databases in the real web app (Chromium, 1280×800, light theme). Opened an unchanged copy of each server-generated text sidecar in the app. Replay supplied the agent turn; the displayed file contains the actual extraction output.

Proven: the scenario fails on base and passes on head. Base joins the adjacent prose and quotation; head separates them into three lines. Both preserve Keep some space.

Before After
de3ec23861 58884173ec
Before: adjacent EPUB prose and quotation joined on line 2 After: EPUB prose and quotation separated on lines 2 through 4
Before recording After recording

Scenario source

Not shown:

  • A live model's verbatim reply was not exercised: Replay does not read files, so the captures instead show the actual server-generated extracted text in the app's file viewer.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 26, 2026
@juliusmarminge
juliusmarminge merged commit 522b067 into pingdotgg:main Nov 26, 2026
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants