@fitlab-ai/agent-infra 0.11.6 → 0.11.8
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/bin/internal-cli.js +8 -2
- package/dist/lib/agent-clients/adapters/codex.js +1 -1
- package/dist/lib/agent-clients/config.js +11 -3
- package/dist/lib/defaults.json +6 -3
- package/dist/lib/git/primary-worktree.js +58 -0
- package/dist/lib/internal/cli-route-inventory.js +3 -0
- package/dist/lib/internal/platform-pr-review.js +20 -3
- package/dist/lib/internal/task-operation-registry.js +3 -1
- package/dist/lib/internal/task-platform-recovery.js +56 -0
- package/dist/lib/merge.js +25 -5
- package/dist/lib/platform/completion-backfill.js +2 -1
- package/dist/lib/platform/in-label-sync.js +12 -1
- package/dist/lib/platform/issue-comments.js +58 -4
- package/dist/lib/platform/issues.js +105 -5
- package/dist/lib/platform/operation-coordinator.js +74 -0
- package/dist/lib/platform/pr-review.js +107 -1
- package/dist/lib/platform/pr-summary.js +79 -57
- package/dist/lib/platform/pull-requests.js +125 -7
- package/dist/lib/sandbox/commands/create.js +6 -3
- package/dist/lib/sandbox/commands/ls.js +4 -3
- package/dist/lib/sandbox/commands/rm.js +1 -1
- package/dist/lib/sandbox/config.js +22 -4
- package/dist/lib/sandbox/control/server.js +6 -2
- package/dist/lib/sandbox/git-metadata.js +50 -0
- package/dist/lib/sandbox/index.js +1 -1
- package/dist/lib/sandbox/mounts.js +12 -0
- package/dist/lib/sandbox/recovery.js +11 -0
- package/dist/lib/sandbox/removal.js +58 -20
- package/dist/lib/sandbox/tools.js +29 -7
- package/dist/lib/server/config.js +7 -27
- package/dist/lib/server/daemon.js +4 -3
- package/dist/lib/server/process-control.js +4 -2
- package/dist/lib/server/runner.js +4 -3
- package/dist/lib/task/activity-intent.js +4 -3
- package/dist/lib/task/artifact-lifecycle.js +42 -10
- package/dist/lib/task/artifact-receipts.js +62 -22
- package/dist/lib/task/capabilities.js +22 -4
- package/dist/lib/task/completion-facts.js +56 -0
- package/dist/lib/task/create-service.js +11 -5
- package/dist/lib/task/create.js +60 -79
- package/dist/lib/task/events.js +268 -195
- package/dist/lib/task/finalization-artifacts.js +4 -1
- package/dist/lib/task/finalization-handoff.js +2 -1
- package/dist/lib/task/finalization.js +157 -24
- package/dist/lib/task/invalidation-command.js +4 -2
- package/dist/lib/task/invalidation.js +38 -9
- package/dist/lib/task/lifecycle.js +38 -2
- package/dist/lib/task/local-artifact-finalization.js +17 -3
- package/dist/lib/task/platform-operation-journal.js +152 -0
- package/dist/lib/task/platform-operation-recovery.js +459 -0
- package/dist/lib/task/qualification-audit.js +23 -105
- package/dist/lib/task/review-finalization.js +7 -0
- package/dist/lib/task/review-identity.js +69 -0
- package/dist/lib/task/sections.js +6 -5
- package/dist/lib/task/task-execution-lock.js +6 -3
- package/dist/lib/task/verification-engine.js +14 -63
- package/dist/lib/task/verification.js +35 -38
- package/dist/lib/task/workflow-warning-intents.js +7 -1
- package/dist/lifecycle-build-manifest.json +3 -3
- package/lib/agent-clients/adapters/codex.ts +1 -1
- package/lib/agent-clients/config.ts +9 -3
- package/lib/defaults.json +6 -3
- package/lib/git/primary-worktree.ts +62 -0
- package/lib/internal/cli-route-inventory.ts +2 -0
- package/lib/internal/platform-pr-review.ts +14 -3
- package/lib/internal/task-operation-registry.ts +3 -1
- package/lib/internal/task-platform-recovery.ts +53 -0
- package/lib/merge.ts +26 -6
- package/lib/platform/completion-backfill.ts +2 -1
- package/lib/platform/in-label-sync.ts +12 -0
- package/lib/platform/issue-comments.ts +59 -3
- package/lib/platform/issues.ts +103 -5
- package/lib/platform/operation-coordinator.ts +96 -0
- package/lib/platform/pr-review.ts +113 -1
- package/lib/platform/pr-summary.ts +22 -1
- package/lib/platform/pull-requests.ts +132 -8
- package/lib/sandbox/commands/create.ts +7 -8
- package/lib/sandbox/commands/ls.ts +4 -3
- package/lib/sandbox/commands/rm.ts +1 -1
- package/lib/sandbox/config.ts +23 -5
- package/lib/sandbox/control/server.ts +5 -2
- package/lib/sandbox/git-metadata.ts +66 -0
- package/lib/sandbox/index.ts +1 -1
- package/lib/sandbox/mounts.ts +14 -0
- package/lib/sandbox/recovery.ts +13 -0
- package/lib/sandbox/removal.ts +57 -19
- package/lib/sandbox/tool-types.ts +1 -1
- package/lib/sandbox/tools.ts +36 -7
- package/lib/server/config.ts +7 -29
- package/lib/server/daemon.ts +5 -3
- package/lib/server/process-control.ts +4 -2
- package/lib/server/runner.ts +7 -4
- package/lib/server/server.schema.json +0 -4
- package/lib/task/activity-intent.ts +4 -3
- package/lib/task/artifact-lifecycle.ts +35 -11
- package/lib/task/artifact-receipts.ts +55 -15
- package/lib/task/capabilities.ts +17 -3
- package/lib/task/completion-facts.ts +66 -0
- package/lib/task/create-service.ts +12 -6
- package/lib/task/create.ts +54 -69
- package/lib/task/events.ts +248 -182
- package/lib/task/finalization-artifacts.ts +4 -1
- package/lib/task/finalization-handoff.ts +2 -1
- package/lib/task/finalization.ts +154 -21
- package/lib/task/invalidation-command.ts +4 -2
- package/lib/task/invalidation.ts +35 -10
- package/lib/task/lifecycle.ts +35 -3
- package/lib/task/local-artifact-finalization.ts +13 -3
- package/lib/task/platform-operation-journal.ts +230 -0
- package/lib/task/platform-operation-recovery.ts +435 -0
- package/lib/task/qualification-audit.ts +21 -114
- package/lib/task/review-finalization.ts +7 -0
- package/lib/task/review-identity.ts +85 -0
- package/lib/task/sections.ts +6 -6
- package/lib/task/task-execution-lock.ts +7 -3
- package/lib/task/verification-engine.ts +13 -86
- package/lib/task/verification.ts +34 -38
- package/lib/task/workflow-warning-intents.ts +9 -1
- package/package.json +1 -1
- package/templates/.agents/README.en.md +19 -17
- package/templates/.agents/README.zh-CN.md +18 -16
- package/templates/.agents/rules/README.en.md +2 -1
- package/templates/.agents/rules/README.zh-CN.md +2 -1
- package/templates/.agents/rules/decision-qualification.en.md +4 -3
- package/templates/.agents/rules/decision-qualification.zh-CN.md +4 -3
- package/templates/.agents/rules/task-management.en.md +12 -0
- package/templates/.agents/rules/task-management.zh-CN.md +12 -0
- package/templates/.agents/rules/validation-output.en.md +19 -0
- package/templates/.agents/rules/validation-output.zh-CN.md +19 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/block-task/SKILL.en.md +2 -0
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +6 -2
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/code-task/SKILL.en.md +5 -3
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/code-task/reference/report-template.en.md +4 -8
- package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +4 -8
- package/templates/.agents/skills/commit/SKILL.en.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +1 -1
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +4 -0
- package/templates/.agents/skills/create-pr/SKILL.en.md +2 -0
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/create-task/SKILL.en.md +2 -0
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-codescan/SKILL.en.md +2 -0
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -0
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +2 -0
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
- package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +3 -1
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +4 -8
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +4 -8
- package/templates/.agents/skills/review-code/SKILL.en.md +13 -12
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +11 -12
- package/templates/.agents/skills/review-code/config/verify.en.json +1 -3
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -3
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +23 -46
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +27 -48
- package/templates/.agents/skills/review-code/reference/report-template.en.md +8 -11
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +8 -11
- package/templates/.agents/skills/review-code/reference/review-criteria.en.md +2 -2
- package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +2 -2
- package/templates/.agents/skills/review-plan/SKILL.en.md +3 -1
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +5 -9
- package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +5 -9
- package/templates/.agents/skills/review-pr/SKILL.en.md +13 -11
- package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +13 -11
- package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +3 -3
- package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +3 -3
- package/templates/.agents/skills/review-pr/reference/report-template.en.md +4 -0
- package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +4 -0
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +1 -1
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +19 -6
- package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -0
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +1 -1
- package/templates/.agents/templates/task.en.md +2 -2
- package/templates/.agents/templates/task.zh-CN.md +2 -2
package/dist/lib/task/create.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
3
4
|
import path from 'node:path';
|
|
4
5
|
import { isValidAgentInfraVersion, VERSION } from '../version.js';
|
|
5
6
|
import { loadShortIdByTaskId, mutateShortIdRegistry } from './short-id.js';
|
|
6
|
-
import { TaskExecutionLockError, withTaskExecutionLock } from './task-execution-lock.js';
|
|
7
|
+
import { TaskExecutionLockError, withRepositoryMutationLock, withTaskExecutionLock } from './task-execution-lock.js';
|
|
7
8
|
import { readDeliveryDefaults, validateBaseRef, validateRemote } from './delivery-target.js';
|
|
8
9
|
import { buildUnboundFact, encodePrDeliveryFact } from './pr-delivery-fact.js';
|
|
9
10
|
import { CANDIDATE_COLUMNS, CONSTRAINT_COLUMNS, parseTaskQualification } from './qualification-audit.js';
|
|
11
|
+
import { enumerateAllTaskDirs } from './resolve-ref.js';
|
|
12
|
+
import { parseTaskFrontmatter } from './frontmatter.js';
|
|
10
13
|
const AGENTS = ['claude', 'codex', 'antigravity', 'opencode', 'cursor'];
|
|
11
14
|
const TYPES = ['feature', 'bugfix', 'refactor', 'docs', 'chore'];
|
|
12
15
|
const PRIORITIES = ['Urgent', 'High', 'Medium', 'Low'];
|
|
@@ -292,10 +295,27 @@ function ensureRealDirectory(directory, code) {
|
|
|
292
295
|
}
|
|
293
296
|
fs.mkdirSync(directory, { mode: 0o700 });
|
|
294
297
|
}
|
|
295
|
-
function
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
298
|
+
function createLockRoot(project) {
|
|
299
|
+
const root = path.join(os.homedir(), '.agent-infra');
|
|
300
|
+
const directories = [root, path.join(root, 'run'), path.join(root, 'run', project), path.join(root, 'run', project, 'task-create-locks')];
|
|
301
|
+
for (const directory of directories) {
|
|
302
|
+
if (fs.existsSync(directory)) {
|
|
303
|
+
assertRealDirectory(directory, 'TASK_CREATE_LOCK_FAILED');
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
fs.mkdirSync(directory, { mode: 0o700 });
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
if (error.code !== 'EEXIST')
|
|
311
|
+
throw error;
|
|
312
|
+
assertRealDirectory(directory, 'TASK_CREATE_LOCK_FAILED');
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return directories.at(-1);
|
|
316
|
+
}
|
|
317
|
+
function withCreateLock(repoRoot, project, operation) {
|
|
318
|
+
const lockRoot = createLockRoot(project);
|
|
299
319
|
let callbackError;
|
|
300
320
|
try {
|
|
301
321
|
return withTaskExecutionLock(repoRoot, 'task-create', 'task-create', () => {
|
|
@@ -306,7 +326,7 @@ function withCreateLock(repoRoot, workspaceRoot, operation) {
|
|
|
306
326
|
callbackError = error;
|
|
307
327
|
throw error;
|
|
308
328
|
}
|
|
309
|
-
}, { lockRoot });
|
|
329
|
+
}, { lockRoot, identityScope: `task-create\0${project}` });
|
|
310
330
|
}
|
|
311
331
|
catch (error) {
|
|
312
332
|
if (callbackError !== undefined)
|
|
@@ -318,45 +338,24 @@ function withCreateLock(repoRoot, workspaceRoot, operation) {
|
|
|
318
338
|
throw new Error(`TASK_CREATE_LOCK_FAILED: ${message}`);
|
|
319
339
|
}
|
|
320
340
|
}
|
|
321
|
-
function
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
try {
|
|
325
|
-
fs.renameSync(temporary, receiptPath);
|
|
326
|
-
}
|
|
327
|
-
catch (error) {
|
|
328
|
-
try {
|
|
329
|
-
fs.unlinkSync(temporary);
|
|
330
|
-
}
|
|
331
|
-
catch { /* best effort */ }
|
|
332
|
-
throw error;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
function recoverPublishedTask(activeRoot, repoRoot, keyDigest, candidateDigest) {
|
|
336
|
-
for (const name of fs.readdirSync(activeRoot)) {
|
|
337
|
-
if (!/^TASK-\d{8}-\d{6}$/.test(name))
|
|
338
|
-
continue;
|
|
339
|
-
const taskDir = path.join(activeRoot, name);
|
|
340
|
-
const stat = fs.lstatSync(taskDir);
|
|
341
|
-
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
342
|
-
continue;
|
|
343
|
-
const taskMd = path.join(taskDir, 'task.md');
|
|
344
|
-
if (!fs.existsSync(taskMd))
|
|
345
|
-
continue;
|
|
341
|
+
function recoverPublishedTask(repoRoot, keyDigest, candidateDigest) {
|
|
342
|
+
for (const task of enumerateAllTaskDirs(repoRoot)) {
|
|
343
|
+
const taskMd = path.join(task.taskDir, 'task.md');
|
|
346
344
|
const taskStat = fs.lstatSync(taskMd);
|
|
347
345
|
if (!taskStat.isFile() || taskStat.isSymbolicLink())
|
|
346
|
+
throw new Error('TASK_CREATE_TASK_INVALID');
|
|
347
|
+
const frontmatter = parseTaskFrontmatter(fs.readFileSync(taskMd, 'utf8'));
|
|
348
|
+
if (frontmatter.task_create_key_digest !== keyDigest)
|
|
348
349
|
continue;
|
|
349
|
-
|
|
350
|
-
if (!content.includes(`task_create_key_digest: ${keyDigest}`))
|
|
351
|
-
continue;
|
|
352
|
-
if (!content.includes(`task_create_candidate_digest: ${candidateDigest}`)) {
|
|
350
|
+
if (frontmatter.task_create_candidate_digest !== candidateDigest) {
|
|
353
351
|
throw new Error('TASK_CREATE_IDEMPOTENCY_CONFLICT');
|
|
354
352
|
}
|
|
355
|
-
const shortId =
|
|
356
|
-
?? mutateShortIdRegistry(repoRoot,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
353
|
+
const shortId = task.state === 'active'
|
|
354
|
+
? loadShortIdByTaskId(repoRoot).get(task.taskId) ?? mutateShortIdRegistry(repoRoot, task.taskId, 'alloc').shortId
|
|
355
|
+
: null;
|
|
356
|
+
if (task.state === 'active' && !shortId)
|
|
357
|
+
throw new Error('TASK_CREATE_SHORT_ID_FAILED');
|
|
358
|
+
return { taskId: task.taskId, shortId, state: task.state };
|
|
360
359
|
}
|
|
361
360
|
return null;
|
|
362
361
|
}
|
|
@@ -376,30 +375,10 @@ function createLocalTask(value, options) {
|
|
|
376
375
|
const canonical = canonicalTaskCreateCandidate(candidate);
|
|
377
376
|
const candidateDigest = sha256(canonical);
|
|
378
377
|
const keyDigest = sha256(candidate.idempotencyKey);
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
if (fs.existsSync(receipts))
|
|
382
|
-
assertRealDirectory(receipts, 'TASK_CREATE_RECEIPT_INVALID');
|
|
383
|
-
const receiptPath = path.join(receipts, `${keyDigest}.json`);
|
|
384
|
-
if (fs.existsSync(receiptPath)) {
|
|
385
|
-
const stat = fs.lstatSync(receiptPath);
|
|
386
|
-
if (!stat.isFile() || stat.isSymbolicLink())
|
|
387
|
-
throw new Error('TASK_CREATE_RECEIPT_INVALID');
|
|
388
|
-
const receipt = JSON.parse(fs.readFileSync(receiptPath, 'utf8'));
|
|
389
|
-
if (receipt.candidateDigest !== candidateDigest)
|
|
390
|
-
throw new Error('TASK_CREATE_IDEMPOTENCY_CONFLICT');
|
|
391
|
-
if (!receipt.taskId || !receipt.shortId || !fs.existsSync(path.join(activeRoot, receipt.taskId, 'task.md'))) {
|
|
392
|
-
throw new Error('TASK_CREATE_RECEIPT_INVALID');
|
|
393
|
-
}
|
|
394
|
-
return { status: 'no-op', changed: false, task: { id: receipt.taskId, shortId: receipt.shortId } };
|
|
395
|
-
}
|
|
396
|
-
const recovered = recoverPublishedTask(activeRoot, repoRoot, keyDigest, candidateDigest);
|
|
378
|
+
function createUnderRepositoryLock() {
|
|
379
|
+
const recovered = recoverPublishedTask(repoRoot, keyDigest, candidateDigest);
|
|
397
380
|
if (recovered) {
|
|
398
|
-
|
|
399
|
-
writeReceipt(receiptPath, {
|
|
400
|
-
version: 1, candidateDigest, taskId: recovered.taskId, shortId: recovered.shortId, status: 'recovered'
|
|
401
|
-
});
|
|
402
|
-
return { status: 'no-op', changed: false, task: { id: recovered.taskId, shortId: recovered.shortId } };
|
|
381
|
+
return { status: 'no-op', changed: false, task: { id: recovered.taskId, shortId: recovered.shortId, state: recovered.state } };
|
|
403
382
|
}
|
|
404
383
|
const base = options.now?.() ?? new Date();
|
|
405
384
|
let taskDate = new Date(base.getTime());
|
|
@@ -418,32 +397,34 @@ function createLocalTask(value, options) {
|
|
|
418
397
|
agentInfraVersion, keyDigest, candidateDigest
|
|
419
398
|
});
|
|
420
399
|
validateRenderedQualification(rendered, candidate);
|
|
421
|
-
ensureRealDirectory(receipts, 'TASK_CREATE_RECEIPT_INVALID');
|
|
422
400
|
const temporary = path.join(workspaceRoot, `.task-create.tmp.${process.pid}.${randomUUID()}`);
|
|
423
401
|
fs.mkdirSync(temporary, { mode: 0o700 });
|
|
424
402
|
fs.writeFileSync(path.join(temporary, 'task.md'), rendered, { flag: 'wx', mode: 0o600 });
|
|
425
403
|
const destination = path.join(activeRoot, taskId);
|
|
426
404
|
fs.renameSync(temporary, destination);
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
catch (error) {
|
|
435
|
-
fs.rmSync(destination, { recursive: true, force: true });
|
|
436
|
-
throw error;
|
|
437
|
-
}
|
|
405
|
+
const allocated = mutateShortIdRegistry(repoRoot, taskId, 'alloc');
|
|
406
|
+
if (!allocated.shortId)
|
|
407
|
+
throw new Error('TASK_CREATE_SHORT_ID_FAILED');
|
|
408
|
+
return { status: 'applied', changed: true, task: { id: taskId, shortId: allocated.shortId, state: 'active' } };
|
|
409
|
+
}
|
|
410
|
+
return withCreateLock(repoRoot, projectConfig.project, () => {
|
|
411
|
+
let callbackError;
|
|
438
412
|
try {
|
|
439
|
-
|
|
413
|
+
return withRepositoryMutationLock(repoRoot, () => {
|
|
414
|
+
try {
|
|
415
|
+
return createUnderRepositoryLock();
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
callbackError = error;
|
|
419
|
+
throw error;
|
|
420
|
+
}
|
|
421
|
+
});
|
|
440
422
|
}
|
|
441
423
|
catch (error) {
|
|
442
|
-
|
|
443
|
-
|
|
424
|
+
if (callbackError !== undefined)
|
|
425
|
+
throw callbackError;
|
|
444
426
|
throw error;
|
|
445
427
|
}
|
|
446
|
-
return { status: 'applied', changed: true, task: { id: taskId, shortId } };
|
|
447
428
|
});
|
|
448
429
|
}
|
|
449
430
|
export { canonicalTaskCreateCandidate, createLocalTask, validateTaskCreateCandidate };
|