@indigoai-us/hq-cloud 6.16.58-alpha.3 → 6.16.58-alpha.4

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 (39) hide show
  1. package/dist/bin/sync-runner-company.d.ts.map +1 -1
  2. package/dist/bin/sync-runner-company.js +50 -2
  3. package/dist/bin/sync-runner-company.js.map +1 -1
  4. package/dist/bin/sync-runner-company.test.js +255 -8
  5. package/dist/bin/sync-runner-company.test.js.map +1 -1
  6. package/dist/bin/sync-runner.d.ts +6 -0
  7. package/dist/bin/sync-runner.d.ts.map +1 -1
  8. package/dist/bin/sync-runner.js.map +1 -1
  9. package/dist/bin/sync-runner.test.js +63 -1
  10. package/dist/bin/sync-runner.test.js.map +1 -1
  11. package/dist/cli/push-scan-exclusions.test.js +4 -4
  12. package/dist/cli/push-scan-exclusions.test.js.map +1 -1
  13. package/dist/cli/share.d.ts +2 -1
  14. package/dist/cli/share.d.ts.map +1 -1
  15. package/dist/cli/share.js +75 -20
  16. package/dist/cli/share.js.map +1 -1
  17. package/dist/cli/share.test.js +95 -4
  18. package/dist/cli/share.test.js.map +1 -1
  19. package/dist/context.d.ts +5 -0
  20. package/dist/context.d.ts.map +1 -1
  21. package/dist/context.js +92 -12
  22. package/dist/context.js.map +1 -1
  23. package/dist/context.test.js +77 -2
  24. package/dist/context.test.js.map +1 -1
  25. package/dist/ignore.d.ts +10 -0
  26. package/dist/ignore.d.ts.map +1 -1
  27. package/dist/ignore.js +47 -5
  28. package/dist/ignore.js.map +1 -1
  29. package/dist/ignore.test.js +30 -3
  30. package/dist/ignore.test.js.map +1 -1
  31. package/dist/lib/net-errors.d.ts +12 -0
  32. package/dist/lib/net-errors.d.ts.map +1 -1
  33. package/dist/lib/net-errors.js +35 -0
  34. package/dist/lib/net-errors.js.map +1 -1
  35. package/dist/lib/net-errors.test.js +19 -1
  36. package/dist/lib/net-errors.test.js.map +1 -1
  37. package/dist/manifest/build-manifest-resident-parity.test.js +3 -3
  38. package/dist/manifest/build-manifest-resident-parity.test.js.map +1 -1
  39. package/package.json +1 -1
@@ -84,7 +84,11 @@ describe("area storage rollout gate", () => {
84
84
  }),
85
85
  legacyStore: openJournalStateStoreForMigration(slug),
86
86
  });
87
- expect(migration.cutOver().phase).toBe("area-authoritative");
87
+ // Production cutOver budgets 1s. Under `pnpm run coverage` the copy+parity
88
+ // work can exceed that and leave the phase at catching-up, which is what
89
+ // failed CI on this PR. The gate under test is the storage flag, not the
90
+ // wall-clock budget, so give the helper enough time.
91
+ expect(migration.cutOver(60_000).phase).toBe("area-authoritative");
88
92
  expect(shouldUseAreaStorage(false, __runnerTestStateDir, slug)).toBe(false);
89
93
  expect(shouldUseAreaStorage(true, __runnerTestStateDir, slug)).toBe(true);
90
94
  expect(shouldUseAreaStorage("auto", __runnerTestStateDir, slug)).toBe(true);
@@ -2361,6 +2365,64 @@ describe("per-company fanout", () => {
2361
2365
  expect.objectContaining({ company: "acme", status: "transient-network" }),
2362
2366
  ]);
2363
2367
  });
2368
+ it("429 on every entity-fetch attempt is reported as transient, not errored", async () => {
2369
+ const throttle = Object.assign(new Error('Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 429 {"message":"Too Many Requests"}'), { statusCode: 429 });
2370
+ const deps = makeDeps({
2371
+ createVaultClient: () => makeVaultStub({
2372
+ memberships: [{ companyUid: "cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG" }],
2373
+ entityGet: (uid) => Promise.resolve({ uid, slug: "indigo" }),
2374
+ }),
2375
+ sync: vi.fn().mockRejectedValue(throttle),
2376
+ });
2377
+ expect(await runRunner(["--companies"], deps)).toBe(TRANSIENT_NETWORK_EXIT);
2378
+ expect(deps.stderr
2379
+ .events()
2380
+ .some((e) => e.type === "error" && e.company === "indigo")).toBe(false);
2381
+ expect(deps.stdout.events().find((e) => e.type === "transient-network")).toMatchObject({
2382
+ company: "indigo",
2383
+ path: "(company)",
2384
+ message: expect.stringContaining("Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 429"),
2385
+ });
2386
+ const all = deps.stdout
2387
+ .events()
2388
+ .find((e) => e.type === "all-complete");
2389
+ expect(all.partial).toBe(true);
2390
+ expect(all.errors).toEqual([]);
2391
+ expect(all.transient).toEqual([
2392
+ {
2393
+ company: "indigo",
2394
+ message: expect.stringContaining('Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 429 {"message":"Too Many Requests"}'),
2395
+ },
2396
+ ]);
2397
+ expect(all.companies).toEqual([
2398
+ expect.objectContaining({ company: "indigo", status: "transient-network" }),
2399
+ ]);
2400
+ });
2401
+ it("a 403 entity fetch is still errored immediately with no retry", async () => {
2402
+ const forbidden = Object.assign(new Error('Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 403 {"message":"Forbidden"}'), { statusCode: 403 });
2403
+ const deps = makeDeps({
2404
+ createVaultClient: () => makeVaultStub({
2405
+ memberships: [{ companyUid: "cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG" }],
2406
+ entityGet: (uid) => Promise.resolve({ uid, slug: "indigo" }),
2407
+ }),
2408
+ sync: vi.fn().mockRejectedValue(forbidden),
2409
+ });
2410
+ expect(await runRunner(["--companies"], deps)).toBe(PARTIAL_SYNC_EXIT);
2411
+ expect(deps.stderr.events().find((e) => e.type === "error" && e.company === "indigo" && e.path === "(company)")).toMatchObject({
2412
+ message: expect.stringContaining("Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 403"),
2413
+ });
2414
+ expect(deps.stdout
2415
+ .events()
2416
+ .some((e) => e.type === "transient-network")).toBe(false);
2417
+ const all = deps.stdout
2418
+ .events()
2419
+ .find((e) => e.type === "all-complete");
2420
+ expect(all.errors).toEqual([expect.objectContaining({ company: "indigo" })]);
2421
+ expect(all.transient).toEqual([]);
2422
+ expect(all.companies).toEqual([
2423
+ expect.objectContaining({ company: "indigo", status: "errored" }),
2424
+ ]);
2425
+ });
2364
2426
  it("keeps deterministic company failures as exit 2 errors", async () => {
2365
2427
  const deps = makeDeps({
2366
2428
  createVaultClient: () => makeVaultStub({