refactor(lambda): route leaf projection kinds through CstFold#641
Conversation
|
Warning Review limit reached
More reviews will be available in 50 minutes and 7 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ 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 (2)
📝 WalkthroughWalkthroughAdds a new ChangesCstFold-backed leaf kind derivation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 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 |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lambda-editor | 9f12b60 | Commit Preview URL Branch Preview URL |
Jun 14 2026, 02:35 AM |
Benchmark Comparison ReportComparing PR branch against Main Module BenchmarksBase branch: PR branch: event-graph-walker BenchmarksBase branch: PR branch: Benchmarks run with |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@lang/lambda/proj/cstfold_compat.mbt`:
- Around line 27-30: Add a doc comment above the
cstfold_projection_compatible_kind function that states which existing APIs were
evaluated (specifically `@parser.syntax_node_to_term` and
cstfold_projection_compatible_term) and explains why neither alone is sufficient
for the use case. The doc comment must explicitly define the helper's
responsibility boundary, clearly stating that it converts a CST node to a
projection-compatible Term by combining the CstFold path through
`@parser.syntax_node_to_term` with projection compatibility normalization via
cstfold_projection_compatible_term.
In `@lang/lambda/proj/proj_node.mbt`:
- Around line 69-75: Add a documentation comment to the cstfold_leaf_node
function that states which existing APIs were considered (ProjNode::leaf and
cstfold_projection_compatible_kind) and why this wrapper is necessary instead of
using those directly. Explicitly document the responsibility boundary of this
helper, which is to own leaf ProjNode construction boundaries as described in
the PR objectives. Follow the coding guideline format that requires stating
candidate existing APIs and the helper's explicit responsibility boundary.
🪄 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: 842d8bdc-fdd7-4657-bd07-649c3d3f92da
📒 Files selected for processing (3)
lang/lambda/proj/cstfold_compat.mbtlang/lambda/proj/proj_node.mbtlang/lambda/proj/proj_node_cstfold_wbtest.mbt
Summary
IntLiteral,VarRef, andHoleLiteralprojection kinds through existing Loom Lambda CstFold output plus the Lambda projection: decide block-expression CstFold divergence #629 compatibility adapter.ProjNode::leafconstruction for leaf spans, node IDs, and childless shape.Reuse check
@parser.syntax_node_to_termfor folded LambdaTermoutput.cstfold_projection_compatible_termto preserve Canopy block-expression semantics decided in Lambda projection: decide block-expression CstFold divergence #629/test(lambda): decide block CstFold compatibility #640.ProjNode::leaffor span/id allocation instead of rebuilding leaf metadata manually.@parser.lambda_fold_node,Term::children, and@ast.rebuild_from;Term::children/@ast.rebuild_fromremain used by the compatibility adapter, while directlambda_fold_nodeuse is unnecessary for the leaf-only projection slice.cstfold_projection_compatible_kindowns the SyntaxNode → adapter-normalized Term boundary;cstfold_leaf_nodeowns the leaf ProjNode construction boundary.Validation
NEW_MOON_MOD=0 moon check lang/lambda/proj --deny-warnNEW_MOON_MOD=0 moon test lang/lambda/projNEW_MOON_MOD=0 moon infogit diff -- '*.mbti'reviewed; no retained public API diff. Unrelatedmoon infonewline churn was reverted.Closes #630.
Summary by CodeRabbit
Refactor
Tests