@wjarka/cezarion 0.14.5-pr466.721 → 0.14.5-pr467.724

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.
Files changed (58) hide show
  1. package/README.md +1 -1
  2. package/dist/automations/types.d.ts +2 -0
  3. package/dist/contract/automations.d.ts +8 -0
  4. package/dist/contract/index.js +2 -0
  5. package/dist/contract/runs.d.ts +7 -0
  6. package/dist/contract/skills.d.ts +1 -0
  7. package/dist/contract/workflows.d.ts +6 -0
  8. package/dist/delegation/execution-identity.d.ts +86 -4
  9. package/dist/delegation/execution-identity.js +32 -9
  10. package/dist/delegation/execution-identity.js.map +1 -1
  11. package/dist/delegation/provision.js +1 -1
  12. package/dist/delegation/provision.js.map +1 -1
  13. package/dist/delegation/service.js +72 -23
  14. package/dist/delegation/service.js.map +1 -1
  15. package/dist/delegation/transport.d.ts +50 -50
  16. package/dist/runs/store.d.ts +1 -0
  17. package/dist/server/server.d.ts +1206 -1138
  18. package/dist/workflows/run.d.ts +30 -2
  19. package/dist/workflows/run.js +128 -34
  20. package/dist/workflows/run.js.map +1 -1
  21. package/dist/workflows/types.d.ts +5 -1
  22. package/dist/workflows/types.js +6 -2
  23. package/dist/workflows/types.js.map +1 -1
  24. package/package.json +3 -3
  25. package/web/dist/assets/{agent-accounts-ChsoqwYE.js → agent-accounts-lP_xK83o.js} +1 -1
  26. package/web/dist/assets/{alert-dialog-D4qfe60v.js → alert-dialog-CmDuefYh.js} +1 -1
  27. package/web/dist/assets/{collapsible-CmsahFk-.js → collapsible-BqX8REmY.js} +1 -1
  28. package/web/dist/assets/{commit-list-BUHKZ0R3.js → commit-list-BWvv1H7A.js} +1 -1
  29. package/web/dist/assets/{compare-variants-4wHkozpE.js → compare-variants-Bg7eLW3z.js} +1 -1
  30. package/web/dist/assets/{diff-CKuHPpKF2.js → diff-0GBum40Q2.js} +2 -2
  31. package/web/dist/assets/{diff-controls-BTEEoiv_.js → diff-controls-HwWHHait.js} +1 -1
  32. package/web/dist/assets/{diff-stat-CfGlC-3a.js → diff-stat-mNkhAc5m.js} +1 -1
  33. package/web/dist/assets/{diff-view-DIeIvCM0.js → diff-view-DW64doDY.js} +1 -1
  34. package/web/dist/assets/{dropdown-menu-DO9dwTo3.js → dropdown-menu-sZjYPcLh.js} +1 -1
  35. package/web/dist/assets/{git-toolbar-LUJNS4D8.js → git-toolbar-DBW5EIcY.js} +1 -1
  36. package/web/dist/assets/{github-CzJMK83b.js → github-CkZ4hWI5.js} +1 -1
  37. package/web/dist/assets/{image-preview-BsOYRjuS.js → image-preview-DZicGNkU.js} +1 -1
  38. package/web/dist/assets/{index-C8rmY4Oe.js → index-DWWI-B9n.js} +3 -3
  39. package/web/dist/assets/{markdown-BhFdi_Sa.js → markdown-AY2K3kIV.js} +1 -1
  40. package/web/dist/assets/{pill-sVVKfIGy.js → pill-CcJqA1cL.js} +1 -1
  41. package/web/dist/assets/{project-router-DX4aLb7q.js → project-router-SwsXRKXs.js} +1 -1
  42. package/web/dist/assets/{prompt-templates-B5ybqYhj.js → prompt-templates-iV2WD2jy.js} +1 -1
  43. package/web/dist/assets/{repo-git-BZjP-y7A.js → repo-git-BW3TOs3U.js} +1 -1
  44. package/web/dist/assets/{run-diff-POmsgDFf.js → run-diff-DPUNj56q.js} +1 -1
  45. package/web/dist/assets/{run-header-BvX0DHVG.js → run-header-DbDluWoV.js} +1 -1
  46. package/web/dist/assets/{skills-BrctVU6J.js → skills-Dv8Vwv5D.js} +1 -1
  47. package/web/dist/assets/{tab-link-BtAaF76w.js → tab-link-DSftvkZS.js} +1 -1
  48. package/web/dist/assets/{task-changes-B-Ihu1zQ.js → task-changes-CTCuVls1.js} +1 -1
  49. package/web/dist/assets/{task-commits-BRH1liH1.js → task-commits-weJQ5GSl.js} +1 -1
  50. package/web/dist/assets/{task-files-dyOkgjk-.js → task-files-B4bUimY8.js} +1 -1
  51. package/web/dist/assets/{task-thread-eFfwIg6V.js → task-thread-BuXrVB9K.js} +1 -1
  52. package/web/dist/assets/{textarea-BR3OsNl1.js → textarea-CxRdTWlq.js} +1 -1
  53. package/web/dist/assets/{thread-loading-zooIcut2.js → thread-loading-JlP6dUpX.js} +1 -1
  54. package/web/dist/assets/{token-metrics-Iln3a6VX.js → token-metrics-Z3UFYbuD.js} +1 -1
  55. package/web/dist/assets/{utils-C3MJSUXM.js → utils-CUnaAifW.js} +1 -1
  56. package/web/dist/assets/{workflows-559XQvqT.js → workflows-vA27Yi8W.js} +3 -3
  57. package/web/dist/assets/{zoomable-image-Bk2_09Jy.js → zoomable-image-DUE1KFJ0.js} +1 -1
  58. package/web/dist/index.html +13 -13
package/README.md CHANGED
@@ -495,7 +495,7 @@ cez worker destroy <worker-id>
495
495
 
496
496
  Use `cez worker --help` to list operations and flags, or `cez worker <operation> --help` for one operation. Explicit help prints human-readable text and exits successfully without an active delegation session. Commands otherwise return bounded JSON and a nonzero exit on failure or incomplete cleanup. Spawn requires a committed baseline (`parent-head` or an explicit ref) and pins its SHA at acceptance; dirty parent edits are excluded. Optional `--context '<text>'` or `--context-file <UTF-8-file>` supplies selected context, not the parent's conversation. The two flags are mutually exclusive, and combined task/context text is limited to 100,000 characters. The API also accepts up to 32 pinned-baseline file or parent-attachment references, with at most 8 MiB of copied attachments. Inspect reports worker-local input locations. Reuse a request ID only with the same task, baseline, context, backend, model, effort and workflow when retrying a lost response. There are at most 32 accepted creations per parent, counting destroyed workers, and 32 undelivered steering messages per worker.
497
497
 
498
- `--workflow <name>` runs a catalog workflow inside the worker: the built-in `quick-task` or any `.ai/cezar/workflows/*.yaml` by name, with its agent and check steps, `skill:` bodies and `onFail` loops, so a repo's `review.yaml` becomes a dedicated reviewer. Omitted `--workflow` runs `quick-task` exactly as before. `--backend`, `--model` and `--effort` fill only the steps that leave those fields unset; a step's own `allowedTools`/`bashAllowlist` never widen the parent's grants. An unknown name is refused, and every agent step must resolve to one runner because a worker runs under one accepted provider (mixed-runner chains wait for per-step worker identity, #452).
498
+ `--workflow <name>` runs a catalog workflow inside the worker: the built-in `quick-task` or any `.ai/cezar/workflows/*.yaml` by name, with its agent and check steps, `skill:` bodies and `onFail` loops, so a repo's `review.yaml` becomes a dedicated reviewer. Omitted `--workflow` runs `quick-task` exactly as before. `--backend`, `--model` and `--effort` fill only the steps that leave those fields unset; a step's own `allowedTools`/`bashAllowlist` narrow the parent's grants and never widen them. An unknown name is refused. Agent steps may mix runners: at spawn every agent step is resolved and pinned separately, so an implement-with-codex, review-with-claude chain runs each step under its own runner, account, model, effort and grants. A step's optional `agentProfile` names the account it runs under (an id the registry does not know is refused); same-backend steps otherwise inherit the parent's account and other runners resolve their project/default one. Run-level columns show the first agent step.
499
499
 
500
500
  Omitted `--backend` inherits the parent's active backend. Same-backend workers inherit omitted model/account/effort; `--backend <claude|codex|opencode|pi|cursor>` selecting another backend resolves that backend's project/default account and model without forwarding another provider's settings. `--model <model>` selects a supported model, subject to existing locks. `--effort <low|medium|high|xhigh|max>` pins reasoning effort on same-backend and mixed-backend spawn; omitted `--effort` still inherits the parent pin on same-backend spawn and drops it on mixed-backend spawn. Accepted identity and grants remain fixed across queuing, restart and Continue, including explicit empty grants. Changing or deleting an account registry entry does not rebind a worker. Missing accepted identity evidence or account homes, incompatible Claude state-file layouts, and conflicting later model locks refuse execution explicitly. Credentials and vendor configuration are never copied; each worker receives its own delegation credential, and unspecified native models stay unspecified.
501
501
 
@@ -32,6 +32,7 @@ export declare const automationTaskSchema: z.ZodObject<{
32
32
  opencode: "opencode";
33
33
  pi: "pi";
34
34
  }>>;
35
+ agentProfile: z.ZodOptional<z.ZodString>;
35
36
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
37
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
38
  command: z.ZodOptional<z.ZodString>;
@@ -95,6 +96,7 @@ export declare const automationDefinitionSchema: z.ZodObject<{
95
96
  opencode: "opencode";
96
97
  pi: "pi";
97
98
  }>>;
99
+ agentProfile: z.ZodOptional<z.ZodString>;
98
100
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
101
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
102
  command: z.ZodOptional<z.ZodString>;
@@ -73,6 +73,7 @@ export declare const automationTaskSchema: z.ZodObject<{
73
73
  opencode: "opencode";
74
74
  pi: "pi";
75
75
  }>>;
76
+ agentProfile: z.ZodOptional<z.ZodString>;
76
77
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
78
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
79
  command: z.ZodOptional<z.ZodString>;
@@ -139,6 +140,7 @@ export declare const automationDefinitionSchema: z.ZodObject<{
139
140
  opencode: "opencode";
140
141
  pi: "pi";
141
142
  }>>;
143
+ agentProfile: z.ZodOptional<z.ZodString>;
142
144
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
143
145
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
146
  command: z.ZodOptional<z.ZodString>;
@@ -298,6 +300,7 @@ export declare const automationListEntrySchema: z.ZodObject<{
298
300
  opencode: "opencode";
299
301
  pi: "pi";
300
302
  }>>;
303
+ agentProfile: z.ZodOptional<z.ZodString>;
301
304
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
302
305
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
303
306
  command: z.ZodOptional<z.ZodString>;
@@ -447,6 +450,7 @@ export declare const automationsResponseSchema: z.ZodObject<{
447
450
  opencode: "opencode";
448
451
  pi: "pi";
449
452
  }>>;
453
+ agentProfile: z.ZodOptional<z.ZodString>;
450
454
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
451
455
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
452
456
  command: z.ZodOptional<z.ZodString>;
@@ -581,6 +585,7 @@ export declare const automationResponseSchema: z.ZodObject<{
581
585
  opencode: "opencode";
582
586
  pi: "pi";
583
587
  }>>;
588
+ agentProfile: z.ZodOptional<z.ZodString>;
584
589
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
585
590
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
586
591
  command: z.ZodOptional<z.ZodString>;
@@ -652,6 +657,7 @@ export declare const automationDetailResponseSchema: z.ZodObject<{
652
657
  opencode: "opencode";
653
658
  pi: "pi";
654
659
  }>>;
660
+ agentProfile: z.ZodOptional<z.ZodString>;
655
661
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
656
662
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
657
663
  command: z.ZodOptional<z.ZodString>;
@@ -859,6 +865,7 @@ export declare const createAutomationInputSchema: z.ZodObject<{
859
865
  opencode: "opencode";
860
866
  pi: "pi";
861
867
  }>>;
868
+ agentProfile: z.ZodOptional<z.ZodString>;
862
869
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
863
870
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
864
871
  command: z.ZodOptional<z.ZodString>;
@@ -928,6 +935,7 @@ export declare const updateAutomationInputSchema: z.ZodObject<{
928
935
  opencode: "opencode";
929
936
  pi: "pi";
930
937
  }>>;
938
+ agentProfile: z.ZodOptional<z.ZodString>;
931
939
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
932
940
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
933
941
  command: z.ZodOptional<z.ZodString>;
@@ -736,6 +736,8 @@ var workflowStepDefSchema = z8.object({
736
736
  effort: z8.string().max(32).optional(),
737
737
  /** Per-step agent backend override (falls back to the task / config default). */
738
738
  runner: runnerSchema.optional(),
739
+ /** Agent account id for this step (spec 2026-07-29-agent-profiles); resolved per step for owned workers (#452). */
740
+ agentProfile: z8.string().min(1).max(64).optional(),
739
741
  allowedTools: z8.array(z8.string()).optional(),
740
742
  bashAllowlist: z8.array(z8.string()).optional(),
741
743
  // check step
@@ -686,6 +686,7 @@ export declare const runRecordSchema: z.ZodObject<{
686
686
  opencode: "opencode";
687
687
  pi: "pi";
688
688
  }>>;
689
+ agentProfile: z.ZodOptional<z.ZodString>;
689
690
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
690
691
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
691
692
  command: z.ZodOptional<z.ZodString>;
@@ -1262,6 +1263,7 @@ export declare const apiRunSchema: z.ZodObject<{
1262
1263
  opencode: "opencode";
1263
1264
  pi: "pi";
1264
1265
  }>>;
1266
+ agentProfile: z.ZodOptional<z.ZodString>;
1265
1267
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1266
1268
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
1267
1269
  command: z.ZodOptional<z.ZodString>;
@@ -2085,6 +2087,7 @@ export declare const createRunResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
2085
2087
  opencode: "opencode";
2086
2088
  pi: "pi";
2087
2089
  }>>;
2090
+ agentProfile: z.ZodOptional<z.ZodString>;
2088
2091
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2089
2092
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
2090
2093
  command: z.ZodOptional<z.ZodString>;
@@ -2654,6 +2657,7 @@ export declare const createRunResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
2654
2657
  opencode: "opencode";
2655
2658
  pi: "pi";
2656
2659
  }>>;
2660
+ agentProfile: z.ZodOptional<z.ZodString>;
2657
2661
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2658
2662
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
2659
2663
  command: z.ZodOptional<z.ZodString>;
@@ -3430,6 +3434,7 @@ export declare const pickVariantResponseSchema: z.ZodObject<{
3430
3434
  opencode: "opencode";
3431
3435
  pi: "pi";
3432
3436
  }>>;
3437
+ agentProfile: z.ZodOptional<z.ZodString>;
3433
3438
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
3434
3439
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
3435
3440
  command: z.ZodOptional<z.ZodString>;
@@ -3526,6 +3531,7 @@ export declare const createRunInputBaseSchema: z.ZodObject<{
3526
3531
  opencode: "opencode";
3527
3532
  pi: "pi";
3528
3533
  }>>;
3534
+ agentProfile: z.ZodOptional<z.ZodString>;
3529
3535
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
3530
3536
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
3531
3537
  command: z.ZodOptional<z.ZodString>;
@@ -3578,6 +3584,7 @@ export declare const createRunInputSchema: z.ZodObject<{
3578
3584
  opencode: "opencode";
3579
3585
  pi: "pi";
3580
3586
  }>>;
3587
+ agentProfile: z.ZodOptional<z.ZodString>;
3581
3588
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
3582
3589
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
3583
3590
  command: z.ZodOptional<z.ZodString>;
@@ -621,6 +621,7 @@ export declare const startTodoResponseSchema: z.ZodObject<{
621
621
  opencode: "opencode";
622
622
  pi: "pi";
623
623
  }>>;
624
+ agentProfile: z.ZodOptional<z.ZodString>;
624
625
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
625
626
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
626
627
  command: z.ZodOptional<z.ZodString>;
@@ -29,6 +29,7 @@ export declare const workflowStepDefSchema: z.ZodObject<{
29
29
  opencode: "opencode";
30
30
  pi: "pi";
31
31
  }>>;
32
+ agentProfile: z.ZodOptional<z.ZodString>;
32
33
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
34
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
35
  command: z.ZodOptional<z.ZodString>;
@@ -56,6 +57,7 @@ export declare const workflowDefSchema: z.ZodObject<{
56
57
  opencode: "opencode";
57
58
  pi: "pi";
58
59
  }>>;
60
+ agentProfile: z.ZodOptional<z.ZodString>;
59
61
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
62
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
63
  command: z.ZodOptional<z.ZodString>;
@@ -98,6 +100,7 @@ export declare const workflowsResponseSchema: z.ZodObject<{
98
100
  opencode: "opencode";
99
101
  pi: "pi";
100
102
  }>>;
103
+ agentProfile: z.ZodOptional<z.ZodString>;
101
104
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
102
105
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
103
106
  command: z.ZodOptional<z.ZodString>;
@@ -141,6 +144,7 @@ export declare const saveWorkflowInputSchema: z.ZodObject<{
141
144
  opencode: "opencode";
142
145
  pi: "pi";
143
146
  }>>;
147
+ agentProfile: z.ZodOptional<z.ZodString>;
144
148
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
149
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
146
150
  command: z.ZodOptional<z.ZodString>;
@@ -177,6 +181,7 @@ export declare const parsedWorkflowSchema: z.ZodObject<{
177
181
  opencode: "opencode";
178
182
  pi: "pi";
179
183
  }>>;
184
+ agentProfile: z.ZodOptional<z.ZodString>;
180
185
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
181
186
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
187
  command: z.ZodOptional<z.ZodString>;
@@ -219,6 +224,7 @@ export declare const planResponseSchema: z.ZodObject<{
219
224
  opencode: "opencode";
220
225
  pi: "pi";
221
226
  }>>;
227
+ agentProfile: z.ZodOptional<z.ZodString>;
222
228
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
223
229
  bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
224
230
  command: z.ZodOptional<z.ZodString>;
@@ -21,9 +21,34 @@ export declare const workerAccountBindingSchema: z.ZodObject<{
21
21
  }, z.core.$strict>], "kind">>;
22
22
  }, z.core.$strict>;
23
23
  export type WorkerAccountBinding = z.infer<typeof workerAccountBindingSchema>;
24
+ /** What one agent step of an owned worker may run under: pinned at acceptance, read at every launch. */
25
+ declare const workerStepIdentityFieldsSchema: z.ZodObject<{
26
+ account: z.ZodObject<{
27
+ provider: z.ZodEnum<{
28
+ claude: "claude";
29
+ codex: "codex";
30
+ cursor: "cursor";
31
+ opencode: "opencode";
32
+ pi: "pi";
33
+ }>;
34
+ profileId: z.ZodString;
35
+ homePath: z.ZodOptional<z.ZodString>;
36
+ claudeLayout: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
37
+ kind: z.ZodLiteral<"native">;
38
+ statePath: z.ZodString;
39
+ }, z.core.$strict>, z.ZodObject<{
40
+ kind: z.ZodLiteral<"relocated">;
41
+ }, z.core.$strict>], "kind">>;
42
+ }, z.core.$strict>;
43
+ grants: z.ZodObject<{
44
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
+ bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
+ }, z.core.$strict>;
47
+ model: z.ZodOptional<z.ZodString>;
48
+ effort: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>;
50
+ export type WorkerStepIdentity = z.infer<typeof workerStepIdentityFieldsSchema>;
24
51
  export declare const acceptedWorkerIdentitySchema: z.ZodObject<{
25
- kind: z.ZodLiteral<"accepted">;
26
- contextHash: z.ZodOptional<z.ZodString>;
27
52
  account: z.ZodObject<{
28
53
  provider: z.ZodEnum<{
29
54
  claude: "claude";
@@ -47,12 +72,40 @@ export declare const acceptedWorkerIdentitySchema: z.ZodObject<{
47
72
  }, z.core.$strict>;
48
73
  model: z.ZodOptional<z.ZodString>;
49
74
  effort: z.ZodOptional<z.ZodString>;
75
+ kind: z.ZodLiteral<"accepted">;
76
+ contextHash: z.ZodOptional<z.ZodString>;
50
77
  workflowHash: z.ZodOptional<z.ZodString>;
78
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
79
+ account: z.ZodObject<{
80
+ provider: z.ZodEnum<{
81
+ claude: "claude";
82
+ codex: "codex";
83
+ cursor: "cursor";
84
+ opencode: "opencode";
85
+ pi: "pi";
86
+ }>;
87
+ profileId: z.ZodString;
88
+ homePath: z.ZodOptional<z.ZodString>;
89
+ claudeLayout: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ kind: z.ZodLiteral<"native">;
91
+ statePath: z.ZodString;
92
+ }, z.core.$strict>, z.ZodObject<{
93
+ kind: z.ZodLiteral<"relocated">;
94
+ }, z.core.$strict>], "kind">>;
95
+ }, z.core.$strict>;
96
+ grants: z.ZodObject<{
97
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
+ }, z.core.$strict>;
100
+ model: z.ZodOptional<z.ZodString>;
101
+ effort: z.ZodOptional<z.ZodString>;
102
+ stepId: z.ZodString;
103
+ }, z.core.$strict>>>;
51
104
  }, z.core.$strict>;
52
105
  export type AcceptedWorkerIdentity = z.infer<typeof acceptedWorkerIdentitySchema>;
106
+ /** The identity one agent step runs under. Explicit entries are authority; a legacy identity answers with its run-level view. */
107
+ export declare function workerStepIdentity(identity: AcceptedWorkerIdentity, stepId: string): WorkerStepIdentity;
53
108
  export declare const workerExecutionIdentitySchema: z.ZodUnion<readonly [z.ZodObject<{
54
- kind: z.ZodLiteral<"accepted">;
55
- contextHash: z.ZodOptional<z.ZodString>;
56
109
  account: z.ZodObject<{
57
110
  provider: z.ZodEnum<{
58
111
  claude: "claude";
@@ -76,7 +129,35 @@ export declare const workerExecutionIdentitySchema: z.ZodUnion<readonly [z.ZodOb
76
129
  }, z.core.$strict>;
77
130
  model: z.ZodOptional<z.ZodString>;
78
131
  effort: z.ZodOptional<z.ZodString>;
132
+ kind: z.ZodLiteral<"accepted">;
133
+ contextHash: z.ZodOptional<z.ZodString>;
79
134
  workflowHash: z.ZodOptional<z.ZodString>;
135
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
136
+ account: z.ZodObject<{
137
+ provider: z.ZodEnum<{
138
+ claude: "claude";
139
+ codex: "codex";
140
+ cursor: "cursor";
141
+ opencode: "opencode";
142
+ pi: "pi";
143
+ }>;
144
+ profileId: z.ZodString;
145
+ homePath: z.ZodOptional<z.ZodString>;
146
+ claudeLayout: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
147
+ kind: z.ZodLiteral<"native">;
148
+ statePath: z.ZodString;
149
+ }, z.core.$strict>, z.ZodObject<{
150
+ kind: z.ZodLiteral<"relocated">;
151
+ }, z.core.$strict>], "kind">>;
152
+ }, z.core.$strict>;
153
+ grants: z.ZodObject<{
154
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
155
+ bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
156
+ }, z.core.$strict>;
157
+ model: z.ZodOptional<z.ZodString>;
158
+ effort: z.ZodOptional<z.ZodString>;
159
+ stepId: z.ZodString;
160
+ }, z.core.$strict>>>;
80
161
  }, z.core.$strict>, z.ZodObject<{
81
162
  kind: z.ZodLiteral<"internal">;
82
163
  workflowHash: z.ZodOptional<z.ZodString>;
@@ -90,3 +171,4 @@ export declare function boundWorkerAccountEnv(binding: WorkerAccountBinding, env
90
171
  export declare function workerContextHash(context: WorkerInputRecipe): string;
91
172
  /** Canonical schema order, as for the context recipe: key order in the persisted record is immaterial. */
92
173
  export declare function workerWorkflowHash(workflow: WorkflowDef): string;
174
+ export {};
@@ -23,21 +23,44 @@ export const workerAccountBindingSchema = z.object({
23
23
  .refine(binding => binding.provider === 'claude'
24
24
  ? binding.claudeLayout !== undefined && (binding.claudeLayout.kind !== 'native' || binding.profileId === 'default')
25
25
  : binding.claudeLayout === undefined);
26
- export const acceptedWorkerIdentitySchema = z.object({
27
- kind: z.literal('accepted'),
28
- /** Binds new input recipes; absence retains compatibility with pre-context identities. */
29
- contextHash: z.string().regex(/^[0-9a-f]{64}$/).optional(),
26
+ // Required private evidence; absent properties and explicit empty grants differ.
27
+ const workerGrantsSchema = z.object({
28
+ allowedTools: z.array(z.string()).optional(),
29
+ bashAllowlist: z.array(z.string()).optional(),
30
+ }).strict();
31
+ /** What one agent step of an owned worker may run under: pinned at acceptance, read at every launch. */
32
+ const workerStepIdentityFieldsSchema = z.object({
30
33
  account: workerAccountBindingSchema,
31
- // Required private evidence; absent properties and explicit empty grants differ.
32
- grants: z.object({
33
- allowedTools: z.array(z.string()).optional(),
34
- bashAllowlist: z.array(z.string()).optional(),
35
- }).strict(),
34
+ grants: workerGrantsSchema,
36
35
  model: z.string().min(1).max(512).optional(),
37
36
  effort: z.string().min(1).max(128).optional(),
37
+ });
38
+ export const acceptedWorkerIdentitySchema = workerStepIdentityFieldsSchema.extend({
39
+ kind: z.literal('accepted'),
40
+ /** Binds new input recipes; absence retains compatibility with pre-context identities. */
41
+ contextHash: z.string().regex(/^[0-9a-f]{64}$/).optional(),
38
42
  /** Binds the public `workflowDef` a catalog worker runs (#451); absent means the built-in quick-task. */
39
43
  workflowHash: z.string().regex(/^[0-9a-f]{64}$/).optional(),
44
+ /**
45
+ * One entry per agent step of the accepted chain (#452), so a codex step and a claude step
46
+ * each run under their own account, model, effort and grants. The run-level fields above
47
+ * hold the FIRST agent step's values: evidence written before this list existed has only
48
+ * those, and `workerStepIdentity` answers every step from them.
49
+ */
50
+ steps: z.array(workerStepIdentityFieldsSchema.extend({ stepId: z.string().min(1) }).strict()).min(1).optional(),
40
51
  }).strict();
52
+ /** The identity one agent step runs under. Explicit entries are authority; a legacy identity answers with its run-level view. */
53
+ export function workerStepIdentity(identity, stepId) {
54
+ if (identity.steps === undefined) {
55
+ return { account: identity.account, grants: identity.grants,
56
+ ...(identity.model === undefined ? {} : { model: identity.model }), ...(identity.effort === undefined ? {} : { effort: identity.effort }) };
57
+ }
58
+ const entry = identity.steps.find(step => step.stepId === stepId);
59
+ if (!entry)
60
+ throw new WorkerIdentityError(`Accepted worker step identity is unavailable for "${stepId}"`);
61
+ const { stepId: _stepId, ...fields } = entry;
62
+ return fields;
63
+ }
41
64
  export const workerExecutionIdentitySchema = z.union([
42
65
  acceptedWorkerIdentitySchema,
43
66
  // Only explicitly written by the internal owned-creation primitive. Absence never means legacy.
@@ -1 +1 @@
1
- {"version":3,"file":"execution-identity.js","sourceRoot":"","sources":["../../src/delegation/execution-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAA0B,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAoB,MAAM,uBAAuB,CAAC;AAE5E,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAE9H,6FAA6F;AAC7F,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACjE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAA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QAAC,MAAM,IAAI,mBAAmB,CAAC,iDAAiD,CAAC,CAAC;IAAC,CAAC;IAC7F,IAAI,OAAO,CAAC,YAAY,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QAC9C,IAAI,CAAC;YACH,IAAI,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,mBAAmB,CAAC,UAAU,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,SAAS;gBACxG,YAAY,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,QAAQ;gBAAE,MAAM,IAAI,KAAK,EAAE,CAAC;QACvE,CAAC;QAAC,MAAM,CAAC;YAAC,MAAM,IAAI,mBAAmB,CAAC,sDAAsD,CAAC,CAAC;QAAC,CAAC;QAClG,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAAC,OAA0B;IAC1D,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3G,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,kBAAkB,CAAC,QAAqB;IACtD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtG,CAAC"}
@@ -65,7 +65,7 @@ export function provisionDelegationSession(options) {
65
65
  `Reuse the request ID only for the exact same task/baseline/context/backend/model/effort/workflow on a retry.`,
66
66
  `Optional spawn flags: --workflow <name>, --context '<selected text>' or --context-file <local-UTF-8-file> (mutually exclusive), --backend <claude|codex|opencode|pi|cursor>, --model <model>, --effort <low|medium|high|xhigh|max>.`,
67
67
  `--workflow runs a catalog workflow (the built-in quick-task or a .ai/cezar/workflows/*.yaml name) inside the worker, agent and check steps alike; omitted means quick-task with your system prompt.`,
68
- `--backend, --model and --effort fill only the steps that leave those fields unset; an unknown name fails, and every agent step must resolve to one runner (mixed-runner chains are refused until #452).`,
68
+ `--backend, --model and --effort fill only the steps that leave those fields unset; an unknown name fails. Agent steps may mix runners: each step is pinned to its own runner, account, model, effort and grants at spawn, and a step's agentProfile names its account explicitly.`,
69
69
  `Example: spawn --baseline parent-head --request-id <UUID> --backend codex --context 'Inspect only the parser' 'Review parser'.`,
70
70
  `Example: spawn --baseline parent-head --request-id <UUID> --workflow review 'Review the parser change'.`,
71
71
  `Task plus context text is limited to 100,000 characters.`,
@@ -1 +1 @@
1
- {"version":3,"file":"provision.js","sourceRoot":"","sources":["../../src/delegation/provision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAA0B,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AACvE,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IAAI,CAAC,WAAW,EAAE,CAAC;gBAAC,OAAO;YAAC,CAAC;QACvE,CAAC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,KAAK,EAAE,CAAC;YAAC,UAAU,EAAE,CAAC;YACtB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE;gBAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC5E,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM;gBAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzF,CAAC,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAAE,MAAM,EAAE,CAAC;QAC/D,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7D,MAAM,SAAS,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF"}
@@ -6,7 +6,7 @@ import { acceptedWorkerIdentitySchema, workerContextHash, workerWorkflowHash } f
6
6
  import { createHash, randomUUID } from 'node:crypto';
7
7
  import { conversationSendRequestSchema, conversationInspectRequestSchema, conversationCancelRequestSchema, requestWaitRequestSchema, workerSpawnRequestSchema, workerSteerRequestSchema, workerWaitRequestSchema, workerParamsSchema, workerCancelWaitRequestSchema, } from '../contract/index.js';
8
8
  import { workerOutcome } from '../runs/delegation-state.js';
9
- import { QUICK_TASK_WORKFLOW, stepKind } from '../workflows/types.js';
9
+ import { QUICK_TASK_WORKFLOW, allowedToolsForStep, stepKind } from '../workflows/types.js';
10
10
  import { findWorkflow } from '../workflows/load.js';
11
11
  import { isAuthenticatedCaller } from './credentials.js';
12
12
  import { parseDelegationEffort } from './effort.js';
@@ -15,23 +15,64 @@ import { planOwnedWorkspace, readOwnedDiff, removeOwnedWorkspace, resolveWorkerB
15
15
  /**
16
16
  * The catalog definition a spawn runs (#451): the built-in quick-task constant when the request
17
17
  * names none — never the catalog's `quick-task` entry, so a repo file cannot change the default
18
- * path — else the named entry. Version one pins one accepted provider per worker, so every agent
19
- * step must agree on a runner; `backend` is that runner when the chain declares one, otherwise
20
- * the request's own selection (absent → inherit the parent).
18
+ * path — else the named entry. Every agent step resolves its own runner and account (#452), so a
19
+ * chain may mix providers; a chain with no agent step has nothing for a worker to run.
21
20
  */
22
21
  async function resolveSpawnWorkflow(root, request) {
23
22
  if (request.workflow === undefined)
24
- return { workflow: QUICK_TASK_WORKFLOW, backend: request.backend };
23
+ return QUICK_TASK_WORKFLOW;
25
24
  const workflow = await findWorkflow(root, request.workflow);
26
25
  if (!workflow)
27
26
  throw new DelegationPolicyError('invalid_input', `Unknown workflow "${request.workflow}"; the catalog holds the built-in quick-task and .ai/cezar/workflows/*.yaml`);
28
- const declared = new Set(workflow.steps.filter(step => stepKind(step) === 'agent').flatMap(step => step.runner ? [step.runner] : []));
29
- if (request.backend !== undefined)
30
- declared.add(request.backend);
31
- if (declared.size > 1) {
32
- throw new DelegationPolicyError('invalid_input', `Workflow "${request.workflow}" needs runners ${[...declared].sort().join(', ')}; a worker runs under one accepted provider, so mixed-runner chains wait for per-step worker identity (#452)`);
27
+ if (!workflow.steps.some(step => stepKind(step) === 'agent'))
28
+ throw new DelegationPolicyError('invalid_input', `Workflow "${request.workflow}" has no agent step for a worker to run`);
29
+ return workflow;
30
+ }
31
+ /**
32
+ * A step's authored tools narrow the parent's grants and never widen them: the parent's
33
+ * permissions bound every worker session (#430). A step that authors nothing inherits the
34
+ * parent's grants exactly; an authored list keeps only what the parent may use, where an absent
35
+ * parent `allowedTools` means the backend's default set and an absent `bashAllowlist` means
36
+ * unrestricted Bash, which any authored allowlist is narrower than.
37
+ */
38
+ function narrowGrants(parent, step, runner) {
39
+ const parentTools = step.allowedTools === undefined ? parent.allowedTools : parent.allowedTools ?? allowedToolsForStep(undefined, runner);
40
+ const allowedTools = step.allowedTools === undefined ? parent.allowedTools : step.allowedTools.filter(tool => parentTools.includes(tool));
41
+ const bashAllowlist = step.bashAllowlist === undefined ? parent.bashAllowlist
42
+ : parent.bashAllowlist === undefined ? [...step.bashAllowlist] : step.bashAllowlist.filter(command => parent.bashAllowlist.includes(command));
43
+ return { ...(allowedTools === undefined ? {} : { allowedTools: [...allowedTools] }), ...(bashAllowlist === undefined ? {} : { bashAllowlist: [...bashAllowlist] }) };
44
+ }
45
+ /**
46
+ * Resolve every agent step of the chain once, before acceptance (#452). The spawn selection fills
47
+ * only what a step leaves unset; a step's own runner, model, effort and account win. Equal
48
+ * selections share one resolution so a ten-step single-runner chain reads the registry once.
49
+ */
50
+ async function resolveSpawnSteps(manager, parentId, request, workflow) {
51
+ const cache = new Map();
52
+ const resolved = [];
53
+ for (const step of workflow.steps) {
54
+ if (stepKind(step) === 'check')
55
+ continue;
56
+ const selection = {
57
+ ...(step.runner ?? request.backend) === undefined ? {} : { backend: step.runner ?? request.backend },
58
+ ...(step.model ?? request.model) === undefined ? {} : { model: step.model ?? request.model },
59
+ ...(step.effort ?? request.effort) === undefined ? {} : { effort: step.effort ?? request.effort },
60
+ ...(step.agentProfile === undefined ? {} : { agentProfile: step.agentProfile }),
61
+ };
62
+ const key = JSON.stringify(selection);
63
+ let pending = cache.get(key);
64
+ if (!pending) {
65
+ pending = manager.selectDelegationExecutionSettings(parentId, selection);
66
+ cache.set(key, pending);
67
+ }
68
+ const settings = await pending;
69
+ resolved.push({ step, settings, grants: narrowGrants({ ...(settings.allowedTools === undefined ? {} : { allowedTools: settings.allowedTools }),
70
+ ...(settings.bashAllowlist === undefined ? {} : { bashAllowlist: settings.bashAllowlist }) }, step, settings.runner) });
33
71
  }
34
- return { workflow, backend: [...declared][0] ?? request.backend };
72
+ return resolved;
73
+ }
74
+ function stepIdentityFields({ settings, grants }) {
75
+ return { account: settings.accountBinding, grants, ...(settings.model === undefined ? {} : { model: settings.model }), ...(settings.effort === undefined ? {} : { effort: settings.effort }) };
35
76
  }
36
77
  export const delegationEnabled = () => process.env.CEZ_DELEGATION === '1';
37
78
  /** A single controller's shared policy adapter; managers retain scheduling and lifecycle ownership. */
@@ -236,10 +277,13 @@ export class DelegationService {
236
277
  }
237
278
  authorizeSpawn(caller, parent, project.id);
238
279
  const catalog = await resolveSpawnWorkflow(project.root, request);
239
- const settings = await project.manager.selectDelegationExecutionSettings(parent.id, { ...request, backend: catalog.backend });
240
- const identity = acceptedWorkerIdentitySchema.parse({ kind: 'accepted', account: settings.accountBinding, model: settings.model, effort: settings.effort,
241
- grants: { ...(settings.allowedTools === undefined ? {} : { allowedTools: [...settings.allowedTools] }),
242
- ...(settings.bashAllowlist === undefined ? {} : { bashAllowlist: [...settings.bashAllowlist] }) } });
280
+ const resolvedSteps = await resolveSpawnSteps(project.manager, parent.id, request, catalog);
281
+ // Run-level fields hold the first agent step (cockpit columns, pre-#452 evidence readers);
282
+ // the per-step list is what each launch binds.
283
+ const first = resolvedSteps[0];
284
+ const settings = first.settings;
285
+ const identity = acceptedWorkerIdentitySchema.parse({ kind: 'accepted', ...stepIdentityFields(first),
286
+ steps: resolvedSteps.map(entry => ({ stepId: entry.step.id, ...stepIdentityFields(entry) })) });
243
287
  const baselineSha = await resolveWorkerBaseline(project.root, settings.cwd, request.baseline);
244
288
  const workspace = await planOwnedWorkspace(project.root, randomUUID(), baselineSha);
245
289
  const prepared = request.context === undefined ? undefined : await prepareWorkerContext({
@@ -254,14 +298,19 @@ export class DelegationService {
254
298
  if (current !== project)
255
299
  throw new DelegationPolicyError('denied_scope', 'Worker scope denied');
256
300
  authorizeSpawn(caller, project.store.getRun(parent.id), project.id);
257
- // Spawn selection fills only what a step leaves unset; the accepted grants replace step
258
- // tools because the parent's permissions bound every worker session. Check steps run
259
- // as authored. Authored `effort` already wins per step at execution, and an unset one
260
- // falls through to the run-level pin, so it is not written here.
261
- const workflowDef = { ...catalog.workflow, steps: catalog.workflow.steps.map(step => stepKind(step) === 'check' ? step : { ...step,
262
- runner: step.runner ?? settings.runner, model: step.model ?? settings.model,
263
- ...(settings.allowedTools === undefined ? {} : { allowedTools: [...settings.allowedTools] }),
264
- ...(settings.bashAllowlist === undefined ? {} : { bashAllowlist: [...settings.bashAllowlist] }),
301
+ // The public definition carries what each agent step RESOLVED to — runner, account,
302
+ // model, effort and the narrowed grants — so the bound `workflowDef` and the private
303
+ // per-step identity describe the same launch and the manager can hold them against each
304
+ // other. Check steps run as authored.
305
+ const workflowDef = { ...catalog, steps: catalog.steps.map(step => {
306
+ const entry = resolvedSteps.find(candidate => candidate.step === step);
307
+ if (!entry)
308
+ return step;
309
+ const { model: _model, effort: _effort, allowedTools: _tools, bashAllowlist: _bash, ...authored } = step;
310
+ return { ...authored, runner: entry.settings.runner, agentProfile: entry.settings.accountBinding.profileId,
311
+ ...(entry.settings.model === undefined ? {} : { model: entry.settings.model }),
312
+ ...(entry.settings.effort === undefined ? {} : { effort: entry.settings.effort }),
313
+ ...entry.grants };
265
314
  }) };
266
315
  const worker = project.store.createOwnedRun({
267
316
  title: request.task.slice(0, 200), task: context ? workerContextTask(request.task, context) : request.task, workflow: workflowDef.name,