specdojo 0.3.0 → 0.3.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/catalog-build-references.js +144 -0
  3. package/dist/catalog-build-render.js +144 -0
  4. package/dist/catalog-build.js +13 -290
  5. package/dist/catalog-generate.js +6 -9
  6. package/dist/catalog-plan-generate.js +2 -2
  7. package/dist/catalog-plan.js +6 -6
  8. package/dist/catalog-scaffold.js +4 -4
  9. package/dist/catalog.js +2 -2
  10. package/dist/dashboard-exec-records.js +105 -0
  11. package/dist/dashboard-routines.js +255 -0
  12. package/dist/dashboard-shared.js +14 -0
  13. package/dist/dashboard-timeline.js +175 -0
  14. package/dist/dashboard.js +10 -544
  15. package/dist/deliverable-trash.js +3 -3
  16. package/dist/doc-index.js +3 -3
  17. package/dist/exec-commands.js +557 -0
  18. package/dist/exec-core.js +457 -0
  19. package/dist/exec-plans-core.js +693 -0
  20. package/dist/exec-plans-generation.js +206 -0
  21. package/dist/exec-plans-storage.js +131 -0
  22. package/dist/exec-plans.js +3 -1018
  23. package/dist/exec-repo-integration-git.js +23 -0
  24. package/dist/exec-repo-integration-sync.js +264 -0
  25. package/dist/exec-repo-integration.js +4 -281
  26. package/dist/exec-reporter-output.js +206 -0
  27. package/dist/exec-reporter.js +2 -206
  28. package/dist/exec-results.js +22 -15
  29. package/dist/exec-run-agent-pipeline.js +256 -0
  30. package/dist/exec-run-agent.js +531 -0
  31. package/dist/exec-run-in-place.js +541 -0
  32. package/dist/exec-run-job.js +717 -0
  33. package/dist/exec-run-lifecycle-commands.js +522 -0
  34. package/dist/exec-run-mode-shared.js +140 -0
  35. package/dist/exec-run-register-command.js +244 -0
  36. package/dist/exec-run-register-core.js +386 -0
  37. package/dist/exec-run-register-mode.js +206 -0
  38. package/dist/exec-run-register-resume.js +393 -0
  39. package/dist/exec-run-register-state.js +322 -0
  40. package/dist/exec-run-register-worktree.js +509 -0
  41. package/dist/exec-run-schedule-mode.js +294 -0
  42. package/dist/exec-run-schedule-prepare.js +353 -0
  43. package/dist/exec-run-schedule-task.js +572 -0
  44. package/dist/exec-run-shared.js +399 -0
  45. package/dist/exec-run.js +11 -6182
  46. package/dist/exec-shared.js +2 -2
  47. package/dist/exec-trial-commands.js +558 -0
  48. package/dist/exec-trial-core.js +371 -0
  49. package/dist/exec-trial.js +2 -921
  50. package/dist/exec-worktree-ops-commit.js +707 -0
  51. package/dist/exec-worktree-ops-lifecycle.js +292 -0
  52. package/dist/exec-worktree-ops-merge.js +303 -0
  53. package/dist/exec-worktree-ops.js +3 -1292
  54. package/dist/exec-worktree.js +32 -4
  55. package/dist/exec.js +2 -1006
  56. package/dist/frontmatter-namespace.js +2 -2
  57. package/dist/grade-apply.js +734 -0
  58. package/dist/grade-command-apply.js +250 -0
  59. package/dist/grade-command-inspect.js +138 -0
  60. package/dist/grade-command-plan.js +101 -0
  61. package/dist/grade-command-shared.js +68 -0
  62. package/dist/grade-core.js +307 -0
  63. package/dist/grade-markdown.js +274 -0
  64. package/dist/grade-pipeline-state.js +184 -0
  65. package/dist/grade-plan.js +507 -0
  66. package/dist/grade-result.js +5 -5
  67. package/dist/grade-target-discovery.js +265 -0
  68. package/dist/grade-targets.js +432 -0
  69. package/dist/grade.js +14 -3188
  70. package/dist/init-command.js +7 -7
  71. package/dist/job-definition.js +670 -0
  72. package/dist/job.js +9 -673
  73. package/dist/kata-command.js +2 -2
  74. package/dist/register-command-types.js +1 -0
  75. package/dist/register-core.js +363 -0
  76. package/dist/register-create-commands.js +245 -0
  77. package/dist/register-events.js +4 -4
  78. package/dist/register-item.js +6 -6
  79. package/dist/register-maintenance-commands.js +187 -0
  80. package/dist/register-migration.js +268 -0
  81. package/dist/register-renumber.js +314 -0
  82. package/dist/register-transition-commands.js +248 -0
  83. package/dist/register-update.js +230 -0
  84. package/dist/register-views.js +256 -0
  85. package/dist/register.js +61 -2069
  86. package/dist/review-plan.js +3 -3
  87. package/dist/routine-definition.js +401 -0
  88. package/dist/routine.js +6 -402
  89. package/dist/schedule-approach.js +2 -2
  90. package/dist/schedule-strategy-generate-document.js +273 -0
  91. package/dist/schedule-strategy-generate-scope.js +199 -0
  92. package/dist/schedule-strategy-generate.js +9 -473
  93. package/dist/schedule.js +4 -4
  94. package/dist/specdojo-config.js +3 -4
  95. package/dist/viewpoint-document-kinds-check.js +3 -3
  96. package/dist/yaml-pages.js +4 -4
  97. package/dist/yaml.js +28 -0
  98. package/docs/ja/specdojo/guides/exec-config-guide.md +6 -6
  99. package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +20 -18
  100. package/docs/ja/specdojo/guides/routine-operation-guide.md +1 -1
  101. package/package.json +4 -5
  102. package/templates/antigravity/README.md +3 -3
  103. package/templates/antigravity/exec-defaults-snippet.yaml +6 -4
  104. package/templates/init-exec-defaults.yaml +3 -1
@@ -0,0 +1,399 @@
1
+ import { basename, resolve } from "node:path";
2
+ import { defaultExecDefaultsPath, hasMemberCommandSource, loadExecDefaultsConfig, resolveMaxConcurrentRuns, resolveMemberCommand, resolveRegisterExecution, } from "./exec-agent-config.js";
3
+ import { resolveProjectPaths } from "./exec-project.js";
4
+ import { buildInitialStateFromStrategy } from "./exec-schedule-initial.js";
5
+ import { buildScheduleIndex } from "./exec-schedule.js";
6
+ import { listFilesRecursive, readYaml } from "./exec-shared.js";
7
+ import { getProjectSchedulePath, loadConfig, specdojoRootDir, } from "./specdojo-config.js";
8
+ import { acquireExecRunLock, EXEC_RUN_LOCK_TOKEN_ENV, execLocksDir, inheritsExecRunLock, releaseExecRunLock, ROUTINE_BUSY_SKIP_EXIT_CODE, ROUTINE_EXEC_ENV, } from "./exec-run-lock.js";
9
+ import { getActiveExecLocksDir, setActiveExecLocksDir } from "./exec-slot-lock.js";
10
+ import { readAllEventFiles, foldEventsToState } from "./exec-events.js";
11
+ import { extractPhaseSuffix, normalizePhaseSetSelection, phaseSetNames, } from "./schedule-phase-sets.js";
12
+ export function pinnedExecutor(task) {
13
+ return typeof task?.agent === "string" ? task.agent : task?.agent?.executor;
14
+ }
15
+ export function pinnedReporter(task) {
16
+ return typeof task?.agent === "object" ? task.agent.reporter : undefined;
17
+ }
18
+ // Resolve the agent override for a task's mode. A single explicit --by nickname wins for every
19
+ // mode. Otherwise the mode-specific --edit-by / --review-by nickname applies. Commands are always
20
+ // resolved from agent-members.yaml and exec-defaults.yaml; raw command strings are not accepted.
21
+ export function resolveAgentOverride(mode, agentNicknameOverride, modeAgentOverrides, roster, execDefaults = {}, stageRole) {
22
+ const nickname = agentNicknameOverride ??
23
+ (mode === "review" ? modeAgentOverrides.review : modeAgentOverrides.edit);
24
+ if (!nickname)
25
+ return { kind: "none" };
26
+ const flag = agentNicknameOverride ? "--by" : mode === "review" ? "--review-by" : "--edit-by";
27
+ const member = roster?.members.find((m) => m.type === "agent" && m.nickname === nickname);
28
+ if (member && stageRole !== undefined && member.stage_role !== stageRole) {
29
+ return {
30
+ kind: "error",
31
+ message: `${flag} agent must have stage_role: ${stageRole} for this pipeline stage: ${nickname}`,
32
+ };
33
+ }
34
+ let command;
35
+ try {
36
+ command = member ? resolveMemberCommand(execDefaults, member) : undefined;
37
+ }
38
+ catch (error) {
39
+ return { kind: "error", message: error instanceof Error ? error.message : String(error) };
40
+ }
41
+ if (!member || !command) {
42
+ return {
43
+ kind: "error",
44
+ message: `${flag} agent nickname not found in agent-members.yaml (or has no resolvable command): ${nickname}`,
45
+ };
46
+ }
47
+ return {
48
+ kind: "command",
49
+ command,
50
+ actor: member.nickname,
51
+ provider: member.provider,
52
+ };
53
+ }
54
+ export class SerialAsyncLock {
55
+ tail = Promise.resolve();
56
+ async runExclusive(fn) {
57
+ const previous = this.tail;
58
+ let release;
59
+ this.tail = new Promise((resolveTail) => {
60
+ release = resolveTail;
61
+ });
62
+ await previous;
63
+ try {
64
+ return await fn();
65
+ }
66
+ finally {
67
+ release();
68
+ }
69
+ }
70
+ }
71
+ export async function runCompletionDrivenWorkerPool(options) {
72
+ const running = new Map();
73
+ let nextToken = 1;
74
+ let stop = false;
75
+ let launched = 0;
76
+ let completed = 0;
77
+ const start = (item) => {
78
+ const token = nextToken++;
79
+ running.set(token, {
80
+ token,
81
+ item,
82
+ promise: options.runItem(item).then((result) => ({ token, item, result })),
83
+ });
84
+ launched++;
85
+ };
86
+ const refill = async () => {
87
+ if (stop || running.size >= options.maxParallel)
88
+ return;
89
+ const items = await options.fillSlots(options.maxParallel - running.size);
90
+ for (const item of items) {
91
+ if (running.size >= options.maxParallel)
92
+ break;
93
+ start(item);
94
+ }
95
+ };
96
+ await refill();
97
+ while (running.size > 0) {
98
+ const outcome = await Promise.race([...running.values()].map((runningItem) => runningItem.promise));
99
+ running.delete(outcome.token);
100
+ completed++;
101
+ const action = await options.onSettled?.(outcome.item, outcome.result);
102
+ if (action?.stop)
103
+ stop = true;
104
+ await refill();
105
+ }
106
+ return { launched, completed };
107
+ }
108
+ export function buildTaskPhaseMap(schedulePath) {
109
+ const localIdToPhaseSets = new Map();
110
+ const phaseSetSuffixToId = new Map();
111
+ const strategyFiles = listFilesRecursive(schedulePath).filter((f) => /sch-strategy-.*\.(yaml|yml)$/.test(f));
112
+ for (const filePath of strategyFiles) {
113
+ let strategy;
114
+ try {
115
+ strategy = readYaml(filePath);
116
+ }
117
+ catch {
118
+ continue;
119
+ }
120
+ if (!strategy?.phase_sets || !Array.isArray(strategy.owner_rules))
121
+ continue;
122
+ let defaultPhaseSets;
123
+ try {
124
+ defaultPhaseSets = phaseSetNames(normalizePhaseSetSelection(strategy.default_phase_sets, strategy.default_phase_set
125
+ ? [strategy.default_phase_set]
126
+ : Object.keys(strategy.phase_sets)));
127
+ }
128
+ catch {
129
+ continue;
130
+ }
131
+ for (const [phaseSetName, phases] of Object.entries(strategy.phase_sets)) {
132
+ for (const phase of phases) {
133
+ phaseSetSuffixToId.set(`${phaseSetName}:${phase.task_suffix}`, phase.id);
134
+ }
135
+ }
136
+ for (const rule of strategy.owner_rules) {
137
+ let phaseSets;
138
+ try {
139
+ phaseSets = rule.phase_sets
140
+ ? phaseSetNames(normalizePhaseSetSelection(rule.phase_sets, []))
141
+ : rule.phase_set
142
+ ? [rule.phase_set]
143
+ : defaultPhaseSets;
144
+ }
145
+ catch {
146
+ continue;
147
+ }
148
+ for (const localId of rule.local_ids) {
149
+ localIdToPhaseSets.set(localId, phaseSets);
150
+ }
151
+ }
152
+ }
153
+ return { localIdToPhaseSets, phaseSetSuffixToId };
154
+ }
155
+ export function resolveTaskPhaseContext(task, localIdToPhaseSets, phaseSetSuffixToId) {
156
+ // ready.json/schedule 側で phase_set・phase_id が既に確定しているタスクは、それを正として
157
+ // 直接返す。cross-deliverable-pass タスク(single local_id を持たず target_local_ids のみを
158
+ // 持つ)はこの分岐でしか解決できないため、local_id の有無より先に判定する。ここで local_id
159
+ // チェックを先にすると、target_local_ids しか持たないタスクは常に「not found in sch-strategy
160
+ // files」で失敗する。
161
+ if (task.phase_set && task.phase_id) {
162
+ return { localId: task.local_id ?? "", phaseSet: task.phase_set, phaseId: task.phase_id };
163
+ }
164
+ const localId = task.local_id;
165
+ if (!localId)
166
+ return null;
167
+ const suffix = task.phase_suffix ?? extractPhaseSuffix(task.id);
168
+ if (!suffix)
169
+ return null;
170
+ const phaseSets = localIdToPhaseSets.get(localId);
171
+ if (!phaseSets)
172
+ return null;
173
+ for (const phaseSet of task.phase_set ? [task.phase_set] : phaseSets) {
174
+ const phaseId = phaseSetSuffixToId.get(`${phaseSet}:${suffix}`);
175
+ if (phaseId)
176
+ return { localId, phaseSet, phaseId };
177
+ }
178
+ return null;
179
+ }
180
+ export function selectCandidates(requirements, roster, taskMode, busyActors, execDefaults = {}) {
181
+ if (!roster)
182
+ return [];
183
+ const { capabilities: required, proficiency, stage_role: stageRole } = requirements;
184
+ return roster.members
185
+ .filter((m) => {
186
+ // Runnable agents need a command source: a provider command_template or an
187
+ // explicit member-level command override.
188
+ if (m.type !== "agent" || !hasMemberCommandSource(execDefaults, m))
189
+ return false;
190
+ // Temporarily disabled agents (e.g. to isolate one provider while testing rate limits)
191
+ // are skipped during auto-selection.
192
+ if (m.disabled === true)
193
+ return false;
194
+ const caps = m.capabilities ?? [];
195
+ if (!required.every((c) => caps.includes(c)))
196
+ return false;
197
+ if (proficiency !== undefined && m.proficiency !== proficiency)
198
+ return false;
199
+ // Pipeline agents and legacy agents form disjoint auto-selection pools. This keeps newly
200
+ // introduced executor/reporter definitions out of existing single-agent tasks while also
201
+ // preventing legacy agents from silently filling a pipeline stage.
202
+ if (stageRole === undefined) {
203
+ if (m.stage_role !== undefined)
204
+ return false;
205
+ }
206
+ else if (m.stage_role !== stageRole) {
207
+ return false;
208
+ }
209
+ // If agent declares a mode and task has a mode, they must match.
210
+ // Agents without a mode field are mode-agnostic and match any task.
211
+ if (m.mode !== undefined && taskMode !== undefined && m.mode !== taskMode)
212
+ return false;
213
+ return true;
214
+ })
215
+ .sort((a, b) => {
216
+ // Primary: agents already busy on a "doing" task sort last. This spreads parallel runs
217
+ // across agents instead of piling every task onto the same top-priority command and
218
+ // hitting its rate limit.
219
+ const aBusy = busyActors?.has(a.nickname) ? 1 : 0;
220
+ const bBusy = busyActors?.has(b.nickname) ? 1 : 0;
221
+ if (aBusy !== bBusy)
222
+ return aBusy - bBusy;
223
+ // Secondary: priority (lower number = tried first)
224
+ const aPriority = a.priority ?? 999;
225
+ const bPriority = b.priority ?? 999;
226
+ if (aPriority !== bPriority)
227
+ return aPriority - bPriority;
228
+ // Tertiary: fewest extra capabilities (tie-breaker within same priority)
229
+ const aExtra = (a.capabilities?.length ?? 0) - required.length;
230
+ const bExtra = (b.capabilities?.length ?? 0) - required.length;
231
+ return aExtra - bExtra;
232
+ });
233
+ }
234
+ // Collect the nicknames of actors currently working a "doing" task, derived from the event log
235
+ // (not the state.json cache) so freshly claimed tasks within the same parallel round are seen.
236
+ // Used to deprioritize busy agents during auto-selection. Failures degrade to "no busy info".
237
+ export function collectBusyActors(schedulePath) {
238
+ const busy = new Set();
239
+ try {
240
+ const sch = buildScheduleIndex(schedulePath);
241
+ const evts = readAllEventFiles(schedulePath);
242
+ const initTasks = buildInitialStateFromStrategy(schedulePath, sch);
243
+ const snap = foldEventsToState(evts, sch, schedulePath, initTasks);
244
+ for (const taskState of Object.values(snap.tasks ?? {})) {
245
+ if (taskState?.state === "doing" && taskState.last_by)
246
+ busy.add(taskState.last_by);
247
+ }
248
+ }
249
+ catch {
250
+ // ignore; selection falls back to priority-only ordering
251
+ }
252
+ return busy;
253
+ }
254
+ export function isRateLimitError(exitCode, output, detection) {
255
+ if (!detection)
256
+ return false;
257
+ // exit_codes is a standalone signal: an exact configured code identifies a rate limit
258
+ // on its own. Keep this list minimal (see exec-defaults.yaml) since generic codes like 1
259
+ // also mean ordinary failure.
260
+ if (detection.exit_codes && exitCode !== null && detection.exit_codes.includes(exitCode)) {
261
+ return true;
262
+ }
263
+ if (detection.stderr_patterns) {
264
+ // `output` is the agent's combined stdout+stderr: some CLIs print the limit notice to
265
+ // stdout, not stderr (e.g. claude's "You've hit your session limit"), so scanning stderr
266
+ // alone misses it. By default a pattern only counts when the process also failed (non-zero
267
+ // or null exit). A successful run (exit 0) that merely echoes the phrase — e.g. an agent
268
+ // editing a file containing the literal text "rate limit" — is not a rate limit.
269
+ const requireNonzeroExit = detection.stderr_requires_nonzero_exit ?? true;
270
+ if (!requireNonzeroExit || exitCode !== 0) {
271
+ const lower = output.toLowerCase();
272
+ for (const pattern of detection.stderr_patterns) {
273
+ if (lower.includes(pattern.toLowerCase()))
274
+ return true;
275
+ }
276
+ }
277
+ }
278
+ return false;
279
+ }
280
+ export function resolveExecDefaultsPath(opts, schedulePath) {
281
+ if (opts.execDefaults)
282
+ return opts.execDefaults;
283
+ if (opts.agentConfig)
284
+ return opts.agentConfig;
285
+ const { config } = loadConfig();
286
+ if (config) {
287
+ const rootDir = specdojoRootDir();
288
+ for (const project of Object.values(config.projects)) {
289
+ const projSchedulePath = resolve(rootDir, getProjectSchedulePath(project));
290
+ if (projSchedulePath === schedulePath && project.run?.exec_defaults) {
291
+ return resolve(rootDir, project.run.exec_defaults);
292
+ }
293
+ if (projSchedulePath === schedulePath && project.run?.agent_config) {
294
+ return resolve(rootDir, project.run.agent_config);
295
+ }
296
+ }
297
+ }
298
+ return defaultExecDefaultsPath();
299
+ }
300
+ export function configuredWorktreeBase(schedulePath) {
301
+ const { config } = loadConfig();
302
+ if (!config)
303
+ return undefined;
304
+ const rootDir = specdojoRootDir();
305
+ for (const project of Object.values(config.projects)) {
306
+ if (resolve(rootDir, getProjectSchedulePath(project)) === schedulePath) {
307
+ return project.run?.worktree_base;
308
+ }
309
+ }
310
+ return undefined;
311
+ }
312
+ export function parseParallel(value) {
313
+ const text = value ?? "1";
314
+ if (!/^\d+$/.test(text)) {
315
+ throw new Error(`--parallel must be a positive integer: ${value ?? ""}`);
316
+ }
317
+ const parsed = Number.parseInt(text, 10);
318
+ if (!Number.isSafeInteger(parsed) || parsed < 1) {
319
+ throw new Error(`--parallel must be a positive integer: ${value ?? ""}`);
320
+ }
321
+ return parsed;
322
+ }
323
+ export function parseExecRunBusyPolicy(value) {
324
+ const policy = value ?? "fail";
325
+ if (policy !== "skip" && policy !== "wait" && policy !== "fail") {
326
+ throw new Error(`--if-busy must be "skip", "wait", or "fail": ${value ?? ""}`);
327
+ }
328
+ return policy;
329
+ }
330
+ export function resolveRegisterWorktree(opts, execDefaults) {
331
+ if (opts.worktree && opts.inPlace) {
332
+ throw new Error("Specify either --worktree or --in-place, not both.");
333
+ }
334
+ if (opts.worktree)
335
+ return true;
336
+ if (opts.inPlace)
337
+ return false;
338
+ return resolveRegisterExecution(execDefaults) === "worktree";
339
+ }
340
+ export const EXCLUSIVE_EXEC_RUN = { shareable: false, join: false };
341
+ function resolveJoinSlotLimit(opts, schedulePath, executionPath) {
342
+ const execDefaults = loadExecDefaultsConfig(resolveExecDefaultsPath(opts, schedulePath), executionPath);
343
+ return resolveMaxConcurrentRuns(execDefaults) - 1;
344
+ }
345
+ export async function withProjectExecRunLock(opts, commandLabel, action, sharing = EXCLUSIVE_EXEC_RUN) {
346
+ const resolvedPaths = resolveProjectPaths({ project: opts.project });
347
+ const locksDir = execLocksDir(resolvedPaths.executionPath);
348
+ const previousLocksDir = getActiveExecLocksDir();
349
+ if (inheritsExecRunLock(resolvedPaths.executionPath)) {
350
+ setActiveExecLocksDir(locksDir);
351
+ try {
352
+ await action();
353
+ }
354
+ finally {
355
+ setActiveExecLocksDir(previousLocksDir);
356
+ }
357
+ return;
358
+ }
359
+ const policy = parseExecRunBusyPolicy(opts.ifBusy);
360
+ const joinLimit = sharing.join
361
+ ? resolveJoinSlotLimit(opts, resolvedPaths.schedulePath, resolvedPaths.executionPath)
362
+ : 0;
363
+ if (sharing.join && joinLimit < 1) {
364
+ throw new Error("--join is disabled: run.max_concurrent_runs in exec-defaults is 1 (raise it to allow joining runs)");
365
+ }
366
+ const handle = await acquireExecRunLock(resolvedPaths.executionPath, {
367
+ actor: opts.by ?? `exec-${commandLabel}`,
368
+ ifBusy: policy,
369
+ shareable: sharing.shareable || sharing.join,
370
+ ...(sharing.join ? { join: { limit: joinLimit } } : {}),
371
+ onWait: () => process.stdout.write(sharing.join
372
+ ? `[${commandLabel}] exec busy — waiting for a join slot (see "exec slots")\n`
373
+ : `[${commandLabel}] exec busy — waiting\n`),
374
+ });
375
+ if (!handle) {
376
+ process.stdout.write(`[${commandLabel}] skipped: exec busy\n`);
377
+ if (process.env[ROUTINE_EXEC_ENV] === "1") {
378
+ process.exitCode = ROUTINE_BUSY_SKIP_EXIT_CODE;
379
+ }
380
+ return;
381
+ }
382
+ if (sharing.join) {
383
+ process.stdout.write(`[${commandLabel}] running as a joined exec (${basename(handle.lockDir)})\n`);
384
+ }
385
+ const previousInheritedToken = process.env[EXEC_RUN_LOCK_TOKEN_ENV];
386
+ process.env[EXEC_RUN_LOCK_TOKEN_ENV] = handle.token;
387
+ setActiveExecLocksDir(locksDir);
388
+ try {
389
+ await action();
390
+ }
391
+ finally {
392
+ setActiveExecLocksDir(previousLocksDir);
393
+ if (previousInheritedToken === undefined)
394
+ delete process.env[EXEC_RUN_LOCK_TOKEN_ENV];
395
+ else
396
+ process.env[EXEC_RUN_LOCK_TOKEN_ENV] = previousInheritedToken;
397
+ releaseExecRunLock(handle);
398
+ }
399
+ }