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
feat(security)!: reconcile SharingRule authoring with the enforced runtime — group→team, +business_unit, prune guest + owner-type (#1878) (#3557)
The authoring ShareRecipientType enum drifted behind the ADR-0090 D3 rename
and the enforced runtime: expandRecipient already expands `team` (sys_team /
sys_team_member via TeamGraphService) and `business_unit`, but the enum still
offered the pre-rename `group` (silently skipped at seed time with a warn)
and omitted both live recipients. Owner-type rules validated but were skipped
wholesale (live-membership-dependent). After this change every authorable
recipient and rule type is enforced — nothing on the SharingRule surface
validates and then silently does nothing (ADR-0078).
- spec: rename group→team, add business_unit, drop guest; delete
OwnerSharingRuleSchema + OwnerSharingRule (SharingRuleSchema = the criteria
form; SharingRuleType = ['criteria']); JSDoc rewritten; explain.zod comment.
- plugin-sharing bootstrap: map team→TeamGraphService expansion; retired
shapes kept as defensive skips (stale pre-built packages), never match-all.
- examples: migrate both never-enforced owner rules to enforced criteria
rules (showcase share_open_tasks_with_manager: done==false → manager;
crm share_active_leads_with_manager: status not converted/disqualified →
sales_manager); crm smoke test asserts criteria-only.
- dogfood: rbac-seeding test flips from "owner rule honestly skipped" to
"criteria replacement seeds + enforces" (criteria_json {done:false},
recipient position/manager — proven on a real boot: ruleCount 4→5,
showcase_task now hook-bound); authz-conformance sharing-rules row updated.
- docs: permissions/sharing-rules.mdx recipient table (all enforced) +
retired-shapes note; references regen; manifest key security/OwnerSharingRule
dropped; api-surface −2 exports.
Verified: spec 6882 + plugin-sharing 101 + crm 20 + showcase 58 + dogfood 17
tests green; spec/downstream-contract/examples tsc clean; check:docs /
api-surface / skill-refs / skill-examples in sync. Ships minor per the
launch-window breaking-as-minor policy; changeset carries the FROM→TO
migration.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
enforcement: 'plugin-sharing/sharing-rule-service.ts (materialized into sys_record_share); every authorable recipient expands in expandRecipient. The never-enforced owner-type rules + group/guest recipients were removed from the authoring spec (ADR-0078; group renamed → team)',proof: 'showcase-bu-hierarchy-sharing.dogfood.test.ts'},
146
146
{id: 'hierarchy-widening',summary: 'hierarchy widening — a unit + its subordinate units gain access',state: 'enforced',
147
147
enforcement: 'plugin-sharing/business-unit-graph.ts BusinessUnitGraphService subtree (business_unit recipient) — ADR-0057 D5 re-homed off the never-existent sys_position.parent',proof: 'showcase-bu-hierarchy-sharing.dogfood.test.ts'},
148
148
{id: 'rls-compiler-fail-closed',summary: 'uncompilable RLS predicate is surfaced/denied, not dropped',state: 'enforced',
0 commit comments