Skip to content

fix: bound developer passage rendering - #216

Closed
PhantomInTheWire wants to merge 4 commits into
mainfrom
fix/developer-passage-render
Closed

fix: bound developer passage rendering#216
PhantomInTheWire wants to merge 4 commits into
mainfrom
fix/developer-passage-render

Conversation

@PhantomInTheWire

@PhantomInTheWire PhantomInTheWire commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • collapse blank-line runs and remove spaces or tabs at line ends in human-readable firecrawl developer passages
  • cap each rendered passage at 40 lines, including the truncation notice and citation metadata
  • cap outside Markdown fenced blocks; bounded fence previews get a matching synthetic closer
  • handle valid closer indentation independently from its Markdown container and reject non-Markdown suffix whitespace
  • retain every passage returned by the server
  • keep --json and --pretty output complete

Merge order

Merge this after firecrawl/search#1007, which performs the required server-side cleanup for existing indexed passages.

Regression coverage

  • blank-run collapse, trailing-space cleanup, and lone-CR line endings
  • exact 40-line cap with citation metadata, including multiline citation input
  • all 45 passages render without a passage-count cap
  • quoted/list-container fences
  • valid closer indentation that differs from the opener
  • matching indentation on synthetic closers
  • blockquote closer spacing, tab-expanded list padding, and the nine-digit ordered-list limit
  • vertical-tab fence suffixes do not close a fence
  • JSON output remains unchanged

Measurement

Exact-head (82297f9694673f0e3f93553aa597aa4dd5be9f4b) offline replay of frozen server responses for 100 deterministic Flint GT queries, every fifth row from the 500-row corpus. Both renderers receive the same 1,502 passages.

Metric Before After
passages retained 1,502 1,502
total passage lines 33,389 24,989
max lines per passage 453 40
p90 lines per passage 58 40
passages with 3+ newline runs 85 0
passages with trailing spaces 78 0
unbalanced fences 2 2

304 passages hit the line cap. The fence-aware cap introduced no additional unbalanced fences. Artifacts: /Users/karan/.search-ops-scratchpad/passage-noise/cli-eval.

Gates

  • Prettier check passed
  • TypeScript no-emit check passed
  • Vitest passed — 24 files, 448 tests
  • TypeScript build passed

pnpm is unavailable on this host, so the lockfile-installed binaries ran directly. The pre-commit hook failed only because it invokes missing pnpm; the equivalent checks above passed.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown

@cubic-dev-ai review\n\nPlease review exact head 57797e810d045c3e47f694da4c7a7214cfed35c0. Human-readable developer passages now collapse blank runs, cap at 40 lines with fence-aware boundaries, retain every passage, and point truncated readers to --json; JSON/pretty output remains full. Format, type-check, 436 tests, and build pass. Never merge.

@PhantomInTheWire I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/developer.ts Outdated
@cubic-dev-ai

cubic-dev-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown

@cubic-dev-ai review\n\nPlease re-review exact head e4bf91587a4890cf1d3f997bc0638532ae6daae1. The prior container-prefix finding is fixed: fence detection now follows block-quote and list prefixes and synthesizes a correctly prefixed close marker within the 40-line cap. Added block-quote and list regressions; 438 tests and all gates pass. Never merge.

@PhantomInTheWire I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/developer.ts Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 2 files

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.

Re-trigger cubic

Require a closing fence to use the opening fence container. This keeps quoted list markers inside fenced code from ending the block.
@PhantomInTheWire

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

Please re-review exact head 3b9b72b04ca4d974637a0cd8f6f506071ca53cfd, superseding e4bf91587a4890cf1d3f997bc0638532ae6daae1. A fence closer must now match the opening Markdown container prefix, so quoted list markers inside fenced code cannot close the block. Human-readable passages remain capped at 40 lines with no passage-count cap; JSON and pretty output remain complete. All 439 tests and format, type-check, and build gates pass. The exact-head 100-query replay table is in the PR body. Never merge.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

Please re-review exact head 3b9b72b04ca4d974637a0cd8f6f506071ca53cfd, superseding e4bf91587a4890cf1d3f997bc0638532ae6daae1. A fence closer must now match the opening Markdown container prefix, so quoted list markers inside fenced code cannot close the block. Human-readable passages remain capped at 40 lines with no passage-count cap; JSON and pretty output remain complete. All 439 tests and format, type-check, and build gates pass. The exact-head 100-query replay table is in the PR body. Never merge.

@PhantomInTheWire I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/developer.ts
Comment thread src/commands/developer.ts
@PhantomInTheWire

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

Please review exact head a31e6add5fbd61f236b7f32790f9ef56d776256d, superseding 3b9b72b04ca4d974637a0cd8f6f506071ca53cfd. Valid closer indentation is now independent of the Markdown container prefix, result formatting preserves leading fence indentation, and only spaces/tabs may trail a closer. Human-readable output remains capped at exactly 40 lines per passage, all passages remain present, and JSON/pretty remain complete. Prettier, type-check, build, and all 442 tests pass. Never merge.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

Please review exact head a31e6add5fbd61f236b7f32790f9ef56d776256d, superseding 3b9b72b04ca4d974637a0cd8f6f506071ca53cfd. Valid closer indentation is now independent of the Markdown container prefix, result formatting preserves leading fence indentation, and only spaces/tabs may trail a closer. Human-readable output remains capped at exactly 40 lines per passage, all passages remain present, and JSON/pretty remain complete. Prettier, type-check, build, and all 442 tests pass. Never merge.

@PhantomInTheWire I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/developer.ts Outdated
Comment thread src/commands/developer.ts Outdated
@PhantomInTheWire
PhantomInTheWire force-pushed the fix/developer-passage-render branch from a31e6ad to dd5015f Compare September 3, 2026 08:00
@PhantomInTheWire

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

Please re-review exact head dd5015fa69add73382855a9cde7af9a5c1a45efe, superseding a31e6add5fbd61f236b7f32790f9ef56d776256d. Quote containers now match regardless of the optional post-marker space, including nested quotes, and ordered-list markers are limited to CommonMark’s one-to-nine digits. The earlier closer-indentation, leading-indent, and suffix-whitespace fixes remain. Prettier, type-check, build, and all 444 tests pass. Never merge.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

Please re-review exact head dd5015fa69add73382855a9cde7af9a5c1a45efe, superseding a31e6add5fbd61f236b7f32790f9ef56d776256d. Quote containers now match regardless of the optional post-marker space, including nested quotes, and ordered-list markers are limited to CommonMark’s one-to-nine digits. The earlier closer-indentation, leading-indent, and suffix-whitespace fixes remain. Prettier, type-check, build, and all 444 tests pass. Never merge.

@PhantomInTheWire I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/developer.ts Outdated
@PhantomInTheWire
PhantomInTheWire force-pushed the fix/developer-passage-render branch from dd5015f to 1f1c149 Compare September 3, 2026 09:17
@PhantomInTheWire

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

Please re-review exact head 1f1c1493b044df1f0c3c837a2423a9fee486391e, superseding dd5015fa69add73382855a9cde7af9a5c1a45efe. Lone-CR passage line endings now normalize and receive the same exact 40-line cap as CRLF/LF input. Quote/list fence matching and all prior fence-boundary fixes remain; every passage is retained and JSON/pretty stay complete. Prettier, type-check, build, and all 445 tests pass. Never merge.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

Please re-review exact head 1f1c1493b044df1f0c3c837a2423a9fee486391e, superseding dd5015fa69add73382855a9cde7af9a5c1a45efe. Lone-CR passage line endings now normalize and receive the same exact 40-line cap as CRLF/LF input. Quote/list fence matching and all prior fence-boundary fixes remain; every passage is retained and JSON/pretty stay complete. Prettier, type-check, build, and all 445 tests pass. Never merge.

@PhantomInTheWire I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/developer.ts Outdated
Comment thread src/commands/developer.ts Outdated
@PhantomInTheWire
PhantomInTheWire force-pushed the fix/developer-passage-render branch from 1f1c149 to 82297f9 Compare September 3, 2026 09:55
@PhantomInTheWire

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

Please re-review exact head 82297f9694673f0e3f93553aa597aa4dd5be9f4b, superseding 1f1c1493b044df1f0c3c837a2423a9fee486391e. Tab-padded list containers now use tab-expanded Markdown columns for real and synthetic fence closers, and citation URL line breaks are flattened before the 40-line budget is computed. All prior line-ending, quote/list boundary, passage-count, and JSON/pretty guarantees remain. Prettier, type-check, build, and all 448 tests pass. Never merge.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

Please re-review exact head 82297f9694673f0e3f93553aa597aa4dd5be9f4b, superseding 1f1c1493b044df1f0c3c837a2423a9fee486391e. Tab-padded list containers now use tab-expanded Markdown columns for real and synthetic fence closers, and citation URL line breaks are flattened before the 40-line budget is computed. All prior line-ending, quote/list boundary, passage-count, and JSON/pretty guarantees remain. Prettier, type-check, build, and all 448 tests pass. Never merge.

@PhantomInTheWire I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Re-trigger cubic

@PhantomInTheWire

Copy link
Copy Markdown
Member Author

Closing: passage normalization (blank-line collapse, trailing-space trim, line cap with fence-aware truncation) belongs server-side so every consumer gets it and there is one set of rules. Server PR follows in firecrawl/search. No CLI-side fallback: the server rolls faster than users upgrade the CLI.

@PhantomInTheWire
PhantomInTheWire deleted the fix/developer-passage-render branch September 3, 2026 20:12
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