@indigoai-us/hq-cloud 6.15.58 → 6.15.60

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.
@@ -3274,6 +3274,61 @@ describe("share", () => {
3274
3274
  filesToSkip: 1,
3275
3275
  });
3276
3276
  });
3277
+ it("scoped file roots retain upload, unchanged, ignore, and vanished-delete behavior", async () => {
3278
+ const companyRoot = path.join(tmpDir, "companies", "acme");
3279
+ fs.mkdirSync(companyRoot, { recursive: true });
3280
+ const changed = path.join(companyRoot, "changed.md");
3281
+ const unchanged = path.join(companyRoot, "unchanged.md");
3282
+ const ignored = path.join(companyRoot, "ignored.md");
3283
+ fs.writeFileSync(changed, "changed");
3284
+ fs.writeFileSync(unchanged, "unchanged");
3285
+ fs.writeFileSync(ignored, "ignored");
3286
+ fs.writeFileSync(path.join(tmpDir, ".hqignore"), "companies/acme/ignored.md\n");
3287
+ const unchangedHash = hashFile(unchanged);
3288
+ seedJournalAt(path.join(stateDir, "sync-journal.acme.json"), {
3289
+ version: "2",
3290
+ lastSync: "",
3291
+ pulls: [],
3292
+ files: {
3293
+ "unchanged.md": {
3294
+ hash: unchangedHash,
3295
+ size: Buffer.byteLength("unchanged"),
3296
+ syncedAt: new Date().toISOString(),
3297
+ direction: "up",
3298
+ remoteEtag: "unchanged-etag",
3299
+ kind: "file",
3300
+ },
3301
+ "vanished.md": {
3302
+ hash: "vanished-hash",
3303
+ size: 1,
3304
+ syncedAt: new Date().toISOString(),
3305
+ direction: "up",
3306
+ remoteEtag: "vanished-etag",
3307
+ kind: "file",
3308
+ localDeleteIntent: deleteIntent("vanished-etag", "vanished-hash"),
3309
+ },
3310
+ },
3311
+ });
3312
+ const result = await share({
3313
+ paths: [changed, unchanged, ignored],
3314
+ company: "acme",
3315
+ vaultConfig: mockConfig,
3316
+ hqRoot: tmpDir,
3317
+ prefixSet: ["changed.md", "unchanged.md", "ignored.md", "vanished.md"],
3318
+ deleteScopeRoots: ["vanished.md"],
3319
+ skipUnchanged: true,
3320
+ propagateDeletes: true,
3321
+ propagateDeletePolicy: "owned-only",
3322
+ });
3323
+ expect(result.filesUploaded).toBe(1);
3324
+ expect(result.filesSkipped).toBe(1);
3325
+ expect(result.filesExcludedByIgnore).toBe(1);
3326
+ expect(uploadFile).toHaveBeenCalledWith(expect.anything(), changed, "changed.md", undefined, expect.anything());
3327
+ expect(uploadFile).not.toHaveBeenCalledWith(expect.anything(), unchanged, "unchanged.md", undefined, expect.anything());
3328
+ expect(uploadFile).not.toHaveBeenCalledWith(expect.anything(), ignored, "ignored.md", undefined, expect.anything());
3329
+ expect(result.filesDeleted).toBe(1);
3330
+ expect(deleteRemoteFile).toHaveBeenCalledWith(expect.anything(), "vanished.md");
3331
+ });
3277
3332
  // ── Delete propagation (propagateDeletes) ──────────────────────────────────
3278
3333
  //
3279
3334
  // The bug: when a user deletes a local file, the next pull re-downloads it