agents-relay 2.0.253 → 2.0.254
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 +13 -0
- package/dist/agent-graph.js +1 -1
- package/dist/cli-help.js +20 -13
- package/dist/cli-job-create.js +3 -3
- package/dist/cli-shortcut.js +62 -4
- package/dist/cli.js +5 -5
- package/dist/dashboard-html.js +3 -4
- package/dist/reconciler-review.js +1 -1
- package/dist/reconciler.js +2 -2
- package/dist/relayd-control.js +1 -1
- package/dist/review-replan.js +5 -1
- package/dist/runtime-status.js +5 -0
- package/dist/workflow/planner-orchestration-v2.js +3 -1
- package/package.json +1 -1
- package/skills/agents-relay/SKILL.md +4 -2
- package/workflow/planner-orchestration.mmd +6 -1
package/README.md
CHANGED
|
@@ -380,3 +380,16 @@ The caller must report only a release it has actually verified. For local-first
|
|
|
380
380
|
### Project-scoped agent Markdown inheritance
|
|
381
381
|
|
|
382
382
|
Agent lookup has exactly two layers: Relay built-in `skills/agents-relay/agents/` and `<job-context-root>/agents/`. `job.projectPath` selects the context root within the repository (including monorepo content projects); no workspace/global agent fallback is searched. Project agent frontmatter can specify `extends: relay/planner`, `mode: extend`, and `sections: { replace: [Heading/Subheading], extend: [Other Heading] }` using heading paths, or `mode: replace` for a full behavioral replacement. Relay-owned lifecycle, Job/Task and events contracts are injected separately and cannot be replaced by a project agent. An unextended local agent is a standalone definition. The resolver emits a deterministic SHA-256 of composed Markdown; a missing section or unsupported parent fails instead of silently dropping instructions.
|
|
383
|
+
|
|
384
|
+
### Plan-free Graph Jobs (unified start)
|
|
385
|
+
|
|
386
|
+
Create a Job without `--initial-plan`, materialize one queued Agent Graph Task,
|
|
387
|
+
then activate it with `agents-relay job run --id JOB --task-id TASK`. No
|
|
388
|
+
`executionMode` is stored; `job run` only activates and publishes a wake-up.
|
|
389
|
+
The ordinary Reconciler creates the Coordinator and durable Agent-named Tasks,
|
|
390
|
+
with the same Script/Model execution, Task Review, Retry and recovery used by
|
|
391
|
+
all other Jobs. `--content-only` is an **independent Job policy** that disables
|
|
392
|
+
Final Job Review and merge; omit it to keep the ordinary Job completion gates.
|
|
393
|
+
The old `--shortcut-execution` input aliases this policy for existing callers,
|
|
394
|
+
but creates no special execution mode. Historical completed/cancelled Shortcut
|
|
395
|
+
records retain their old fields for read-only compatibility.
|
package/dist/agent-graph.js
CHANGED
|
@@ -84,5 +84,5 @@ export async function agentGraphPrompt(context, source) {
|
|
|
84
84
|
validateAgentSelection(context, undefined, source);
|
|
85
85
|
const contracts = await Promise.all(graph.nodes.map(async (node) => ({ node, prompt: await agentContractPrompt(context, node.agent) })));
|
|
86
86
|
const incoming = new Map(graph.nodes.map(node => [node.id, graph.edges.filter(edge => edge.to === node.id).map(edge => edge.from)]));
|
|
87
|
-
return `[Task Agent Graph]\n${source.trim()}\n\nExecution waves: ${graph.waves.map((wave, index) => `${index + 1}:${wave.join(',')}`).join(' | ')}\n\
|
|
87
|
+
return `[Task Agent Graph]\n${source.trim()}\n\nExecution waves: ${graph.waves.map((wave, index) => `${index + 1}:${wave.join(',')}`).join(' | ')}\n\nThe Coordinator materializes each graph node as its own durable Agent Task when its predecessors succeed. All Agent Tasks use the ordinary Reconciler and Task Lifecycle. Each child receives only the original Job/Task context and structured outputs of its declared predecessors. Independent nodes may run concurrently. Never execute the entire graph inside one Model Worker, invent additional Tasks, or publish another Task's lifecycle events.\n\n${contracts.map(({ node, prompt }) => `[Node ${node.id}; predecessors=${(incoming.get(node.id) ?? []).join(',') || 'none'}]\n${prompt}`).join('\n\n')}`;
|
|
88
88
|
}
|
package/dist/cli-help.js
CHANGED
|
@@ -40,7 +40,7 @@ Actions:
|
|
|
40
40
|
create Create a durable SQLite-authoritative Job
|
|
41
41
|
update Partially update mutable metadata on a healthy existing Job
|
|
42
42
|
show Show one durable Job
|
|
43
|
-
run
|
|
43
|
+
run Activate a create-only Job with a durable Agent Graph Task
|
|
44
44
|
shortcut-receipt Atomically record a validated nonhuman result for a persisted wait
|
|
45
45
|
list List managed Jobs in a repository
|
|
46
46
|
merge Legacy entry point; local Git merge is Graph-owned (no CLI PR merge)
|
|
@@ -53,17 +53,15 @@ Common options:
|
|
|
53
53
|
--repo OWNER/REPO Required for create; optional Job identity check otherwise
|
|
54
54
|
--id JOB_ID Durable job identifier
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
agents-relay job run --
|
|
58
|
-
[--
|
|
56
|
+
Graph Job activation:
|
|
57
|
+
agents-relay job run --id JOB --task-id TASK
|
|
58
|
+
[--project-path DIR] [--workspace-root DIR]
|
|
59
59
|
|
|
60
|
-
The
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
events are wake signals. Human approval remains hostInvocation-only.
|
|
66
|
-
Shortcut Job completion requires durable contentOnly=true and no PR, merge, or review gates.
|
|
60
|
+
The Job is created DRAFT without a Planner. This command activates its Graph
|
|
61
|
+
Task, then the same Relay Reconciler schedules all durable Agent child Tasks.
|
|
62
|
+
Use --content-only on job create only when no Final Review or Merge is wanted.
|
|
63
|
+
The --mode shortcut flag is accepted only as a deprecated CLI input alias.
|
|
64
|
+
Historical direct Shortcut checkpoints are read for compatibility.
|
|
67
65
|
|
|
68
66
|
Record an asynchronous result with:
|
|
69
67
|
agents-relay job shortcut-receipt --id JOB --task-id TASK
|
|
@@ -118,11 +116,20 @@ Optional: --thread-id THREAD_ID persists a reviewer override; omitted uses Job r
|
|
|
118
116
|
'job create': `Create a SQLite-authoritative Job (objective-only).
|
|
119
117
|
|
|
120
118
|
Required: --repo OWNER/REPO and a standalone Job objective. Job ID defaults to an auto-incrementing store-global number; --id may only reference an existing numeric Job.
|
|
121
|
-
Common: --id JOB_ID (optional), --title TEXT, --objective-file PATH|- (preferred), --objective MARKDOWN (short/simple only), --project-path RELATIVE_PATH, --priority P0|P1|P2|P3, --initial-plan, --no-review, --
|
|
122
|
-
Job creation enables auto-merge by default. By default it is create-only; --initial-plan validates the first real Planner round before atomically creating the durable Job and Plan, then publishes the normal wake. --
|
|
119
|
+
Common: --id JOB_ID (optional), --title TEXT, --objective-file PATH|- (preferred), --objective MARKDOWN (short/simple only), --project-path RELATIVE_PATH, --priority P0|P1|P2|P3, --initial-plan, --no-review, --content-only, --tag JSON, --reviewer-thread-id ID, --creator-thread-id ID, --implementation-thread-id ID. --objective and --objective-file are mutually exclusive.
|
|
120
|
+
Job creation enables auto-merge by default. By default it is create-only; --initial-plan validates the first real Planner round before atomically creating the durable Job and Plan, then publishes the normal wake. --content-only disables Final Review and Merge independent of how the Job starts; do not combine it with --initial-plan. The deprecated --shortcut-execution input is an alias for --content-only and is never persisted as an execution mode. Re-running create against an already healthy Job is idempotent and does not mutate its metadata.
|
|
123
121
|
|
|
124
122
|
Example:
|
|
125
123
|
npx agents-relay job create --repo OWNER/REPO --project-path vlog --title "Episode" --objective-file episode.md --initial-plan`,
|
|
124
|
+
'job run': `Activate a create-only Job with a durable Agent Graph Task. No Planner or execution mode is required.
|
|
125
|
+
|
|
126
|
+
Usage: agents-relay job run --id JOB --task-id TASK [--project-path DIR] [--no-github]
|
|
127
|
+
|
|
128
|
+
The command activates the normal Job lifecycle and emits a wake-up. The ordinary
|
|
129
|
+
Relay Scheduler creates runtime Agent Tasks, runs Script or Model executors,
|
|
130
|
+
waits for human review, retries failures and handles completion. A Job may use
|
|
131
|
+
--content-only independent of how it starts. --mode shortcut is a deprecated
|
|
132
|
+
input alias; it does not choose an execution engine.`,
|
|
126
133
|
'job update': `Partially update mutable metadata on a healthy existing Job.
|
|
127
134
|
|
|
128
135
|
Required: --id JOB_ID. Optional: --repo OWNER/REPO verifies the stored Job identity.
|
package/dist/cli-job-create.js
CHANGED
|
@@ -53,10 +53,10 @@ export async function ensureManagedGitHubJob(_client, repositoryName, _trustedAu
|
|
|
53
53
|
description: pr.body || undefined,
|
|
54
54
|
priority: options.priority ?? 'P2',
|
|
55
55
|
tag: options.tag,
|
|
56
|
-
autoMerge: options.executionMode === 'shortcut' ? false : true,
|
|
56
|
+
autoMerge: options.contentOnly || options.executionMode === 'shortcut' ? false : true,
|
|
57
57
|
...(localMergeSource ? { localMerge: { sourceRef: localMergeSource, targetRef: 'refs/heads/main', status: 'pending' } } : {}),
|
|
58
|
-
reviewEnabled: options.executionMode === 'shortcut' ? false : options.reviewEnabled ?? true,
|
|
59
|
-
...(options.executionMode === 'shortcut' ? {
|
|
58
|
+
reviewEnabled: options.contentOnly || options.executionMode === 'shortcut' ? false : options.reviewEnabled ?? true,
|
|
59
|
+
...(options.contentOnly || options.executionMode === 'shortcut' ? { contentOnly: true } : {}),
|
|
60
60
|
...(options.reviewerThreadId
|
|
61
61
|
? { reviewerThreadId: normalizeThreadId(options.reviewerThreadId, 'reviewer thread ID') }
|
|
62
62
|
: {}),
|
package/dist/cli-shortcut.js
CHANGED
|
@@ -33,20 +33,78 @@ export async function activateShortcutJobForDirectRun(store, jobId) {
|
|
|
33
33
|
}
|
|
34
34
|
export async function runShortcutJobCommand(args, id, makeRunner) {
|
|
35
35
|
assertSqliteShortcutArgs(args);
|
|
36
|
-
if (arg(args, '--mode') !== 'shortcut')
|
|
37
|
-
throw new Error('job run
|
|
36
|
+
if (arg(args, '--mode') && arg(args, '--mode') !== 'shortcut')
|
|
37
|
+
throw new Error('job run no longer selects an execution mode');
|
|
38
38
|
const loaded = await storeFor(args, false, true);
|
|
39
39
|
if (loaded.localFile !== null || !loaded.store.mutateJob || !loaded.store.reserveWorkflowLaunch)
|
|
40
40
|
throw new Error('Shortcut execution requires the authoritative SQLite Relay store');
|
|
41
41
|
const job = loaded.job;
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
// An explicit graph start is an ordinary Job activation. Historical in-flight
|
|
43
|
+
// direct Shortcut checkpoints alone continue through the archived runner below.
|
|
44
44
|
const taskId = arg(args, '--task-id');
|
|
45
45
|
if (!taskId)
|
|
46
46
|
throw new Error('job run requires --task-id');
|
|
47
47
|
let task = job.tasks.find(item => item.id === taskId);
|
|
48
48
|
if (!task)
|
|
49
49
|
throw new Error(`Task ${taskId} not found`);
|
|
50
|
+
const legacy = hasArg(args, '--legacy-shortcut-runtime') || Boolean(task.result?.data?.shortcut);
|
|
51
|
+
if (!legacy) {
|
|
52
|
+
if (hasArg(args, '--event-json'))
|
|
53
|
+
throw new Error('Normal Job activation does not accept a Shortcut runner event');
|
|
54
|
+
const graphOverride = hasArg(args, '--agent-graph-file') ? await textOption(args, '--agent-graph', '--agent-graph-file') : undefined;
|
|
55
|
+
if (graphOverride)
|
|
56
|
+
parseAgentGraph(graphOverride);
|
|
57
|
+
const effectiveGraph = task.agentGraph ?? graphOverride;
|
|
58
|
+
if (!effectiveGraph)
|
|
59
|
+
throw new Error('job run requires a Task with an Agent Graph');
|
|
60
|
+
const workspaceRoot = await resolveWorkspaceRoot(arg(args, '--workspace-root') || undefined);
|
|
61
|
+
const projectRoot = await resolveManagedProjectPath(noGitHubMode(args) ? undefined : job.repository, arg(args, '--project-path') || job.projectPath || '', workspaceRoot);
|
|
62
|
+
const projectPath = resolveRepositoryProjectPath(projectRoot, job.projectPath);
|
|
63
|
+
const globalRoot = arg(args, '--global-root') || process.env.AGENTS_HOME || undefined;
|
|
64
|
+
const sharedRoot = arg(args, '--shared-root') || process.env.AGENTS_RELAY_SHARED_ROOT || undefined;
|
|
65
|
+
await loaded.store.mutateJob(id, current => {
|
|
66
|
+
const root = current.tasks.find(t => t.id === taskId);
|
|
67
|
+
if (!root)
|
|
68
|
+
throw Error('Graph Task disappeared');
|
|
69
|
+
if (root.agentGraph && root.agentGraph !== effectiveGraph)
|
|
70
|
+
throw Error('Graph Task changed since activation');
|
|
71
|
+
if (root.state !== 'QUEUED' && root.state !== 'RUNNING' && root.state !== 'DRAFT')
|
|
72
|
+
throw Error('Graph Task is not startable: ' + root.state);
|
|
73
|
+
if (!root.agentGraph) {
|
|
74
|
+
if (root.state !== 'QUEUED' && root.state !== 'DRAFT')
|
|
75
|
+
throw Error('Graph cannot be replaced after Task started');
|
|
76
|
+
root.agentGraph = effectiveGraph;
|
|
77
|
+
}
|
|
78
|
+
if (root.state === 'DRAFT') {
|
|
79
|
+
if (root.dependencies.length)
|
|
80
|
+
throw Error('Graph root has unmet dependencies');
|
|
81
|
+
const queued = tryTransitionTaskEvent(root, 'queue', { dependenciesSatisfied: true });
|
|
82
|
+
if (!queued.accepted || queued.target !== 'QUEUED')
|
|
83
|
+
throw Error('Task Lifecycle rejected Graph root queue');
|
|
84
|
+
}
|
|
85
|
+
const ctx = { projectPath, workspaceRoot, ...(sharedRoot ? { sharedRoot } : {}), ...(globalRoot ? { globalRoot } : {}), noGitHub: noGitHubMode(args) };
|
|
86
|
+
const existing = current.graphStartContext;
|
|
87
|
+
if (existing && ['projectPath', 'workspaceRoot', 'sharedRoot', 'globalRoot', 'noGitHub'].some(k => existing[k] !== ctx[k]))
|
|
88
|
+
throw Error('Graph start context changed from first authorized invocation');
|
|
89
|
+
if (!existing)
|
|
90
|
+
current.graphStartContext = ctx;
|
|
91
|
+
if (current.state === 'DRAFT') {
|
|
92
|
+
const decision = dispatchJobLifecycleSync(current, 'activate');
|
|
93
|
+
if (!decision.accepted || decision.target !== 'ACTIVE')
|
|
94
|
+
throw Error('Job Lifecycle rejected activation');
|
|
95
|
+
}
|
|
96
|
+
else if (current.state !== 'ACTIVE')
|
|
97
|
+
throw Error('Job is not runnable: ' + current.state);
|
|
98
|
+
return current;
|
|
99
|
+
});
|
|
100
|
+
const scheduled = await loaded.store.load(id);
|
|
101
|
+
await withEventBus(args, bus => publishWake(bus, scheduled, taskId, 'Graph Job activated; ordinary Scheduler owns execution'));
|
|
102
|
+
console.log(JSON.stringify({ jobId: id, taskId, scheduled: true, state: scheduled.state, graphRuntime: 'tasks',
|
|
103
|
+
message: 'Job activated; Relay Scheduler owns DAG Tasks, Reviews and recovery' }, null, 2));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (job.executionMode !== 'shortcut' || job.contentOnly !== true)
|
|
107
|
+
throw new Error('Legacy Shortcut runner requires its original archived Job policy');
|
|
50
108
|
if (hasArg(args, '--event-json'))
|
|
51
109
|
shortcutResumeEvent(arg(args, '--event-json'));
|
|
52
110
|
if (!task.agentGraph && !hasArg(args, '--agent-graph-file'))
|
package/dist/cli.js
CHANGED
|
@@ -62,7 +62,7 @@ async function runManagedTaskCommand(action, args) {
|
|
|
62
62
|
throw new Error(`task ${action} requires --task-id`);
|
|
63
63
|
let result;
|
|
64
64
|
if (action === 'create') {
|
|
65
|
-
if (hasArg(args, '--shortcut-execution') && hasArg(args, '--initial-plan'))
|
|
65
|
+
if ((hasArg(args, '--shortcut-execution') || hasArg(args, '--content-only')) && hasArg(args, '--initial-plan'))
|
|
66
66
|
throw new Error('--shortcut-execution currently requires create-only job creation; materialize Graph Tasks after the durable shortcut policy is stored');
|
|
67
67
|
const job = await relayControlJob(args, jobId);
|
|
68
68
|
if (['COMPLETED', 'CANCELLED'].includes(job.state))
|
|
@@ -402,8 +402,8 @@ async function runJobCommand(action, args) {
|
|
|
402
402
|
optionalLegacyPr(args);
|
|
403
403
|
let createObjective;
|
|
404
404
|
if (action === 'create') {
|
|
405
|
-
if (hasArg(args, '--no-auto-merge'))
|
|
406
|
-
throw new Error('
|
|
405
|
+
if (hasArg(args, '--no-auto-merge') && !hasArg(args, '--content-only'))
|
|
406
|
+
throw new Error('Use --content-only for an explicit no-merge content Job');
|
|
407
407
|
const taskOnlyFlags = ['--start', '--task-id', '--input', '--input-file', '--adapter', '--provider', '--model', '--profile', '--reasoning', '--story-size', '--project', '--agent', '--parent', '--deps', '--capabilities', '--attachments', '--max-attempts', '--timeout', '--cwd', '--chatgpt-project', '--chatgpt-tab-close-policy', '--output', '--output-path', '--draft', '--queue'];
|
|
408
408
|
const invalid = taskOnlyFlags.find(flag => hasArg(args, flag));
|
|
409
409
|
if (invalid)
|
|
@@ -433,7 +433,7 @@ async function runJobCommand(action, args) {
|
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
435
|
if (action === 'create') {
|
|
436
|
-
if (hasArg(args, '--shortcut-execution') && hasArg(args, '--initial-plan'))
|
|
436
|
+
if ((hasArg(args, '--shortcut-execution') || hasArg(args, '--content-only')) && hasArg(args, '--initial-plan'))
|
|
437
437
|
throw new Error('--shortcut-execution requires create-only Job creation; materialize Agent Graph Tasks only after durable shortcut policy is stored');
|
|
438
438
|
rejectRemovedJobOptions(args);
|
|
439
439
|
const objective = createObjective ?? '';
|
|
@@ -442,7 +442,7 @@ async function runJobCommand(action, args) {
|
|
|
442
442
|
const result = await relayControlCommand(args, { command: 'job.create', repository: repo, initialPlan: hasArg(args, '--initial-plan'), options: {
|
|
443
443
|
id: id || undefined, idempotencyKey: arg(args, '--idempotency-key') || undefined, title: arg(args, '--title') || undefined, objective: objective || undefined, projectPath: arg(args, '--project-path') || undefined,
|
|
444
444
|
priority: priority(args), tag: jobTagFromArgs(args), reviewEnabled: !hasArg(args, '--no-review'), continuation: continuation(args),
|
|
445
|
-
|
|
445
|
+
contentOnly: hasArg(args, '--content-only') || hasArg(args, '--shortcut-execution'),
|
|
446
446
|
reviewerThreadId: hasArg(args, '--reviewer-thread-id') ? arg(args, '--reviewer-thread-id') : undefined, creatorThreadId: hasArg(args, '--creator-thread-id') ? arg(args, '--creator-thread-id') : undefined, implementationThreadId: hasArg(args, '--implementation-thread-id') ? arg(args, '--implementation-thread-id') : undefined,
|
|
447
447
|
} });
|
|
448
448
|
console.log(JSON.stringify(result, null, 2));
|
package/dist/dashboard-html.js
CHANGED
|
@@ -191,7 +191,7 @@ function relativeTime(timestamp){if(!timestamp)return '—';const parsed=Date.pa
|
|
|
191
191
|
function safePrUrl(repository,prNumber){if(typeof repository!=='string'||!Number.isInteger(prNumber)||prNumber<=0)return null;const parts=repository.split('/');if(parts.length!==2)return null;const [owner,repo]=parts;if(!owner||!repo||owner==='.'||owner==='..'||repo==='.'||repo==='..')return null;if(!/^[A-Za-z0-9-]+$/.test(owner)||!/^[A-Za-z0-9._-]+$/.test(repo))return null;return 'https://github.com/'+owner+'/'+repo+'/pull/'+prNumber;}
|
|
192
192
|
function safeCommitUrl(repository,sha){if(typeof repository!=='string'||typeof sha!=='string'||!/^[0-9a-f]{7,64}$/i.test(sha))return null;const parts=repository.split('/');if(parts.length!==2||!parts[0]||!parts[1])return null;return 'https://github.com/'+parts[0]+'/'+parts[1]+'/commit/'+sha;}
|
|
193
193
|
function commitField(label,job,sha){const box=element('div','detail-group');box.append(element('p','detail-label',text(label)));const line=element('p','detail-value');const url=safeCommitUrl(job?.repository,sha);if(url){const link=document.createElement('a');link.href=url;link.target='_blank';link.rel='noopener noreferrer';link.textContent=sha.slice(0,7);line.append(link);}else line.append(text(sha||'—'));box.append(line);return box;}
|
|
194
|
-
function prField(job){if(job.
|
|
194
|
+
function prField(job){if(Number(job.prNumber||0)===0)return field('GitHub PR','Not applicable');const box=element('div','detail-group');box.append(element('p','detail-label',text('GitHub PR')));const line=element('p','detail-value');const prNumber=Number(job.prNumber||0);const url=safePrUrl(job.repository,prNumber);if(url){const link=document.createElement('a');link.href=url;link.target='_blank';link.rel='noopener noreferrer';link.textContent='PR #'+prNumber;line.append(link);}else line.append(text('unavailable'));box.append(line);return box;}
|
|
195
195
|
function safeWorkerThreadUrl(input,adapter){try{const url=new URL(input);const parts=url.pathname.split('/');const domain=adapter==='z'?'chat.z.ai':'chatgpt.com';if(url.protocol!=='https:'||url.hostname!==domain||parts.length!==3||parts[1]!=='c'||!/^[A-Za-z0-9_-]{8,160}$/.test(parts[2]))return null;return url.origin+url.pathname;}catch{return null;}}
|
|
196
196
|
function chatField(task){const box=element('div','detail-group');box.append(element('p','detail-label',text('Worker threads')));const items=Array.isArray(task.threadHistory)?task.threadHistory.slice(-8).reverse():[];if(items.length===0)items.push({threadUrl:task.threadUrl,attempt:task.attempt});let shown=0;for(const item of items){const url=safeWorkerThreadUrl(item.threadUrl,task.adapter);if(!url)continue;const line=element('p','detail-value');const link=document.createElement('a');link.href=url;link.target='_blank';link.rel='noopener noreferrer';link.textContent='Open '+(task.adapter==='z'?'Z.ai':'ChatGPT')+' thread'+(Number.isInteger(item.attempt)?' · attempt '+item.attempt:'');line.append(link);box.append(line);shown++;}if(!shown){const line=element('p','detail-value');if(task.adapter==='chatgpt'&&typeof task.threadId==='string'){const url=safeWorkerThreadUrl('https://chatgpt.com/c/'+encodeURIComponent(task.threadId),'chatgpt');if(url){const link=document.createElement('a');link.href=url;link.target='_blank';link.rel='noopener noreferrer';link.textContent='Open ChatGPT thread';line.append(link);shown++;}}if(!shown)line.append(text('—'));box.append(line);}return box;}
|
|
197
197
|
function taskCommentField(task){const box=element('div','detail-group');box.append(element('p','detail-label',text('PR comment')));const line=element('p','detail-value');if(typeof task.taskUrl==='string'&&task.taskUrl.startsWith('https://github.com/')){const link=document.createElement('a');link.className='task-link';link.href=task.taskUrl;link.target='_blank';link.rel='noopener noreferrer';link.textContent='Open task comment';line.append(link);}else line.append(text('—'));box.append(line);return box;}
|
|
@@ -255,8 +255,7 @@ function applyJelHighlights(svg){
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
function jelField(job){const box=element('div','detail-group');box.append(element('p','detail-label',text('Job Execution Lifecycle')));const line=element('p','detail-value');const link=element('a','',text('View JEL chart'));link.href='#graph-dialog';link.addEventListener('click',event=>{event.preventDefault();void openJelChart(job);});line.append(link);box.append(line);return box;}
|
|
258
|
-
function
|
|
259
|
-
function renderJobList(){jobList.replaceChildren();const visible=filteredJobs();if(!jobs.length){jobList.append(element('li','empty',text('No durable jobs discovered.')));return;}if(!visible.length){jobList.append(element('li','empty',text('No jobs match the selected filters.')));return;}for(const job of visible){const row=element('div','job-row'+(isCompleteUnmerged(job)?' complete-unmerged':''));row.setAttribute('aria-current',String(jobSelectionKey(job)===selectedJob));row.addEventListener('click',()=>selectJob(job));const content=element('div','job-content');const select=document.createElement('button');select.type='button';select.className='job-button';select.setAttribute('aria-current',String(jobSelectionKey(job)===selectedJob));select.title=job.title||job.id;select.addEventListener('click',event=>{event.stopPropagation();selectJob(job);});select.append(element('span','job-title',text(repoName(job.repository)+'/'+value(job.id)+(Number(job.prNumber||0)>0?'/PR#'+value(job.prNumber):'')+': '+value(job.title||job.id))));const states=element('span','job-status-line');states.append(element('span','badge '+value(job.state),text(value(job.state))));if(job.executionMode==='shortcut')states.append(element('span','badge shortcut-mode',text('SHORTCUT')));states.append(element('span','badge '+value(job.runtimeStatus||'IDLE'),text(value(job.runtimeStatus||'IDLE'))));if(job.publicationFailure)states.append(element('span','badge FAILED',text('PUBLISH FAILED: '+value(job.publicationFailure.stage))));else if(job.publication?.version)states.append(element('span','badge SUCCEEDED',text('v'+job.publication.version)));else if(Number(job.prNumber||0)>0&&job.githubState==='MERGED')states.append(element('span','badge MERGED',text('PR Merged')));else if(job.state==='COMPLETED'&&job.githubState==='CLOSED')states.append(element('span','badge SUCCEEDED',text('PR Archived')));if(job.state==='ACTIVE'&&job.reviewEnabled!==false)states.append(element('span','badge flag-review',text('REVIEW REQUIRED')));if(job.localMerge?.status==='failed')states.append(element('span','badge FAILED',text('MERGE FAILED: '+value(job.localMerge.error||'Unknown error'))));else if(isCompleteUnmerged(job))states.append(element('span','badge MERGE_PENDING',text('MERGE PENDING')));const primary=element('div','job-primary');primary.append(states);const lastLine=element('div','job-last-line');lastLine.append(element('span','subtle',text(compactCounts(counts(job.tasks)))),element('span','subtle',text(relativeTime(job.updatedAt))));content.append(select,primary,lastLine);row.append(content);jobList.append(element('li','',row));}}
|
|
258
|
+
function renderJobList(){jobList.replaceChildren();const visible=filteredJobs();if(!jobs.length){jobList.append(element('li','empty',text('No durable jobs discovered.')));return;}if(!visible.length){jobList.append(element('li','empty',text('No jobs match the selected filters.')));return;}for(const job of visible){const row=element('div','job-row'+(isCompleteUnmerged(job)?' complete-unmerged':''));row.setAttribute('aria-current',String(jobSelectionKey(job)===selectedJob));row.addEventListener('click',()=>selectJob(job));const content=element('div','job-content');const select=document.createElement('button');select.type='button';select.className='job-button';select.setAttribute('aria-current',String(jobSelectionKey(job)===selectedJob));select.title=job.title||job.id;select.addEventListener('click',event=>{event.stopPropagation();selectJob(job);});select.append(element('span','job-title',text(repoName(job.repository)+'/'+value(job.id)+(Number(job.prNumber||0)>0?'/PR#'+value(job.prNumber):'')+': '+value(job.title||job.id))));const states=element('span','job-status-line');states.append(element('span','badge '+value(job.state),text(value(job.state))));states.append(element('span','badge '+value(job.runtimeStatus||'IDLE'),text(value(job.runtimeStatus||'IDLE'))));if(job.publicationFailure)states.append(element('span','badge FAILED',text('PUBLISH FAILED: '+value(job.publicationFailure.stage))));else if(job.publication?.version)states.append(element('span','badge SUCCEEDED',text('v'+job.publication.version)));else if(Number(job.prNumber||0)>0&&job.githubState==='MERGED')states.append(element('span','badge MERGED',text('PR Merged')));else if(job.state==='COMPLETED'&&job.githubState==='CLOSED')states.append(element('span','badge SUCCEEDED',text('PR Archived')));if(job.state==='ACTIVE'&&job.reviewEnabled!==false)states.append(element('span','badge flag-review',text('REVIEW REQUIRED')));if(job.localMerge?.status==='failed')states.append(element('span','badge FAILED',text('MERGE FAILED: '+value(job.localMerge.error||'Unknown error'))));else if(isCompleteUnmerged(job))states.append(element('span','badge MERGE_PENDING',text('MERGE PENDING')));const primary=element('div','job-primary');primary.append(states);const lastLine=element('div','job-last-line');lastLine.append(element('span','subtle',text(compactCounts(counts(job.tasks)))),element('span','subtle',text(relativeTime(job.updatedAt))));content.append(select,primary,lastLine);row.append(content);jobList.append(element('li','',row));}}
|
|
260
259
|
function taskTagDisplay(job,task){const display=task.tag&&job?.tag?.values?.[task.tag];return typeof display==='string'&&display?display:null;}
|
|
261
260
|
function taskVerdict(job,task){if(task.state!=="SUCCEEDED")return null;const data=task.result?.data||{};if(["reviewer","job-acceptance-reviewer"].includes(task.agentName)){const verdict=data.verdict||((job?.review?.taskId===task.id)?job.review.outcome:null);return ({approved:"APPROVED",pass:"APPROVED","changes-required":"CHANGES REQUIRED",changes_required:"CHANGES REQUIRED"})[verdict]||null;}if(task.agentName==="troubleshooter"){const original=job?.tasks?.find(t=>t.id===task.parentTaskId);const resolution=original?.resolution;if(resolution?.state!=="resolved"||resolution.owner!=="troubleshooter")return null;return ({exact_original_retry:"RETRY VERIFIED",same_job_dependency:"DEPENDENCY REGISTERED",blocker_job_dependency:"BLOCKER REGISTERED",cancel_supersede:"SUPERSEDED"})[resolution.path]||null;}return null;}function taskSubtreeComplete(task,children){return ['SUCCEEDED','CANCELLED'].includes(task.state)&&(children.get(task.id)||[]).every(child=>taskSubtreeComplete(child,children));}
|
|
262
261
|
function taskStateLabel(task){const resolution=task?.resolution?.state;return task?.state==='FAILED'&&typeof resolution==='string'&&resolution.trim()?task.state+' / '+resolution:task.state;}
|
|
@@ -272,7 +271,7 @@ function taskStateField(task){const box=element('div','detail-group');box.append
|
|
|
272
271
|
function manualOverrideField(task){const rows=Array.isArray(task.manualStateOverrides)?task.manualStateOverrides:[];const last=rows.at(-1);return field('Manual override',last?last.from+' → '+last.to+' · '+relativeTime(last.at):'—');}
|
|
273
272
|
function iconSvg(name){const paths={close:'M5 5l14 14M19 5 5 19',detail:'M7 3h7l4 4v14H7zM14 3v5h4M10 12h5m-5 4h5'};const ns='http://www.w3.org/2000/svg';const svg=document.createElementNS(ns,'svg');svg.setAttribute('viewBox','0 0 24 24');svg.setAttribute('aria-hidden','true');const path=document.createElementNS(ns,'path');path.setAttribute('d',paths[name]);svg.append(path);return svg;}
|
|
274
273
|
function showDetailsDialog(title,sections){const dialog=element('dialog','details-dialog');dialog.setAttribute('aria-label',title);const head=element('div','details-dialog-head');const name=element('strong','',text(title));const close=element('button','icon-button');close.append(iconSvg('close'));close.type='button';close.setAttribute('aria-label','Close details');close.title='Close details';close.addEventListener('click',()=>dialog.close());head.append(name,close);dialog.append(head);for(const [label,value] of sections){if(value===undefined||value===null||value==='')continue;dialog.append(element('h3','',text(label)));const content=element('pre');content.textContent=typeof value==='string'?value:JSON.stringify(value,null,2);dialog.append(content);}dialog.addEventListener('close',()=>dialog.remove());document.body.append(dialog);dialog.showModal();}function openJobDetails(){const job=selected();if(!job)return;showDetailsDialog('Job '+job.id+' · '+value(job.title),[['Objective',job.objective],['Description',job.description],['State',job.state],['Plans',job.plans?.map(p=>({id:p.id,status:p.status,assessment:p.assessment,error:p.error,generatedTaskIds:p.generatedTaskIds}))],['Review',job.review],['Outcome',job.result],['Publication',job.publication],['Failure',job.error]]);}function openTaskDetails(task){const result=task.result?.data??task.result;showDetailsDialog('Task '+task.id+' · '+value(task.title),[['Input / task objective',task.input],['State',task.state],['Conclusion',result],['Result summary',task.result?.summary],['Planner assessment',task.plannerResult?.assessment],['Resolution',task.resolution],['Resolution classification',task.resolutionClassification],['Failure',task.failureReason||task.error],['Dependencies',task.dependencies]]);}document.querySelector('#job-content-open').addEventListener('click',openJobDetails);function renderTaskDetail(task){taskDetailRoot.replaceChildren();if(!task){taskDetailRoot.append(element('p','empty',text('Select a task to inspect execution details.')));return;}const routing=task.routing||{};const groups=element('div','detail-groups');groups.append(field('Title',task.title||'—'),field('Task ID',task.id),field('Kind',task.kind||'work'),taskStateField(task),...(task.state==='FAILED'&&task.resolution?.state?[field('Resolution state',task.resolution.state),field('Resolution path',task.resolution.path||'—'),field('Resolution target',task.resolution.targetTaskId||'—')]:[]),manualOverrideField(task),field('Planning decision',task.planningDecisionId||'—'),field('Planning source',task.planningSource||'—'),field('Planning round',task.planningRound===undefined?'—':String(task.planningRound)),field('Project / agent',value(task.projectName)+' / '+value(task.agentName)),field('Parent task',task.parentTaskId||'root'),...(task.resolutionClassification?[field('Resolution classification',task.resolutionClassification.kind),field('Resolution target',task.resolutionClassification.targetTaskId),field('Resolution evidence',task.resolutionClassification.evidence),field('Resolution reason',task.resolutionClassification.reason)]:[]),field('Adapter',task.adapter),field('Provider / model',value(routing.provider)+' / '+value(routing.model)),field('Reasoning / profile',value(routing.reasoning||routing.profile)),field('Attempt',attemptBudget(task)),field('Dependencies',Array.isArray(task.dependencies)&&task.dependencies.length?task.dependencies.join(', '):'none'),taskCommentField(task),chatField(task));const job=selected();if(task.reviewHeadSha&&job)groups.append(commitField('HEAD commit',job,task.reviewHeadSha));const graph=agentGraphField(task);if(graph)groups.append(graph);if(task.plannerResult)groups.append(field('Objective status',task.plannerResult.objective_status),markdownField('Assessment',task.plannerResult.assessment));if(task.error)groups.append(field('Error',task.error));const result=task.result?.data??task.result;if(result){groups.append(field('Conclusion',result.verdict||result.outcome?.verdict||task.result?.summary||'Available'));}taskDetailRoot.append(groups);const details=element('button','icon-button');details.append(iconSvg('detail'));details.type='button';details.setAttribute('aria-label','Task details and conclusion');details.title='Task details and conclusion';details.addEventListener('click',()=>openTaskDetails(task));taskDetailRoot.append(details);}
|
|
275
|
-
function reviewStatus(job){const review=job?.review;if(!review)return 'Not started';if(review.outcome==='approved'&&review.headSha===job.headSha)return 'MERGE READY · approved';const stale=Array.isArray(job?.tasks)&&job.tasks.some(task=>['reviewer','job-acceptance-reviewer'].includes(task.agentName)&&task.reviewHeadSha&&job.headSha&&task.reviewHeadSha!==job.headSha);if(stale)return 'STALE · awaiting review';return String(review.outcome||'pending').replace('_',' ').toUpperCase();}function renderSelectedJob(){jobDetail.replaceChildren();const job=selected();if(!job){selectedJobTitle.textContent='';jobContentButton.disabled=true;jobContentButton.dataset.state='IDLE';jobDetail.append(element('div','empty',text('No durable jobs discovered.')));buildTree([]);renderTaskDetail(null);return;}selectedJobTitle.textContent=value(job.title||job.id);jobContentButton.disabled=false;jobContentButton.dataset.state=JOB_STATES.includes(job.state)?job.state:'IDLE';jobContentButton.setAttribute('aria-label','Job details · '+value(job.state));jobContentButton.title='Job details · '+value(job.state);if(jobSelectionKey(job)!==selectedJob){selectedJob=jobSelectionKey(job);selectedTaskId=null;eventTaskId=null;clearEvents();rememberSelection();}const summary=element('div','job-summary');summary.append(field('PR state',job.
|
|
274
|
+
function reviewStatus(job){const review=job?.review;if(!review)return 'Not started';if(review.outcome==='approved'&&review.headSha===job.headSha)return 'MERGE READY · approved';const stale=Array.isArray(job?.tasks)&&job.tasks.some(task=>['reviewer','job-acceptance-reviewer'].includes(task.agentName)&&task.reviewHeadSha&&job.headSha&&task.reviewHeadSha!==job.headSha);if(stale)return 'STALE · awaiting review';return String(review.outcome||'pending').replace('_',' ').toUpperCase();}function renderSelectedJob(){jobDetail.replaceChildren();const job=selected();if(!job){selectedJobTitle.textContent='';jobContentButton.disabled=true;jobContentButton.dataset.state='IDLE';jobDetail.append(element('div','empty',text('No durable jobs discovered.')));buildTree([]);renderTaskDetail(null);return;}selectedJobTitle.textContent=value(job.title||job.id);jobContentButton.disabled=false;jobContentButton.dataset.state=JOB_STATES.includes(job.state)?job.state:'IDLE';jobContentButton.setAttribute('aria-label','Job details · '+value(job.state));jobContentButton.title='Job details · '+value(job.state);if(jobSelectionKey(job)!==selectedJob){selectedJob=jobSelectionKey(job);selectedTaskId=null;eventTaskId=null;clearEvents();rememberSelection();}const summary=element('div','job-summary');summary.append(field('PR state',Number(job.prNumber||0)===0?'Not applicable':job.githubState||'UNKNOWN'),jobStateField(job),field('Runtime status',job.runtimeStatus||'IDLE'),field('Review',job.reviewEnabled===false?'Not required':reviewStatus(job)),field('Creator thread',job.creatorThreadId||'—'),threadField('Implementation thread',job.implementationThreadId),threadField('Reviewer thread',job.reviewerThreadId),commitField('Review head SHA',job,job.review?.headSha||job.headSha||''),prField(job),field('Repository',job.repository||'—'),field('Last activity',relativeTime(job.updatedAt)),field('Task states',compactCounts(job.tasks)),jelField(job));jobDetail.append(summary);const selectedTask=(job.tasks||[]).find(task=>task.id===selectedTaskId)||null;if(selectedTaskId&&!selectedTask){selectedTaskId=null;eventTaskId=null;clearEvents();rememberSelection();}buildTree(job.tasks||[]);renderTaskDetail(selectedTask);renderEventScope();}function renderAll(){jobs.sort(compareJobs);syncFilters();renderJobList();renderSelectedJob();syncMobileJobsView();}
|
|
276
275
|
function isCompleteUnmerged(job){return job.runtimeStatus==='MERGE_PENDING';}
|
|
277
276
|
function compareJobs(a,b){const lifecycleGroup=job=>job.state==='COMPLETED'||job.state==='CANCELLED'?1:0;const timestamp=job=>{const updated=Date.parse(job.updatedAt||'');if(Number.isFinite(updated))return updated;const created=Date.parse(job.createdAt||'');return Number.isFinite(created)?created:0;};return lifecycleGroup(a)-lifecycleGroup(b)||timestamp(b)-timestamp(a)||String(a.repository||'').localeCompare(String(b.repository||''))||String(a.id||'').localeCompare(String(b.id||''));}
|
|
278
277
|
async function loadJSON(url){const response=await fetch(url);if(!response.ok)throw new Error(response.status+' '+response.statusText);return response.json();}
|
|
@@ -123,7 +123,7 @@ export class ReconcilerReviewBase extends ReconcilerRuntimeBase {
|
|
|
123
123
|
'This is a PRE-MERGE artifact approval gate: inspect exact PR head, requirements, tests and genuine blocking defects.',
|
|
124
124
|
'Do not block approval because automatic merge, Job COMPLETED, or post-merge validation has not occurred yet.',
|
|
125
125
|
'All non-review Tasks have terminal outcomes. Examine FAILED and CANCELLED Tasks and their recovery evidence; never approve an unresolved required outcome.',
|
|
126
|
-
'The Final Review is the Job completion check. Persist concrete, owner-attributed findings with a changes-required verdict; Relay
|
|
126
|
+
'The Final Review is the Job completion check. Persist concrete, owner-attributed findings with a changes-required verdict. A Job without an explicit Planner remains plan-free; request targeted revisions rather than assuming Relay creates a Planner round.',
|
|
127
127
|
'Do not treat historical failed attempts as current artifact defects; distinguish preserved baseline files from implementation.',
|
|
128
128
|
].join('\n\n');
|
|
129
129
|
const task = createTaskEntity(job, {
|
package/dist/reconciler.js
CHANGED
|
@@ -204,7 +204,7 @@ export class Reconciler extends ReconcilerReviewBase {
|
|
|
204
204
|
scheduled = refreshTaskDependencies(await this.store.load(jobId));
|
|
205
205
|
}
|
|
206
206
|
scheduled = refreshTaskDependencies(await this.maybeCreatePlanner(scheduled));
|
|
207
|
-
scheduled = refreshTaskDependencies(await reconcileDAGSchedule({ store: this.store, jobId, job: scheduled, projectPathForTask: async (j, t) => j.shortcutRunnerContext?.projectPath ?? (this.options.projectPathForJob ? this.options.projectPathForJob(j, t) : t.routing?.cwd ?? process.cwd()), roots: this.options.executionContextRoots }));
|
|
207
|
+
scheduled = refreshTaskDependencies(await reconcileDAGSchedule({ store: this.store, jobId, job: scheduled, projectPathForTask: async (j, t) => j.graphStartContext?.projectPath ?? j.shortcutRunnerContext?.projectPath ?? (this.options.projectPathForJob ? this.options.projectPathForJob(j, t) : t.routing?.cwd ?? process.cwd()), roots: this.options.executionContextRoots }));
|
|
208
208
|
if (scheduled.state !== previousState || scheduled.updatedAt !== job.updatedAt)
|
|
209
209
|
await this.store.saveJob(scheduled);
|
|
210
210
|
scheduled = await this.dispatchExecutableTasks(jobId);
|
|
@@ -463,7 +463,7 @@ export class Reconciler extends ReconcilerReviewBase {
|
|
|
463
463
|
let executionContext;
|
|
464
464
|
try {
|
|
465
465
|
const role = isFinalReviewAgent(task.agentName) ? 'reviewer' : task.agentName === 'troubleshooter' ? 'troubleshooter' : task.parentTaskId ? 'nested-worker' : 'worker';
|
|
466
|
-
const projectPath = task.dagNode && job.shortcutRunnerContext?.projectPath ? job.shortcutRunnerContext.projectPath : this.options.projectPathForJob ? await this.options.projectPathForJob(job, task) : task.routing?.cwd ?? process.cwd();
|
|
466
|
+
const projectPath = task.dagNode && (job.graphStartContext?.projectPath ?? job.shortcutRunnerContext?.projectPath) ? (job.graphStartContext?.projectPath ?? job.shortcutRunnerContext.projectPath) : this.options.projectPathForJob ? await this.options.projectPathForJob(job, task) : task.routing?.cwd ?? process.cwd();
|
|
467
467
|
executionContext = await this.resolvedContext(job, task, role, projectPath);
|
|
468
468
|
}
|
|
469
469
|
catch (error) {
|
package/dist/relayd-control.js
CHANGED
|
@@ -34,7 +34,7 @@ export function createWorkspaceControl(deps) {
|
|
|
34
34
|
priority: options.priority,
|
|
35
35
|
tag: options.tag,
|
|
36
36
|
reviewEnabled: typeof options.reviewEnabled === 'boolean' ? options.reviewEnabled : undefined,
|
|
37
|
-
|
|
37
|
+
contentOnly: options.contentOnly === true || options.executionMode === 'shortcut',
|
|
38
38
|
continuation: options.continuation,
|
|
39
39
|
reviewerThreadId: typeof options.reviewerThreadId === 'string' ? options.reviewerThreadId : undefined,
|
|
40
40
|
creatorThreadId: typeof options.creatorThreadId === 'string' ? options.creatorThreadId : undefined,
|
package/dist/review-replan.js
CHANGED
|
@@ -25,7 +25,11 @@ export function reviewPlanReady(job) {
|
|
|
25
25
|
return false;
|
|
26
26
|
const latest = (job.plans ?? []).at(-1);
|
|
27
27
|
const legacy = !latest && job.tasks.some(task => task.kind === 'planner' && task.state === 'SUCCEEDED');
|
|
28
|
-
|
|
28
|
+
// A plan-free Graph Job has no Planner round to wait for. Final Review
|
|
29
|
+
// still validates its durable Agent Tasks under the same Job lifecycle.
|
|
30
|
+
if (!legacy && latest && latest.status !== 'SUCCEEDED')
|
|
31
|
+
return false;
|
|
32
|
+
if (!job.tasks.some(task => task.kind !== 'planner' && !isFinalReviewAgent(task.agentName)))
|
|
29
33
|
return false;
|
|
30
34
|
const review = job.review;
|
|
31
35
|
if (!review?.taskId || review.revisionDisposition === 'targeted')
|
package/dist/runtime-status.js
CHANGED
|
@@ -69,6 +69,11 @@ export function deriveJobRuntimeStatus(job, _prState = 'OPEN') {
|
|
|
69
69
|
return 'BLOCKED';
|
|
70
70
|
return 'WAITING'; // External Shortcut Runner has not started or needs a resume.
|
|
71
71
|
}
|
|
72
|
+
// A DAG Coordinator is not a leased worker. Human review waiting takes
|
|
73
|
+
// precedence unless another Agent Task is genuinely running.
|
|
74
|
+
if (job.tasks.some(t => t.state === 'AWAITING_DECISION') &&
|
|
75
|
+
!job.tasks.some(t => t.state === 'RUNNING' && t.executionId !== null && t.leaseOwner))
|
|
76
|
+
return 'WAITING';
|
|
72
77
|
const currentPlan = job.plans?.at(-1);
|
|
73
78
|
// An unresolved planner failure is a Job failure, not an idle Job.
|
|
74
79
|
// Active task execution still takes precedence below.
|
|
@@ -7,7 +7,7 @@ const source = readFileSync(new URL('../../workflow/planner-orchestration.mmd',
|
|
|
7
7
|
const boolGuard = (name) => (facts) => facts.durableFacts[name] === true;
|
|
8
8
|
export const plannerOrchestrationV2 = new GraphRuntime(source, {
|
|
9
9
|
states: new Set([
|
|
10
|
-
'idle', 'check_legacy_pending', 'check_recover', 'check_plan_failure', 'check_plan_recovery', 'check_plan_recovery_exists', 'check_seed', 'check_planner', 'check_resolution_ownership',
|
|
10
|
+
'idle', 'check_legacy_pending', 'check_recover', 'check_plan_failure', 'check_plan_recovery', 'check_plan_recovery_exists', 'check_seed', 'check_planner_opt_in', 'check_planner', 'check_resolution_ownership',
|
|
11
11
|
'check_blocked', 'check_work', 'check_materialized', 'check_review', 'wait', 'recovered', 'created',
|
|
12
12
|
]),
|
|
13
13
|
guards: {
|
|
@@ -17,6 +17,7 @@ export const plannerOrchestrationV2 = new GraphRuntime(source, {
|
|
|
17
17
|
planRecoveryExists: boolGuard('planRecoveryExists'),
|
|
18
18
|
planRecoveryVerified: boolGuard('planRecoveryVerified'),
|
|
19
19
|
hasSeedWork: boolGuard('hasSeedWork'),
|
|
20
|
+
planningRequested: boolGuard('planningRequested'),
|
|
20
21
|
noActivePlanner: boolGuard('noActivePlanner'),
|
|
21
22
|
resolutionOwnedByTroubleshooter: boolGuard('resolutionOwnedByTroubleshooter'),
|
|
22
23
|
noBlockedWork: boolGuard('noBlockedWork'),
|
|
@@ -61,6 +62,7 @@ export function plannerOrchestrationFacts(job, recoverablePendingPlan) {
|
|
|
61
62
|
planRecoveryExists: Boolean(recovery),
|
|
62
63
|
planRecoveryVerified: recoveryVerified,
|
|
63
64
|
hasSeedWork: !((job.plans?.length ?? 0) === 0 && job.tasks.filter(task => task.kind !== 'planner').length === 0),
|
|
65
|
+
planningRequested: Boolean(job.initialPlanning || scopedPlans.length || scopedTasks.some(task => task.kind === 'planner') || !scopedTasks.some(task => Boolean(task.agentGraph)) || reviewNeedsReplan(job)),
|
|
64
66
|
noActivePlanner: failedPlan?.manualPlanning ? false : unblockNeedsNewPlan(job) || !unconsumedUnblockTrigger(job) ? !scopedPlans.some(plan => plan.status === 'PLANNING') : false,
|
|
65
67
|
noBlockedWork: Boolean(unconsumedUnblockTrigger(job)) || !scopedTasks.some(task => task.kind !== 'planner' && isEffectivelyBlocked(task)),
|
|
66
68
|
noActiveImplementation: !scopedTasks.some(task => task.kind !== 'planner' && (['QUEUED', 'RUNNING', 'AWAITING_DECISION'].includes(task.state) || (task.state === 'DRAFT' && !task.unblock))),
|
package/package.json
CHANGED
|
@@ -45,8 +45,10 @@ Task and Planner context commands reject stale identities. Optional `--repo` con
|
|
|
45
45
|
Graph Tasks use Relay's ordinary Task Reconciler: `agentGraph` becomes a
|
|
46
46
|
**Coordinator** with durable Agent-named children created as dependencies become
|
|
47
47
|
ready. Script and Model are Task execution choices; each has the same
|
|
48
|
-
Task-level retry, failure and review semantics.
|
|
49
|
-
|
|
48
|
+
Task-level retry, failure and review semantics. `job run --id JOB --task-id TASK` activates any create-only Graph Job and
|
|
49
|
+
hands it to that same Reconciler; it is not a separate DAG scheduler or Job
|
|
50
|
+
execution mode. Set `--content-only` at creation only when Final Review and
|
|
51
|
+
Merge are not required. A Graph needs no Planner unless one is requested.
|
|
50
52
|
|
|
51
53
|
## 3. Verify, review, and recover
|
|
52
54
|
|
|
@@ -12,6 +12,7 @@ checkPlanRecovery["state: check_plan_recovery"]
|
|
|
12
12
|
checkPlanRecoveryExists["state: check_plan_recovery_exists"]
|
|
13
13
|
checkSeed["state: check_seed"]
|
|
14
14
|
checkPlanner["state: check_planner"]
|
|
15
|
+
checkOptIn["state: check_planner_opt_in"]
|
|
15
16
|
checkResolution["state: check_resolution_ownership"]
|
|
16
17
|
checkBlocked["state: check_blocked"]
|
|
17
18
|
checkWork["state: check_work"]
|
|
@@ -27,6 +28,7 @@ terminalFailure["guard: terminalPlanFailure"]
|
|
|
27
28
|
recoveryVerified["guard: planRecoveryVerified"]
|
|
28
29
|
recoveryExists["guard: planRecoveryExists"]
|
|
29
30
|
hasSeed["guard: hasSeedWork"]
|
|
31
|
+
planningEnabled["guard: planningRequested"]
|
|
30
32
|
noActivePlanner["guard: noActivePlanner"]
|
|
31
33
|
resolutionOwned["guard: resolutionOwnedByTroubleshooter"]
|
|
32
34
|
noBlocked["guard: noBlockedWork"]
|
|
@@ -64,7 +66,10 @@ createRecovery --> created
|
|
|
64
66
|
|
|
65
67
|
checkSeed -->|on: planner.reconcile| hasSeed
|
|
66
68
|
hasSeed -->|false| wait
|
|
67
|
-
hasSeed -->|true|
|
|
69
|
+
hasSeed -->|true| checkOptIn
|
|
70
|
+
checkOptIn -->|on: planner.reconcile| planningEnabled
|
|
71
|
+
planningEnabled -->|false| wait
|
|
72
|
+
planningEnabled -->|true| checkPlanner
|
|
68
73
|
|
|
69
74
|
checkPlanner -->|on: planner.reconcile| noActivePlanner
|
|
70
75
|
noActivePlanner -->|false| wait
|