Repository navigation
fix: improve page index descriptions - #17268
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe page index compilation template now requires concise, source-grounded heading descriptions, including synthesized parent overviews when direct content is absent. Its JSON output rules now include ChangesPage Index Extraction
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8)api/db/init_data/compilation_templates/page_index.yamlTraceback (most recent call last): 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api/db/init_data/compilation_templates/page_index.yaml`:
- Around line 9-10: Update the heading extraction prompt in the page-index
template to consistently require the entity key title rather than name, matching
the emitted JSON schema. Ensure all related instructions use title and preserve
the existing PageIndex format expected by consumers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f03fc89d-0cd0-4120-a219-61022b69c16e
📒 Files selected for processing (1)
api/db/init_data/compilation_templates/page_index.yaml
| entity's `name` must be the exact clean heading text. For each heading, | ||
| write a strongly compressed summary of only the content belonging to |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Use title consistently instead of name.
The prompt requires an entity name, but the emitted JSON shape uses title at Line 35. This ambiguity can produce the wrong key and break consumers expecting the existing PageIndex format.
Proposed fix
- The entity's `name` must be the exact clean heading text.
+ The entity's `title` must be the exact clean heading text.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| entity's `name` must be the exact clean heading text. For each heading, | |
| write a strongly compressed summary of only the content belonging to | |
| The entity's `title` must be the exact clean heading text. For each heading, | |
| write a strongly compressed summary of only the content belonging to |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@api/db/init_data/compilation_templates/page_index.yaml` around lines 9 - 10,
Update the heading extraction prompt in the page-index template to consistently
require the entity key title rather than name, matching the emitted JSON schema.
Ensure all related instructions use title and preserve the existing PageIndex
format expected by consumers.
wangq8
left a comment
There was a problem hiding this comment.
Thanks for this improvement! The updated page_index template is a solid enhancement — making entity descriptions more source-grounded, concise, and useful for cross-chunk merging is exactly the right direction.
What works well:
- Parent headings without direct content now get a higher-level overview derived from children instead of an empty description — this is a key fix for downstream merging quality.
- Explicitly forbidding meta descriptions like "heading for…" and empty descriptions except when there is truly no source content adds useful guardrails.
- The 1–2 sentence / 2–4 key facts constraint provides concrete guidance without being too rigid.
Minor considerations (non-blocking):
- The prompt is significantly longer now, which will increase token cost per page_index call. This is probably fine given the quality gain, but worth keeping an eye on.
- "Roughly half the length of a normal summary" is a bit subjective — LLMs may interpret this inconsistently. Not a problem, just worth monitoring output quality in practice.
Overall LGTM. Thanks for the contribution!
What problem does this PR solve?
Improve the PageIndex extraction template so entity descriptions are concise, source-grounded, and useful for later cross-chunk merging.
Parent headings without direct content now receive a higher-level overview instead of an empty description.
Type of change