agents-relay 2.0.250 → 2.0.251

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 CHANGED
@@ -19,6 +19,14 @@ Relay appends `--handoff-file`, optional `--on-needs-user-file`, and `--cwd`
19
19
  without using a shell. No Neo executable is assumed. Missing/failed executors
20
20
  produce `technical_failure` rather than silently resolving a blocker.
21
21
 
22
+ **Shortcut three-node L3 gate:** `npm run test:l3:shortcut` runs four isolated,
23
+ deterministic three-agent DAG scenarios: no review, sequential approvals,
24
+ Request Changes for a scripted node with a durable revision Worker, and
25
+ Request Changes for a model-only node with re-review. They exercise real
26
+ Shortcut CLI/SQLite/Git review identities and the real Reconciler with a
27
+ synthetic model adapter; no external model, iPhone, or production Job is used.
28
+ The gate is also included in `test:shortcut:dags` and `test:publish`.
29
+
22
30
  **Interactive Review:** Relay owns the generic
23
31
  `review.interactive.begin/wait/ready/fail/abort` lifecycle, immutable revision
24
32
  binding and decision correlation. The caller (e.g. Neo's Markcut MCP wrapper)
@@ -28,12 +28,11 @@ export async function beginInteractiveReview(store, jobId, taskId, executionId)
28
28
  reused = true; // Wrapper rejects a second compile for this pending request.
29
29
  }
30
30
  else if (!existing || (existing.executionId !== executionId &&
31
- (existing.status === 'changes_requested' || existing.status === 'awaiting_decision'))) {
32
- // A new authoritative RUNNING execution replaces a stale undelivered
33
- // invocation left behind by a crashed prior wrapper/worker. The old
34
- // execution cannot still be current by the Task execution guard above.
35
- // The prior decision remains in the durable decision ledger and Task
36
- // comments. A fresh execution may start the next preview revision.
31
+ (existing.status === 'changes_requested' || existing.status === 'awaiting_decision' || existing.status === 'approved'))) {
32
+ // A new authoritative execution can open the next Stage Preview after
33
+ // a prior approval, requested revision, or stale undelivered preview.
34
+ // The current execution guard prevents replacing an in-flight decision;
35
+ // historical decisions remain in the ledger and Task comments.
37
36
  invocationId = proposedId;
38
37
  task.interactiveInvocation = { invocationId, executionId, revision: `pending:${invocationId}`,
39
38
  status: 'awaiting_decision', boundAt: new Date().toISOString() };
@@ -54,7 +54,7 @@ export class Reconciler extends ReconcilerReviewBase {
54
54
  return;
55
55
  if (task.kind !== 'planner' && task.adapter !== 'orchestrator')
56
56
  await this.launch(job, task);
57
- }, context => `effect.launchTask:${context.jobId}:${context.taskId ?? 'task'}:${String(context.data?.attempt ?? 0)}`));
57
+ }, context => `effect.launchTask:${context.jobId}:${context.taskId ?? 'task'}:${String(context.data?.attempt ?? 0)}:${String(context.data?.reviewInvocationId ?? 'initial')}`));
58
58
  this.workflowEffects.register(new CallbackWorkflowEffectHandler('effect.launchShortcut', async (context) => launchShortcutEffect(this.store, this.options, context.jobId, context.taskId, event => this.emit(event)), context => `effect.launchShortcut:${context.jobId}:${context.taskId ?? 'task'}:${String(context.data?.attempt ?? 0)}`));
59
59
  this.workflowEffects.register(new CallbackWorkflowEffectHandler('effect.resumeShortcut', async (context) => resumeShortcutEffect(this.store, this.options, context.jobId, context.taskId, context.data, event => this.emit(event)), context => `effect.resumeShortcut:${context.jobId}:${context.taskId ?? 'task'}:${String(context.data?.executionId ?? '')}:${String(context.data?.nodeId ?? '')}:${String(context.data?.waitId ?? '')}`));
60
60
  this.workflowEffects.register(new CallbackWorkflowEffectHandler('effect.cancelActiveTasks', async (context) => this.cancelActiveTasks(context.jobId, String(context.data?.reason ?? 'Job terminated'))));
@@ -83,7 +83,7 @@ export class Reconciler extends ReconcilerReviewBase {
83
83
  for (const task of dispatchable) {
84
84
  const shortcut = task.result?.data?.shortcut;
85
85
  await transitionTaskEvent(task, 'dispatch', { dispatchable: true, shortcutExecution: scheduled.executionMode === 'shortcut' && scheduled.contentOnly === true && shortcut?.workerFallback !== true && Boolean(task.agentGraph), shortcutFallback: shortcut?.workerFallback === true, shortcutHasGraph: Boolean(task.agentGraph) }, async (actionId) => {
86
- const outcomes = await this.workflowEffects.execute([actionId], { jobId: scheduled.id, taskId: task.id, transitionKey: `dispatch:${task.attempt}`, data: { attempt: task.attempt } });
86
+ const outcomes = await this.workflowEffects.execute([actionId], { jobId: scheduled.id, taskId: task.id, transitionKey: `dispatch:${task.attempt}`, data: { attempt: task.attempt, ...(task.interactiveInvocation?.decidedAt ? { reviewInvocationId: task.interactiveInvocation.invocationId } : {}) } });
87
87
  await this.applyTaskEffectOutcomes(scheduled, task, outcomes);
88
88
  }, async () => { await this.store.saveTask(task); });
89
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.250",
3
+ "version": "2.0.251",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,8 +16,9 @@
16
16
  "test": "npm run test:full",
17
17
  "test:chatgpt-temp-quality": "AGENTS_RELAY_RUN_CHATGPT_TEMP_QUALITY=1 sh -c \"npm run build && node test/quality/run-temporary-chat.mjs\"",
18
18
  "dev": "tsx src/cli.ts",
19
- "test:publish": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=1 --test-force-exit test/*.test.js",
20
- "test:shortcut:dags": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=1 test/verification/shortcut-dag-matrix.test.mjs test/agent-shortcut.test.js",
19
+ "test:publish": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=1 --test-force-exit test/*.test.js test/verification/l3-shortcut-review.test.mjs",
20
+ "test:l3:shortcut": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=1 test/verification/l3-shortcut-review.test.mjs",
21
+ "test:shortcut:dags": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=1 test/verification/shortcut-dag-matrix.test.mjs test/verification/l3-shortcut-review.test.mjs test/agent-shortcut.test.js",
21
22
  "test:fast": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=2 test/workflow-lifecycle.test.js test/workflow-v2-lifecycle-parity.test.js test/workflow-effects.test.js test/relay-store.test.js test/local-authority.test.js test/local-jobid-routing.test.js test/interactive-request.test.js test/local-sqlite-jobid.test.js test/no-github.test.js test/reconcile-coordinator.test.js test/service-publication.test.js test/github-webhook.test.js test/verification/shortcut-dag-matrix.test.mjs",
22
23
  "test:full": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=1 test/*.test.js test/verification/shortcut-dag-matrix.test.mjs && npm run test:verification:l3",
23
24
  "test:verification:l1": "npm run build && node --test test/verification/harness.test.mjs test/verification/contract.test.mjs test/browser-worker-pool-graph.test.js test/verification/graph-inventory.test.mjs test/verification/dashboard-drilldown.test.mjs test/verification/evidence-matrix.test.mjs test/verification/task-resolution-classification.test.mjs test/verification/planner-contract.test.mjs test/verification/force-restate-validation.test.mjs test/planner-child-recovery.test.js",