Cap the summary and highlight paths, closing the last ENG-3697 review findings - #24
Merged
Merged
Conversation
…ings Bounding only the tree fallback left the headline claim true of the endpoints nobody was complaining about and false of the ones they were. `summary` is the server's concatenation of a hit's highlights, and the API caps each HIGHLIGHT at ~2000 — not their sum — so a hit with ten of them emitted ~20KB from Search and Answer, the two most-used operations. Every path in matchedText is now capped at MAX_SIMPLIFIED_TEXT. This changes Search and Answer output for existing workflows, which is why it is a minor bump rather than a patch. Also closes two review nits: the shared property test asserted only that SOME preSend was wired, which an unrelated no-op would satisfy, and the live-list cap had no test with any text in it — the prod fixture carries none, so an unbounded payload would have passed. That fixture stays a verbatim recording; the new test brings its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
EntelligenceAI PR SummaryCaps simplified document text across summary, highlight, and tree-fallback paths to prevent Search and Answer results from expanding to tens of kilobytes. Adds regression coverage for summary/highlight aggregation and live-list payloads, and strengthens the connection ID wiring test to verify the exact validator function. Review Scorecard
Safe to merge — this is a clean, low-blast-radius change with no correctness, security, or robustness issues identified. The caps are applied across the summary, highlight, and tree-fallback paths, with regression coverage for aggregation and live-list payloads; the connection ID test also verifies the exact validator function. No pre-existing unresolved issues or new review findings require follow-up. Key Findings:
Evaluated against
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #23, closing the three review findings that were still open when it merged.
Cap summary and highlights (Entelligence MAJOR,
simplify.ts:112)matchedTextreturnedsummaryverbatim. Summary is the server's concatenation of a hit's highlights, and the API caps each highlight at ~2000 — not their sum — so a hit with ten of them emitted ~20KB. That means Search and Answer, the two most-used operations, were never bounded: #23's table claiming them "bounded, correct" was wrong.Every path in
matchedTextis now capped atMAX_SIMPLIFIED_TEXT.This changes Search and Answer output for existing workflows, so the release that carries it is 0.8.0, not a patch.
Two review nits
connection-id.test.mjsasserted only that some preSend was wired, which an unrelated no-op would satisfy. Now asserts identity.Verification
npm run build,npm run lint,npm test— 112/112 (was 108).The summary path is covered by unit tests; end-to-end confirmation through a live query is blocked locally on an expired AWS SSO token (the query path needs SageMaker embeddings), not on anything in this diff.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.