agents-relay 2.0.214 → 2.0.216

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 CHANGED
@@ -102,7 +102,7 @@ When provided, --thread-id persists a reviewer destination; otherwise the Job re
102
102
  Managed host interaction (Node Wrapper normally calls these automatically):
103
103
  agents-relay review interactive begin --id JOB --task-id TASK --execution-id EXEC
104
104
  agents-relay review interactive wait --id JOB --task-id TASK --execution-id EXEC --invocation-id INV
105
- agents-relay review interactive ready --id JOB --task-id TASK --execution-id EXEC --invocation-id INV --revision SHA256
105
+ agents-relay review interactive ready --id JOB --task-id TASK --execution-id EXEC --invocation-id INV --revision GIT_COMMIT_SHA
106
106
  agents-relay review interactive fail --id JOB --task-id TASK --execution-id EXEC --invocation-id INV --reason REASON
107
107
  agents-relay review interactive abort --id JOB --task-id TASK --execution-id EXEC --invocation-id INV
108
108
  The CLI controls the running Relay daemon; this is not a separate Worker step.`,
@@ -22,8 +22,8 @@ export async function runInteractiveReviewCommand(argv) {
22
22
  if (action !== 'begin' && !invocationId)
23
23
  throw new Error('review interactive ' + action + ' requires --invocation-id');
24
24
  const revision = arg(args, '--revision');
25
- if (action === 'ready' && !/^[a-f0-9]{64}$/.test(revision))
26
- throw new Error('review interactive ready requires --revision SHA256');
25
+ if (action === 'ready' && !/^[a-f0-9]{40}$/.test(revision))
26
+ throw new Error('review interactive ready requires full 40-character Git Commit SHA');
27
27
  if (action === 'fail' && !arg(args, '--reason').trim())
28
28
  throw new Error('review interactive fail requires --reason');
29
29
  const body = { command: `review.interactive.${action}`, jobId, taskId, executionId };
@@ -54,11 +54,15 @@ export function normalizeInteractiveDecision(event) {
54
54
  return null;
55
55
  if (event.source?.id !== `job/${jobId}/task/${taskId}/execution/${executionId}`)
56
56
  return null;
57
- if (value.contentHash !== undefined && typeof value.feedback !== 'string')
58
- return null;
59
57
  const feedback = typeof value.feedback === 'string' ? value.feedback : null;
58
+ const commitSha = string('commitSha');
60
59
  const contentHash = string('contentHash');
61
- if (contentHash && contentHash !== revision)
60
+ if (commitSha) {
61
+ if (!/^[a-f0-9]{40}$/.test(commitSha) || revision !== commitSha ||
62
+ value.contentHash !== undefined || value.revisionId !== undefined || feedback === null)
63
+ return null;
64
+ }
65
+ else if (contentHash && (contentHash !== revision || feedback === null))
62
66
  return null;
63
67
  const comments = value.comments;
64
68
  if (comments !== undefined && (!Array.isArray(comments) || comments.length > 100 ||
@@ -68,6 +72,7 @@ export function normalizeInteractiveDecision(event) {
68
72
  return {
69
73
  jobId, taskId, executionId, invocationId, revision, decision,
70
74
  feedback: feedback ?? undefined,
75
+ commitSha: commitSha ?? undefined,
71
76
  contentHash: contentHash ?? undefined, revisionId: string('revisionId') ?? undefined,
72
77
  previewId: string('previewId') ?? undefined, requestId: string('requestId') ?? undefined,
73
78
  idempotencyKey: string('idempotencyKey') ?? undefined,
@@ -88,11 +93,12 @@ export function interactiveDecisionFingerprint(decision) {
88
93
  comments: decision.comments ?? null,
89
94
  })).digest('hex');
90
95
  }
91
- /** First event for an unbound interaction must carry immutable video identity. */
96
+ /** Event-only review identity is exactly one complete Git commit SHA. */
92
97
  export function eventOnlyReviewEligible(delivery) {
93
- return Boolean(delivery.contentHash && /^[a-f0-9]{64}$/.test(delivery.contentHash) &&
94
- delivery.revision === delivery.contentHash && delivery.feedback !== undefined &&
95
- [delivery.revisionId, delivery.requestId, delivery.idempotencyKey, delivery.invocationId]
98
+ return Boolean(delivery.commitSha && /^[a-f0-9]{40}$/.test(delivery.commitSha) &&
99
+ delivery.revision === delivery.commitSha && !delivery.contentHash && !delivery.revisionId &&
100
+ delivery.feedback !== undefined &&
101
+ [delivery.requestId, delivery.idempotencyKey, delivery.invocationId]
96
102
  .every(value => typeof value === 'string' && value.length > 0 && value.length <= 128));
97
103
  }
98
104
  function invocationState(invocation) {
@@ -57,8 +57,8 @@ export async function abortInteractiveReview(store, jobId, taskId, executionId,
57
57
  });
58
58
  }
59
59
  export async function readyInteractiveReview(store, jobId, taskId, executionId, invocationId, revision) {
60
- if (!/^[a-f0-9]{64}$/.test(revision))
61
- throw new Error('Immutable revision must be SHA-256');
60
+ if (!/^[a-f0-9]{40}$/.test(revision))
61
+ throw new Error('Immutable review revision must be full Git Commit SHA');
62
62
  if (!store.mutateJob)
63
63
  throw new Error('Interactive review requires durable mutation');
64
64
  await store.mutateJob(jobId, job => {
@@ -101,12 +101,18 @@ export async function runShortcutModelNode(options) {
101
101
  if (item && typeof item === 'object' && !Array.isArray(item)) {
102
102
  const ref = item;
103
103
  const fields = Object.keys(ref);
104
+ // A Worker may naturally produce a path-only file record. Accept
105
+ // EXACTLY {path} (no unrecognized metadata), then let the Graph
106
+ // executor verify realpath confinement and SHA-256 as usual.
107
+ if (fields.length === 1 && fields[0] === 'path'
108
+ && typeof ref.path === 'string' && ref.path.trim())
109
+ return ref.path;
104
110
  if (fields.length === 2 && fields.includes('path')
105
111
  && ((fields.includes('type') && ref.type === 'file') || (fields.includes('kind') && ref.kind === 'file'))
106
112
  && typeof ref.path === 'string' && ref.path.trim())
107
113
  return ref.path;
108
114
  }
109
- throw new Error('Worker node returned unsupported artifact entry; expected a file path, {type:"file",path} or {kind:"file",path}');
115
+ throw new Error('Worker node returned unsupported artifact entry; expected a file path, {path}, {type:"file",path} or {kind:"file",path}');
110
116
  });
111
117
  return { ...record, artifacts: files };
112
118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.214",
3
+ "version": "2.0.216",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "repository": {
6
6
  "type": "git",
@@ -161,6 +161,8 @@ A newly created zero-task DRAFT Job waits for explicit initial planning (`plan`
161
161
 
162
162
  ## Task evidence and head identity
163
163
 
164
+ For Git-versioned Neo Project Interactive Previews, bind a verified full 40-character Git Commit SHA as the sole review revision (`data.interactive.commitSha`, and `data.interactive.revision` must equal it). Compiled media cache hashes, legacy Markcut `revisionId` and `contentHash` must not be used as the Event Review identity. The Producer creates the Stage Commit before requesting Preview; Relay continues to own the decision and Task lifecycle. Generic non-video interactions are not made into Git commits by this contract.
165
+
164
166
  ### Canonical Neo Project runs boundary
165
167
 
166
168
  `runs/` is durable runtime evidence, not source code and not temporary checkout state. When a Task's declared file output is under `runs/`, that Task and every semantic descendant execute directly in the canonical resolved project directory. Agents Relay MUST NOT create or switch those Tasks into per-execution Git worktrees.