You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
policy commands refuse the documented graph-plus-cluster bundle layout #761
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>orcluster, 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.
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.
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>.
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.
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.
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.
Activity
ragnorc commentedon Sep 25, 2026
Reproduced on main (
80406fee), with bundles copied fromdocs/user/operations/policy.mdand applied withcluster importandcluster apply. All three defects hold.graph-access→[knowledge],server-access→[cluster]).policy validate --graph knowledge,policy explain --action readandpolicy explain --action graph-listall fail withgraph 'knowledge' in cluster '.' matches 2 policy bundles ([graph-access, server-access]); the cluster model expects one bundle per graph scope. Without--graphthe refusal ishas 2 policy bundles … pass --graph <id>.clusterbundle.policy validate(with or without--graph) fails withpolicy rule 'owners-manage-config' uses cluster-scoped action 'config_manage' in a Graph policy file; move it to a cluster policy file.explain --action graph-listandexplain --action config-manageanswerdecision: deny, evaluated against the graph bundle. Adding theclusterbundle that could grant them hits case 1. So the CLI can never reportallowfor either action on any valid layout.select_cluster_policyincrates/omnigraph-cli/src/helpers.rsis unchanged since this was filed.ragnorc commentedon Nov 9, 2026
What happens
A cluster can bind one policy bundle to a graph and a second bundle to the
clusterscope, as the policy guide shows. With that layout,omnigraph policy validate,testandexplainrefuse with "matches 2 policy bundles". Reproduced on main2e7921c4. The failing test iscli_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 aclusterbundle as a graph bundle, sograph_listandconfig_managerules fail to load, and it asks the graph bundle aboutgraph_list. A server instead asks the graph bundle about graph actions and theclusterbundle aboutgraph_listandconfig_manage. Seeselect_cluster_policyand the server's routing insettings.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-accessbound to[knowledge]andserver-accessbound to[cluster], applied withcluster apply:With #1311,
explain --action graph-listand--action config-manageanswer fromserver-access(allow for its owner),explain --action readanswers fromgraph-access, and atestfile that mixes both kinds of case runs each case against its bundle. A cluster with only theclusterbundle 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.
fix(cli): route policy commands to the bundle each action's scope bin…