feat(recipes): type-ancestors and type-descendants#141
Conversation
Ship bundled SQL for extends/implements hierarchy walks parsed from symbols.signature, with minimal fixture coverage and golden-query CI.
🦋 Changeset detectedLatest commit: 32cad9c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
More reviews will be available in 45 minutes and 34 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis PR implements ChangesType-hierarchy recipes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
- Scope recursive heritage walks by child/descendant file_path - Resolve parent types with same-file preference via ROW_NUMBER - Add optional file_path param for homonym disambiguation - Add homonym, cycle, multi-extends fixtures and edge-case goldens - Extract shared heritage CTE fragment; delete shipped plan per governance
Add changeset, MCP instructions, delivery tracker row, descendants file_path homonym scoping, and homonym/unknown descendant goldens.
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 `@templates/recipes/type-descendants.sql`:
- Around line 132-158: The JOIN in the descendants CTE currently uses only
he.base_name = bs.name which pulls heritage edges from homonymous bases in other
files; update the JOIN between base_symbols bs and heritage_edges he inside the
descendants CTE to also constrain the base file path so the first-level
expansion respects params.file_path (e.g. JOIN heritage_edges he ON he.base_name
= bs.name AND (bs.file_path IS NULL OR bs.file_path = '' OR he.base_file_path =
bs.file_path)); keep the rest of the descendant columns/visited construction the
same so deeper recursion still works.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7e060a8a-0c95-4014-bfa8-22c2c3b8eced
📒 Files selected for processing (30)
docs/plans/agent-surface-and-ops.mddocs/plans/call-path-type-hierarchy-recipes.mddocs/roadmap.mdfixtures/golden/minimal/barrel-files.jsonfixtures/golden/minimal/files-count.jsonfixtures/golden/minimal/files-hashes.jsonfixtures/golden/minimal/files-largest.jsonfixtures/golden/minimal/index-summary.jsonfixtures/golden/minimal/refactor-risk-ranking.jsonfixtures/golden/minimal/type-ancestors-cycle.jsonfixtures/golden/minimal/type-ancestors-dog.jsonfixtures/golden/minimal/type-ancestors-homonym.jsonfixtures/golden/minimal/type-ancestors-kind-filter.jsonfixtures/golden/minimal/type-ancestors-max-depth.jsonfixtures/golden/minimal/type-ancestors-unknown.jsonfixtures/golden/minimal/type-descendants-animal.jsonfixtures/golden/minimal/type-descendants-max-depth.jsonfixtures/golden/minimal/type-descendants-pet-class.jsonfixtures/golden/minimal/unimported-exports.jsonfixtures/golden/minimal/unused-type-members.jsonfixtures/golden/scenarios.jsonfixtures/minimal/README.mdfixtures/minimal/src/types/hierarchy.tsfixtures/minimal/src/types/homonym-mammal.tsfixtures/minimal/src/types/type-cycle.tstemplates/recipes-fragments/heritage-edges.sqltemplates/recipes/type-ancestors.mdtemplates/recipes/type-ancestors.sqltemplates/recipes/type-descendants.mdtemplates/recipes/type-descendants.sql
💤 Files with no reviewable changes (2)
- docs/plans/call-path-type-hierarchy-recipes.md
- docs/roadmap.md
Documents the substrate path to replace signature parsing in type-ancestors and type-descendants; links from roadmap and agent-surface related plans.
…ipe limits" This reverts commit 3ece392.
* docs(plans): add type-heritage-substrate plan for lifting recipe limits Documents the substrate path to replace signature parsing in type-ancestors and type-descendants; links from roadmap and agent-surface related plans. * docs(delivery): mark #141 merged; track type-heritage-substrate as in flight * feat(substrate): type_heritage table and recipe rewire Add AST-backed type_heritage extraction, import-aware resolve pass, and rewire type-ancestors/type-descendants to JOIN substrate rows. Schema bump 34→35; heritage-qualified fixture; goldens refreshed.
Summary
type-ancestorsandtype-descendantsbundled recipes for walking class/interface heritage via recursive CTEs onsymbols.signature(extends/implementsclauses).fixtures/minimal/src/types/hierarchy.ts(Animal → Mammal → Dog+Petimplements) with four golden-query scenarios.call-path-type-hierarchy-recipesplan shipped and prune the item from roadmap / agent-surface P2 table.Heritage is signature-derived (no new schema columns). Recipe docs note parsing limits (qualified extends, commas in generics).
Test plan
bun run test:golden --updatethenbun run test:goldenCODEMAP_ROOT=fixtures/minimal bun src/index.ts query --recipe type-ancestors --params symbol_name=Dog --jsonCODEMAP_ROOT=fixtures/minimal bun src/index.ts query --recipe type-descendants --params symbol_name=Animal --jsonSummary by CodeRabbit
New Features
Documentation
Chores