Skip to content

[P0][security] SharingRuleSchema disconnected from the live engine #1887

Description

@os-zhuang

Part of the metadata liveness audit umbrella #1878 (P0 security cluster).

Problem

SharingRuleSchema is disconnected from the live engine. The runtime enforces a divergent sys_sharing_rule model:

  • runtime: JSON criteria_json, recipient enum user / team / department / role / queue;
  • spec: CEL condition, recipients including role_and_subordinates / guest.

The spec's CEL condition is never compiled, and unparsable CEL degrades to "match nothing" — so spec-authored sharing rules silently grant no access. The two models have diverged into a write-only spec surface.

Decision required (enforce or remove)

  • Reconcile/enforce: compile the spec's CEL condition into the live engine and map the spec recipient set (including role_and_subordinates, which depends on the Role parent walk, and guest) onto sys_sharing_rule.
  • Remove: deprecate SharingRuleSchema in favor of authoring sys_sharing_rule directly, and document the supported (criteria_json, 5-recipient) model.

Evidence

  • docs/audits/2026-06-security-identity-property-liveness.md
  • runtime sys_sharing_rule model vs spec SharingRuleSchema

Note: depends on the Role parent hierarchy issue for the role_and_subordinates recipient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p0Critical: blocker, must ship before MVPsecurity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions