Repository navigation
fix: preserve Capire chunk context and token budgets - #232
larsPlessing wants to merge 1 commit into
Conversation
Pack list-item openers once instead of charging their token cost to every nested fragment. Compare rendered embedding text, display text, and runtime labels when removing duplicates so distinct headings and retrieval context remain available. Add unit and pipeline regression tests. With both MiniLM models, live-document duplicate drops decrease from 235 to 100 and the affected warning remains one complete chunk. Full tests, lint, and formatting checks pass. No public API changes.
SummaryThe following content is AI-generated and provides a summary of the pull request: Preserve Capire Chunk Context and Token BudgetsBug Fix🐛 Corrected Capire chunk packing so list-item openers consume the token budget only once, preventing nested warnings from being split into incomplete fragments. Deduplication now considers rendered embedding text, display context, and runtime labels, preserving semantically distinct chunks while still removing exact duplicates across source anchors. Changes
All rendered chunks remain within the configured token limit. No public API changes are introduced. Validation
Images and Links
PR Bot InformationVersion:
|
There was a problem hiding this comment.
No substantive correctness or maintainability issues found in the changed code. The regression tests cover the revised token-budget and deduplication behavior well.
PR Bot Information
Version: 1.33.47
- Experiment Variant:
control - Event Trigger:
pull_request.opened - Correlation ID:
dc468c20-ddeb-11f1-934e-c7dc2592b94b - File Content Strategy: Full file content
- LLM:
gpt-5.6-sol
Summary
Cause and reproduction
The chunking pipeline for
cds-mcp createCapireEmbeddings --model sentence-transformers/all-MiniLM-L6-v2 --model Xenova/all-MiniLM-L6-v2dropped 235 duplicates for each model.A list-item opener was included in every nested token measurement but emitted only once. With a 126-token content budget, this produced warning fragments containing only
/,s, or-. The duplicate key also ignored headings and display context.Live-document verification
Compared the original and updated chunking pipelines with the same documentation input and both model tokenizers. No embeddings were generated.
Affected section: https://cap.cloud.sap/docs/java/working-with-cql/query-execution#updatable-views
All updated rendered chunks pass the maximum-token check. Eleven short-body warnings remain.
Tests
npm test -- --test-reporter=dotnpm run lintgit diff --checkAll checks passed locally on Node.js 24.15.0. No public API changes.