@htilabs/platform-common-models 0.60.0 → 0.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +81 -0
  2. package/dist/authz/index.cjs +104 -0
  3. package/dist/authz/index.cjs.map +1 -1
  4. package/dist/authz/index.d.cts +21 -1
  5. package/dist/authz/index.d.ts +21 -1
  6. package/dist/authz/index.js +101 -0
  7. package/dist/authz/index.js.map +1 -1
  8. package/dist/{index-DvAypMJV.d.ts → index-Bh1zO_Vu.d.ts} +1 -1
  9. package/dist/{index-Bj-s0nZy.d.cts → index-XWSYon40.d.cts} +1 -1
  10. package/dist/index.cjs +185 -7
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +3 -3
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +182 -7
  15. package/dist/index.js.map +1 -1
  16. package/dist/models/index.d.cts +2 -2
  17. package/dist/models/index.d.ts +2 -2
  18. package/dist/schemas/index.d.cts +25 -25
  19. package/dist/schemas/index.d.ts +25 -25
  20. package/dist/sharing-ceiling/index.cjs +81 -7
  21. package/dist/sharing-ceiling/index.cjs.map +1 -1
  22. package/dist/sharing-ceiling/index.d.cts +64 -4
  23. package/dist/sharing-ceiling/index.d.ts +64 -4
  24. package/dist/sharing-ceiling/index.js +81 -7
  25. package/dist/sharing-ceiling/index.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/__tests__/authz-resolve.test.ts +3 -0
  28. package/src/__tests__/core-function-notes.test.ts +35 -0
  29. package/src/authz/functionNotes.ts +20 -0
  30. package/src/authz/index.ts +1 -0
  31. package/src/generated/coreFunctionNotes.ts +107 -0
  32. package/src/sharingCeiling/__tests__/resolveShare.purposeRule.test.ts +836 -0
  33. package/src/sharingCeiling/index.ts +4 -0
  34. package/src/sharingCeiling/resolve.ts +219 -15
  35. package/dist/{cvcEntry-BLeRivoF.d.cts → cvcEntry-D787utvP.d.cts} +8 -8
  36. package/dist/{cvcEntry-BLeRivoF.d.ts → cvcEntry-D787utvP.d.ts} +8 -8
@@ -432,8 +432,27 @@ declare const accountSharePurposePolicy: typeof shareDefaultScopeFor;
432
432
  * `sharing-four-state-k13.js` (A–C); the test suite beside this file carries
433
433
  * their vectors.
434
434
  *
435
+ * The `byPurpose` virtual fork (since 0.61.0; data.js `governingPolicyFor` @ aa2c63a
436
+ * L55006-L55028, "An authored byPurpose sub-row with no explicit attachment is the
437
+ * ruled fork-with-one-attachment"): when no policy is attached to the relationship
438
+ * for the purpose but the account has AUTHORED a purpose-specific rule for the
439
+ * partner (`partnerPurposeRule`), the governing policy is NAMED as that rule —
440
+ * `pol-bp-<partner>-<purpose>`, level `relationship`, `virtual: true`. As in data.js
441
+ * (`effectiveCeiling` L55376: "The virtual byPurpose fork adds NAMING only"), the
442
+ * ladder names ONE policy, so the account default beneath it is not consulted for posture
443
+ * (data.js L55391 skips a virtual policy) and its list does not bind as 5b (L55539). Whenever
444
+ * a rule is present the posture STARTS from the rule (L55342 — `relationshipPosture` is then
445
+ * ignored), whatever the ladder named. SCOPE under the fork is clamp 5's (L55504): the legacy
446
+ * cell chain (`legacyCeiling`), else an EDITED account default's category list (data.js
447
+ * projects it into `sharingScopeEdits[__default__]`, `projectScopeEdits` L55163-L55164), else
448
+ * the Platform default's starting scope; that default's field groups (`infoScopeItems`) bind
449
+ * too — deliberately narrower than data.js, whose 5c (L55658) drops them under the fork. When
450
+ * the rule itself blocked, the share reads data.js's sentences (L55436-L55448); when an
451
+ * attached policy blocked, the policy is named (a deliberate correction — data.js names the
452
+ * rule there). A rule for `__external__` is ignored (L55333: scope-only).
453
+ *
435
454
  * Deliberately NOT here (prototype storage artefacts or relationship-row
436
- * facts the caller holds): the `byPurpose` virtual fork, the legacy
455
+ * facts the caller holds): the legacy
437
456
  * `sharingPolicies` narrowing rows (#451 moved them onto cards), the partner
438
457
  * row's direction / team-scoped gates and item `restrictions`, deconfliction /
439
458
  * viewing / release / routing species. The legacy cell chain (`sharingScopeEdits`
@@ -597,8 +616,41 @@ interface ShareResolveInput {
597
616
  readonly teamRowId?: string | null;
598
617
  /** Clamp 1: the purpose is switched off for the account (`isSharingPurposeDisabled` in chain.ts). Blocks reports too (flow M1). */
599
618
  readonly purposeOff?: boolean;
600
- /** The partner row's own posture, which a policy can only raise (data.js `effectiveCeiling`). Default `open`. */
619
+ /**
620
+ * The partner row's own posture, which a policy can only raise (data.js `effectiveCeiling`). Default `open`.
621
+ * IGNORED when a `partnerPurposeRule` is present: the posture then starts from the rule
622
+ * (data.js L55342: `bp.sharingPosture || over.sharingPosture || …` — the rule first).
623
+ */
601
624
  readonly relationshipPosture?: SharePosture | null;
625
+ /**
626
+ * The account's AUTHORED purpose-specific rule for this partner and purpose — data.js
627
+ * `policies.partnerOverrides[partner].byPurpose[purpose]` when it carries a `sharingPosture`
628
+ * (the Share Partners "purpose-specific rule"). When no policy is attached to the relationship
629
+ * for the purpose, the answer NAMES it as the governing policy (the virtual fork
630
+ * `pol-bp-<partner>-<purpose>`, "<purpose label> — <partner name> variant", level
631
+ * `relationship`, `virtual: true`; data.js `governingPolicyFor` L55006-L55028).
632
+ * - Posture: STARTS from `posture` whenever a rule is present, whatever the ladder named
633
+ * (L55342; `relationshipPosture` is ignored); policies and the team ceiling can only raise
634
+ * it. Under the fork the account default is not consulted for posture (L55391).
635
+ * - Scope under the fork: clamp 5 (L55504) — `legacyCeiling` (a rule's category list, if the
636
+ * caller still carries one, goes there), else an EDITED account default's list (data.js's
637
+ * projected `sharingScopeEdits[__default__]`, L55163-L55164), else the Platform default's
638
+ * starting scope; the default's list does not bind as 5b (L55539). The edited default's
639
+ * field groups (`infoScopeItems`) still bind — deliberately narrower than data.js (L55658).
640
+ * - When the rule itself blocked: "Partner is blocked for this purpose by your account's
641
+ * sharing policy" (L55447-L55448), or for a report the carve-out "Partner is blocked for
642
+ * ordinary sharing — reachable for reports" (L55436-L55446). When a policy blocked, the
643
+ * policy is named (deliberate correction: data.js names the rule even when it is open).
644
+ * Ignored inside the account and for an `__external__` recipient (L55333: scope-only); not
645
+ * named as the fork when a pair row or a relationship policy governs or for an unknown
646
+ * purpose; a `posture` that is not open / approval / blocked is no rule. `null` / absent = no
647
+ * rule (the answer is the one 0.60.0 gave).
648
+ */
649
+ readonly partnerPurposeRule?: {
650
+ readonly posture: SharePosture;
651
+ /** The partner's display name for the fork's name (the recipient id when absent). */
652
+ readonly partnerName?: string | null;
653
+ } | null;
602
654
  /**
603
655
  * The legacy cell chain for callers still carrying `sharingScopeEdits`: pass `effectiveCeiling(...)`'s
604
656
  * ANSWER (its `platform_default` rung is then ignored — the resolver reads that document itself;
@@ -633,6 +685,11 @@ interface ShareNamedPolicy {
633
685
  readonly edited: boolean;
634
686
  readonly origin: string | null;
635
687
  readonly rulePath: string;
688
+ /**
689
+ * `true` only on the virtual `byPurpose` fork (`partnerPurposeRule`): a NAME for the authored
690
+ * purpose-specific rule, not a stored document — it binds nothing itself.
691
+ */
692
+ readonly virtual?: true;
636
693
  }
637
694
  interface ShareCategoryEntry {
638
695
  readonly allowed: boolean;
@@ -782,8 +839,11 @@ declare function shareRowCeiling(resolution: Pick<ShareResolution, "allowed" | "
782
839
  * THE read. See the module header; the algorithm, step by step:
783
840
  * 1. the ladder (`governingPolicyFor`): pair row → [inside: the account's
784
841
  * inside default → the platform's inside starter, stop] → relationship
785
- * (the partner id, or `__external__`) → the account default → the
786
- * Platform default (a versioned document, `pol-starter-<purpose>`);
842
+ * (the partner id, or `__external__`) → [the account's authored
843
+ * purpose-specific rule for the partner (`partnerPurposeRule`), NAMED as
844
+ * its virtual fork — posture from the rule, scope from clamp 5] → the
845
+ * account default → the Platform default (a versioned document,
846
+ * `pol-starter-<purpose>`);
787
847
  * 2. the sending team's own policy for the purpose rides as a CEILING when
788
848
  * it is not the governing one (inside the account too);
789
849
  * 3. posture: the relationship's, raised (never lowered) by the governing
@@ -432,8 +432,27 @@ declare const accountSharePurposePolicy: typeof shareDefaultScopeFor;
432
432
  * `sharing-four-state-k13.js` (A–C); the test suite beside this file carries
433
433
  * their vectors.
434
434
  *
435
+ * The `byPurpose` virtual fork (since 0.61.0; data.js `governingPolicyFor` @ aa2c63a
436
+ * L55006-L55028, "An authored byPurpose sub-row with no explicit attachment is the
437
+ * ruled fork-with-one-attachment"): when no policy is attached to the relationship
438
+ * for the purpose but the account has AUTHORED a purpose-specific rule for the
439
+ * partner (`partnerPurposeRule`), the governing policy is NAMED as that rule —
440
+ * `pol-bp-<partner>-<purpose>`, level `relationship`, `virtual: true`. As in data.js
441
+ * (`effectiveCeiling` L55376: "The virtual byPurpose fork adds NAMING only"), the
442
+ * ladder names ONE policy, so the account default beneath it is not consulted for posture
443
+ * (data.js L55391 skips a virtual policy) and its list does not bind as 5b (L55539). Whenever
444
+ * a rule is present the posture STARTS from the rule (L55342 — `relationshipPosture` is then
445
+ * ignored), whatever the ladder named. SCOPE under the fork is clamp 5's (L55504): the legacy
446
+ * cell chain (`legacyCeiling`), else an EDITED account default's category list (data.js
447
+ * projects it into `sharingScopeEdits[__default__]`, `projectScopeEdits` L55163-L55164), else
448
+ * the Platform default's starting scope; that default's field groups (`infoScopeItems`) bind
449
+ * too — deliberately narrower than data.js, whose 5c (L55658) drops them under the fork. When
450
+ * the rule itself blocked, the share reads data.js's sentences (L55436-L55448); when an
451
+ * attached policy blocked, the policy is named (a deliberate correction — data.js names the
452
+ * rule there). A rule for `__external__` is ignored (L55333: scope-only).
453
+ *
435
454
  * Deliberately NOT here (prototype storage artefacts or relationship-row
436
- * facts the caller holds): the `byPurpose` virtual fork, the legacy
455
+ * facts the caller holds): the legacy
437
456
  * `sharingPolicies` narrowing rows (#451 moved them onto cards), the partner
438
457
  * row's direction / team-scoped gates and item `restrictions`, deconfliction /
439
458
  * viewing / release / routing species. The legacy cell chain (`sharingScopeEdits`
@@ -597,8 +616,41 @@ interface ShareResolveInput {
597
616
  readonly teamRowId?: string | null;
598
617
  /** Clamp 1: the purpose is switched off for the account (`isSharingPurposeDisabled` in chain.ts). Blocks reports too (flow M1). */
599
618
  readonly purposeOff?: boolean;
600
- /** The partner row's own posture, which a policy can only raise (data.js `effectiveCeiling`). Default `open`. */
619
+ /**
620
+ * The partner row's own posture, which a policy can only raise (data.js `effectiveCeiling`). Default `open`.
621
+ * IGNORED when a `partnerPurposeRule` is present: the posture then starts from the rule
622
+ * (data.js L55342: `bp.sharingPosture || over.sharingPosture || …` — the rule first).
623
+ */
601
624
  readonly relationshipPosture?: SharePosture | null;
625
+ /**
626
+ * The account's AUTHORED purpose-specific rule for this partner and purpose — data.js
627
+ * `policies.partnerOverrides[partner].byPurpose[purpose]` when it carries a `sharingPosture`
628
+ * (the Share Partners "purpose-specific rule"). When no policy is attached to the relationship
629
+ * for the purpose, the answer NAMES it as the governing policy (the virtual fork
630
+ * `pol-bp-<partner>-<purpose>`, "<purpose label> — <partner name> variant", level
631
+ * `relationship`, `virtual: true`; data.js `governingPolicyFor` L55006-L55028).
632
+ * - Posture: STARTS from `posture` whenever a rule is present, whatever the ladder named
633
+ * (L55342; `relationshipPosture` is ignored); policies and the team ceiling can only raise
634
+ * it. Under the fork the account default is not consulted for posture (L55391).
635
+ * - Scope under the fork: clamp 5 (L55504) — `legacyCeiling` (a rule's category list, if the
636
+ * caller still carries one, goes there), else an EDITED account default's list (data.js's
637
+ * projected `sharingScopeEdits[__default__]`, L55163-L55164), else the Platform default's
638
+ * starting scope; the default's list does not bind as 5b (L55539). The edited default's
639
+ * field groups (`infoScopeItems`) still bind — deliberately narrower than data.js (L55658).
640
+ * - When the rule itself blocked: "Partner is blocked for this purpose by your account's
641
+ * sharing policy" (L55447-L55448), or for a report the carve-out "Partner is blocked for
642
+ * ordinary sharing — reachable for reports" (L55436-L55446). When a policy blocked, the
643
+ * policy is named (deliberate correction: data.js names the rule even when it is open).
644
+ * Ignored inside the account and for an `__external__` recipient (L55333: scope-only); not
645
+ * named as the fork when a pair row or a relationship policy governs or for an unknown
646
+ * purpose; a `posture` that is not open / approval / blocked is no rule. `null` / absent = no
647
+ * rule (the answer is the one 0.60.0 gave).
648
+ */
649
+ readonly partnerPurposeRule?: {
650
+ readonly posture: SharePosture;
651
+ /** The partner's display name for the fork's name (the recipient id when absent). */
652
+ readonly partnerName?: string | null;
653
+ } | null;
602
654
  /**
603
655
  * The legacy cell chain for callers still carrying `sharingScopeEdits`: pass `effectiveCeiling(...)`'s
604
656
  * ANSWER (its `platform_default` rung is then ignored — the resolver reads that document itself;
@@ -633,6 +685,11 @@ interface ShareNamedPolicy {
633
685
  readonly edited: boolean;
634
686
  readonly origin: string | null;
635
687
  readonly rulePath: string;
688
+ /**
689
+ * `true` only on the virtual `byPurpose` fork (`partnerPurposeRule`): a NAME for the authored
690
+ * purpose-specific rule, not a stored document — it binds nothing itself.
691
+ */
692
+ readonly virtual?: true;
636
693
  }
637
694
  interface ShareCategoryEntry {
638
695
  readonly allowed: boolean;
@@ -782,8 +839,11 @@ declare function shareRowCeiling(resolution: Pick<ShareResolution, "allowed" | "
782
839
  * THE read. See the module header; the algorithm, step by step:
783
840
  * 1. the ladder (`governingPolicyFor`): pair row → [inside: the account's
784
841
  * inside default → the platform's inside starter, stop] → relationship
785
- * (the partner id, or `__external__`) → the account default → the
786
- * Platform default (a versioned document, `pol-starter-<purpose>`);
842
+ * (the partner id, or `__external__`) → [the account's authored
843
+ * purpose-specific rule for the partner (`partnerPurposeRule`), NAMED as
844
+ * its virtual fork — posture from the rule, scope from clamp 5] → the
845
+ * account default → the Platform default (a versioned document,
846
+ * `pol-starter-<purpose>`);
787
847
  * 2. the sending team's own policy for the purpose rides as a CEILING when
788
848
  * it is not the governing one (inside the account too);
789
849
  * 3. posture: the relationship's, raised (never lowered) by the governing
@@ -811,8 +811,31 @@ function resolveShare(input) {
811
811
  };
812
812
  }
813
813
  }
814
+ let fork = null;
814
815
  if (gov === null && !inside && purposeKnown && recipientKey !== null) {
815
816
  gov = hit(cell(att.relationships, recipientKey), "relationship");
817
+ const rule = input.partnerPurposeRule;
818
+ const rulePosture2 = rule?.posture;
819
+ if (gov === null && recipient.kind === "partner" && // `__external__` stays scope-only (data.js L55333)
820
+ (rulePosture2 === "open" || rulePosture2 === "approval" || rulePosture2 === "blocked")) {
821
+ const partnerName = typeof rule?.partnerName === "string" && rule.partnerName !== "" ? rule.partnerName : recipientKey;
822
+ fork = {
823
+ policy: {
824
+ id: `pol-bp-${recipientKey}-${purpose}`,
825
+ name: `${purposeLabel} \u2014 ${partnerName} variant`,
826
+ purpose,
827
+ posture: rulePosture2,
828
+ infoScope: null,
829
+ cadences: null,
830
+ version: 1,
831
+ origin: { kind: "fork" },
832
+ edited: true
833
+ },
834
+ level: "relationship",
835
+ version: 1,
836
+ rulePath: `policies.partnerOverrides[${recipientKey}].byPurpose[${purpose}] (purpose-specific rule, reported as its fork)`
837
+ };
838
+ }
816
839
  if (gov === null)
817
840
  gov = hit(own2(att.agencyDefaults, purpose), "agency_default");
818
841
  if (gov === null && pd !== null) {
@@ -834,18 +857,36 @@ function resolveShare(input) {
834
857
  };
835
858
  }
836
859
  }
860
+ let defaultProjection = null;
861
+ let defaultItems = null;
862
+ if (fork !== null) {
863
+ if (gov !== null && gov.level === "agency_default" && gov.policy.edited === true) {
864
+ if (isStringList2(gov.policy.infoScope))
865
+ defaultProjection = [...gov.policy.infoScope];
866
+ const items = copyItems(gov.policy.infoScopeItems);
867
+ if (items !== null)
868
+ defaultItems = {
869
+ rows: items,
870
+ name: typeof gov.policy.name === "string" ? gov.policy.name : gov.policy.id
871
+ };
872
+ }
873
+ gov = fork;
874
+ }
875
+ const rulePosture = input.partnerPurposeRule?.posture;
876
+ const ruleAuthored = !inside && recipient.kind === "partner" && (rulePosture === "open" || rulePosture === "approval" || rulePosture === "blocked");
837
877
  let tc = null;
838
878
  if (teamId !== null && gov !== null) {
839
879
  const t = hit(cell(att.teams, teamId), "team");
840
880
  if (t !== null && t.policy.id !== gov.policy.id) tc = t;
841
881
  }
842
- const govNamed = gov === null ? null : named(gov);
882
+ const govNamed = gov === null ? null : fork !== null ? { ...named(gov), virtual: true } : named(gov);
843
883
  const tcNamed = tc === null ? null : named(tc);
844
884
  const rulePath = gov === null ? `no Platform default for purpose \u201C${purpose}\u201D \u2014 nothing governs (fails closed)` : tc === null ? gov.rulePath : `${gov.rulePath} \u2229 ${tc.rulePath} (the sending team's own policy is a ceiling \u2014 only what both allow)`;
845
- let posture = input.relationshipPosture === "approval" || input.relationshipPosture === "blocked" ? input.relationshipPosture : "open";
885
+ let posture = ruleAuthored && rulePosture !== void 0 ? rulePosture : input.relationshipPosture === "approval" || input.relationshipPosture === "blocked" ? input.relationshipPosture : "open";
846
886
  let postureSource = "relationship";
847
887
  let posturePol = null;
848
- if (govNamed?.posture && SHARE_POSTURE_RANK[govNamed.posture] > SHARE_POSTURE_RANK[posture]) {
888
+ if (fork === null && // data.js L55391: a virtual policy's posture is never applied
889
+ govNamed?.posture && SHARE_POSTURE_RANK[govNamed.posture] > SHARE_POSTURE_RANK[posture]) {
849
890
  posture = govNamed.posture;
850
891
  postureSource = "policy";
851
892
  posturePol = govNamed;
@@ -870,11 +911,22 @@ function resolveShare(input) {
870
911
  } else if (posture === "blocked") {
871
912
  const pol = posturePol;
872
913
  const path = pol === null ? "relationship posture = blocked" : `sharingPurposePolicies[${pol.id}].posture=blocked (policy \u201C${pol.name}\u201D \u2014 ${pol.levelLabel})`;
873
- if (report) {
914
+ const byRule = ruleAuthored && postureSource === "relationship";
915
+ if (report && byRule) {
916
+ reportCarveOut = {
917
+ note: "Partner is blocked for ordinary sharing \u2014 reachable for reports",
918
+ rulePath: `reports-never-blocked-at-partner-layer (Crysta ruling 2026-08-23; policies.partnerOverrides[${recipientKey}].byPurpose[${purpose}].sharingPosture=blocked does not bind a legal duty \u2014 who may send is a role/function question)`
919
+ };
920
+ } else if (report) {
874
921
  reportCarveOut = {
875
922
  note: pol === null ? "Blocked for ordinary sharing \u2014 reachable for reports (nothing at the partner layer extinguishes the duty)" : `The \u201C${pol.name}\u201D policy blocks ordinary sharing \u2014 reachable for reports`,
876
923
  rulePath: path
877
924
  };
925
+ } else if (byRule) {
926
+ excluded = {
927
+ reason: "Partner is blocked for this purpose by your account's sharing policy",
928
+ rulePath: `policies.partnerOverrides[${recipientKey}].byPurpose[${purpose}].sharingPosture=blocked (Share Partners \u2014 purpose-specific rule)`
929
+ };
878
930
  } else {
879
931
  excluded = {
880
932
  reason: pol === null ? "Blocked for this purpose by the relationship" : `Blocked for this purpose by your account's \u201C${pol.name}\u201D policy`,
@@ -887,9 +939,11 @@ function resolveShare(input) {
887
939
  const govList = govNamed?.infoScope ?? null;
888
940
  const polScopeBinds = gov !== null && Array.isArray(govList) && (level === "team_row" || level === "relationship" || level === "account_internal" || level === "inside_starter" || level === "agency_default" && gov.policy.edited === true);
889
941
  const legacy = legacyCeilingList(input.legacyCeiling);
890
- const ceilingIsStarter = legacy === null;
891
- let groupCeiling = legacy ?? pdRaw;
892
- let ceilingPath = legacy !== null ? "sharingScopeEdits (the account's partner / default rule \u2014 the legacy cell chain)" : pd === null ? "no Platform default" : `pol-starter-${purpose} v${pd.version} (Platform default \u2014 the starting scope for this purpose)`;
942
+ const projectionPath = `policies.sharingScopeEdits[__default__][${purpose}] (projected from your account default policy)`;
943
+ const projOverLegacy = legacy !== null ? defaultProjection : null;
944
+ const ceilingIsStarter = legacy === null && defaultProjection === null;
945
+ let groupCeiling = legacy ?? defaultProjection ?? pdRaw;
946
+ let ceilingPath = legacy !== null ? "sharingScopeEdits (the account's partner / default rule \u2014 the legacy cell chain)" : defaultProjection !== null ? projectionPath : pd === null ? "no Platform default" : `pol-starter-${purpose} v${pd.version} (Platform default \u2014 the starting scope for this purpose)`;
893
947
  if (ceilingIsStarter && polScopeBinds) {
894
948
  groupCeiling = null;
895
949
  ceilingPath = "";
@@ -991,6 +1045,17 @@ function resolveShare(input) {
991
1045
  `Outside what the \u201C${govName}\u201D policy allows for this purpose`
992
1046
  );
993
1047
  }
1048
+ if (allowed && !req && projOverLegacy !== null && !scopeListCovers(scope, projOverLegacy, g)) {
1049
+ allowed = false;
1050
+ reason = "Outside the payload for this purpose";
1051
+ path = projectionPath;
1052
+ }
1053
+ if (allowed && !req && projOverLegacy !== null && !scopeListStrictlyCovers(scope, projOverLegacy, g)) {
1054
+ addExcluded(
1055
+ outside((r) => scopeListCovers(scope, projOverLegacy, g, r)),
1056
+ "Outside the payload for this purpose"
1057
+ );
1058
+ }
994
1059
  const govRows = polScopeBinds ? own2(govItems, g) : void 0;
995
1060
  if (allowed && !req && isStringList2(govRows)) {
996
1061
  const keep = new Set(govRows);
@@ -1000,6 +1065,15 @@ function resolveShare(input) {
1000
1065
  `Outside what the \u201C${govName}\u201D policy allows for this purpose`
1001
1066
  );
1002
1067
  }
1068
+ const defRows = defaultItems === null ? void 0 : own2(defaultItems.rows, g);
1069
+ if (allowed && !req && isStringList2(defRows)) {
1070
+ const keep = new Set(defRows);
1071
+ const kept = (r) => keep.has(r) || scope.ancestorsOf(r).some((a) => a !== g && keep.has(a));
1072
+ addExcluded(
1073
+ outside(kept),
1074
+ `Outside what the \u201C${defaultItems?.name ?? ""}\u201D policy allows for this purpose`
1075
+ );
1076
+ }
1003
1077
  if (allowed && !req && tcScope !== null && !scopeListCovers(scope, tcScope, g)) {
1004
1078
  allowed = false;
1005
1079
  reason = `Outside what your team's \u201C${tcNamed?.name}\u201D policy allows`;