@indigoai-us/hq-cloud 6.16.28 → 6.16.29

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.
@@ -1121,18 +1121,33 @@ describe("sync", () => {
1121
1121
  const resolveSpy = vi
1122
1122
  .spyOn(conflictModule, "resolveConflict")
1123
1123
  .mockResolvedValue("skip");
1124
+ // An UNSET strategy only prompts when a human is on a TTY; off a TTY it is
1125
+ // the version-aware winner, which never consults the prompt and decides by
1126
+ // mtime instead — so without this the outcome depended on how many seconds
1127
+ // separated the S3 mock's `new Date()` from the local write above. Model the
1128
+ // interactive terminal so the `skip` arm is what runs.
1129
+ const ttyDescriptor = Object.getOwnPropertyDescriptor(process.stdin, "isTTY");
1130
+ Object.defineProperty(process.stdin, "isTTY", { value: true, configurable: true });
1124
1131
  let result;
1132
+ let prompted = 0;
1125
1133
  try {
1126
1134
  result = await sync({
1127
1135
  company: "acme",
1128
1136
  vaultConfig: mockConfig,
1129
1137
  hqRoot: tmpDir,
1130
1138
  });
1139
+ prompted = resolveSpy.mock.calls.length;
1131
1140
  }
1132
1141
  finally {
1142
+ if (ttyDescriptor)
1143
+ Object.defineProperty(process.stdin, "isTTY", ttyDescriptor);
1144
+ else
1145
+ delete process.stdin.isTTY;
1133
1146
  resolveSpy.mockRestore();
1134
1147
  }
1135
1148
  expect(result.conflicts).toBe(1);
1149
+ // The prompt stand-in decided — not a wall-clock mtime comparison.
1150
+ expect(prompted).toBe(1);
1136
1151
  const journal = journalAt(journalPath);
1137
1152
  // remoteEtag still recorded so the conflict can't re-fire (#137 invariant)…
1138
1153
  expect(journal.files["docs/handoff.md"].remoteEtag).toBeTruthy();