feat(pkg/go): validate entrypoints from the weighted graph - #667
Draft
SoulPancake wants to merge 1 commit into
Draft
feat(pkg/go): validate entrypoints from the weighted graph#667SoulPancake wants to merge 1 commit into
SoulPancake wants to merge 1 commit into
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Adds pkg/go/validation/graph_validation.go, which builds the weighted graph through the exported builder and reports unreachable relations by reading it rather than by walking the rewrite tree. A relation node carries one weight per terminal type it can reach, so reaching none is what the traversal calls an impossible relation. EngineOptions.UseGraphValidation selects it, and the two paths are an if/else rather than two phases. They answer the same question by different means, so running both would report one problem twice and disagree wherever they diverge. It is off by default because the graph path is not the source of truth yet. Over the 84 non-skipped cases of the shared semantic corpus, validation and the graph reject 33 of the same models, validation rejects 47 the graph builds, and the graph rejects none that validation accepts. Of the 51 the graph builds, the new rule and the traversal name an identical set of entrypoint findings on all 51, compared as whole findings including symbol, line, column and message. The rule fires on 7, so that comparison is not of empty lists. Under the option, 73 of 84 corpus cases pass. The 11 that do not diverge one way: Build stops at the first problem and returns no graph with its error, so there is nothing left to enumerate relations from, and a model with three broken relations yields one finding naming none of them. Those cases report the new graph-model-unbuildable instead, which carries no position. It chains the error the builder returned under ErrModelNotBuildable, so errors.Is reaches both the refusal and the reason. Nothing under pkg/go/graph changes.
SoulPancake
force-pushed
the
feat/graph-validation-api
branch
from
August 21, 2026 13:31
6f98202 to
1e1f520
Compare
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.
Adds pkg/go/validation/graph_validation.go, which builds the weighted graph through the exported builder and reports unreachable relations by reading it rather than by walking the rewrite tree. A relation node carries one weight per terminal type it can reach, so reaching none is what the traversal calls an impossible relation.
EngineOptions.UseGraphValidation selects it, and the two paths are an if/else rather than two phases. They answer the same question by different means, so running both would report one problem twice and disagree wherever they diverge. It is off by default because the graph path is not the source of truth yet.
Over the 84 non-skipped cases of the shared semantic corpus, validation and the graph reject 33 of the same models, validation rejects 47 the graph builds, and the graph rejects none that validation accepts. Of the 51 the graph builds, the new rule and the traversal name an identical set of entrypoint findings on all 51, compared as whole findings including symbol, line, column and message. The rule fires on 7, so that comparison is not of empty lists.
Under the option, 73 of 84 corpus cases pass. The 11 that do not diverge one way: Build stops at the first problem and returns no graph with its error, so there is nothing left to enumerate relations from, and a model with three broken relations yields one finding naming none of them. Those cases report the new graph-model-unbuildable instead, which carries no position. It chains the error the builder returned under ErrModelNotBuildable, so errors.Is reaches both the refusal and the reason.
Nothing under pkg/go/graph changes.
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
main