@whittlelabs/sifter 0.26.0 → 0.27.0

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 (3) hide show
  1. package/bin.js +19 -2
  2. package/bin.js.map +2 -2
  3. package/package.json +1 -1
package/bin.js CHANGED
@@ -15399,9 +15399,26 @@ var require_client = __commonJS({
15399
15399
  async getJobPool(poolId) {
15400
15400
  return this.request("GET", `/api/job-pools/${poolId}`);
15401
15401
  }
15402
+ /**
15403
+ * Resolve a pool by exact name. Names are unique per OWNER, not globally
15404
+ * (whittlelabs#763), and this method lists without a principal filter, so
15405
+ * the same name can legitimately come back under several owners. That
15406
+ * reference is inherently ambiguous — and silently picking one (the old
15407
+ * behavior took the server's newest-first ordering) is exactly the
15408
+ * capture vector the per-owner constraint closed, re-opened cross-owner.
15409
+ * So it refuses instead: reference the pool by id, or list with explicit
15410
+ * principal filters, when more than one owner holds the name.
15411
+ */
15402
15412
  async resolveJobPoolByName(name) {
15403
15413
  const pools = await this.listJobPools({ name });
15404
- return pools.find((p) => p.name === name);
15414
+ const matches = pools.filter((p) => p.name === name);
15415
+ const owners = new Set(matches.map((p) => `${p.principalClass ?? ""}/${p.principalId ?? ""}`));
15416
+ if (owners.size > 1) {
15417
+ const error = new Error(`Job pool name "${name}" is ambiguous: ${matches.length} pools under ${owners.size} different owners hold it. Reference the pool by id, or resolve it with explicit principal filters (listJobPools).`);
15418
+ error.code = "JOB_POOL_NAME_AMBIGUOUS";
15419
+ throw error;
15420
+ }
15421
+ return matches[0];
15405
15422
  }
15406
15423
  /** Internal: resolve a `PoolRef` to a pool id. */
15407
15424
  async resolvePoolRef(ref) {
@@ -22433,7 +22450,7 @@ var import_path = require("path");
22433
22450
  var import_promises = require("fs/promises");
22434
22451
  var import_yaml = __toESM(require_dist());
22435
22452
  var import_shuttle = __toESM(require_dist5());
22436
- var buildVersion = true ? "0.26.0" : pkg.version;
22453
+ var buildVersion = true ? "0.27.0" : pkg.version;
22437
22454
  var sifterBrand = {
22438
22455
  product: {
22439
22456
  id: "sifter",