@indigoai-us/hq-cloud 6.14.22 → 6.14.24

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 (120) hide show
  1. package/dist/bin/sync-runner-company.d.ts.map +1 -1
  2. package/dist/bin/sync-runner-company.js +20 -0
  3. package/dist/bin/sync-runner-company.js.map +1 -1
  4. package/dist/bin/sync-runner-events.test.js +22 -0
  5. package/dist/bin/sync-runner-events.test.js.map +1 -1
  6. package/dist/bin/sync-runner-planning.d.ts +11 -0
  7. package/dist/bin/sync-runner-planning.d.ts.map +1 -1
  8. package/dist/bin/sync-runner-planning.js +37 -2
  9. package/dist/bin/sync-runner-planning.js.map +1 -1
  10. package/dist/bin/sync-runner-planning.test.js +1 -0
  11. package/dist/bin/sync-runner-planning.test.js.map +1 -1
  12. package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
  13. package/dist/bin/sync-runner-watch-loop.js +17 -1
  14. package/dist/bin/sync-runner-watch-loop.js.map +1 -1
  15. package/dist/bin/sync-runner.d.ts +33 -1
  16. package/dist/bin/sync-runner.d.ts.map +1 -1
  17. package/dist/bin/sync-runner.js +28 -3
  18. package/dist/bin/sync-runner.js.map +1 -1
  19. package/dist/bin/sync-runner.test.js +206 -2
  20. package/dist/bin/sync-runner.test.js.map +1 -1
  21. package/dist/cli/doctor.d.ts +119 -0
  22. package/dist/cli/doctor.d.ts.map +1 -0
  23. package/dist/cli/doctor.js +485 -0
  24. package/dist/cli/doctor.js.map +1 -0
  25. package/dist/cli/doctor.test.d.ts +13 -0
  26. package/dist/cli/doctor.test.d.ts.map +1 -0
  27. package/dist/cli/doctor.test.js +485 -0
  28. package/dist/cli/doctor.test.js.map +1 -0
  29. package/dist/cli/index.d.ts +2 -0
  30. package/dist/cli/index.d.ts.map +1 -1
  31. package/dist/cli/index.js +4 -0
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/cli/share.js +6 -1
  34. package/dist/cli/share.js.map +1 -1
  35. package/dist/cli/share.test.js +1 -0
  36. package/dist/cli/share.test.js.map +1 -1
  37. package/dist/cli/sync.d.ts +54 -0
  38. package/dist/cli/sync.d.ts.map +1 -1
  39. package/dist/cli/sync.js +223 -3
  40. package/dist/cli/sync.js.map +1 -1
  41. package/dist/cli/sync.test.js +394 -1
  42. package/dist/cli/sync.test.js.map +1 -1
  43. package/dist/cognito-auth.test.js +7 -0
  44. package/dist/cognito-auth.test.js.map +1 -1
  45. package/dist/index.d.ts +2 -0
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +3 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/lib/conflict-file.d.ts.map +1 -1
  50. package/dist/lib/conflict-file.js +5 -1
  51. package/dist/lib/conflict-file.js.map +1 -1
  52. package/dist/lib/conflict-index.d.ts +7 -0
  53. package/dist/lib/conflict-index.d.ts.map +1 -1
  54. package/dist/lib/conflict-index.js +10 -2
  55. package/dist/lib/conflict-index.js.map +1 -1
  56. package/dist/lib/conflict.test.js +31 -0
  57. package/dist/lib/conflict.test.js.map +1 -1
  58. package/dist/lib/machine-id.test.js +14 -0
  59. package/dist/lib/machine-id.test.js.map +1 -1
  60. package/dist/local-path-codec.d.ts +18 -0
  61. package/dist/local-path-codec.d.ts.map +1 -1
  62. package/dist/local-path-codec.js +63 -0
  63. package/dist/local-path-codec.js.map +1 -1
  64. package/dist/local-path-codec.test.d.ts +14 -0
  65. package/dist/local-path-codec.test.d.ts.map +1 -0
  66. package/dist/local-path-codec.test.js +102 -0
  67. package/dist/local-path-codec.test.js.map +1 -0
  68. package/dist/machine-auth.test.js +7 -0
  69. package/dist/machine-auth.test.js.map +1 -1
  70. package/dist/s3.d.ts +5 -0
  71. package/dist/s3.d.ts.map +1 -1
  72. package/dist/s3.js +129 -3
  73. package/dist/s3.js.map +1 -1
  74. package/dist/s3.symlink-materialize.test.d.ts +18 -0
  75. package/dist/s3.symlink-materialize.test.d.ts.map +1 -0
  76. package/dist/s3.symlink-materialize.test.js +394 -0
  77. package/dist/s3.symlink-materialize.test.js.map +1 -0
  78. package/dist/s3.test.js +19 -0
  79. package/dist/s3.test.js.map +1 -1
  80. package/dist/skill-telemetry.d.ts.map +1 -1
  81. package/dist/skill-telemetry.js +23 -2
  82. package/dist/skill-telemetry.js.map +1 -1
  83. package/dist/skill-telemetry.test.js +17 -0
  84. package/dist/skill-telemetry.test.js.map +1 -1
  85. package/dist/watcher.d.ts.map +1 -1
  86. package/dist/watcher.js +10 -1
  87. package/dist/watcher.js.map +1 -1
  88. package/dist/watcher.test.js +28 -0
  89. package/dist/watcher.test.js.map +1 -1
  90. package/package.json +1 -1
  91. package/src/bin/sync-runner-company.ts +18 -0
  92. package/src/bin/sync-runner-events.test.ts +31 -0
  93. package/src/bin/sync-runner-planning.test.ts +1 -0
  94. package/src/bin/sync-runner-planning.ts +46 -3
  95. package/src/bin/sync-runner-watch-loop.ts +19 -1
  96. package/src/bin/sync-runner.test.ts +236 -1
  97. package/src/bin/sync-runner.ts +57 -2
  98. package/src/cli/doctor.test.ts +581 -0
  99. package/src/cli/doctor.ts +640 -0
  100. package/src/cli/index.ts +14 -0
  101. package/src/cli/share.test.ts +1 -0
  102. package/src/cli/share.ts +6 -1
  103. package/src/cli/sync.test.ts +473 -1
  104. package/src/cli/sync.ts +310 -3
  105. package/src/cognito-auth.test.ts +5 -0
  106. package/src/index.ts +10 -0
  107. package/src/lib/conflict-file.ts +6 -1
  108. package/src/lib/conflict-index.ts +18 -2
  109. package/src/lib/conflict.test.ts +33 -0
  110. package/src/lib/machine-id.test.ts +10 -0
  111. package/src/local-path-codec.test.ts +138 -0
  112. package/src/local-path-codec.ts +66 -0
  113. package/src/machine-auth.test.ts +5 -0
  114. package/src/s3.symlink-materialize.test.ts +492 -0
  115. package/src/s3.test.ts +24 -0
  116. package/src/s3.ts +148 -4
  117. package/src/skill-telemetry.test.ts +19 -0
  118. package/src/skill-telemetry.ts +31 -2
  119. package/src/watcher.test.ts +33 -0
  120. package/src/watcher.ts +10 -1
@@ -144,9 +144,12 @@ import {
144
144
  buildFanoutPlan,
145
145
  emitFanoutPlan,
146
146
  resolveMembershipsForRun,
147
+ resolveSkipCompanies,
147
148
  type RunnerTarget,
148
149
  type SetupNeededReason,
149
150
  } from "./sync-runner-planning.js";
151
+
152
+ export { resolveSkipCompanies } from "./sync-runner-planning.js";
150
153
  import {
151
154
  seedActiveCompany,
152
155
  type SeedActiveCompanyOptions,
@@ -385,11 +388,19 @@ export type RunnerEvent =
385
388
  | ({ type: "conflict"; company: string } & Omit<Extract<SyncProgressEvent, { type: "conflict" }>, "type">)
386
389
  | { type: "new-files"; company: string; files: Array<{ path: string; bytes: number; addedBy: string | null }> }
387
390
  | { type: "scope-excluded"; company: string; count: number; samplePaths: string[] }
391
+ | ({ type: "scope-materialization-gap"; company: string } & Omit<
392
+ Extract<SyncProgressEvent, { type: "scope-materialization-gap" }>,
393
+ "type"
394
+ >)
388
395
  | { type: "ignore-excluded"; company: string; count: number; totalExcluded: number; samplePaths: string[] }
389
396
  | ({ type: "skip-invalid-scoped-key"; company: string } & Omit<
390
397
  Extract<SyncProgressEvent, { type: "skip-invalid-scoped-key" }>,
391
398
  "type"
392
399
  >)
400
+ | ({ type: "skip-junk-key-spelling"; company: string } & Omit<
401
+ Extract<SyncProgressEvent, { type: "skip-junk-key-spelling" }>,
402
+ "type"
403
+ >)
393
404
  | ({
394
405
  type: "complete";
395
406
  company: string;
@@ -465,6 +476,28 @@ export type RunnerEvent =
465
476
  filesUploaded: number;
466
477
  bytesUploaded: number;
467
478
  }>;
479
+ }
480
+ | {
481
+ /**
482
+ * Emitted at most ONCE per fanout, AFTER `all-complete`, when the
483
+ * post-sync conflict-ledger prune leaves one or more PRESERVED conflict
484
+ * variants that a human still has to resolve (`kept > 0`). The prune
485
+ * self-heals the ledger (drops orphaned + byte-identical false-positive
486
+ * rows), but genuine divergences are conservatively KEPT — and pre-fix
487
+ * that residual set was silent, so the reporter of feedback_d2082110
488
+ * finished a full sync with "20 older preserved conflict entries" still
489
+ * on disk and no signal they were there. This event reconciles and
490
+ * surfaces the remaining count so the operator knows to run
491
+ * `/resolve-conflicts`. Ledger-global (not per-company — the index lives
492
+ * at the HQ root). Not emitted when the ledger is clean (`kept === 0`).
493
+ *
494
+ * `count` is the number of preserved conflict rows still awaiting
495
+ * resolution; `samplePaths` carries up to 10 original (non-mirror) paths
496
+ * for display.
497
+ */
498
+ type: "conflicts-remaining";
499
+ count: number;
500
+ samplePaths: string[];
468
501
  };
469
502
 
470
503
  /**
@@ -1415,6 +1448,7 @@ export async function runRunner(
1415
1448
  client,
1416
1449
  claims,
1417
1450
  resolveSkipPersonal,
1451
+ skipCompanies: resolveSkipCompanies(),
1418
1452
  });
1419
1453
  } catch (err) {
1420
1454
  if (err instanceof VaultAuthError) {
@@ -1435,6 +1469,7 @@ export async function runRunner(
1435
1469
  return 0;
1436
1470
  }
1437
1471
  const plan = targetPlan.plan;
1472
+ const deferredUnresolved = targetPlan.deferredUnresolved;
1438
1473
 
1439
1474
  emitFanoutPlan(emit, plan);
1440
1475
 
@@ -1784,7 +1819,20 @@ export async function runRunner(
1784
1819
  // HQ_CONFLICT_PRUNE_ON_SYNC=0.
1785
1820
  if (process.env.HQ_CONFLICT_PRUNE_ON_SYNC !== "0") {
1786
1821
  try {
1787
- pruneConflictIndex(parsed.hqRoot);
1822
+ const pruneResult = pruneConflictIndex(parsed.hqRoot);
1823
+ // Reconcile + surface the residual preserved conflict variants a human
1824
+ // still has to resolve. Pre-fix this set was silent — the reporter of
1825
+ // feedback_d2082110 finished a full sync with 20 preserved conflict
1826
+ // entries still on disk and no signal. Emitting after the prune means the
1827
+ // count reflects the self-healed (orphan/false-positive-dropped) ledger,
1828
+ // never the inflated raw one. Ledger-global; silent on a clean ledger.
1829
+ if (pruneResult.kept > 0) {
1830
+ emit({
1831
+ type: "conflicts-remaining",
1832
+ count: pruneResult.kept,
1833
+ samplePaths: pruneResult.keptSamplePaths,
1834
+ });
1835
+ }
1788
1836
  } catch (err) {
1789
1837
  reportDiagnostic({
1790
1838
  component: "conflict-index",
@@ -1843,7 +1891,14 @@ export async function runRunner(
1843
1891
  // otherwise fire for normal user-policy outcomes. Consumers that want to
1844
1892
  // flag any non-clean outcome (clean-abort + thrown-error) read `partial`
1845
1893
  // from the JSON. The watch loop stays alive on this code (see exit-codes.ts).
1846
- return errors.length > 0 ? PARTIAL_SYNC_EXIT : 0;
1894
+ //
1895
+ // deferredUnresolved: a slug denylist was active but entity discovery blipped
1896
+ // for one or more memberships we could not prove were paused. Fail closed on
1897
+ // the plan (they were omitted) and return TRANSIENT so watch scoped drain
1898
+ // does not publish without a successful upload pass.
1899
+ if (errors.length > 0) return PARTIAL_SYNC_EXIT;
1900
+ if (deferredUnresolved > 0) return TRANSIENT_NETWORK_EXIT;
1901
+ return 0;
1847
1902
  }
1848
1903
 
1849
1904
  // ---------------------------------------------------------------------------