agents-relay 2.0.209 → 2.0.211
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/cli-help.js +10 -4
- package/dist/cli-prompt.js +2 -1
- package/dist/cli-revision.js +49 -0
- package/dist/cli-worker-task.js +15 -0
- package/dist/cli.js +11 -2
- package/dist/dashboard-html.js +2 -2
- package/dist/dependency-revision-execution.js +152 -0
- package/dist/dependency-validity.js +17 -0
- package/dist/final-review-role.js +17 -0
- package/dist/force-restate-validation.js +3 -2
- package/dist/host-invocation-store.js +18 -4
- package/dist/interactive-invocation.js +37 -5
- package/dist/job-pr-number-migration.js +2 -1
- package/dist/managed-worker-input.js +2 -1
- package/dist/planner-agent-roles.js +18 -0
- package/dist/planner-runtime.js +7 -1
- package/dist/planner-task-ids.js +1 -0
- package/dist/planner.js +11 -6
- package/dist/reconciler-review.js +78 -96
- package/dist/reconciler-runtime.js +14 -5
- package/dist/reconciler.js +21 -11
- package/dist/relay-store.js +2 -0
- package/dist/relayd-control.js +31 -0
- package/dist/review-evidence.js +44 -0
- package/dist/review-generation-fence.js +2 -1
- package/dist/review-revision-execution.js +86 -0
- package/dist/review-revision-merge.js +15 -0
- package/dist/review-revision-model.js +191 -0
- package/dist/review-revision-policy.js +49 -0
- package/dist/review-revision-settlement.js +54 -0
- package/dist/review-revision-stale.js +57 -0
- package/dist/reviewer-thread.js +41 -1
- package/dist/runtime-status.js +13 -4
- package/dist/single-job-task-control.js +1 -1
- package/dist/task-context.js +3 -2
- package/dist/worker-failure-recovery.js +2 -1
- package/dist/workflow/dependency-revision-v2.js +16 -0
- package/dist/workflow/entity-creation.js +2 -0
- package/dist/workflow/review-v2.js +6 -2
- package/dist/workflow/revision-v2.js +32 -0
- package/dist/workflow/task-reconcile.js +3 -0
- package/package.json +1 -1
- package/skills/agents-relay/agents/job-acceptance-reviewer.agent.md +41 -0
- package/skills/agents-relay/agents/planner.agent.md +6 -3
- package/skills/agents-relay/contracts/event-contract.md +55 -1
- package/skills/agents-relay/contracts/task-job-contract.md +6 -0
- package/workflow/dependency-revision.mmd +30 -0
- package/workflow/interactive-invocation.mmd +8 -2
- package/workflow/review-lifecycle.mmd +40 -9
- package/workflow/revision-lifecycle.mmd +68 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isFinalReviewAgent } from './final-review-role.js';
|
|
1
2
|
import { deriveTaskTitle } from './task-title.js';
|
|
2
3
|
export function normalizeLegacyJobPrNumber(input) {
|
|
3
4
|
const record = input;
|
|
@@ -7,7 +8,7 @@ export function normalizeLegacyJobPrNumber(input) {
|
|
|
7
8
|
input.prNumber = Number(legacy);
|
|
8
9
|
delete record[legacyKey];
|
|
9
10
|
for (const task of input.tasks ?? []) {
|
|
10
|
-
if (task.id.startsWith('final-review-') && task.agentName
|
|
11
|
+
if (task.id.startsWith('final-review-') && isFinalReviewAgent(task.agentName) && /^Job ID:\s*\d+$/i.test(task.title?.trim() ?? '')) {
|
|
11
12
|
task.title = `Final review: ${input.title}`;
|
|
12
13
|
}
|
|
13
14
|
if (!task.title?.trim())
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isFinalReviewAgent } from './final-review-role.js';
|
|
1
2
|
import { buildAgentPrompt, buildRelayWorkPrompt, renderAgentPrompt } from './agent-prompt-builder.js';
|
|
2
3
|
import { resolveAgentContract } from './execution-context.js';
|
|
3
4
|
import { dirname, join } from 'node:path';
|
|
@@ -25,7 +26,7 @@ export async function managedWorkerInput(job, task, context, mode = 'production'
|
|
|
25
26
|
throw new Error(`Agent ${agentName} requires ${requiredRuntime} runtime; ${adapter} cannot launch this Task`);
|
|
26
27
|
}
|
|
27
28
|
const agent = selected.definition;
|
|
28
|
-
const role = agentName
|
|
29
|
+
const role = isFinalReviewAgent(agentName) ? 'reviewer' : agentName === 'planner' || agentName === 'troubleshooter' ? agentName : 'worker';
|
|
29
30
|
if (mode === 'evaluation') {
|
|
30
31
|
const safeAgent = agent.replace(/^.*(?:task\.started|task\.completed|task\.failed|events__publish|NEO_EVENTS_EMIT).*\n?/gm, '');
|
|
31
32
|
return renderAgentPrompt(buildAgentPrompt({ role, system: [safeAgent, '[Read-only evaluation safety boundary]\nDo not use tools, files, events or external services. Evaluate the role instructions as criteria only.'].filter(Boolean).join('\n\n'), user: `[Isolated prompt evaluation mode]\nTask: ${task.id}\n${task.input}` }), adapter);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isFinalReviewAgent } from './final-review-role.js';
|
|
2
|
+
/** One durable newly authored Task per effective Agent responsibility in each Plan.
|
|
3
|
+
* Null/blank agentName is the generic implementation role. Existing plans
|
|
4
|
+
* and later genuine revision rounds are not retroactively constrained.
|
|
5
|
+
*/
|
|
6
|
+
export function validatePlannerAgentRoles(specs) {
|
|
7
|
+
const owners = new Map();
|
|
8
|
+
for (const spec of specs) {
|
|
9
|
+
const role = spec.agentName?.trim() || 'implementation';
|
|
10
|
+
if (isFinalReviewAgent(role)) {
|
|
11
|
+
throw new Error(`Task ${spec.id} must not plan job-acceptance-reviewer: Relay creates the immutable-head Final Review gate automatically`);
|
|
12
|
+
}
|
|
13
|
+
const previous = owners.get(role);
|
|
14
|
+
if (previous)
|
|
15
|
+
throw new Error(`Tasks ${previous} and ${spec.id} have duplicate effective Agent role ${role}; consolidate all phases into one Task owned by that Agent in this Plan round. Future rounds may reuse the role for genuine revisions.`);
|
|
16
|
+
owners.set(role, spec.id);
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dist/planner-runtime.js
CHANGED
|
@@ -2,7 +2,7 @@ import { assignPlannerTaskIds } from './planner-task-ids.js';
|
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { jobHasActiveExecution } from './job-execution-slot.js';
|
|
4
4
|
import { eventFor } from './events.js';
|
|
5
|
-
import { materializePlannerChild, parsePlannerResult, validatePlannerHierarchy, validatePlannerLifecycleOwnership, validatePlannerProgress, validatePlannerResolutionMaterialization } from './planner.js';
|
|
5
|
+
import { materializePlannerChild, parsePlannerResult, validatePlannerHierarchy, validatePlannerAgentRoles, validatePlannerLifecycleOwnership, validatePlannerProgress, validatePlannerResolutionMaterialization } from './planner.js';
|
|
6
6
|
import { attachResolutionOwnership } from './workflow/task-resolution.js';
|
|
7
7
|
import { samePlannerChildDefinition } from './planner-child.js';
|
|
8
8
|
import { dispatchJobLifecycleSync } from './workflow/lifecycle.js';
|
|
@@ -184,6 +184,12 @@ export async function finishPlanner(ports, jobId, planId, executionId, error, ra
|
|
|
184
184
|
const historyCleanup = parsed.history_cleanup ?? [];
|
|
185
185
|
const result = assignPlannerTaskIds(parsed, job.repository, job.id, plan.id);
|
|
186
186
|
const executionContext = await ports.plannerContext(job, plan);
|
|
187
|
+
try {
|
|
188
|
+
validatePlannerAgentRoles(result.next_tasks);
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
throw new PlannerApplyValidationError('candidate', [error instanceof Error ? error.message : String(error)]);
|
|
192
|
+
}
|
|
187
193
|
validatePlannerHierarchy(job.tasks, result.next_tasks);
|
|
188
194
|
if (!plan.forceRestate)
|
|
189
195
|
validatePlannerResolutionMaterialization(job.tasks, result.next_tasks);
|
package/dist/planner-task-ids.js
CHANGED
|
@@ -10,6 +10,7 @@ export function assignPlannerTaskIds(result, repository, jobId, planId, director
|
|
|
10
10
|
id: aliases.get(spec.id),
|
|
11
11
|
parentTaskId: spec.parentTaskId ? (aliases.get(spec.parentTaskId) ?? spec.parentTaskId) : spec.parentTaskId,
|
|
12
12
|
dependencies: spec.dependencies?.map(dep => aliases.get(dep) ?? dep),
|
|
13
|
+
...(spec.dependencyValidity ? { dependencyValidity: Object.fromEntries(Object.entries(spec.dependencyValidity).map(([dep, policy]) => [aliases.get(dep) ?? dep, policy])) } : {}),
|
|
13
14
|
})),
|
|
14
15
|
};
|
|
15
16
|
}
|
package/dist/planner.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isFinalReviewAgent } from './final-review-role.js';
|
|
1
2
|
import { buildRelayWorkPrompt } from './agent-prompt-builder.js';
|
|
2
3
|
import { readFile } from 'node:fs/promises';
|
|
3
4
|
import { fileURLToPath } from 'node:url';
|
|
@@ -15,6 +16,7 @@ import { requiredPlannerTaskTitle } from './planner-task-title.js';
|
|
|
15
16
|
import { parsePlannerHistoryCleanup } from './planner-history-cleanup.js';
|
|
16
17
|
import { plannerTaskContext } from './planner-task-context.js';
|
|
17
18
|
import { relayStoreDirectory } from './local-job-path.js';
|
|
19
|
+
import { validateDependencyValidity } from './dependency-validity.js';
|
|
18
20
|
export function semanticTaskTree(tasks) {
|
|
19
21
|
const work = tasks.filter(task => task.kind !== 'planner');
|
|
20
22
|
const ids = new Set(work.map(task => task.id));
|
|
@@ -105,22 +107,22 @@ export function materializePlannerChild(job, planner, spec, executionContext) {
|
|
|
105
107
|
const source = 'round' in planner ? planner.source : planner.planningSource ?? 'model-planner';
|
|
106
108
|
const round = 'round' in planner ? planner.round : planner.planningRound ?? 1;
|
|
107
109
|
const plannerHeadSha = 'round' in planner ? planner.headSha : undefined;
|
|
108
|
-
const reviewHeadSha = spec.agentName
|
|
110
|
+
const reviewHeadSha = isFinalReviewAgent(spec.agentName) && !(spec.dependencies?.length) ? plannerHeadSha ?? job.headSha : undefined;
|
|
109
111
|
const resolution = spec.resolution;
|
|
110
112
|
if (resolution) {
|
|
111
113
|
const target = resolution.targetTaskId ? job.tasks.find(task => task.id === resolution.targetTaskId) : undefined;
|
|
112
114
|
if (!target || !unresolvedTask(target))
|
|
113
115
|
throw new Error(`Planner resolution for ${spec.id} must target one unresolved durable Task`);
|
|
114
116
|
}
|
|
115
|
-
const reviewerThread = spec.agentName
|
|
116
|
-
return createTaskEntity(job, { jobId: job.id, id: spec.id, title: spec.agentName
|
|
117
|
+
const reviewerThread = isFinalReviewAgent(spec.agentName) ? prepareReviewerThreadDelivery(job, { id: spec.id, agentName: spec.agentName, reviewHeadSha }) : undefined, implementationThread = (spec.agentName === 'implementation' || spec.agentName == null) && job.implementationThreadId ? job.implementationThreadId : undefined, threadOwned = Boolean(reviewerThread || implementationThread);
|
|
118
|
+
return createTaskEntity(job, { jobId: job.id, id: spec.id, title: isFinalReviewAgent(spec.agentName) ? 'Review' : spec.title, kind: 'work', priority: spec.priority ?? job.priority, storySize: spec.storySize ?? 'M', projectName: spec.projectName, agentName: spec.agentName, agentGraph: spec.agentGraph, review: spec.review, parentTaskId: isFinalReviewAgent(spec.agentName) ? null : spec.parentTaskId ?? null, dependencies: spec.dependencies ?? [], dependencyValidity: spec.dependencyValidity, capabilities: spec.capabilities ?? [], workerRequirements: threadOwned ? chatgptThreadRequirements(spec.workerRequirements) : spec.workerRequirements, adapter: threadOwned ? 'chatgpt' : (spec.adapter ?? 'codex'), chatgptThreadDelivery: reviewerThread, input: spec.input, output: spec.output, continuation: spec.continuation ?? null, continuationDeliveredAt: null, attempt: 0, maxAttempts: spec.maxAttempts ?? 3, leaseOwner: null, leaseExpiresAt: null, executionId: null, threadId: null, result: null, plannerResult: null, error: null, timeoutMs: spec.timeoutMs ?? taskOverallTimeoutMs(spec.storySize ?? 'M'), createdAt: now, updatedAt: now, planningDecisionId: decisionId, planningSource: source, planningRound: round, reviewHeadSha, resolution: resolution ? { ...resolution, state: 'proposed', owner: 'planner', updatedAt: now } : undefined });
|
|
117
119
|
}
|
|
118
120
|
export function planningSpec(task) {
|
|
119
121
|
if (!task.output)
|
|
120
122
|
throw new Error(`Initial task ${task.id} requires an output contract`);
|
|
121
123
|
if (!['codex', 'chatgpt', 'z'].includes(task.adapter))
|
|
122
124
|
throw new Error(`Initial task ${task.id} requires a supported worker adapter`);
|
|
123
|
-
return { id: task.id, title: task.title, parentTaskId: task.parentTaskId, input: task.input, priority: task.priority, storySize: task.storySize, projectName: task.projectName, agentName: task.agentName, agentGraph: task.agentGraph, review: task.review, dependencies: task.dependencies, capabilities: task.capabilities, workerRequirements: task.workerRequirements, adapter: task.adapter, output: task.output ?? { kind: 'task_pr' }, routing: task.routing, continuation: task.continuation, maxAttempts: task.maxAttempts, timeoutMs: task.timeoutMs, resolution: task.resolution ? { ...task.resolution, state: undefined, owner: undefined, updatedAt: undefined } : undefined };
|
|
125
|
+
return { id: task.id, title: task.title, parentTaskId: task.parentTaskId, input: task.input, priority: task.priority, storySize: task.storySize, projectName: task.projectName, agentName: task.agentName, agentGraph: task.agentGraph, review: task.review, dependencies: task.dependencies, dependencyValidity: task.dependencyValidity, capabilities: task.capabilities, workerRequirements: task.workerRequirements, adapter: task.adapter, output: task.output ?? { kind: 'task_pr' }, routing: task.routing, continuation: task.continuation, maxAttempts: task.maxAttempts, timeoutMs: task.timeoutMs, resolution: task.resolution ? { ...task.resolution, state: undefined, owner: undefined, updatedAt: undefined } : undefined };
|
|
124
126
|
}
|
|
125
127
|
function record(value, field = 'result') {
|
|
126
128
|
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
@@ -278,6 +280,8 @@ export function parsePlannerResult(value) {
|
|
|
278
280
|
if (typeof task.input !== 'string' || task.input.length === 0)
|
|
279
281
|
throw new Error(`Planner next_tasks[${index}].input is required`);
|
|
280
282
|
const parentTaskId = task.parentTaskId === undefined || task.parentTaskId === null ? task.parentTaskId : optionalString(task.parentTaskId, `next_tasks[${index}].parentTaskId`);
|
|
283
|
+
const dependencies = stringArray(task.dependencies, `next_tasks[${index}].dependencies`);
|
|
284
|
+
const dependencyValidity = validateDependencyValidity(dependencies, task.dependencyValidity, `next_tasks[${index}].dependencyValidity`);
|
|
281
285
|
const adapter = task.adapter;
|
|
282
286
|
if (adapter !== undefined && !['codex', 'chatgpt', 'z'].includes(String(adapter)))
|
|
283
287
|
throw new Error(`Planner next_tasks[${index}].adapter must be codex, chatgpt, or z when provided`);
|
|
@@ -312,7 +316,7 @@ export function parsePlannerResult(value) {
|
|
|
312
316
|
return {
|
|
313
317
|
id, title: requiredPlannerTaskTitle(task.title, index), parentTaskId, input: task.input, priority, storySize,
|
|
314
318
|
projectName: optionalString(task.projectName, 'projectName'), agentName: optionalString(task.agentName, 'agentName'), agentGraph, review,
|
|
315
|
-
dependencies
|
|
319
|
+
dependencies, dependencyValidity, capabilities: stringArray(task.capabilities, 'capabilities'), workerRequirements: requirements,
|
|
316
320
|
adapter: adapter, output: output, routing: route,
|
|
317
321
|
continuation: task.continuation, maxAttempts, timeoutMs, resolution: resolutionProposal(task.resolution, `next_tasks[${index}].resolution`)
|
|
318
322
|
};
|
|
@@ -322,7 +326,7 @@ export function parsePlannerResult(value) {
|
|
|
322
326
|
export function validatePlannerProgress(job, result) {
|
|
323
327
|
if (result.objective_status !== 'in_progress' || result.next_tasks.length > 0 || result.unblocks.length > 0)
|
|
324
328
|
return;
|
|
325
|
-
const previousReviewFinished = job.tasks.some(task => task.agentName
|
|
329
|
+
const previousReviewFinished = job.tasks.some(task => isFinalReviewAgent(task.agentName) && task.state === 'SUCCEEDED');
|
|
326
330
|
if (previousReviewFinished)
|
|
327
331
|
return;
|
|
328
332
|
const liveWork = job.tasks.some(task => task.kind !== 'planner' && !['SUCCEEDED', 'FAILED', 'CANCELLED'].includes(task.state));
|
|
@@ -330,6 +334,7 @@ export function validatePlannerProgress(job, result) {
|
|
|
330
334
|
return;
|
|
331
335
|
throw new Error('Planner returned in_progress with no executable tasks or unblocks while no live work remains; return satisfied when only Relay-owned review/merge/completion effects remain');
|
|
332
336
|
}
|
|
337
|
+
export { validatePlannerAgentRoles } from './planner-agent-roles.js';
|
|
333
338
|
export function validatePlannerLifecycleOwnership(job, specs) {
|
|
334
339
|
if (!job.localMerge?.sourceRef)
|
|
335
340
|
return;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { settleReviewRevisionRound } from './review-revision-settlement.js';
|
|
2
|
+
import { isFinalReviewAgent, FINAL_REVIEW_AGENT, nextFinalReviewTaskId } from './final-review-role.js';
|
|
3
|
+
import { normalizeReviewEvidence } from './review-evidence.js';
|
|
1
4
|
import { browserWorkerPool } from './browser-worker-runtime.js';
|
|
2
5
|
import { storySizeTimeoutMs, taskOverallTimeoutMs } from './types.js';
|
|
3
6
|
import { completionGateSatisfied, refreshTaskDependencies, transitionTaskEvent, tryTransitionTaskEvent } from './task-transitions.js';
|
|
@@ -8,11 +11,14 @@ import { routeExecution } from './execution-routing.js';
|
|
|
8
11
|
import { recordRouteOutcome } from './route-outcome-recording.js';
|
|
9
12
|
import { ReconcilerRuntimeBase } from './reconciler-runtime.js';
|
|
10
13
|
import { dispatchReviewLifecycle, reviewOutcome } from './workflow/review-v2.js';
|
|
14
|
+
import { staleReviewRevisions } from './review-revision-stale.js';
|
|
11
15
|
import { dispatchTaskLifecycleSync } from './workflow/lifecycle.js';
|
|
12
16
|
import { createTaskEntity } from './workflow/entity-creation.js';
|
|
13
17
|
import { localSourceHead, localWorkingHead } from './local-git-merge.js';
|
|
14
18
|
import { chatgptThreadRequirements, resolveReviewerThreadDestination, resolveImplementationTaskThreadDestination, prepareReviewerThreadDelivery } from './reviewer-thread.js';
|
|
15
19
|
import { reviewGenerationMatches } from './review-generation-fence.js';
|
|
20
|
+
import { targetedRequestsForReview, targetedRequestsCoverReview } from './review-revision-model.js';
|
|
21
|
+
import { reviewFindingFingerprint } from './review-revision-policy.js';
|
|
16
22
|
import { codexNoStartFallbackRoute, quarantineUnavailableCodexFallback } from './chatgpt-platform-fallback.js';
|
|
17
23
|
export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
18
24
|
async currentHeadSha(job) {
|
|
@@ -36,7 +42,7 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
reviewFacts(job, headSha) {
|
|
39
|
-
const reviewTasks = job.tasks.filter(task => task.agentName
|
|
45
|
+
const reviewTasks = job.tasks.filter(task => isFinalReviewAgent(task.agentName) && task.reviewHeadSha === headSha);
|
|
40
46
|
const currentReviewTask = job.review?.taskId ? job.tasks.find(task => task.id === job.review?.taskId) : undefined;
|
|
41
47
|
return {
|
|
42
48
|
reviewEnabled: job.reviewEnabled !== false,
|
|
@@ -49,45 +55,6 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
49
55
|
noApprovedCurrentReview: !reviewTasks.some(task => task.state === 'SUCCEEDED' && job.review?.headSha === headSha && job.review.outcome === 'approved'),
|
|
50
56
|
};
|
|
51
57
|
}
|
|
52
|
-
static reviewRecord(value) {
|
|
53
|
-
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
54
|
-
}
|
|
55
|
-
static reviewHeadSha(event) {
|
|
56
|
-
const data = ReconcilerReviewBase.reviewRecord(event.data);
|
|
57
|
-
const outcome = ReconcilerReviewBase.reviewRecord(data.outcome);
|
|
58
|
-
const review = ReconcilerReviewBase.reviewRecord(data.review);
|
|
59
|
-
return [outcome.head_sha, outcome.headSha, review.head_sha, review.headSha, data.head_sha, data.headSha]
|
|
60
|
-
.find((value) => typeof value === 'string' && value.length > 0);
|
|
61
|
-
}
|
|
62
|
-
static reviewIssues(event) {
|
|
63
|
-
const data = ReconcilerReviewBase.reviewRecord(event.data);
|
|
64
|
-
const outcome = ReconcilerReviewBase.reviewRecord(data.outcome);
|
|
65
|
-
const review = ReconcilerReviewBase.reviewRecord(data.review);
|
|
66
|
-
const rawIssues = outcome.blocking_findings !== undefined ? outcome.blocking_findings
|
|
67
|
-
: outcome.blockingFindings !== undefined ? outcome.blockingFindings
|
|
68
|
-
: review.issues !== undefined ? review.issues
|
|
69
|
-
: data.issues;
|
|
70
|
-
if (!Array.isArray(rawIssues))
|
|
71
|
-
return [];
|
|
72
|
-
return rawIssues.map(item => {
|
|
73
|
-
if (typeof item === 'string')
|
|
74
|
-
return item.trim();
|
|
75
|
-
if (!item || typeof item !== 'object' || Array.isArray(item))
|
|
76
|
-
return '';
|
|
77
|
-
const value = item;
|
|
78
|
-
return (typeof value.summary === 'string' ? value.summary
|
|
79
|
-
: typeof value.message === 'string' ? value.message
|
|
80
|
-
: typeof value.finding === 'string' ? value.finding
|
|
81
|
-
: typeof value.title === 'string' ? value.title : '').trim();
|
|
82
|
-
}).filter(Boolean);
|
|
83
|
-
}
|
|
84
|
-
static normalizeReviewEvidence(event, task) {
|
|
85
|
-
const explicitHeadSha = ReconcilerReviewBase.reviewHeadSha(event);
|
|
86
|
-
const headSha = explicitHeadSha ?? (event.type === 'review.approved' ? task.reviewHeadSha : undefined);
|
|
87
|
-
if (!headSha)
|
|
88
|
-
return null;
|
|
89
|
-
return { headSha, issues: ReconcilerReviewBase.reviewIssues(event) };
|
|
90
|
-
}
|
|
91
58
|
async cancelStaleReviewTask(job) {
|
|
92
59
|
const staleTask = job.review?.taskId ? job.tasks.find(task => task.id === job.review?.taskId) : undefined;
|
|
93
60
|
if (!staleTask || !['DRAFT', 'QUEUED', 'RUNNING'].includes(staleTask.state))
|
|
@@ -100,11 +67,14 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
100
67
|
await this.store.saveTask(staleTask);
|
|
101
68
|
}
|
|
102
69
|
async invalidateStaleReview(job, headSha) {
|
|
103
|
-
|
|
70
|
+
const staleReview = job.review;
|
|
71
|
+
if (!headSha || !staleReview || staleReview.headSha === headSha)
|
|
104
72
|
return;
|
|
105
|
-
const decision = await dispatchReviewLifecycle(
|
|
73
|
+
const decision = await dispatchReviewLifecycle(staleReview.outcome, 'head.changed', {}, async (actionId) => {
|
|
106
74
|
if (actionId === 'review.cancelStale') {
|
|
107
75
|
await this.cancelStaleReviewTask(job);
|
|
76
|
+
if (staleReview.taskId)
|
|
77
|
+
await staleReviewRevisions(this.store, job, staleReview.taskId, staleReview.headSha, (taskId, executionId) => this.cancelExecutionGeneration(job.id, taskId, executionId));
|
|
108
78
|
return {};
|
|
109
79
|
}
|
|
110
80
|
throw new Error('Unsupported stale review action ' + actionId);
|
|
@@ -114,33 +84,32 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
114
84
|
const outcome = reviewOutcome(decision.target);
|
|
115
85
|
if (!outcome)
|
|
116
86
|
throw new Error('Review graph produced invalid stale target ' + decision.target);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
87
|
+
const updatedAt = new Date().toISOString();
|
|
88
|
+
if (this.store.mutateJob) {
|
|
89
|
+
const persisted = await this.store.mutateJob(job.id, current => {
|
|
90
|
+
const currentReview = current.review;
|
|
91
|
+
if (!currentReview || currentReview.taskId !== staleReview.taskId || currentReview.headSha !== staleReview.headSha)
|
|
92
|
+
return current;
|
|
93
|
+
current.review = { ...currentReview, outcome, updatedAt };
|
|
94
|
+
current.updatedAt = updatedAt;
|
|
95
|
+
return current;
|
|
96
|
+
});
|
|
97
|
+
Object.assign(job, persisted);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
job.review = { ...staleReview, outcome, updatedAt };
|
|
101
|
+
await this.store.saveJob(job);
|
|
129
102
|
}
|
|
130
|
-
throw new Error('Too many final review rounds for ' + headSha);
|
|
131
|
-
}
|
|
132
|
-
externalReviewPrNumber(job) {
|
|
133
|
-
return job.prNumber;
|
|
134
103
|
}
|
|
135
104
|
async createFinalReviewTask(job, headSha) {
|
|
136
|
-
const id =
|
|
137
|
-
const reviewPrNumber =
|
|
105
|
+
const id = nextFinalReviewTaskId(job, headSha);
|
|
106
|
+
const reviewPrNumber = job.prNumber;
|
|
138
107
|
const now = new Date().toISOString();
|
|
139
108
|
const reviewGateTasks = implementationTasks(job);
|
|
140
109
|
const reviewThread = resolveReviewerThreadDestination(job, this.options.reviewer?.threadId);
|
|
141
110
|
const reviewerRouting = await this.selectReviewer(reviewGateTasks, reviewThread ? chatgptThreadRequirements(this.options.reviewer?.requirements) : undefined);
|
|
142
111
|
const chatgptThreadDelivery = prepareReviewerThreadDelivery(job, {
|
|
143
|
-
id, agentName:
|
|
112
|
+
id, agentName: FINAL_REVIEW_AGENT, reviewHeadSha: headSha, routing: reviewerRouting.candidate.routing,
|
|
144
113
|
}, this.options.reviewer?.threadId);
|
|
145
114
|
const input = [
|
|
146
115
|
`Job ID: ${job.id}`,
|
|
@@ -154,7 +123,7 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
154
123
|
'Do not treat historical failed attempts as current artifact defects; distinguish preserved baseline files from implementation.',
|
|
155
124
|
].join('\n\n');
|
|
156
125
|
const task = createTaskEntity(job, {
|
|
157
|
-
jobId: job.id, id, title: 'Review', kind: 'work', priority: job.priority, storySize: 'M', projectName: job.title, agentName:
|
|
126
|
+
jobId: job.id, id, title: 'Review', kind: 'work', priority: job.priority, storySize: 'M', projectName: job.title, agentName: FINAL_REVIEW_AGENT,
|
|
158
127
|
parentTaskId: null, dependencies: reviewGateTasks.map(item => item.id), capabilities: ['review'],
|
|
159
128
|
workerSelection: reviewerRouting.selection, adapter: reviewerRouting.candidate.adapter,
|
|
160
129
|
input,
|
|
@@ -165,7 +134,7 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
165
134
|
error: null, timeoutMs: this.options.reviewer?.timeoutMs ?? storySizeTimeoutMs('M'), createdAt: now, updatedAt: now
|
|
166
135
|
});
|
|
167
136
|
await this.store.appendTask(task);
|
|
168
|
-
await this.emit(eventFor(job.id, id, task.parentTaskId, 'review.created', 'queued', 'Final review task ' + id + ' created for ' + headSha + ' using ' + reviewerRouting.reason, 'orchestrator', { headSha, agentName:
|
|
137
|
+
await this.emit(eventFor(job.id, id, task.parentTaskId, 'review.created', 'queued', 'Final review task ' + id + ' created for ' + headSha + ' using ' + reviewerRouting.reason, 'orchestrator', { headSha, agentName: FINAL_REVIEW_AGENT, reviewerRouting: { workerId: reviewerRouting.selection.workerId, reason: reviewerRouting.reason, selectedBy: reviewerRouting.selection.selectedBy } }));
|
|
169
138
|
return id;
|
|
170
139
|
}
|
|
171
140
|
async projectedReviewHeadReady(job, headSha) {
|
|
@@ -185,11 +154,12 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
185
154
|
async ensureFinalReview(job, headSha) {
|
|
186
155
|
if (headSha && !(await this.projectedReviewHeadReady(job, headSha)))
|
|
187
156
|
return;
|
|
157
|
+
job = await settleReviewRevisionRound(this.store, job);
|
|
188
158
|
// Restore the review gate only after an authoritative unblock of the original reviewer.
|
|
189
159
|
const priorReviewTask = job.tasks.find(task => task.id === job.review?.taskId);
|
|
190
160
|
if (job.review?.outcome === 'blocked' && job.review.headSha === headSha
|
|
191
|
-
&& priorReviewTask?.agentName
|
|
192
|
-
&& ['QUEUED', 'RUNNING', 'FAILED'].includes(priorReviewTask
|
|
161
|
+
&& isFinalReviewAgent(priorReviewTask?.agentName) && priorReviewTask?.unblock?.event === 'task.unblocked'
|
|
162
|
+
&& ['QUEUED', 'RUNNING', 'FAILED'].includes(priorReviewTask?.state ?? '')) {
|
|
193
163
|
const recovered = await dispatchReviewLifecycle('blocked', 'review.retry', { reviewUnblocked: true });
|
|
194
164
|
if (recovered.accepted && recovered.target === 'PENDING') {
|
|
195
165
|
job.review = { ...job.review, outcome: 'pending', updatedAt: new Date().toISOString() };
|
|
@@ -271,7 +241,7 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
271
241
|
}
|
|
272
242
|
async routeTaskForExecution(job, task) {
|
|
273
243
|
const implementationThread = resolveImplementationTaskThreadDestination(job, task);
|
|
274
|
-
const reviewerThread = task.agentName
|
|
244
|
+
const reviewerThread = isFinalReviewAgent(task.agentName) ? resolveReviewerThreadDestination(job, this.options.reviewer?.threadId) : null;
|
|
275
245
|
if (task.routing && !((implementationThread || reviewerThread) && task.adapter !== 'chatgpt'))
|
|
276
246
|
return { task, routed: false };
|
|
277
247
|
if (!task.output || task.adapter === 'orchestrator')
|
|
@@ -293,7 +263,7 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
293
263
|
id: job.id, title: job.title, objective: job.objective ?? null,
|
|
294
264
|
description: job.description ?? null, priority: job.priority ?? null,
|
|
295
265
|
repository: job.repository,
|
|
296
|
-
prNumber:
|
|
266
|
+
prNumber: job.prNumber, state: job.state,
|
|
297
267
|
},
|
|
298
268
|
task: {
|
|
299
269
|
id: task.id, kind: task.kind ?? 'work', storySize: task.storySize ?? 'M',
|
|
@@ -369,10 +339,10 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
369
339
|
}
|
|
370
340
|
async applyReviewEvent(event) {
|
|
371
341
|
const job = await this.store.load(event.job_id);
|
|
372
|
-
const task = job.tasks.find(item => item.id === event.task_id && item.agentName
|
|
342
|
+
const task = job.tasks.find(item => item.id === event.task_id && isFinalReviewAgent(item.agentName));
|
|
373
343
|
if (!task)
|
|
374
344
|
return { applied: false, reconcile: false, reason: event.type + '.ignored' };
|
|
375
|
-
const normalizedEvidence =
|
|
345
|
+
const normalizedEvidence = normalizeReviewEvidence(event, task);
|
|
376
346
|
if (!normalizedEvidence)
|
|
377
347
|
return { applied: false, reconcile: false, reason: event.type + '.ignored' };
|
|
378
348
|
const headSha = normalizedEvidence.headSha;
|
|
@@ -381,6 +351,13 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
381
351
|
const currentHeadSha = await this.currentHeadSha(job);
|
|
382
352
|
if (currentHeadSha ? currentHeadSha !== headSha : Boolean(job.headSha && job.headSha !== headSha))
|
|
383
353
|
return { applied: false, reconcile: false, reason: event.type + '.stale' };
|
|
354
|
+
// Reviewer attempts may restart at the same SHA. Graph-stale requests
|
|
355
|
+
// from prior execution generations before accepting this generation's
|
|
356
|
+
// verdict; otherwise their DRAFT children can block approval forever.
|
|
357
|
+
if (task.executionId && job.reviewRevisionRequests?.some(request => request.reviewTaskId === task.id && request.reviewHeadSha === headSha
|
|
358
|
+
&& request.reviewExecutionId !== task.executionId && request.status !== 'stale')) {
|
|
359
|
+
await staleReviewRevisions(this.store, job, task.id, headSha, (taskId, executionId) => this.cancelExecutionGeneration(job.id, taskId, executionId), task.executionId);
|
|
360
|
+
}
|
|
384
361
|
// Planner-created reviewer tasks predate the final-review Job gate. Bind
|
|
385
362
|
// their first trustworthy review event to PENDING before dispatching it.
|
|
386
363
|
const freshAfterStale = job.review?.outcome === 'stale'
|
|
@@ -402,22 +379,19 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
402
379
|
await this.store.saveTask(task);
|
|
403
380
|
}
|
|
404
381
|
let needsReconcile = false;
|
|
405
|
-
let
|
|
406
|
-
const reviewDecision = await dispatchReviewLifecycle(initialReviewOutcome, event.type, { autoMerge: job.autoMerge !== false }, async (actionId) => {
|
|
407
|
-
if (actionId === 'review.
|
|
382
|
+
let revisionDisposition;
|
|
383
|
+
const reviewDecision = await dispatchReviewLifecycle(initialReviewOutcome, event.type, { autoMerge: job.autoMerge !== false, targetedRevisionRequestsReady: targetedRequestsCoverReview(job, task, headSha, normalizedEvidence.issues) }, async (actionId) => {
|
|
384
|
+
if (actionId === 'review.awaitTargetedRevisions') {
|
|
385
|
+
revisionDisposition = 'targeted';
|
|
386
|
+
// Subsequent revision child scheduling is owned by the revision Graph;
|
|
387
|
+
// the review verdict never creates an unowned generic fix.
|
|
408
388
|
needsReconcile = true;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
const fixPrNumber = this.externalReviewPrNumber(job);
|
|
416
|
-
const fixTarget = fixPrNumber > 0 ? `PR #${fixPrNumber}` : `Job ${job.id} artifact`;
|
|
417
|
-
const input = 'Address all reviewer findings for ' + fixTarget + ' at ' + headSha + ':\n\n' + issues.map((issue, index) => (index + 1) + '. ' + issue).join('\n');
|
|
418
|
-
const fixTask = createTaskEntity(job, { jobId: job.id, id, title: `Fix review ${headSha.slice(0, 8)}`, kind: 'work', priority: job.priority, storySize: 'M', projectName: job.title, agentName: 'implementation', parentTaskId: task.id, dependencies: [task.id], capabilities: ['implementation'], workerRequirements: { capabilities: [] }, adapter: 'codex', input, output: { kind: 'task_pr' }, continuation: null, continuationDeliveredAt: null, attempt: 0, maxAttempts: 3, leaseOwner: null, leaseExpiresAt: null, executionId: null, threadId: null, result: null, plannerResult: null, error: null, timeoutMs: 0, createdAt: now, updatedAt: now });
|
|
419
|
-
pendingFixTask = fixTask;
|
|
420
|
-
}
|
|
389
|
+
return {};
|
|
390
|
+
}
|
|
391
|
+
if (actionId === 'review.requireOwnerResolution') {
|
|
392
|
+
revisionDisposition = 'needs-ownership';
|
|
393
|
+
// An explicitly authorized Planner re-plan may resolve ownership,
|
|
394
|
+
// but there is no implicit generic fix or automatic escalation.
|
|
421
395
|
return {};
|
|
422
396
|
}
|
|
423
397
|
if (actionId === 'review.requestMerge') {
|
|
@@ -445,6 +419,13 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
445
419
|
if (!freshTask || !reviewGenerationMatches(current, job, task, headSha))
|
|
446
420
|
return current;
|
|
447
421
|
const candidate = structuredClone(freshTask);
|
|
422
|
+
// The graph verdict was decided on the outer snapshot. Never commit a
|
|
423
|
+
// different disposition if concurrent intake changed the requests.
|
|
424
|
+
if (event.type === 'review.changes_required'
|
|
425
|
+
&& targetedRequestsCoverReview(current, freshTask, headSha, normalizedEvidence.issues)
|
|
426
|
+
!== (revisionDisposition === 'targeted'))
|
|
427
|
+
return current;
|
|
428
|
+
const requestIds = targetedRequestsForReview(current, freshTask, headSha).map(item => item.requestId);
|
|
448
429
|
const freshDecision = tryTransitionTaskEvent(candidate, event.type);
|
|
449
430
|
if (!freshDecision.accepted || !freshDecision.target)
|
|
450
431
|
return current;
|
|
@@ -466,9 +447,18 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
466
447
|
freshTask.error = null;
|
|
467
448
|
if (freshDecision.target !== 'RUNNING')
|
|
468
449
|
freshTask.result = { summary: event.message || `Review ${event.type}`, data: event.data ?? {} };
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
450
|
+
current.review = { outcome, headSha, taskId: freshTask.id, evidence, updatedAt: reviewUpdatedAt,
|
|
451
|
+
...(revisionDisposition ? { revisionDisposition } : {}) };
|
|
452
|
+
if ((event.type === 'review.changes_required' || event.type === 'review.approved') && terminalExecutionId
|
|
453
|
+
&& !current.reviewRevisionRounds?.some(round => round.reviewTaskId === freshTask.id && round.reviewExecutionId === terminalExecutionId)) {
|
|
454
|
+
current.reviewRevisionRounds = [...(current.reviewRevisionRounds ?? []), {
|
|
455
|
+
reviewTaskId: freshTask.id, reviewExecutionId: terminalExecutionId, headSha,
|
|
456
|
+
requestIds,
|
|
457
|
+
status: outcome === 'approved' ? 'approved' : 'changes_required',
|
|
458
|
+
findingFingerprint: reviewFindingFingerprint(normalizedEvidence.issues),
|
|
459
|
+
recordedAt: reviewUpdatedAt,
|
|
460
|
+
}];
|
|
461
|
+
}
|
|
472
462
|
current.updatedAt = reviewUpdatedAt;
|
|
473
463
|
committed = true;
|
|
474
464
|
return current;
|
|
@@ -480,17 +470,9 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
480
470
|
if (terminalExecutionId) {
|
|
481
471
|
this.finalizeReviewExecution(job.id, { ...task, executionId: terminalExecutionId }, event);
|
|
482
472
|
}
|
|
483
|
-
const committedFixTask = pendingFixTask;
|
|
484
|
-
if (committedFixTask)
|
|
485
|
-
await this.emit(eventFor(job.id, committedFixTask.id, task.id, 'review.fix_task_created', 'queued', 'Created one fix task ' + committedFixTask.id + ' for reviewer findings', 'orchestrator', { headSha }, { agent: 'relay', component: 'agents-relay' }));
|
|
486
473
|
}
|
|
487
474
|
else {
|
|
488
|
-
|
|
489
|
-
if (legacyFixTask) {
|
|
490
|
-
await this.store.appendTask(legacyFixTask);
|
|
491
|
-
await this.emit(eventFor(job.id, legacyFixTask.id, task.id, 'review.fix_task_created', 'queued', 'Created one fix task ' + legacyFixTask.id + ' for reviewer findings', 'orchestrator', { headSha }, { agent: 'relay', component: 'agents-relay' }));
|
|
492
|
-
}
|
|
493
|
-
job.review = { outcome, headSha, taskId: task.id, evidence, updatedAt: reviewUpdatedAt };
|
|
475
|
+
job.review = { outcome, headSha, taskId: task.id, evidence, updatedAt: reviewUpdatedAt, ...(revisionDisposition ? { revisionDisposition } : {}) };
|
|
494
476
|
job.updatedAt = reviewUpdatedAt;
|
|
495
477
|
await this.store.saveTask(task);
|
|
496
478
|
await this.store.saveJob(job);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { dependencyRevisionStillCurrent } from './dependency-revision-execution.js';
|
|
2
|
+
import { isFinalReviewAgent } from './final-review-role.js';
|
|
1
3
|
import { handleWorkerLaunchFailure } from './worker-failure-recovery.js';
|
|
2
4
|
import { normalizeReviewerTerminalEvent } from './review-terminal-normalization.js';
|
|
3
5
|
import { executionEventSource, eventSourceId, executionIdFromSource, claimTerminalExecution, terminalExecutionClaimed } from './execution-event-identity.js';
|
|
@@ -70,7 +72,7 @@ export class ReconcilerRuntimeBase {
|
|
|
70
72
|
}
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
|
-
async applyHostInvocationEvent(event) { const result = await this.hostInvocations.applyEvent(event); const resumed = result.resumeWorker && result.decision ? await resumeInteractiveTask(this.store, result.decision.jobId, result.decision.taskId, result.decision.invocationId, result.decision.revision, result.decision.decision) : false; return { applied: result.outcome !== 'ignored', reconcile: resumed, reason: `task.interactive_decision.${result.outcome}` }; }
|
|
75
|
+
async applyHostInvocationEvent(event) { const result = await this.hostInvocations.applyEvent(event); const resumed = result.resumeWorker && result.decision ? await resumeInteractiveTask(this.store, result.decision.jobId, result.decision.taskId, result.decision.invocationId, result.decision.revision, result.decision.decision) : false; return { applied: result.outcome !== 'ignored', reconcile: resumed || result.outcome === 'accepted', reason: `task.interactive_decision.${result.outcome}` }; }
|
|
74
76
|
bindInteractiveInvocation(jobId, task, executionId, invocationId, revision) { return this.hostInvocations.bind(jobId, task, executionId, invocationId, revision); }
|
|
75
77
|
async applyJobEffectOutcomes(job, outcomes) {
|
|
76
78
|
await applyJobEffectOutcomes(this.store, event => this.emit(event), job, outcomes);
|
|
@@ -88,8 +90,15 @@ export class ReconcilerRuntimeBase {
|
|
|
88
90
|
if (event.type === 'task.progress')
|
|
89
91
|
return this.markWorkerProgress(event);
|
|
90
92
|
if (event.type === 'task.completed') {
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
+
const latest = await this.store.load(event.job_id);
|
|
94
|
+
const task = latest.tasks.find(item => item.id === event.task_id);
|
|
95
|
+
// Source generation still goes through canonical Task terminal
|
|
96
|
+
// correlation; convert stale verification into a safe supersede event.
|
|
97
|
+
if (task?.revision && task.revision.kind !== 'targeted' && !dependencyRevisionStillCurrent(latest, task)) {
|
|
98
|
+
return this.applyTerminalEvent({ ...event, type: 'task.cancelled',
|
|
99
|
+
message: 'Superseded upstream dependency evidence vector changed before terminal validation' });
|
|
100
|
+
}
|
|
101
|
+
const normalized = isFinalReviewAgent(task?.agentName) ? normalizeReviewerTerminalEvent(event) : null;
|
|
93
102
|
if (normalized)
|
|
94
103
|
return normalized.type === 'task.failed' ? this.applyTerminalEvent(normalized) : this.applyReviewEvent(normalized);
|
|
95
104
|
}
|
|
@@ -401,7 +410,7 @@ export class ReconcilerRuntimeBase {
|
|
|
401
410
|
return false;
|
|
402
411
|
if (event.type === 'task.blocked' && lifecycleEvent !== 'interactive.waiting' && (!trustedInternal || task.agentName !== 'troubleshooter'))
|
|
403
412
|
return false;
|
|
404
|
-
if (task.agentName
|
|
413
|
+
if (isFinalReviewAgent(task.agentName) && event.type === 'task.completed')
|
|
405
414
|
return false;
|
|
406
415
|
if (event.type === 'task.completed' && task.interactiveInvocation?.status !== undefined && task.interactiveInvocation.status !== 'approved')
|
|
407
416
|
return false; // current interactive revision requires durable approval
|
|
@@ -477,7 +486,7 @@ export class ReconcilerRuntimeBase {
|
|
|
477
486
|
}
|
|
478
487
|
if (event.type === 'task.completed')
|
|
479
488
|
await this.deliverContinuation(transition.job, transition.task);
|
|
480
|
-
const reviewWorker = transition.task.agentName
|
|
489
|
+
const reviewWorker = isFinalReviewAgent(transition.task.agentName);
|
|
481
490
|
return { applied: true, reconcile: lifecycleEvent !== 'interactive.waiting' && (!reviewWorker || event.type === 'task.failed'), reason: reviewWorker ? `${event.type}.review-worker` : event.type, reconcileMode: reviewWorker || lifecycleEvent === 'interactive.waiting' ? undefined : 'detached' };
|
|
482
491
|
}
|
|
483
492
|
terminalWait(taskId, executionId, launchBarrier) {
|