@indigoai-us/hq-cloud 6.12.5 → 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.
- package/dist/bin/sync-runner.test.js +35 -0
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/cli/share.js +15 -0
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +100 -0
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync.d.ts +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +87 -3
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/sync.test.js +204 -0
- package/dist/cli/sync.test.js.map +1 -1
- package/dist/journal.d.ts +1 -1
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js.map +1 -1
- package/dist/types.d.ts +11 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bin/sync-runner.test.ts +41 -0
- package/src/cli/share.test.ts +119 -0
- package/src/cli/share.ts +21 -1
- package/src/cli/sync.test.ts +256 -0
- package/src/cli/sync.ts +97 -3
- package/src/journal.ts +1 -1
- package/src/types.ts +11 -1
|
@@ -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
|