Skip to content

chore: add documentation for the weighted graph - #656

Draft
senojj wants to merge 2 commits into
mainfrom
chore/weighted-graph-documentation
Draft

chore: add documentation for the weighted graph#656
senojj wants to merge 2 commits into
mainfrom
chore/weighted-graph-documentation

Conversation

@senojj

@senojj senojj commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Document some of the rules that govern the weighted authorization graph.

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for weighted authorization graphs.
    • Clarified vertex and edge types, structural constraints, naming rules, and permitted endpoints.
    • Documented weight propagation, sink reachability, tuple resolution, logical groupings, and recursive or tuple cycles.
    • Added guidance for direct, intersection, and exclusion paths, including cycle restrictions and finiteness guarantees.

Copilot AI lite review requested due to automatic review settings August 5, 2026 21:56
@senojj
senojj requested a review from a team as a code owner August 5, 2026 21:56
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ebfece0a-b6ae-4abf-a0bc-d4107b6327a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Walkthrough

Changes

Weighted authorization graph

Layer / File(s) Summary
Graph specification
pkg/go/graph/README.md
Defines vertex and edge kinds, naming and structural constraints, edge conditions, grouping, weight propagation, sink reachability, tuple-resolving edges, circulation rules, and recursive tuple cycles.
Graph theorems
pkg/go/graph/README.md
States nine theorems about path weights, circulation, terminal targets, reachability, expression trees, intersections, exclusions, and global finiteness bounds.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding documentation for the weighted authorization graph.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/weighted-graph-documentation

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.

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

@senojj senojj changed the title add documentation for the weighted graph chore: add documentation for the weighted graph Aug 5, 2026
@senojj
senojj force-pushed the chore/weighted-graph-documentation branch from 871dc67 to c7e8fad Compare August 5, 2026 22:22
@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

@senojj
senojj force-pushed the chore/weighted-graph-documentation branch from c7e8fad to b86b212 Compare August 6, 2026 15:13
@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

@senojj
senojj marked this pull request as draft August 6, 2026 16:35
@senojj
senojj force-pushed the chore/weighted-graph-documentation branch from b86b212 to 1ea7618 Compare August 6, 2026 19:33

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 4

🤖 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 `@pkg/go/graph/README.md`:
- Line 49: Correct the exclusion weight rule in the README statement: when the
base edge reaches the sink, a successful subtract branch must suppress the base
result and produce weight zero; do not describe the result as max(base,
subtract).
- Around line 45-48: Clarify the weight definitions in the README by defining
how outgoing-edge contributions are derived from vertex weights, and revise the
edge monotonicity rule to apply only to edges that contribute to propagation.
Ensure the intersection rule permits a zero vertex weight when an outgoing edge
cannot reach the sink, without contradicting the monotonicity rule; use explicit
operator exceptions if propagation-scoped wording is insufficient.
- Line 27: Update Axiom 4 in the graph README to apply only to represented or
existing source, target, kind, and tupleset-relation combinations, rather than
requiring an edge for every possible combination. Preserve the uniqueness and
condition-accumulation requirements for combinations that do exist.
- Line 15: Update the reachability definition in the graph README to describe an
operator-aware, tuple-valid path rather than any directed path, ensuring it
accounts for tuple resolution and branch rejection required by Axioms 44 and 48.
Revise the later weight rules to use this propagation-valid reachability
definition consistently.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af6f29a0-42b5-4488-9dac-478a90a5053c

📥 Commits

Reviewing files that changed from the base of the PR and between b86b212 and 1ea7618.

📒 Files selected for processing (1)
  • pkg/go/graph/README.md

Comment thread pkg/go/graph/README.md
Comment thread pkg/go/graph/README.md Outdated
Comment thread pkg/go/graph/README.md
Comment thread pkg/go/graph/README.md
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