Skip to content

feat(pkg/go): add graph-based validation entry points - #684

Draft
SoulPancake wants to merge 2 commits into
feat/converged-error-taxonomyfrom
feat/graph-validation-findings
Draft

SoulPancake wants to merge 2 commits into
feat/converged-error-taxonomyfrom
feat/graph-validation-findings

Conversation

@SoulPancake

Copy link
Copy Markdown
Member

Stacked on #660; exposes graph-based validation on top of that branch's model.

Adds ValidateDSLWithGraph and ValidateJSONWithGraph, which resolve relation entrypoints from the weighted authorization-model graph instead of walking the rewrite tree. They run the same phases as ValidateDSL/ValidateJSON behind 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-unbuildable finding, a Go-side code with no pkg/js or pkg/java counterpart.

ValidateDSL/ValidateJSON are unchanged and remain the default; the graph path is opt-in.

Replaces the approach in #667, which predates #660's converged model.

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.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

// 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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already validated through the weight, or this is something different?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants