You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): separate EPUB block quotes from adjacent text - #43156
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.
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
extractDocumentTextwith a synthetic EPUB, then reduced the chapter toA<blockquote>B</blockquote>C.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 1passed 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.