dsh-workplan 3.0.0 → 3.0.1

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/src/watchdog.ts CHANGED
@@ -164,6 +164,11 @@ export function createProgressWatchdog(input: {
164
164
  idleMs: number
165
165
  hardMs: number
166
166
  makeError: (reason: Exclude<TimeoutReason, null>) => Error
167
+ /**
168
+ * 是否执行时间上限。缺省 false:只观测进度与回执,不预警、不拒绝、不中止。
169
+ * 仅供独立历史测试显式传 true 复现旧工具语义;部门负责人/专家生产路径不得启用。
170
+ */
171
+ enforceTimeouts?: boolean
167
172
  pollMs?: number
168
173
  onProgress?: (info: { now: number; seq: number; elapsedMs: number }) => void
169
174
  onApproachingDeadline?: (info: ApproachingDeadlineInfo) => void
@@ -171,6 +176,7 @@ export function createProgressWatchdog(input: {
171
176
  now?: () => number
172
177
  }): ProgressWatchdog {
173
178
  const clock = input.now ?? (() => Date.now())
179
+ const enforceTimeouts = input.enforceTimeouts === true
174
180
  const pollMs = Math.max(10, Math.floor(input.pollMs ?? 2000))
175
181
  const startedAt = clock()
176
182
  let lastProgress = startedAt
@@ -254,6 +260,7 @@ export function createProgressWatchdog(input: {
254
260
  }
255
261
  }
256
262
  }
263
+ if (!enforceTimeouts) return
257
264
  warnApproachingDeadline(now)
258
265
  const reason = pickTimeoutReason({
259
266
  now,