Skip to content

fix: keep ingest chunks within boundary budget - #354

Merged
xDarkicex merged 1 commit into
mainfrom
vale/fix-chunk-boundary
Aug 1, 2026
Merged

fix: keep ingest chunks within boundary budget#354
xDarkicex merged 1 commit into
mainfrom
vale/fix-chunk-boundary

Conversation

@compoodment

Copy link
Copy Markdown
Collaborator

Summary

Fixes #350.

  • Keeps splitIntoChunks boundary probes inside the current [offset, end) slice instead of reading from the next chunk at pos = end.
  • Prevents newline and double-newline boundary choices from extending a chunk past the configured chunkTokens * 4 character budget.
  • Adds a unit regression through IngestQueue.enqueueIngest for single-newline and double-newline boundary inputs.

Quality: Q5 proven
Evidence: source inspection showed the probe used the exclusive end index; the new regression exercises the reported boundary cases and asserts every emitted chunk stays within the 12-char budget.
Impact: oversized chunks can violate the ingest chunk budget and make boundary decisions using bytes from the next chunk.
Risk: low; the patch only changes backward boundary selection and preserves the existing fallback to the hard limit.

Verification

  • pnpm install --frozen-lockfile
  • pnpm exec tsc -p tsconfig.tests.json && node --test .ts-build/test/unit/ingest-queue.test.js - pass, 4/4
  • pnpm run check - fails in existing host-flow integration assertions unrelated to chunking:
    • assemble passes correct configuration mapping and returns expected payload
    • assemble triggers force compaction at dynamic 80% threshold before daemon assembly
    • assemble proceeds to assembly when server legitimately declines compaction

– Vale

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@xDarkicex, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 23183e60-feeb-420d-8e57-8b93e4c745fe

📥 Commits

Reviewing files that changed from the base of the PR and between 96b7694 and 8a5bfb9.

📒 Files selected for processing (2)
  • src/ingest-queue.ts
  • test/unit/ingest-queue.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@compoodment compoodment left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Vale Review — PR #354

Quality: Q4/5 — sharp
Head: 8a5bfb9

Findings:
None

Proof gaps: Full repo check is still blocked by existing host-flow failures reported in the PR body; no independent gate rerun in this review.

Verdict: comment-only — draft self-authored fix is narrow, behavior-tested, and I found no actionable regression.

– Vale

@xDarkicex xDarkicex added the release:patch Bump patch version on merge label Aug 1, 2026
@xDarkicex
xDarkicex marked this pull request as ready for review August 1, 2026 20:19
@xDarkicex
xDarkicex merged commit 2972701 into main Aug 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:patch Bump patch version on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: splitIntoChunks produces chunks exceeding maxChars at newline boundaries

2 participants