@adhdev/daemon-standalone 1.0.58-rc.61 → 1.0.58-rc.63

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.
package/dist/index.js CHANGED
@@ -36911,10 +36911,10 @@ var require_dist3 = __commonJS({
36911
36911
  }
36912
36912
  function getDaemonBuildInfo() {
36913
36913
  if (cached2) return cached2;
36914
- const commit = readInjected(true ? "4bf24d94c6554a1919d31d66b30fd6a74ca05255" : void 0) ?? "unknown";
36915
- const commitShort = readInjected(true ? "4bf24d94" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
36916
- const version2 = readInjected(true ? "1.0.58-rc.61" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
36917
- const builtAt = readInjected(true ? "2026-09-02T04:15:59.059Z" : void 0);
36914
+ const commit = readInjected(true ? "5383b7406921a4dfcfe39a50793abc9411fc35df" : void 0) ?? "unknown";
36915
+ const commitShort = readInjected(true ? "5383b740" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
36916
+ const version2 = readInjected(true ? "1.0.58-rc.63" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
36917
+ const builtAt = readInjected(true ? "2026-09-02T07:52:30.182Z" : void 0);
36918
36918
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
36919
36919
  return cached2;
36920
36920
  }
@@ -50368,6 +50368,11 @@ ${lines.join("\n")}
50368
50368
  const ts2 = Date.parse(iso);
50369
50369
  return Number.isFinite(ts2) ? Math.max(0, nowMs - ts2) : null;
50370
50370
  }
50371
+ function isStaleTurnAttemptAuthority(row, nowMs) {
50372
+ if (!STALE_GATED_STAGES.has(row.stage)) return false;
50373
+ const age = ageMs(nowMs, row.updatedAt ?? null);
50374
+ return age !== null && age > STALE_TURN_ATTEMPT_AUTHORITY_MAX_AGE_MS;
50375
+ }
50371
50376
  function presentationFromAttemptRow(row, nowMs = Date.now()) {
50372
50377
  const stage = row.stage;
50373
50378
  return {
@@ -50413,7 +50418,7 @@ ${lines.join("\n")}
50413
50418
  function resolveSessionTurnPresentation(args) {
50414
50419
  const nowMs = args.nowMs ?? Date.now();
50415
50420
  const row = resolveTurnAttemptRow(args);
50416
- if (row) {
50421
+ if (row && !isStaleTurnAttemptAuthority(row, nowMs)) {
50417
50422
  const presentation = presentationFromAttemptRow(row, nowMs);
50418
50423
  recordProjectionSource("turn_reducer");
50419
50424
  shadowCompareLegacyVsProjection(args.surface, args.providerType ?? row.providerType, args.legacyStatus, presentation);
@@ -50510,6 +50515,8 @@ ${lines.join("\n")}
50510
50515
  LOG2.info("TurnPresentation", `Shadow divergence (${reason}) surface=${surface} provider=${provider} legacy=${legacyNorm} projected=${presentation.status} stage=${presentation.stage ?? "none"} task=${presentation.taskId ?? "none"} attempt=${presentation.attemptId ?? "none"}`);
50511
50516
  }
50512
50517
  }
50518
+ var STALE_TURN_ATTEMPT_AUTHORITY_MAX_AGE_MS;
50519
+ var STALE_GATED_STAGES;
50513
50520
  var MAX_DIVERGENCE_KEYS;
50514
50521
  var OVERFLOW_KEY;
50515
50522
  var presentationMetrics;
@@ -50521,6 +50528,8 @@ ${lines.join("\n")}
50521
50528
  init_mesh_turn_ledger();
50522
50529
  init_logger();
50523
50530
  init_normalize();
50531
+ STALE_TURN_ATTEMPT_AUTHORITY_MAX_AGE_MS = 30 * 60 * 1e3;
50532
+ STALE_GATED_STAGES = /* @__PURE__ */ new Set(["generating", "consumed"]);
50524
50533
  MAX_DIVERGENCE_KEYS = 200;
50525
50534
  OVERFLOW_KEY = "overflow|__overflow__|__overflow__";
50526
50535
  presentationMetrics = {