Skip to content

fix(tier2): bound embedding chunks and preserve source evidence - #227

Merged
rng1995 merged 7 commits into
mainfrom
feat/christopherk/public-dedup-chunk-bounds
Oct 30, 2026
Merged

rng1995 merged 7 commits into
mainfrom
feat/christopherk/public-dedup-chunk-bounds

Conversation

@chrisknvidia

@chrisknvidia chrisknvidia commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A long table, Python docstring or shell function can become one oversized embedding input, causing a provider context-limit rejection. Cap each intra-skill input at 3,000 characters, retain meaningful short tails and correct source ranges, and keep sibling pieces from becoming duplicate findings with each other. Independent copies still participate in clustering. Existing Markdown fence handling and scan budgets remain intact.

Verification

  • Reviewed the contributing guidelines and added focused tests; the new regressions failed before implementation.
  • Deduplication suite: 167 passed, 1 skipped; independent edge-case review completed.
  • Real public CLI with a deterministic local HTTP protocol fixture: bounded input passes, an independent copy remains a duplicate, and public-main control receives an oversized-input rejection. JSON, HTML and Markdown outputs checked; actual HTML inspected in Chrome.
  • Lint, wheel/sdist build and documentation validation passed. Fern skips the authenticated redirects check without a token.
  • Public-only source and fixtures; privacy and Gitleaks scans passed.
  • Full default regression suite: 14,511 passed, 27 skipped. This PR stays draft pending CI.

The HTTP fixture verifies request boundaries and output behavior, not embedding quality or live model-provider acceptance. Public provider credentials were unavailable; no live provider or GPU evaluation is claimed.

Release Impact

  • Updated CHANGELOG.md and the Tier 2 guide.

CI status

The existing HTML parser compatibility matrix cannot install Python 3.12.11 or 3.13.5 on the current ubuntu-latest Ubuntu 26.04 runner. These jobs fail during Python setup, before tests execute. The workflow is unchanged by this PR; this remains a CI blocker, and the PR stays draft.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Automated review: 3 findings (0 P1, 1 P2, 2 P3); 3 posted inline.

Reviewed at 74a2e03. The core bound in _bounded_pieces is correct: over 3,000 random inputs (CJK, emoji, long lines) every piece is at most 3,000 characters and the split is lossless apart from whitespace. 11 of the 12 new chunk-bound tests fail on main. The comments below are about the paragraph path for oversized Markdown sections and about how split pieces show up in findings and docs.

Comment thread docs/tier2-deduplication.mdx Resolved
rng1995 and others added 3 commits October 28, 2026 08:14
…rces once

Short paragraphs of an oversized Markdown section stay attached to a neighbour, pieces share the section's split group, and clusters merge sibling pieces into one location with the merged line range.

Signed-off-by: Christopher Kevin <[email protected]>
…lic-dedup-chunk-bounds

Signed-off-by: Christopher Kevin <[email protected]>
@rng1995
rng1995 marked this pull request as ready for review October 29, 2026 21:13

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the complete diff and all review threads/replies. Verified the three earlier findings are addressed: oversized Markdown paragraphs are packed with shared sibling identity; clusters merge split sources for one displayed location; documentation reflects packing and the 3,000-character input cap. Merged current main (935b162), preserving both CHANGELOG sides. Also reproduced and fixed a source-evidence regression: a short packed tail after blank lines reported line 4 instead of actual line 102; paragraph packing now preserves source line gaps. The added regression failed before the fix. Validation: deduplication suite 169 passed, 1 skipped; Ruff across src/tests and git diff --check passed; wheel/sdist build passed. Approval applies to cdeca42; GitHub checks may still be running after this push.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the refresh against main at 618fc0f. The sole conflict was CHANGELOG.md; the resolution retains both the bounded-chunk/source-evidence note and all upstream release notes. The existing 3,000-character bound, independent-copy clustering, and source-gap fix are preserved unchanged. Independent review confirmed the resolution.

Validation: affected deduplication tests completed successfully within the broader deduplication/embedding run (330 passed, 2 skipped before that broader run was interrupted during unrelated filesystem-heavy cases). Its sole failure was the sandbox rejecting the Unix-socket fixture at socket.bind; that exact test passed outside the sandbox. The direct packed-tail check retains source line 102 with two inputs of at most 2,998 characters. Ruff over src/tests, whitespace checks, and wheel/source-distribution builds passed. GitHub reports this exact head mergeable; CI is rerunning.

@rng1995
rng1995 enabled auto-merge October 30, 2026 06:14
@rng1995
rng1995 merged commit ddf2e0d into main Oct 30, 2026
20 checks passed
@rng1995
rng1995 deleted the feat/christopherk/public-dedup-chunk-bounds branch October 30, 2026 06:22
chrisknvidia added a commit that referenced this pull request Oct 30, 2026
* fix(tier2): bound embedding chunks and preserve source evidence
* fix(tier2): pack oversized sections by paragraph and report split sources once

Signed-off-by: Christopher Kevin <[email protected]>
chrisknvidia pushed a commit that referenced this pull request Oct 30, 2026
* fix(tier2): retain source gaps when packing bounded chunks

Signed-off-by: Narendran Raghavan <[email protected]>
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.

2 participants