@tangle-network/agent-interface 0.25.0 → 0.26.0

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
@@ -66,13 +66,13 @@ const provider: AgentEnvironmentProvider = {
66
66
 
67
67
  `AgentCandidateBundle` is the portable output of an improvement run: a recursively strict profile, an explicit disabled/no-op/changed code result, a shell-free launch, optional knowledge, isolated memory, ancestry, and spend.
68
68
  Execution either pins a candidate-selected container in the bundle or delegates container selection to the benchmark evaluator.
69
- For evaluator-owned task images, the protected runtime creates a separate plan for every candidate/task pair and binds the root repository, exact Git base, exact UTF-8 instruction bytes, selected OCI index, manifest, platform, task workspace, model, launch, counted attempt, retry policy, and tool-step limit before execution.
69
+ For evaluator-owned task images, the protected runtime creates a separate plan for every candidate/task pair and binds the exact result shape (workspace change or bounded typed output), UTF-8 instruction bytes, selected OCI index, manifest, platform, task workspace, model, launch, counted attempt, retry policy, and tool-step limit before execution.
70
70
  Instruction delivery is closed to one final argv element, exact stdin bytes followed by EOF, or a fixed file path exposed through `TANGLE_CANDIDATE_TASK_PATH`.
71
71
  That plan also binds the profile target workspace and every mounted path; benchmark adapters must restore or exclude task-targeted profile paths before capturing the submitted solution patch.
72
72
  Resources are embedded, addressed through closed S3/IPFS locators, or pinned to a full GitHub commit plus content digest.
73
73
  Candidate-authored process configuration is explicitly public; model authorization is evaluator-mediated and secret values never belong in the bundle.
74
74
  Because prompts and inline files are arbitrary text, producers must also run their normal secret scanner before persistence.
75
- Candidate v1 rejects unregistered backend extensions instead of accepting an untyped behavior or credential channel.
75
+ Candidate bundles reject unregistered backend extensions instead of accepting an untyped behavior or credential channel.
76
76
 
77
77
  `agentCandidateBundleSchema.parse()` proves only that the wire shape is valid.
78
78
  Before execution, an integrity verifier must omit only the top-level `digest`, canonicalize the rest with RFC 8785, hash the UTF-8 bytes to lowercase `sha256:<hex>`, verify every artifact, apply any Git patch to the declared base tree, and emit an `AgentCandidateMaterializationReceipt`.
@@ -60,25 +60,25 @@ export declare const agentCandidateCapturedArtifactSchema: z.ZodUnion<readonly [
60
60
  byteLength: z.ZodNumber;
61
61
  }, z.core.$strict>]>;
62
62
  export declare const agentCandidateWorkspaceManifestMaterialSchema: z.ZodObject<{
63
- schemaVersion: z.ZodLiteral<1>;
63
+ schemaVersion: z.ZodLiteral<2>;
64
64
  kind: z.ZodLiteral<"agent-candidate-workspace-manifest">;
65
65
  files: z.ZodArray<z.ZodObject<{
66
66
  path: z.ZodString;
67
- mode: z.ZodUnion<readonly [z.ZodLiteral<420>, z.ZodLiteral<493>]>;
67
+ mode: z.ZodNumber;
68
68
  sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
69
69
  byteLength: z.ZodNumber;
70
70
  }, z.core.$strict>>;
71
71
  }, z.core.$strict>;
72
72
  export declare const agentCandidateWorkspaceSnapshotEvidenceSchema: z.ZodObject<{
73
- schemaVersion: z.ZodLiteral<1>;
73
+ schemaVersion: z.ZodLiteral<2>;
74
74
  kind: z.ZodLiteral<"agent-candidate-workspace-snapshot">;
75
75
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
76
76
  material: z.ZodObject<{
77
- schemaVersion: z.ZodLiteral<1>;
77
+ schemaVersion: z.ZodLiteral<2>;
78
78
  kind: z.ZodLiteral<"agent-candidate-workspace-manifest">;
79
79
  files: z.ZodArray<z.ZodObject<{
80
80
  path: z.ZodString;
81
- mode: z.ZodUnion<readonly [z.ZodLiteral<420>, z.ZodLiteral<493>]>;
81
+ mode: z.ZodNumber;
82
82
  sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
83
83
  byteLength: z.ZodNumber;
84
84
  }, z.core.$strict>>;
@@ -65,14 +65,14 @@ export const agentCandidateCapturedArtifactSchema = z.union([
65
65
  ]);
66
66
  export const agentCandidateWorkspaceManifestMaterialSchema = z
67
67
  .object({
68
- schemaVersion: z.literal(1),
68
+ schemaVersion: z.literal(2),
69
69
  kind: z.literal("agent-candidate-workspace-manifest"),
70
70
  files: z.array(z
71
71
  .object({
72
72
  path: z
73
73
  .string()
74
74
  .refine((value) => isSafeRelativePath(value, false), "workspace manifest paths must be canonical and relative"),
75
- mode: z.union([z.literal(0o644), z.literal(0o755)]),
75
+ mode: z.number().int().min(0).max(0o777),
76
76
  sha256: sha256DigestSchema,
77
77
  byteLength: z.number().int().nonnegative(),
78
78
  })
@@ -94,7 +94,7 @@ export const agentCandidateWorkspaceManifestMaterialSchema = z
94
94
  });
95
95
  export const agentCandidateWorkspaceSnapshotEvidenceSchema = z
96
96
  .object({
97
- schemaVersion: z.literal(1),
97
+ schemaVersion: z.literal(2),
98
98
  kind: z.literal("agent-candidate-workspace-snapshot"),
99
99
  digest: sha256DigestSchema,
100
100
  material: agentCandidateWorkspaceManifestMaterialSchema,
@@ -235,15 +235,15 @@ export declare const agentCandidateExecutionSchema: z.ZodObject<{
235
235
  kind: z.ZodLiteral<"evaluator-task-container">;
236
236
  }, z.core.$strict>], "kind">;
237
237
  workspace: z.ZodOptional<z.ZodObject<{
238
- schemaVersion: z.ZodLiteral<1>;
238
+ schemaVersion: z.ZodLiteral<2>;
239
239
  kind: z.ZodLiteral<"agent-candidate-workspace-snapshot">;
240
240
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
241
241
  material: z.ZodObject<{
242
- schemaVersion: z.ZodLiteral<1>;
242
+ schemaVersion: z.ZodLiteral<2>;
243
243
  kind: z.ZodLiteral<"agent-candidate-workspace-manifest">;
244
244
  files: z.ZodArray<z.ZodObject<{
245
245
  path: z.ZodString;
246
- mode: z.ZodUnion<readonly [z.ZodLiteral<420>, z.ZodLiteral<493>]>;
246
+ mode: z.ZodNumber;
247
247
  sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
248
248
  byteLength: z.ZodNumber;
249
249
  }, z.core.$strict>>;
@@ -88,15 +88,15 @@ export declare const agentCandidateEffectiveMemorySchema: z.ZodDiscriminatedUnio
88
88
  emptyStateDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
89
89
  }, z.core.$strict>;
90
90
  beforeState: z.ZodObject<{
91
- schemaVersion: z.ZodLiteral<1>;
91
+ schemaVersion: z.ZodLiteral<2>;
92
92
  kind: z.ZodLiteral<"agent-candidate-workspace-snapshot">;
93
93
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
94
94
  material: z.ZodObject<{
95
- schemaVersion: z.ZodLiteral<1>;
95
+ schemaVersion: z.ZodLiteral<2>;
96
96
  kind: z.ZodLiteral<"agent-candidate-workspace-manifest">;
97
97
  files: z.ZodArray<z.ZodObject<{
98
98
  path: z.ZodString;
99
- mode: z.ZodUnion<readonly [z.ZodLiteral<420>, z.ZodLiteral<493>]>;
99
+ mode: z.ZodNumber;
100
100
  sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
101
101
  byteLength: z.ZodNumber;
102
102
  }, z.core.$strict>>;
@@ -150,8 +150,15 @@ export declare const agentCandidateExecutionLimitsSchema: z.ZodObject<{
150
150
  maxOutputTokens: z.ZodNumber;
151
151
  maxCostUsd: z.ZodNumber;
152
152
  }, z.core.$strict>;
153
+ export declare const agentCandidateTaskOutcomeSpecSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
154
+ kind: z.ZodLiteral<"workspace">;
155
+ }, z.core.$strict>, z.ZodObject<{
156
+ kind: z.ZodLiteral<"output">;
157
+ mediaType: z.ZodString;
158
+ maxBytes: z.ZodNumber;
159
+ }, z.core.$strict>], "kind">;
153
160
  export declare const agentCandidateExecutionPlanMaterialSchema: z.ZodObject<{
154
- schemaVersion: z.ZodLiteral<1>;
161
+ schemaVersion: z.ZodLiteral<2>;
155
162
  kind: z.ZodLiteral<"agent-candidate-execution-plan-material">;
156
163
  bundleDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
157
164
  executionId: z.ZodString;
@@ -182,22 +189,29 @@ export declare const agentCandidateExecutionPlanMaterialSchema: z.ZodObject<{
182
189
  path: z.ZodLiteral<"/tangle/input/task.txt">;
183
190
  }, z.core.$strict>], "kind">;
184
191
  }, z.core.$strict>;
185
- repository: z.ZodObject<{
192
+ repository: z.ZodOptional<z.ZodObject<{
186
193
  identity: z.ZodString;
187
194
  rootIdentity: z.ZodString;
188
195
  baseCommit: z.ZodString;
189
196
  baseTree: z.ZodString;
190
- }, z.core.$strict>;
197
+ }, z.core.$strict>>;
198
+ outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
199
+ kind: z.ZodLiteral<"workspace">;
200
+ }, z.core.$strict>, z.ZodObject<{
201
+ kind: z.ZodLiteral<"output">;
202
+ mediaType: z.ZodString;
203
+ maxBytes: z.ZodNumber;
204
+ }, z.core.$strict>], "kind">;
191
205
  workspace: z.ZodObject<{
192
- schemaVersion: z.ZodLiteral<1>;
206
+ schemaVersion: z.ZodLiteral<2>;
193
207
  kind: z.ZodLiteral<"agent-candidate-workspace-snapshot">;
194
208
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
195
209
  material: z.ZodObject<{
196
- schemaVersion: z.ZodLiteral<1>;
210
+ schemaVersion: z.ZodLiteral<2>;
197
211
  kind: z.ZodLiteral<"agent-candidate-workspace-manifest">;
198
212
  files: z.ZodArray<z.ZodObject<{
199
213
  path: z.ZodString;
200
- mode: z.ZodUnion<readonly [z.ZodLiteral<420>, z.ZodLiteral<493>]>;
214
+ mode: z.ZodNumber;
201
215
  sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
202
216
  byteLength: z.ZodNumber;
203
217
  }, z.core.$strict>>;
@@ -252,15 +266,15 @@ export declare const agentCandidateExecutionPlanMaterialSchema: z.ZodObject<{
252
266
  "git-patch": "git-patch";
253
267
  }>;
254
268
  candidateWorkspace: z.ZodOptional<z.ZodObject<{
255
- schemaVersion: z.ZodLiteral<1>;
269
+ schemaVersion: z.ZodLiteral<2>;
256
270
  kind: z.ZodLiteral<"agent-candidate-workspace-snapshot">;
257
271
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
258
272
  material: z.ZodObject<{
259
- schemaVersion: z.ZodLiteral<1>;
273
+ schemaVersion: z.ZodLiteral<2>;
260
274
  kind: z.ZodLiteral<"agent-candidate-workspace-manifest">;
261
275
  files: z.ZodArray<z.ZodObject<{
262
276
  path: z.ZodString;
263
- mode: z.ZodUnion<readonly [z.ZodLiteral<420>, z.ZodLiteral<493>]>;
277
+ mode: z.ZodNumber;
264
278
  sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
265
279
  byteLength: z.ZodNumber;
266
280
  }, z.core.$strict>>;
@@ -455,15 +469,15 @@ export declare const agentCandidateExecutionPlanMaterialSchema: z.ZodObject<{
455
469
  emptyStateDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
456
470
  }, z.core.$strict>;
457
471
  beforeState: z.ZodObject<{
458
- schemaVersion: z.ZodLiteral<1>;
472
+ schemaVersion: z.ZodLiteral<2>;
459
473
  kind: z.ZodLiteral<"agent-candidate-workspace-snapshot">;
460
474
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
461
475
  material: z.ZodObject<{
462
- schemaVersion: z.ZodLiteral<1>;
476
+ schemaVersion: z.ZodLiteral<2>;
463
477
  kind: z.ZodLiteral<"agent-candidate-workspace-manifest">;
464
478
  files: z.ZodArray<z.ZodObject<{
465
479
  path: z.ZodString;
466
- mode: z.ZodUnion<readonly [z.ZodLiteral<420>, z.ZodLiteral<493>]>;
480
+ mode: z.ZodNumber;
467
481
  sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
468
482
  byteLength: z.ZodNumber;
469
483
  }, z.core.$strict>>;
@@ -586,12 +600,87 @@ export declare const agentCandidateProfilePlanEvidenceSchema: z.ZodObject<{
586
600
  byteLength: z.ZodNumber;
587
601
  }, z.core.$strict>]>;
588
602
  }, z.core.$strict>;
589
- export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
603
+ export declare const agentCandidateProfileActivationSchema: z.ZodObject<{
590
604
  schemaVersion: z.ZodLiteral<1>;
605
+ kind: z.ZodLiteral<"agent-candidate-profile-activation">;
606
+ profilePlan: z.ZodObject<{
607
+ schemaVersion: z.ZodLiteral<1>;
608
+ kind: z.ZodLiteral<"agent-profile-workspace-plan">;
609
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
610
+ material: z.ZodType<{
611
+ version: 1;
612
+ harness: "claude-code" | "claude" | "claudish" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "kimi" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
613
+ files: {
614
+ relPath: string;
615
+ mode: number;
616
+ contentSha256: `sha256:${string}`;
617
+ }[];
618
+ env: Record<string, {
619
+ kind: "public";
620
+ value: string;
621
+ }>;
622
+ flags: {
623
+ kind: "public";
624
+ value: string;
625
+ }[];
626
+ unsupported: {
627
+ dimension: string;
628
+ reason: string;
629
+ }[];
630
+ }, unknown, z.core.$ZodTypeInternals<{
631
+ version: 1;
632
+ harness: "claude-code" | "claude" | "claudish" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "kimi" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
633
+ files: {
634
+ relPath: string;
635
+ mode: number;
636
+ contentSha256: `sha256:${string}`;
637
+ }[];
638
+ env: Record<string, {
639
+ kind: "public";
640
+ value: string;
641
+ }>;
642
+ flags: {
643
+ kind: "public";
644
+ value: string;
645
+ }[];
646
+ unsupported: {
647
+ dimension: string;
648
+ reason: string;
649
+ }[];
650
+ }, unknown>>;
651
+ artifact: z.ZodUnion<readonly [z.ZodObject<{
652
+ locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
653
+ kind: z.ZodLiteral<"s3">;
654
+ bucket: z.ZodString;
655
+ key: z.ZodString;
656
+ region: z.ZodOptional<z.ZodString>;
657
+ }, z.core.$strict>, z.ZodObject<{
658
+ kind: z.ZodLiteral<"ipfs">;
659
+ cid: z.ZodString;
660
+ path: z.ZodOptional<z.ZodString>;
661
+ }, z.core.$strict>], "kind">;
662
+ sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
663
+ byteLength: z.ZodNumber;
664
+ }, z.core.$strict>, z.ZodObject<{
665
+ encoding: z.ZodLiteral<"base64">;
666
+ content: z.ZodString;
667
+ sha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
668
+ byteLength: z.ZodNumber;
669
+ }, z.core.$strict>]>;
670
+ }, z.core.$strict>;
671
+ files: z.ZodArray<z.ZodObject<{
672
+ path: z.ZodString;
673
+ mode: z.ZodNumber;
674
+ content: z.ZodString;
675
+ }, z.core.$strict>>;
676
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
677
+ }, z.core.$strict>;
678
+ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
679
+ schemaVersion: z.ZodLiteral<2>;
591
680
  kind: z.ZodLiteral<"agent-candidate-execution-plan">;
592
681
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
593
682
  material: z.ZodType<{
594
- schemaVersion: 1;
683
+ schemaVersion: 2;
595
684
  kind: "agent-candidate-execution-plan-material";
596
685
  bundleDigest: `sha256:${string}`;
597
686
  executionId: string;
@@ -619,22 +708,23 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
619
708
  path: "/tangle/input/task.txt";
620
709
  };
621
710
  };
622
- repository: {
623
- identity: string;
624
- rootIdentity: string;
625
- baseCommit: string;
626
- baseTree: string;
711
+ outcome: {
712
+ kind: "workspace";
713
+ } | {
714
+ kind: "output";
715
+ mediaType: string;
716
+ maxBytes: number;
627
717
  };
628
718
  workspace: {
629
- schemaVersion: 1;
719
+ schemaVersion: 2;
630
720
  kind: "agent-candidate-workspace-snapshot";
631
721
  digest: `sha256:${string}`;
632
722
  material: {
633
- schemaVersion: 1;
723
+ schemaVersion: 2;
634
724
  kind: "agent-candidate-workspace-manifest";
635
725
  files: {
636
726
  path: string;
637
- mode: 420 | 493;
727
+ mode: number;
638
728
  sha256: `sha256:${string}`;
639
729
  byteLength: number;
640
730
  }[];
@@ -678,6 +768,12 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
678
768
  byteLength: number;
679
769
  };
680
770
  };
771
+ repository?: {
772
+ identity: string;
773
+ rootIdentity: string;
774
+ baseCommit: string;
775
+ baseTree: string;
776
+ } | undefined;
681
777
  };
682
778
  workspaces: {
683
779
  taskRoot: string;
@@ -798,15 +894,15 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
798
894
  emptyStateDigest: `sha256:${string}`;
799
895
  };
800
896
  beforeState: {
801
- schemaVersion: 1;
897
+ schemaVersion: 2;
802
898
  kind: "agent-candidate-workspace-snapshot";
803
899
  digest: `sha256:${string}`;
804
900
  material: {
805
- schemaVersion: 1;
901
+ schemaVersion: 2;
806
902
  kind: "agent-candidate-workspace-manifest";
807
903
  files: {
808
904
  path: string;
809
- mode: 420 | 493;
905
+ mode: number;
810
906
  sha256: `sha256:${string}`;
811
907
  byteLength: number;
812
908
  }[];
@@ -866,15 +962,15 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
866
962
  mode: "disabled";
867
963
  };
868
964
  candidateWorkspace?: {
869
- schemaVersion: 1;
965
+ schemaVersion: 2;
870
966
  kind: "agent-candidate-workspace-snapshot";
871
967
  digest: `sha256:${string}`;
872
968
  material: {
873
- schemaVersion: 1;
969
+ schemaVersion: 2;
874
970
  kind: "agent-candidate-workspace-manifest";
875
971
  files: {
876
972
  path: string;
877
- mode: 420 | 493;
973
+ mode: number;
878
974
  sha256: `sha256:${string}`;
879
975
  byteLength: number;
880
976
  }[];
@@ -920,7 +1016,7 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
920
1016
  } | undefined;
921
1017
  knowledgeManifestDigest?: `sha256:${string}` | undefined;
922
1018
  }, unknown, z.core.$ZodTypeInternals<{
923
- schemaVersion: 1;
1019
+ schemaVersion: 2;
924
1020
  kind: "agent-candidate-execution-plan-material";
925
1021
  bundleDigest: `sha256:${string}`;
926
1022
  executionId: string;
@@ -948,22 +1044,23 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
948
1044
  path: "/tangle/input/task.txt";
949
1045
  };
950
1046
  };
951
- repository: {
952
- identity: string;
953
- rootIdentity: string;
954
- baseCommit: string;
955
- baseTree: string;
1047
+ outcome: {
1048
+ kind: "workspace";
1049
+ } | {
1050
+ kind: "output";
1051
+ mediaType: string;
1052
+ maxBytes: number;
956
1053
  };
957
1054
  workspace: {
958
- schemaVersion: 1;
1055
+ schemaVersion: 2;
959
1056
  kind: "agent-candidate-workspace-snapshot";
960
1057
  digest: `sha256:${string}`;
961
1058
  material: {
962
- schemaVersion: 1;
1059
+ schemaVersion: 2;
963
1060
  kind: "agent-candidate-workspace-manifest";
964
1061
  files: {
965
1062
  path: string;
966
- mode: 420 | 493;
1063
+ mode: number;
967
1064
  sha256: `sha256:${string}`;
968
1065
  byteLength: number;
969
1066
  }[];
@@ -1007,6 +1104,12 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
1007
1104
  byteLength: number;
1008
1105
  };
1009
1106
  };
1107
+ repository?: {
1108
+ identity: string;
1109
+ rootIdentity: string;
1110
+ baseCommit: string;
1111
+ baseTree: string;
1112
+ } | undefined;
1010
1113
  };
1011
1114
  workspaces: {
1012
1115
  taskRoot: string;
@@ -1127,15 +1230,15 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
1127
1230
  emptyStateDigest: `sha256:${string}`;
1128
1231
  };
1129
1232
  beforeState: {
1130
- schemaVersion: 1;
1233
+ schemaVersion: 2;
1131
1234
  kind: "agent-candidate-workspace-snapshot";
1132
1235
  digest: `sha256:${string}`;
1133
1236
  material: {
1134
- schemaVersion: 1;
1237
+ schemaVersion: 2;
1135
1238
  kind: "agent-candidate-workspace-manifest";
1136
1239
  files: {
1137
1240
  path: string;
1138
- mode: 420 | 493;
1241
+ mode: number;
1139
1242
  sha256: `sha256:${string}`;
1140
1243
  byteLength: number;
1141
1244
  }[];
@@ -1195,15 +1298,15 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
1195
1298
  mode: "disabled";
1196
1299
  };
1197
1300
  candidateWorkspace?: {
1198
- schemaVersion: 1;
1301
+ schemaVersion: 2;
1199
1302
  kind: "agent-candidate-workspace-snapshot";
1200
1303
  digest: `sha256:${string}`;
1201
1304
  material: {
1202
- schemaVersion: 1;
1305
+ schemaVersion: 2;
1203
1306
  kind: "agent-candidate-workspace-manifest";
1204
1307
  files: {
1205
1308
  path: string;
1206
- mode: 420 | 493;
1309
+ mode: number;
1207
1310
  sha256: `sha256:${string}`;
1208
1311
  byteLength: number;
1209
1312
  }[];
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { agentCandidateArtifactRefSchema, agentCandidateCapturedArtifactSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, } from "./agent-candidate-artifact-schema.js";
3
3
  import { agentCandidateContainerSchema, agentCandidateInstructionDeliverySchema, agentCandidateWorkingDirectorySchema, } from "./agent-candidate-code-schema.js";
4
- import { addDuplicateIssues, agentCandidateConfigValueSchema, environmentConfigSchema, gitObjectSchema, isCanonicalJsonValue, isObviouslyPrivateHostname, isSafeExecutable, isSafeRelativePath, sameGitObjectFormat, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
4
+ import { addDuplicateIssues, agentCandidateConfigValueSchema, agentCandidateMediaTypeSchema, environmentConfigSchema, gitObjectSchema, isCanonicalJsonValue, isObviouslyPrivateHostname, isSafeExecutable, isSafeRelativePath, isWellFormedUnicode, sameGitObjectFormat, sha256Utf8, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
5
5
  import { harnessTypeSchema } from "./harness.js";
6
6
  const reasoningEffortSchema = z.enum([
7
7
  "none",
@@ -140,9 +140,19 @@ export const agentCandidateExecutionLimitsSchema = z
140
140
  maxCostUsd: z.number().finite().nonnegative(),
141
141
  })
142
142
  .strict();
143
+ export const agentCandidateTaskOutcomeSpecSchema = z.discriminatedUnion("kind", [
144
+ z.object({ kind: z.literal("workspace") }).strict(),
145
+ z
146
+ .object({
147
+ kind: z.literal("output"),
148
+ mediaType: agentCandidateMediaTypeSchema,
149
+ maxBytes: z.number().int().positive().max(64 * 1024 * 1024),
150
+ })
151
+ .strict(),
152
+ ]);
143
153
  export const agentCandidateExecutionPlanMaterialSchema = z
144
154
  .object({
145
- schemaVersion: z.literal(1),
155
+ schemaVersion: z.literal(2),
146
156
  kind: z.literal("agent-candidate-execution-plan-material"),
147
157
  bundleDigest: sha256DigestSchema,
148
158
  executionId: z.string().min(1),
@@ -174,7 +184,9 @@ export const agentCandidateExecutionPlanMaterialSchema = z
174
184
  baseCommit: gitObjectSchema,
175
185
  baseTree: gitObjectSchema,
176
186
  })
177
- .strict(),
187
+ .strict()
188
+ .optional(),
189
+ outcome: agentCandidateTaskOutcomeSpecSchema,
178
190
  workspace: agentCandidateWorkspaceSnapshotEvidenceSchema,
179
191
  })
180
192
  .strict(),
@@ -282,13 +294,22 @@ export const agentCandidateExecutionPlanMaterialSchema = z
282
294
  })
283
295
  .strict()
284
296
  .superRefine((material, ctx) => {
285
- if (!sameGitObjectFormat(material.task.repository.baseCommit, material.task.repository.baseTree)) {
297
+ if (material.task.repository !== undefined &&
298
+ !sameGitObjectFormat(material.task.repository.baseCommit, material.task.repository.baseTree)) {
286
299
  ctx.addIssue({
287
300
  code: "custom",
288
301
  path: ["task", "repository"],
289
302
  message: "task Git object ids must use one object format",
290
303
  });
291
304
  }
305
+ if (material.task.outcome.kind === "workspace" &&
306
+ material.task.repository === undefined) {
307
+ ctx.addIssue({
308
+ code: "custom",
309
+ path: ["task", "repository"],
310
+ message: "workspace outcomes require task repository provenance",
311
+ });
312
+ }
292
313
  if (material.attempt.number > material.attempt.maxAttempts) {
293
314
  ctx.addIssue({
294
315
  code: "custom",
@@ -436,7 +457,8 @@ export const agentCandidateExecutionPlanMaterialSchema = z
436
457
  message: "active candidate workspaces cannot be empty",
437
458
  });
438
459
  }
439
- if (material.task.workspace.material.files.length === 0) {
460
+ if (material.task.outcome.kind === "workspace" &&
461
+ material.task.workspace.material.files.length === 0) {
440
462
  ctx.addIssue({
441
463
  code: "custom",
442
464
  path: ["task", "workspace", "material", "files"],
@@ -450,10 +472,10 @@ export const agentCandidateExecutionPlanMaterialSchema = z
450
472
  });
451
473
  }
452
474
  });
453
- function planEvidenceSchema(kind, material) {
475
+ function planEvidenceSchema(schemaVersion, kind, material) {
454
476
  return z
455
477
  .object({
456
- schemaVersion: z.literal(1),
478
+ schemaVersion: z.literal(schemaVersion),
457
479
  kind: z.literal(kind),
458
480
  digest: sha256DigestSchema,
459
481
  material,
@@ -477,5 +499,55 @@ function planEvidenceSchema(kind, material) {
477
499
  }
478
500
  });
479
501
  }
480
- export const agentCandidateProfilePlanEvidenceSchema = planEvidenceSchema("agent-profile-workspace-plan", agentCandidateProfilePlanMaterialSchema);
481
- export const agentCandidateExecutionPlanEvidenceSchema = planEvidenceSchema("agent-candidate-execution-plan", agentCandidateExecutionPlanMaterialSchema);
502
+ export const agentCandidateProfilePlanEvidenceSchema = planEvidenceSchema(1, "agent-profile-workspace-plan", agentCandidateProfilePlanMaterialSchema);
503
+ export const agentCandidateProfileActivationSchema = z
504
+ .object({
505
+ schemaVersion: z.literal(1),
506
+ kind: z.literal("agent-candidate-profile-activation"),
507
+ profilePlan: agentCandidateProfilePlanEvidenceSchema,
508
+ files: z.array(z
509
+ .object({
510
+ path: z
511
+ .string()
512
+ .refine((value) => isSafeRelativePath(value, false), "profile activation file must use a canonical relative path"),
513
+ mode: z.number().int().min(0).max(0o777),
514
+ content: z
515
+ .string()
516
+ .refine(isWellFormedUnicode, "profile activation content must be valid Unicode"),
517
+ })
518
+ .strict()),
519
+ digest: sha256DigestSchema,
520
+ })
521
+ .strict()
522
+ .superRefine((activation, ctx) => {
523
+ const planned = activation.profilePlan.material.files;
524
+ if (activation.files.length !== planned.length) {
525
+ ctx.addIssue({
526
+ code: "custom",
527
+ path: ["files"],
528
+ message: "profile activation must contain every planned native file",
529
+ });
530
+ }
531
+ for (let index = 0; index < planned.length; index++) {
532
+ const expected = planned[index];
533
+ const actual = activation.files[index];
534
+ if (expected === undefined ||
535
+ actual === undefined ||
536
+ actual.path !== expected.relPath ||
537
+ actual.mode !== expected.mode ||
538
+ sha256Utf8(actual.content) !== expected.contentSha256) {
539
+ ctx.addIssue({
540
+ code: "custom",
541
+ path: ["files", index],
542
+ message: "profile activation file path, mode, and content must match the canonical plan",
543
+ });
544
+ }
545
+ }
546
+ if (!isCanonicalJsonValue(activation)) {
547
+ ctx.addIssue({
548
+ code: "custom",
549
+ message: "profile activation must contain only RFC 8785 JSON values",
550
+ });
551
+ }
552
+ });
553
+ export const agentCandidateExecutionPlanEvidenceSchema = planEvidenceSchema(2, "agent-candidate-execution-plan", agentCandidateExecutionPlanMaterialSchema);