@indigoai-us/hq-cloud 6.12.4 → 6.13.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.
@@ -2877,6 +2877,41 @@ describe("resolvePullScope", () => {
2877
2877
  expect(scope.syncMode).toBe("shared");
2878
2878
  expect(scope.prefixSet).toEqual(["knowledge/", "shared/"]);
2879
2879
  });
2880
+ // Regression lock-in (Michal / ridge report): a non-owner member whose
2881
+ // ONLY grant is a COMPANY-WIDE write grant (surfaced by the server as
2882
+ // `source: "open"`) on a projects prefix — and who has NO direct
2883
+ // person/group/email grant — MUST resolve a non-empty shared scope that
2884
+ // COVERS that prefix. The reported bug was the push resolving an empty/
2885
+ // sparse prefixSet here (ignoring company-wide grants), so every file was
2886
+ // scope-excluded (403 SCOPE_EXCEEDS_PARENT on old clients, silent no-op on
2887
+ // 5.54.1). resolvePullScope treats a company-wide `open` grant identically
2888
+ // to a direct grant; this test guards against a future filter that drops
2889
+ // `source: "open"` and re-introduces the silent-drop regression.
2890
+ it("honors a company-wide-only write grant as the shared push scope (no empty-prune)", async () => {
2891
+ const scope = await resolvePullScope(stubClient({
2892
+ listMyMemberships: async () => [membership("cmp_a", "mk_a")],
2893
+ getMembershipSyncConfig: async () => ({
2894
+ membershipId: "mk_a",
2895
+ syncMode: "shared",
2896
+ isDefault: false,
2897
+ }),
2898
+ // Exactly one grant, company-wide WRITE, no direct grant.
2899
+ listMyExplicitGrants: async () => [
2900
+ {
2901
+ companyUid: "cmp_a",
2902
+ path: "projects/alpha/",
2903
+ permission: "write",
2904
+ source: "open",
2905
+ },
2906
+ ],
2907
+ }), "cmp_a", "acme");
2908
+ expect(scope.syncMode).toBe("shared");
2909
+ // The granted prefix is present — NOT an empty set (which would scope-
2910
+ // exclude every file and silently push nothing).
2911
+ expect(scope.prefixSet).toEqual(["projects/alpha/"]);
2912
+ expect(scope.prefixSet).not.toEqual([]);
2913
+ expect(scope.prefixSet?.length).toBeGreaterThan(0);
2914
+ });
2880
2915
  it("normalizes real-world mixed/glob grant paths into company-relative prefixes", async () => {
2881
2916
  // The exact shapes observed in the live hq-pro vault for `indigo`:
2882
2917
  // bare glob, full-anchored + /*, full-anchored exact file, slug-anchored