Repository navigation
feat(pkg/go): add graph-based validation entry points - #684
SoulPancake wants to merge 2 commits into
Conversation
ValidateDSLWithGraph and ValidateJSONWithGraph resolve relation entrypoints from the weighted authorization-model graph rather than by walking the rewrite tree. They reuse every other validation phase and the cascade gate, differing only in how entrypoint reachability is answered. Where the graph builds, both paths report identical entrypoint findings (message, code, position). A model the builder refuses yields a single graph-model-unbuildable finding, a Go-side code with no pkg/js or pkg/java counterpart.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
| // viewer` closes on itself through a computed rewrite and nothing else, which it | ||
| // calls a potential loop. `define viewer: viewer from parent` reaches a tupleset | ||
| // it can never satisfy, which it calls a missing entrypoint. | ||
| func (s *graphScope) reachesOnlyRewrites(nodeID string) bool { |
There was a problem hiding this comment.
this is already validated through the weight, or this is something different?
There was a problem hiding this comment.
It's something different, I think: the weights decide whether a relation is reported, and this only picks which of the two messages it gets. define viewer: viewer and define viewer: viewer from parent look the same in the weights, and only the edge type tells them apart. I'll make the comment clearer before moving it from draft to ready! Thanks
Stacked on #660; exposes graph-based validation on top of that branch's model.
Adds
ValidateDSLWithGraphandValidateJSONWithGraph, which resolve relation entrypoints from the weighted authorization-model graph instead of walking the rewrite tree. They run the same phases asValidateDSL/ValidateJSONbehind the same cascade gate, differing only in how entrypoint reachability is answered.Where the graph builds, both paths report identical entrypoint findings — same message, code, and position. A model the builder refuses yields a single
graph-model-unbuildablefinding, a Go-side code with no pkg/js or pkg/java counterpart.ValidateDSL/ValidateJSONare unchanged and remain the default; the graph path is opt-in.Replaces the approach in #667, which predates #660's converged model.