@indigoai-us/hq-cloud 6.15.43 → 6.15.44

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.
@@ -1809,13 +1809,13 @@ describe("sync", () => {
1809
1809
  const sweptJournal = journalAt(journalPath);
1810
1810
  expect(sweptJournal.files[ignoredKey]).toBeDefined();
1811
1811
  });
1812
- it("tombstone lookup failure does not resurrect a current intent-backed delete", async () => {
1812
+ it("tombstone lookup failure fails closed before a current intent-backed delete can resurrect", async () => {
1813
1813
  const key = "docs/watcher-deleted.md";
1814
1814
  const localPath = path.join(tmpDir, "companies", "acme", key);
1815
1815
  vi.mocked(s3Module.listRemoteFiles).mockResolvedValueOnce([
1816
1816
  { key, size: 42, lastModified: new Date(), etag: '"cur123"' },
1817
1817
  ]);
1818
- setupFetchMock({ tombstoneFailure: true });
1818
+ const fetchMock = setupFetchMock({ tombstoneFailure: true });
1819
1819
  fs.writeFileSync(journalPath, JSON.stringify({
1820
1820
  version: "2",
1821
1821
  lastSync: new Date().toISOString(),
@@ -1837,11 +1837,18 @@ describe("sync", () => {
1837
1837
  },
1838
1838
  pulls: [],
1839
1839
  }));
1840
- await sync({ company: "acme", vaultConfig: mockConfig, hqRoot: tmpDir });
1840
+ const log = vi.spyOn(console, "error").mockImplementation(() => { });
1841
+ try {
1842
+ await expect(sync({ company: "acme", vaultConfig: mockConfig, hqRoot: tmpDir })).rejects.toThrow("refusing to sync without delete suppression");
1843
+ expect(log).toHaveBeenCalledWith(expect.stringContaining("WARN tombstone fetch attempt 3/3 failed"));
1844
+ expect(fetchMock.mock.calls.filter((call) => String(call[0]).includes("/v1/files/tombstones"))).toHaveLength(3);
1845
+ }
1846
+ finally {
1847
+ log.mockRestore();
1848
+ }
1841
1849
  expect(s3Module.downloadFile).not.toHaveBeenCalledWith(expect.anything(), key, expect.anything(), expect.anything());
1842
1850
  expect(fs.existsSync(localPath)).toBe(false);
1843
- expect(journalAt(journalPath).files[key]
1844
- ?.removedReason).toBe("local-delete");
1851
+ expect(journalAt(journalPath).files[key]?.localDeleteIntent).toBeDefined();
1845
1852
  });
1846
1853
  it("pull producer: a BULK disappearance is drift-restored, NOT tombstoned (ridge-incident guard in the pull leg)", async () => {
1847
1854
  // 12 clean files vanish at once (corrupt mirror / bulk rm / checkout). The