@fitlab-ai/agent-infra 0.9.12 → 0.9.13
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/README.md +11 -11
- package/README.zh-CN.md +11 -11
- package/dist/bin/internal-cli.js +24 -19
- package/dist/lib/agent-clients/next-steps.js +6 -1
- package/dist/lib/decide.js +3 -3
- package/dist/lib/internal/platform-checks.js +3 -3
- package/dist/lib/internal/platform-comment.js +9 -9
- package/dist/lib/internal/platform-context.js +2 -2
- package/dist/lib/internal/platform-issue.js +8 -9
- package/dist/lib/internal/platform-pr-review.js +10 -10
- package/dist/lib/internal/platform-pr.js +63 -24
- package/dist/lib/internal/platform-release-notes.js +3 -3
- package/dist/lib/internal/pr-review-grade.js +11 -9
- package/dist/lib/internal/release-workflow.js +4 -4
- package/dist/lib/internal/sandbox-control.js +30 -4
- package/dist/lib/internal/task-activity.js +3 -3
- package/dist/lib/internal/task-artifact.js +76 -24
- package/dist/lib/internal/task-create.js +2 -2
- package/dist/lib/internal/task-event.js +6 -3
- package/dist/lib/internal/task-finalization.js +2 -2
- package/dist/lib/internal/task-invalidation.js +60 -0
- package/dist/lib/internal/task-ledger.js +9 -6
- package/dist/lib/internal/task-lifecycle.js +2 -2
- package/dist/lib/internal/task-override.js +4 -4
- package/dist/lib/internal/task-review.js +3 -3
- package/dist/lib/internal/task-verify.js +6 -6
- package/dist/lib/internal/task-warning.js +3 -3
- package/dist/lib/platform/adapters.js +1 -3
- package/dist/lib/platform/change-request-git-evidence.js +27 -7
- package/dist/lib/platform/completion-backfill.js +6 -5
- package/dist/lib/platform/context.js +70 -130
- package/dist/lib/platform/github-client.js +1 -1
- package/dist/lib/platform/github-provider.js +903 -0
- package/dist/lib/platform/in-label-sync.js +143 -0
- package/dist/lib/platform/issue-comments.js +94 -41
- package/dist/lib/platform/issues.js +335 -189
- package/dist/lib/platform/metadata-labels.js +6 -2
- package/dist/lib/platform/none-provider.js +28 -0
- package/dist/lib/platform/pr-change-report.js +551 -0
- package/dist/lib/platform/pr-checks.js +119 -104
- package/dist/lib/platform/pr-review.js +88 -72
- package/dist/lib/platform/pr-summary.js +520 -50
- package/dist/lib/platform/provider-bridge.js +45 -0
- package/dist/lib/platform/provider-contract.d.ts +487 -0
- package/dist/lib/platform/provider-contract.js +95 -0
- package/dist/lib/platform/provider-loader.js +251 -0
- package/dist/lib/platform/provider-validation.js +504 -0
- package/dist/lib/platform/pull-request-metadata.js +8 -6
- package/dist/lib/platform/pull-requests.js +783 -537
- package/dist/lib/platform/release-notes.js +78 -55
- package/dist/lib/platform/releases.js +79 -50
- package/dist/lib/platform/resource-identity.d.ts +26 -0
- package/dist/lib/platform/resource-identity.js +92 -0
- package/dist/lib/platform/task-identities.js +31 -0
- package/dist/lib/platform/verification-required.js +11 -12
- package/dist/lib/platform/verification-sync.js +112 -238
- package/dist/lib/pr-review/evidence-grading.js +19 -6
- package/dist/lib/run/index.js +63 -23
- package/dist/lib/sandbox/control/client.js +96 -15
- package/dist/lib/sandbox/control/executor.js +3 -3
- package/dist/lib/sandbox/control/protocol.js +77 -0
- package/dist/lib/sandbox/control/server.js +398 -25
- package/dist/lib/sandbox/control/state.js +204 -1
- package/dist/lib/server/protocol.js +38 -1
- package/dist/lib/task/activity-log.js +8 -1
- package/dist/lib/task/artifact-lifecycle.js +33 -5
- package/dist/lib/task/capabilities.js +239 -0
- package/dist/lib/task/commands/status.js +32 -0
- package/dist/lib/task/commit-operation.js +12 -1
- package/dist/lib/task/control-authority.js +8 -5
- package/dist/lib/task/create-service.js +8 -8
- package/dist/lib/task/current-contract.js +5 -1
- package/dist/lib/task/decision-details.js +1 -1
- package/dist/lib/task/events.js +297 -17
- package/dist/lib/task/finalization.js +37 -13
- package/dist/lib/task/human-override.js +58 -36
- package/dist/lib/task/invalidation-command.js +86 -0
- package/dist/lib/task/invalidation.js +260 -0
- package/dist/lib/task/ledger-intents.js +37 -0
- package/dist/lib/task/local-artifact-finalization.js +374 -0
- package/dist/lib/task/orchestration.js +49 -93
- package/dist/lib/task/pr-delivery-fact.js +102 -101
- package/dist/lib/task/review-fingerprint.js +24 -2
- package/dist/lib/task/rework-intent.js +138 -0
- package/dist/lib/task/skill-scope.js +23 -0
- package/dist/lib/task/task-execution-lock.js +27 -17
- package/dist/lib/task/verification-engine.js +43 -16
- package/dist/lib/task/verification.js +3 -3
- package/dist/lib/task/workflow-warning-intents.js +1 -1
- package/dist/lib/task/write.js +11 -0
- package/dist/lib/version.js +11 -1
- package/dist/lifecycle-build-manifest.json +3 -3
- package/lib/agent-clients/next-steps.ts +6 -1
- package/lib/decide.ts +3 -3
- package/lib/init.ts +1 -1
- package/lib/internal/platform-checks.ts +3 -3
- package/lib/internal/platform-comment.ts +8 -8
- package/lib/internal/platform-context.ts +2 -2
- package/lib/internal/platform-issue.ts +7 -8
- package/lib/internal/platform-pr-review.ts +9 -9
- package/lib/internal/platform-pr.ts +47 -22
- package/lib/internal/platform-release-notes.ts +3 -3
- package/lib/internal/pr-review-grade.ts +10 -8
- package/lib/internal/release-workflow.ts +4 -4
- package/lib/internal/sandbox-control.ts +27 -3
- package/lib/internal/task-activity.ts +3 -3
- package/lib/internal/task-artifact.ts +65 -22
- package/lib/internal/task-create.ts +2 -2
- package/lib/internal/task-event.ts +6 -3
- package/lib/internal/task-finalization.ts +3 -3
- package/lib/internal/task-invalidation.ts +39 -0
- package/lib/internal/task-ledger.ts +11 -8
- package/lib/internal/task-lifecycle.ts +2 -2
- package/lib/internal/task-override.ts +6 -6
- package/lib/internal/task-review.ts +3 -3
- package/lib/internal/task-verify.ts +6 -6
- package/lib/internal/task-warning.ts +3 -3
- package/lib/platform/adapters.ts +3 -2
- package/lib/platform/change-request-git-evidence.ts +36 -9
- package/lib/platform/completion-backfill.ts +9 -8
- package/lib/platform/context.ts +97 -134
- package/lib/platform/github-client.ts +2 -2
- package/lib/platform/github-provider.ts +910 -0
- package/lib/platform/in-label-sync.ts +208 -0
- package/lib/platform/issue-comments.ts +97 -47
- package/lib/platform/issues.ts +344 -174
- package/lib/platform/metadata-labels.ts +5 -2
- package/lib/platform/none-provider.ts +35 -0
- package/lib/platform/pr-change-report.ts +645 -0
- package/lib/platform/pr-checks.ts +126 -106
- package/lib/platform/pr-review.ts +88 -85
- package/lib/platform/pr-summary.ts +560 -53
- package/lib/platform/provider-bridge.ts +82 -0
- package/lib/platform/provider-contract.ts +536 -0
- package/lib/platform/provider-loader.ts +307 -0
- package/lib/platform/provider-validation.ts +529 -0
- package/lib/platform/pull-request-metadata.ts +10 -7
- package/lib/platform/pull-requests.ts +826 -543
- package/lib/platform/release-notes.ts +76 -59
- package/lib/platform/releases.ts +77 -43
- package/lib/platform/resource-identity.ts +121 -0
- package/lib/platform/task-identities.ts +40 -0
- package/lib/platform/types.ts +4 -2
- package/lib/platform/verification-required.ts +11 -13
- package/lib/platform/verification-sync.ts +112 -292
- package/lib/pr-review/evidence-grading.ts +25 -8
- package/lib/run/index.ts +57 -22
- package/lib/sandbox/control/client.ts +105 -15
- package/lib/sandbox/control/executor.ts +4 -4
- package/lib/sandbox/control/protocol.ts +113 -0
- package/lib/sandbox/control/server.ts +431 -23
- package/lib/sandbox/control/state.ts +251 -1
- package/lib/server/protocol.ts +36 -1
- package/lib/task/activity-log.ts +8 -0
- package/lib/task/artifact-lifecycle.ts +32 -6
- package/lib/task/capabilities.ts +262 -0
- package/lib/task/commands/status.ts +38 -0
- package/lib/task/commit-operation.ts +12 -1
- package/lib/task/control-authority.ts +11 -8
- package/lib/task/create-service.ts +8 -8
- package/lib/task/current-contract.ts +6 -1
- package/lib/task/decision-details.ts +6 -2
- package/lib/task/events.ts +296 -16
- package/lib/task/finalization.ts +50 -14
- package/lib/task/human-override.ts +70 -46
- package/lib/task/invalidation-command.ts +86 -0
- package/lib/task/invalidation.ts +332 -0
- package/lib/task/ledger-intents.ts +35 -1
- package/lib/task/local-artifact-finalization.ts +563 -0
- package/lib/task/orchestration.ts +52 -85
- package/lib/task/pr-delivery-fact.ts +131 -148
- package/lib/task/review-fingerprint.ts +23 -2
- package/lib/task/rework-intent.ts +165 -0
- package/lib/task/skill-scope.ts +24 -0
- package/lib/task/task-execution-lock.ts +23 -14
- package/lib/task/verification-engine.ts +52 -17
- package/lib/task/verification.ts +4 -4
- package/lib/task/workflow-warning-intents.ts +1 -1
- package/lib/task/write.ts +19 -0
- package/lib/update.ts +1 -1
- package/lib/version.ts +15 -1
- package/package.json +7 -1
- package/templates/.agents/rules/README.en.md +1 -1
- package/templates/.agents/rules/README.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.en.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-sync.en.md +2 -0
- package/templates/.agents/rules/issue-sync.zh-CN.md +2 -0
- package/templates/.agents/rules/local-artifact-repair.en.md +9 -2
- package/templates/.agents/rules/local-artifact-repair.zh-CN.md +9 -2
- package/templates/.agents/rules/pr-sync.en.md +10 -4
- package/templates/.agents/rules/pr-sync.zh-CN.md +17 -4
- package/templates/.agents/rules/task-short-id.en.md +1 -4
- package/templates/.agents/rules/task-short-id.zh-CN.md +1 -3
- package/templates/.agents/skills/analyze-task/SKILL.en.md +13 -3
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +10 -3
- package/templates/.agents/skills/check-task/SKILL.en.md +16 -37
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -37
- package/templates/.agents/skills/code-task/SKILL.en.md +27 -8
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +29 -10
- package/templates/.agents/skills/code-task/config/verify.en.json +1 -0
- package/templates/.agents/skills/code-task/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +2 -0
- package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +2 -0
- package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +3 -3
- package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +3 -3
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +5 -3
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +4 -3
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +4 -3
- package/templates/.agents/skills/complete-task/SKILL.en.md +21 -3
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +20 -3
- package/templates/.agents/skills/create-pr/SKILL.en.md +7 -6
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +7 -7
- package/templates/.agents/skills/create-pr/config/verify.json +1 -0
- package/templates/.agents/skills/create-pr/reference/change-report.en.md +16 -4
- package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +16 -4
- package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +5 -3
- package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +5 -3
- package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +1 -1
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +1 -1
- package/templates/.agents/skills/create-pr/scripts/change-report.mjs +3 -0
- package/templates/.agents/skills/plan-task/SKILL.en.md +13 -3
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +10 -3
- package/templates/.agents/skills/review-analysis/SKILL.en.md +3 -3
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/review-code/SKILL.en.md +4 -4
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/review-plan/SKILL.en.md +3 -3
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +4 -2
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +4 -2
- package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +6 -0
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +6 -0
- package/templates/.agents/templates/task.en.md +18 -1
- package/templates/.agents/templates/task.zh-CN.md +18 -1
- package/templates/.github/workflows/pr-label.yml +7 -26
|
@@ -11,6 +11,9 @@ import { getOpenWorkflowWarnings, formatWorkflowWarningSummary } from '../workfl
|
|
|
11
11
|
import { parseActivityLog, pairEntries, startedBackedRows } from '../activity-log.js';
|
|
12
12
|
import { readRun } from '../orchestration.js';
|
|
13
13
|
import { statusCard } from '../../server/display.js';
|
|
14
|
+
import { invalidationBlocks, parseInvalidationDocument } from '../invalidation.js';
|
|
15
|
+
import { parseReworkIntentDocument } from '../rework-intent.js';
|
|
16
|
+
import { buildLifecycleFacts, recommendNext } from '../capabilities.js';
|
|
14
17
|
const USAGE = `Usage: ai task status [--task <ref> | -t <ref>]
|
|
15
18
|
|
|
16
19
|
Prints an aggregated "health check" view for a task: header, metadata,
|
|
@@ -317,6 +320,12 @@ function renderStatus(model) {
|
|
|
317
320
|
else {
|
|
318
321
|
lines.push(...renderPairs(model.artifacts.groups.map((group) => [group.stage, group.files.join(', ')])));
|
|
319
322
|
}
|
|
323
|
+
lines.push('', 'Invalidation', ...renderPairs([
|
|
324
|
+
['status', model.invalidation?.status ?? 'unknown'],
|
|
325
|
+
['processed', `${model.invalidation?.processed ?? 0}/${model.invalidation?.total ?? 0}`],
|
|
326
|
+
['pending_intents', String(model.invalidation?.pendingIntents ?? 0)]
|
|
327
|
+
]));
|
|
328
|
+
lines.push('', 'Recommendation', ...renderPairs([['action', model.recommendation ?? DASH]]));
|
|
320
329
|
lines.push('', 'Orchestration', ...renderPairs([
|
|
321
330
|
['status', model.orchestration.status],
|
|
322
331
|
['run_id', model.orchestration.runId],
|
|
@@ -361,6 +370,10 @@ function renderStatus(model) {
|
|
|
361
370
|
return lines;
|
|
362
371
|
}
|
|
363
372
|
function modelTone(model) {
|
|
373
|
+
if (model.invalidation?.status === 'invalid')
|
|
374
|
+
return 'danger';
|
|
375
|
+
if (model.invalidation?.status === 'pending' || model.invalidation?.status === 'in-progress')
|
|
376
|
+
return 'warning';
|
|
364
377
|
if (model.orchestration.status === 'paused')
|
|
365
378
|
return 'warning';
|
|
366
379
|
if (model.orchestration.status === 'running')
|
|
@@ -382,6 +395,23 @@ function buildFromResolved(input) {
|
|
|
382
395
|
const run = input.run ?? makeRunner(input.repoRoot);
|
|
383
396
|
const artifacts = enumerateArtifacts(input.taskDir);
|
|
384
397
|
const workflow = collectWorkflow(content, input.now);
|
|
398
|
+
const invalidation = parseInvalidationDocument(content);
|
|
399
|
+
const rework = parseReworkIntentDocument(content);
|
|
400
|
+
const pendingIntents = rework.ok ? rework.intents.filter((intent) => intent.status === 'pending').length : 0;
|
|
401
|
+
const invalidationInfo = !invalidation.ok
|
|
402
|
+
? { status: 'invalid', processed: 0, total: 0, pendingIntents }
|
|
403
|
+
: {
|
|
404
|
+
status: invalidation.present
|
|
405
|
+
? invalidationBlocks(invalidation.document)
|
|
406
|
+
? invalidation.document.operations.some((operation) => operation.status === 'in-progress') ? 'in-progress' : 'pending'
|
|
407
|
+
: 'completed'
|
|
408
|
+
: 'none',
|
|
409
|
+
processed: invalidation.document.operations.reduce((sum, operation) => sum + operation.processed, 0),
|
|
410
|
+
total: invalidation.document.operations.reduce((sum, operation) => sum + operation.total, 0),
|
|
411
|
+
pendingIntents
|
|
412
|
+
};
|
|
413
|
+
const facts = buildLifecycleFacts(input.taskDir, content, fm.status ?? 'active');
|
|
414
|
+
const recommendation = facts.ok ? (recommendNext(facts.facts).action ?? DASH) : DASH;
|
|
385
415
|
return {
|
|
386
416
|
taskId: input.taskId,
|
|
387
417
|
shortId: input.shortId ?? loadShortIdByTaskId(input.repoRoot).get(input.taskId) ?? DASH,
|
|
@@ -392,6 +422,8 @@ function buildFromResolved(input) {
|
|
|
392
422
|
workflow,
|
|
393
423
|
runtime: collectRuntime(input.taskDir, workflow, run),
|
|
394
424
|
orchestration: collectOrchestration(input.taskDir),
|
|
425
|
+
invalidation: invalidationInfo,
|
|
426
|
+
recommendation,
|
|
395
427
|
git: collectGit(fm.branch ?? '', run)
|
|
396
428
|
};
|
|
397
429
|
}
|
|
@@ -123,7 +123,18 @@ function syncTaskCommit(input, task, committedHead) {
|
|
|
123
123
|
return warning('TASK_STATUS_SYNC_FAILED', 'task has no unique Activity Log section', true, 'task', task.taskId, 'ACTION_REQUIRED');
|
|
124
124
|
const metadata = captureTaskWriteMetadata();
|
|
125
125
|
const commitNote = gitText(task.repoRoot, ['show', '-s', '--format=%h %s', committedHead]);
|
|
126
|
-
|
|
126
|
+
let matchingCommitIndex = -1;
|
|
127
|
+
for (let index = activity.entries.length - 1; index >= 0; index -= 1) {
|
|
128
|
+
const entry = activity.entries[index];
|
|
129
|
+
if (entry.step === 'Commit' && entry.note === commitNote) {
|
|
130
|
+
matchingCommitIndex = index;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const reviewedAfterCommit = matchingCommitIndex >= 0 && activity.entries
|
|
135
|
+
.slice(matchingCommitIndex + 1)
|
|
136
|
+
.some((entry) => /^Review Code \(Round \d+\)$/.test(entry.step));
|
|
137
|
+
const alreadyLogged = matchingCommitIndex >= 0 && !reviewedAfterCommit;
|
|
127
138
|
const mutations = [];
|
|
128
139
|
if (!alreadyLogged)
|
|
129
140
|
mutations.push({
|
|
@@ -101,12 +101,12 @@ function lifecycleTaskId(request, repoRoot) {
|
|
|
101
101
|
return null;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function applyLifecycleWithAuthority(context, request) {
|
|
104
|
+
async function applyLifecycleWithAuthority(context, request) {
|
|
105
105
|
const conflict = overrideDryRunConflict(request);
|
|
106
106
|
if (conflict) {
|
|
107
107
|
return taskLifecycleFailure(request, { code: 'LIFECYCLE_PAYLOAD_INVALID', message: conflict.message });
|
|
108
108
|
}
|
|
109
|
-
const execute = () => {
|
|
109
|
+
const execute = async () => {
|
|
110
110
|
const lifecycleResult = applyTaskLifecycle(request, { repoRoot: context.repoRoot });
|
|
111
111
|
if (lifecycleResult.status !== 'failed' || !request.overrideTicket)
|
|
112
112
|
return lifecycleResult;
|
|
@@ -116,7 +116,7 @@ function applyLifecycleWithAuthority(context, request) {
|
|
|
116
116
|
error: { code: 'OVERRIDE_PAYLOAD_INVALID', message: 'override ticket requires --override-target and --override-scope' }
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
const override = consumeHumanOverride({
|
|
119
|
+
const override = await consumeHumanOverride({
|
|
120
120
|
taskRef: request.taskRef,
|
|
121
121
|
ticketId: request.overrideTicket,
|
|
122
122
|
failureId: failureId('lifecycle.apply', lifecycleResult.error?.code ?? 'LIFECYCLE_FAILED'),
|
|
@@ -133,9 +133,9 @@ function applyLifecycleWithAuthority(context, request) {
|
|
|
133
133
|
};
|
|
134
134
|
const taskId = lifecycleTaskId(request, context.repoRoot);
|
|
135
135
|
if (!taskId)
|
|
136
|
-
return execute();
|
|
136
|
+
return await execute();
|
|
137
137
|
try {
|
|
138
|
-
return withTaskExecutionLock(context.repoRoot, taskId, `task-lifecycle.${request.intent}`, execute);
|
|
138
|
+
return await withTaskExecutionLock(context.repoRoot, taskId, `task-lifecycle.${request.intent}`, execute);
|
|
139
139
|
}
|
|
140
140
|
catch (error) {
|
|
141
141
|
if (!(error instanceof TaskExecutionLockError))
|
|
@@ -210,6 +210,9 @@ export function dispatchTaskControlOperation(context, operation) {
|
|
|
210
210
|
operationTaskId(context, operation.request.taskRef);
|
|
211
211
|
return applyTaskFinalization(operation.request, {
|
|
212
212
|
repoRoot: context.repoRoot,
|
|
213
|
+
...(context.source === 'sandbox-executor' ? {
|
|
214
|
+
controlBinding: { generation: context.generation, requestId: context.requestId }
|
|
215
|
+
} : {}),
|
|
213
216
|
preflight: (request, options) => verifyTaskEvent({ ...request, event: 'complete-task.hard-preflight' }, options)
|
|
214
217
|
});
|
|
215
218
|
}
|
|
@@ -12,8 +12,8 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
12
12
|
syncComment: syncPlatformComment,
|
|
13
13
|
addWarning: applyWorkflowWarningIntent
|
|
14
14
|
};
|
|
15
|
-
function verifyCreatedTask(repoRoot, taskId) {
|
|
16
|
-
const verification = verifyTaskEvent({ taskRef: taskId, event: 'create-task.completed' }, { repoRoot });
|
|
15
|
+
async function verifyCreatedTask(repoRoot, taskId) {
|
|
16
|
+
const verification = await verifyTaskEvent({ taskRef: taskId, event: 'create-task.completed' }, { repoRoot });
|
|
17
17
|
if (verification.status === 'pass') {
|
|
18
18
|
return { operation: { name: 'task:verify', status: 'pass', reasonCode: null }, error: null };
|
|
19
19
|
}
|
|
@@ -42,7 +42,7 @@ function issueFromTask(repoRoot, taskId) {
|
|
|
42
42
|
const match = /^issue_number:\s*(\d+)\s*$/m.exec(content);
|
|
43
43
|
return match ? { number: Number(match[1]), url: '' } : null;
|
|
44
44
|
}
|
|
45
|
-
function createTask(value, options) {
|
|
45
|
+
async function createTask(value, options) {
|
|
46
46
|
const dependencies = { ...DEFAULT_DEPENDENCIES, ...options.dependencies };
|
|
47
47
|
let candidate;
|
|
48
48
|
let local;
|
|
@@ -65,13 +65,13 @@ function createTask(value, options) {
|
|
|
65
65
|
name: 'task:local', status: local.status, reasonCode: null
|
|
66
66
|
}];
|
|
67
67
|
let issue = issueFromTask(options.repoRoot, local.task.id);
|
|
68
|
-
const created = dependencies.createIssue(local.task.id, { cwd: options.repoRoot, agent: candidate.agent });
|
|
68
|
+
const created = await dependencies.createIssue(local.task.id, { cwd: options.repoRoot, agent: candidate.agent });
|
|
69
69
|
operations.push(...platformOperations('platform-create', created.operations));
|
|
70
70
|
if (created.issue)
|
|
71
71
|
issue = { number: created.issue.number, url: created.issue.url };
|
|
72
72
|
let platformFailure = created.status === 'failed' || created.status === 'blocked' ? created : null;
|
|
73
73
|
if (!platformFailure && (created.task.issueNumber || issue)) {
|
|
74
|
-
const synced = dependencies.syncIssue(local.task.id, {
|
|
74
|
+
const synced = await dependencies.syncIssue(local.task.id, {
|
|
75
75
|
cwd: options.repoRoot,
|
|
76
76
|
agent: candidate.agent,
|
|
77
77
|
status: 'waiting-for-triage',
|
|
@@ -86,7 +86,7 @@ function createTask(value, options) {
|
|
|
86
86
|
if (synced.status === 'failed' || synced.status === 'blocked')
|
|
87
87
|
platformFailure = synced;
|
|
88
88
|
if (!platformFailure) {
|
|
89
|
-
const commented = dependencies.syncComment(local.task.id, { cwd: options.repoRoot, kind: 'task', agent: candidate.agent });
|
|
89
|
+
const commented = await dependencies.syncComment(local.task.id, { cwd: options.repoRoot, kind: 'task', agent: candidate.agent });
|
|
90
90
|
operations.push(...platformOperations('platform-comment', commented.operations));
|
|
91
91
|
if (commented.status === 'failed' || commented.status === 'blocked')
|
|
92
92
|
platformFailure = commented;
|
|
@@ -99,7 +99,7 @@ function createTask(value, options) {
|
|
|
99
99
|
code: 'ISSUE_CREATE_FAILED', target: 'issue', message: `${error.code}: ${error.message}`,
|
|
100
100
|
action: 'Fix platform authentication or connectivity, then retry Issue creation for this task.'
|
|
101
101
|
}, { repoRoot: options.repoRoot });
|
|
102
|
-
const verified = verifyCreatedTask(options.repoRoot, local.task.id);
|
|
102
|
+
const verified = await verifyCreatedTask(options.repoRoot, local.task.id);
|
|
103
103
|
operations.push(verified.operation);
|
|
104
104
|
if (verified.error)
|
|
105
105
|
return {
|
|
@@ -116,7 +116,7 @@ function createTask(value, options) {
|
|
|
116
116
|
error
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
const verified = verifyCreatedTask(options.repoRoot, local.task.id);
|
|
119
|
+
const verified = await verifyCreatedTask(options.repoRoot, local.task.id);
|
|
120
120
|
operations.push(verified.operation);
|
|
121
121
|
if (verified.error)
|
|
122
122
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isValidAgentInfraVersion } from '../version.js';
|
|
2
2
|
import { parseTypedTaskFrontmatter } from './frontmatter.js';
|
|
3
3
|
import { LEDGER_SECTION_MISSING_CODE, LEDGER_SECTION_MISSING_MESSAGE, parseLedgerDocument, validateLedgerRows } from './ledger.js';
|
|
4
|
+
import { parseInvalidationDocument } from './invalidation.js';
|
|
4
5
|
function validateCurrentTaskContract(content) {
|
|
5
6
|
let metadata;
|
|
6
7
|
try {
|
|
@@ -29,7 +30,10 @@ function validateCurrentTaskContract(content) {
|
|
|
29
30
|
const invalid = validateLedgerRows(ledger.rows);
|
|
30
31
|
if (invalid)
|
|
31
32
|
return { ok: false, code: 'TASK_CURRENT_CONTRACT_INVALID', message: `${invalid.code}: ${invalid.message}` };
|
|
32
|
-
|
|
33
|
+
const invalidation = parseInvalidationDocument(content);
|
|
34
|
+
if (!invalidation.ok)
|
|
35
|
+
return { ok: false, code: 'TASK_CURRENT_CONTRACT_INVALID', message: `${invalidation.code}: ${invalidation.message}` };
|
|
36
|
+
return { ok: true, metadata, ledger, invalidation: invalidation.document };
|
|
33
37
|
}
|
|
34
38
|
export { validateCurrentTaskContract };
|
|
35
39
|
//# sourceMappingURL=current-contract.js.map
|
|
@@ -214,5 +214,5 @@ function normalizeDecisionDetailForDisplay(block) {
|
|
|
214
214
|
ordered.push(byKey.get('implementation'));
|
|
215
215
|
return [body.slice(heading.start, heading.end).trim(), ...ordered].join('\n\n').trim();
|
|
216
216
|
}
|
|
217
|
-
export { inspectDecisionDetailDuplicates, normalizeDecisionDetailForDisplay, parseDecisionDetailBlocks, parseDecisionEvidence, resolveDecisionDetail };
|
|
217
|
+
export { inspectDecisionDetailDuplicates, normalizeDecisionDetailForDisplay, parseDecisionDetailBlocks, parseDecisionEvidence, resolveDecisionDetail, scanVisibleMarkdown };
|
|
218
218
|
//# sourceMappingURL=decision-details.js.map
|