Skip to content

Cap the summary and highlight paths, closing the last ENG-3697 review findings - #24

Merged
Dithilli merged 1 commit into
mainfrom
david/eng-3697-cap-summary-and-close-review
Aug 12, 2026
Merged

Cap the summary and highlight paths, closing the last ENG-3697 review findings#24
Dithilli merged 1 commit into
mainfrom
david/eng-3697-cap-summary-and-close-review

Conversation

@Dithilli

@Dithilli Dithilli commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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)

matchedText returned summary verbatim. 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 matchedText is now capped at MAX_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.mjs asserted only that some preSend was wired, which an unrelated no-op would satisfy. Now asserts identity.
  • The live-list cap had no test containing any text — the prod fixture has none, so an unbounded payload would have passed. That fixture stays a verbatim recording; the new test brings its own long node.

Verification

npm run build, npm run lint, npm test112/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.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…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>
@linear-code

linear-code Bot commented Aug 12, 2026

Copy link
Copy Markdown

ENG-3697

@entelligence-ai-pr-reviews

Copy link
Copy Markdown

EntelligenceAI PR Summary

Caps 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

Dimension Rating Basis
Code Quality ●●●●● 5/5 — Excellent no critical/significant findings — rated Excellent
Blast Radius Low changed symbols are referenced only within their own file(s); no high-impact surface touched, 1 file(s) / ~11 line(s) changed (size only — not a blast signal)
Merge Confidence ●●●●● 5/5 — Safe to Merge code quality 5/5 × Low blast radius

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:

  • Summary, highlight, and tree-fallback text paths are capped consistently, preventing oversized Search and Answer payloads without changing unrelated behavior.
  • Regression coverage exercises summary/highlight aggregation and live-list payloads, while the connection ID wiring test checks the precise validator rather than only broad behavior.
Evaluated against
  • 4/4 changed files reviewed
  • criteria: correctness, security & access control, robustness & error handling, concurrency & data integrity, repo conventions / steering docs
  • steering docs: none found in repo

@Dithilli
Dithilli merged commit fdcef2a into main Aug 12, 2026
2 checks passed
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