Skip to content

policy commands refuse the documented graph-plus-cluster bundle layout #761

Closed

Description

@ragnorc

omnigraph policy validate|test|explain --cluster <dir> --graph <id> refuses the
cluster layout the documentation prescribes.

select_cluster_policy (crates/omnigraph-cli/src/helpers.rs) matches every bundle
whose applies_to contains graph.<id> or cluster, then refuses when more
than one matches:

graph `knowledge` in cluster `./company-brain` matches 2 policy bundles ([graph, server]);
the cluster model expects one bundle per graph scope

Both docs/user/operations/policy.md and skills/omnigraph/references/server-policy.md
document exactly that layout: one bundle bound to a graph id, a second bound to
cluster (which is what grants graph_list, and now config_manage). So the
policy commands are unusable on a normal cluster.

Two related defects in the same selector:

  • A cluster bundle is always compiled as a graph bundle
    (PolicyEngine::load_graph_from_source), so its graph_list / config_manage
    rules are rejected by the kind check. A cluster whose only bundle is the
    cluster one therefore fails policy validate outright.
  • policy explain --action graph-list evaluates against the graph bundle rather
    than the bundle the server actually asks.

The server does not have this problem: crates/omnigraph-server/src/settings.rs
routes bindings to slots (one bundle per graph, one cluster bundle) and asks the
bundle that owns each request. The CLI had drifted from that model.

Expected: the policy commands select a bundle per request the way serving does —
graph actions from the --graph bundle, graph_list / config_manage from the
cluster bundle, with no fallback between scopes.

Existing CLI coverage only ever applied a single bundle, so nothing caught this.

Activity

  1. ragnorc commented on Sep 25, 2026

    @ragnorc
    ContributorAuthor

    Reproduced on main (80406fee), with bundles copied from docs/user/operations/policy.md and applied with cluster import and cluster apply. All three defects hold.

    1. Documented layout (graph-access → [knowledge], server-access → [cluster]). policy validate --graph knowledge, policy explain --action read and policy explain --action graph-list all fail with graph 'knowledge' in cluster '.' matches 2 policy bundles ([graph-access, server-access]); the cluster model expects one bundle per graph scope. Without --graph the refusal is has 2 policy bundles … pass --graph <id>.
    2. Only the cluster bundle. policy validate (with or without --graph) fails with policy rule 'owners-manage-config' uses cluster-scoped action 'config_manage' in a Graph policy file; move it to a cluster policy file.
    3. Only the graph bundle. explain --action graph-list and explain --action config-manage answer decision: deny, evaluated against the graph bundle. Adding the cluster bundle that could grant them hits case 1. So the CLI can never report allow for either action on any valid layout.

    select_cluster_policy in crates/omnigraph-cli/src/helpers.rs is unchanged since this was filed.

  2. ragnorc commented on Nov 9, 2026

    @ragnorc
    ContributorAuthor

    What happens

    A cluster can bind one policy bundle to a graph and a second bundle to the cluster scope, as the policy guide shows. With that layout, omnigraph policy validate, test and explain refuse with "matches 2 policy bundles". Reproduced on main 2e7921c4. The failing test is cli_data::policy_commands_route_each_action_to_its_bound_bundle_issue_761.

    Why

    The CLI picks one bundle for every action. It takes any bundle bound to the graph or to cluster, and refuses when it finds two. It also reads a cluster bundle as a graph bundle, so graph_list and config_manage rules fail to load, and it asks the graph bundle about graph_list. A server instead asks the graph bundle about graph actions and the cluster bundle about graph_list and config_manage. See select_cluster_policy and the server's routing in settings.rs.

    Pull request

    #1311 makes the CLI ask the same bundle a server asks, reads each bundle as its own kind, and never uses one scope's bundle for the other scope.

    Commands and results

    Cluster with graph-access bound to [knowledge] and server-access bound to [cluster], applied with cluster apply:

    $ omnigraph policy validate --target <dir> --graph knowledge
    main:  graph `knowledge` in cluster `<dir>` matches 2 policy bundles ([graph-access, server-access]); the cluster model expects one bundle per graph scope
    #1311: policy valid: bundle 'graph-access' [2 actors]
           policy valid: bundle 'server-access' [1 actors]
    

    With #1311, explain --action graph-list and --action config-manage answer from server-access (allow for its owner), explain --action read answers from graph-access, and a test file that mixes both kinds of case runs each case against its bundle. A cluster with only the cluster bundle now validates. An action whose scope has no bundle is refused with a message that names the missing scope.

    Lance is not involved: the change is in the CLI policy tooling only.

  3. added a commit that references this issue on Nov 9, 2026
    fc8f21e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions