@archmax-ai/harness 0.9.0 → 1.0.1

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 (207) hide show
  1. package/README.md +58 -14
  2. package/dist/agent.d.ts +4 -6
  3. package/dist/agent.js +4 -6
  4. package/dist/agent.js.map +1 -1
  5. package/dist/assembly/compose.d.ts +5 -24
  6. package/dist/assembly/compose.js +28 -42
  7. package/dist/assembly/compose.js.map +1 -1
  8. package/dist/assembly/delegation-registry.js +3 -14
  9. package/dist/assembly/delegation-registry.js.map +1 -1
  10. package/dist/assembly/index.d.ts +8 -15
  11. package/dist/assembly/index.js +21 -28
  12. package/dist/assembly/index.js.map +1 -1
  13. package/dist/assembly/plain.js +1 -2
  14. package/dist/assembly/plain.js.map +1 -1
  15. package/dist/authoring-skill/archmax-harness/README.md +5 -5
  16. package/dist/authoring-skill/archmax-harness/SKILL.md +72 -30
  17. package/dist/authoring-skill/archmax-harness/references/backend-integration.md +33 -24
  18. package/dist/authoring-skill/archmax-harness/references/cases.md +41 -8
  19. package/dist/authoring-skill/archmax-harness/references/{hook-and-test-scripts.md → code-state-and-test-scripts.md} +599 -339
  20. package/dist/authoring-skill/archmax-harness/references/code-states-and-scripts.md +115 -0
  21. package/dist/authoring-skill/archmax-harness/references/diagnostics.md +40 -7
  22. package/dist/authoring-skill/archmax-harness/references/wiring.md +19 -10
  23. package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +404 -293
  24. package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +151 -62
  25. package/dist/cli/state-flow.d.ts +1 -1
  26. package/dist/cli/state-flow.js +18 -28
  27. package/dist/cli/state-flow.js.map +1 -1
  28. package/dist/cli/turn.d.ts +1 -1
  29. package/dist/cli/turn.js +1 -1
  30. package/dist/core/code-description.d.ts +3 -3
  31. package/dist/core/code-description.js +3 -3
  32. package/dist/core/deepagents.d.ts +5 -12
  33. package/dist/core/deepagents.js +4 -17
  34. package/dist/core/deepagents.js.map +1 -1
  35. package/dist/core/events.d.ts +23 -42
  36. package/dist/core/events.js +21 -24
  37. package/dist/core/events.js.map +1 -1
  38. package/dist/core/message-readers.d.ts +4 -5
  39. package/dist/core/message-readers.js +3 -8
  40. package/dist/core/message-readers.js.map +1 -1
  41. package/dist/core/messages.d.ts +0 -22
  42. package/dist/core/messages.js +1 -32
  43. package/dist/core/messages.js.map +1 -1
  44. package/dist/core/mounts.js +3 -3
  45. package/dist/core/platform-prompt.generated.js +1 -1
  46. package/dist/core/platform-prompt.generated.js.map +1 -1
  47. package/dist/core/session-zone.d.ts +1 -1
  48. package/dist/core/session-zone.js +1 -1
  49. package/dist/core/workspace-context.d.ts +1 -1
  50. package/dist/core/workspace.d.ts +1 -1
  51. package/dist/core/workspace.js +1 -1
  52. package/dist/core/zones.d.ts +4 -4
  53. package/dist/core/zones.js +5 -5
  54. package/dist/core/zones.js.map +1 -1
  55. package/dist/env.d.ts +9 -9
  56. package/dist/index.d.ts +3 -7
  57. package/dist/index.js +2 -4
  58. package/dist/index.js.map +1 -1
  59. package/dist/kernel/kernel.d.ts +31 -61
  60. package/dist/kernel/kernel.js +54 -112
  61. package/dist/kernel/kernel.js.map +1 -1
  62. package/dist/machine/lint-spec.js +53 -12
  63. package/dist/machine/lint-spec.js.map +1 -1
  64. package/dist/machine/machine.d.ts +36 -18
  65. package/dist/machine/machine.js +62 -51
  66. package/dist/machine/machine.js.map +1 -1
  67. package/dist/machine/spec-schema.d.ts +32 -180
  68. package/dist/machine/spec-schema.js +52 -113
  69. package/dist/machine/spec-schema.js.map +1 -1
  70. package/dist/machine/tool-names.d.ts +34 -16
  71. package/dist/machine/tool-names.js +41 -16
  72. package/dist/machine/tool-names.js.map +1 -1
  73. package/dist/machine/types.d.ts +14 -46
  74. package/dist/machine/types.js +0 -2
  75. package/dist/machine/types.js.map +1 -1
  76. package/dist/machine/validate-spec.d.ts +1 -1
  77. package/dist/public/sandbox.d.ts +59 -95
  78. package/dist/public/sandbox.js +22 -23
  79. package/dist/public/sandbox.js.map +1 -1
  80. package/dist/public/spec.d.ts +13 -20
  81. package/dist/public/spec.js +12 -20
  82. package/dist/public/spec.js.map +1 -1
  83. package/dist/runtime/contract.d.ts +11 -12
  84. package/dist/runtime/contract.js +16 -16
  85. package/dist/runtime/contract.js.map +1 -1
  86. package/dist/sandbox/assets/parts/code-state.js +17 -0
  87. package/dist/sandbox/executor.d.ts +25 -7
  88. package/dist/sandbox/executor.js +56 -57
  89. package/dist/sandbox/executor.js.map +1 -1
  90. package/dist/sandbox/imports.d.ts +10 -10
  91. package/dist/sandbox/imports.js +11 -11
  92. package/dist/sandbox/imports.js.map +1 -1
  93. package/dist/sandbox/prelude.d.ts +5 -6
  94. package/dist/sandbox/prelude.js +38 -35
  95. package/dist/sandbox/prelude.js.map +1 -1
  96. package/dist/sandbox/ptc-gateway.d.ts +19 -18
  97. package/dist/sandbox/ptc-gateway.js +26 -22
  98. package/dist/sandbox/ptc-gateway.js.map +1 -1
  99. package/dist/sessions/resume.d.ts +2 -2
  100. package/dist/sessions/resume.js +1 -1
  101. package/dist/sessions/resume.js.map +1 -1
  102. package/dist/sessions/scope.d.ts +0 -10
  103. package/dist/sessions/scope.js +0 -17
  104. package/dist/sessions/scope.js.map +1 -1
  105. package/dist/sessions/summary.d.ts +1 -1
  106. package/dist/testing/assertions.js +9 -4
  107. package/dist/testing/assertions.js.map +1 -1
  108. package/dist/testing/driver.js +3 -0
  109. package/dist/testing/driver.js.map +1 -1
  110. package/dist/testing/interpreter.d.ts +2 -2
  111. package/dist/testing/runner.d.ts +2 -2
  112. package/dist/validate/validate.d.ts +1 -1
  113. package/dist/validate/validate.js +39 -70
  114. package/dist/validate/validate.js.map +1 -1
  115. package/dist/workflow/automated-controls.d.ts +63 -0
  116. package/dist/workflow/automated-controls.js +158 -0
  117. package/dist/workflow/automated-controls.js.map +1 -0
  118. package/dist/workflow/automated.d.ts +112 -0
  119. package/dist/workflow/automated.js +163 -0
  120. package/dist/workflow/automated.js.map +1 -0
  121. package/dist/workflow/code-state.d.ts +46 -0
  122. package/dist/workflow/code-state.js +26 -0
  123. package/dist/workflow/code-state.js.map +1 -0
  124. package/dist/workflow/control-tools.d.ts +54 -23
  125. package/dist/workflow/control-tools.js +99 -79
  126. package/dist/workflow/control-tools.js.map +1 -1
  127. package/dist/workflow/file-values.d.ts +4 -4
  128. package/dist/workflow/file-values.js +1 -1
  129. package/dist/workflow/file-values.js.map +1 -1
  130. package/dist/workflow/governance.d.ts +11 -22
  131. package/dist/workflow/governance.js +47 -104
  132. package/dist/workflow/governance.js.map +1 -1
  133. package/dist/workflow/grader-state.d.ts +55 -0
  134. package/dist/workflow/grader-state.js +182 -0
  135. package/dist/workflow/grader-state.js.map +1 -0
  136. package/dist/workflow/history.d.ts +11 -0
  137. package/dist/{lifecycle/transcript.js → workflow/history.js} +24 -8
  138. package/dist/workflow/history.js.map +1 -0
  139. package/dist/workflow/middleware.d.ts +14 -17
  140. package/dist/workflow/middleware.js +109 -95
  141. package/dist/workflow/middleware.js.map +1 -1
  142. package/dist/workflow/move-events.d.ts +21 -0
  143. package/dist/workflow/move-events.js +20 -0
  144. package/dist/workflow/move-events.js.map +1 -0
  145. package/dist/workflow/on-error.js +0 -2
  146. package/dist/workflow/on-error.js.map +1 -1
  147. package/dist/workflow/parks.d.ts +9 -2
  148. package/dist/workflow/parks.js +16 -10
  149. package/dist/workflow/parks.js.map +1 -1
  150. package/dist/workflow/paths.d.ts +9 -9
  151. package/dist/workflow/paths.js +19 -19
  152. package/dist/workflow/paths.js.map +1 -1
  153. package/dist/workflow/render-prompt.d.ts +7 -5
  154. package/dist/workflow/render-prompt.js +22 -37
  155. package/dist/workflow/render-prompt.js.map +1 -1
  156. package/dist/workflow/signature-checks.d.ts +2 -2
  157. package/dist/workflow/snapshot.js +5 -29
  158. package/dist/workflow/snapshot.js.map +1 -1
  159. package/dist/workflow/state.d.ts +14 -42
  160. package/dist/workflow/state.js +20 -33
  161. package/dist/workflow/state.js.map +1 -1
  162. package/dist/workflow/sub-workflow.d.ts +3 -3
  163. package/dist/workflow/sub-workflow.js +3 -7
  164. package/dist/workflow/sub-workflow.js.map +1 -1
  165. package/dist/workflow/tool-service.d.ts +1 -9
  166. package/dist/workflow/tool-service.js +21 -24
  167. package/dist/workflow/tool-service.js.map +1 -1
  168. package/dist/workflow/turn-boundary.d.ts +2 -2
  169. package/dist/workflow/turn-boundary.js +10 -15
  170. package/dist/workflow/turn-boundary.js.map +1 -1
  171. package/dist/workflow/turn-runner.js +5 -6
  172. package/dist/workflow/turn-runner.js.map +1 -1
  173. package/package.json +2 -2
  174. package/skills/archmax-harness/README.md +5 -5
  175. package/skills/archmax-harness/SKILL.md +72 -30
  176. package/skills/archmax-harness/references/backend-integration.md +33 -24
  177. package/skills/archmax-harness/references/cases.md +41 -8
  178. package/skills/archmax-harness/references/{hook-and-test-scripts.md → code-state-and-test-scripts.md} +599 -339
  179. package/skills/archmax-harness/references/code-states-and-scripts.md +115 -0
  180. package/skills/archmax-harness/references/diagnostics.md +40 -7
  181. package/skills/archmax-harness/references/wiring.md +19 -10
  182. package/skills/archmax-harness/references/workflow-schema.md +404 -293
  183. package/skills/archmax-harness/references/workflow-yaml.md +151 -62
  184. package/dist/authoring-skill/archmax-harness/references/hooks-and-scripts.md +0 -89
  185. package/dist/lifecycle/hook-shape.d.ts +0 -44
  186. package/dist/lifecycle/hook-shape.js +0 -66
  187. package/dist/lifecycle/hook-shape.js.map +0 -1
  188. package/dist/lifecycle/runner.d.ts +0 -197
  189. package/dist/lifecycle/runner.js +0 -419
  190. package/dist/lifecycle/runner.js.map +0 -1
  191. package/dist/lifecycle/tool-calls.d.ts +0 -9
  192. package/dist/lifecycle/tool-calls.js +0 -57
  193. package/dist/lifecycle/tool-calls.js.map +0 -1
  194. package/dist/lifecycle/transcript.d.ts +0 -31
  195. package/dist/lifecycle/transcript.js.map +0 -1
  196. package/dist/rubrics/rubrics.d.ts +0 -135
  197. package/dist/rubrics/rubrics.js +0 -145
  198. package/dist/rubrics/rubrics.js.map +0 -1
  199. package/dist/sandbox/assets/parts/core.js +0 -22
  200. package/dist/sandbox/assets/parts/lifecycle-hook.js +0 -47
  201. package/dist/sandbox/bridge.d.ts +0 -16
  202. package/dist/sandbox/bridge.js +0 -95
  203. package/dist/sandbox/bridge.js.map +0 -1
  204. package/dist/workflow/visits.d.ts +0 -21
  205. package/dist/workflow/visits.js +0 -45
  206. package/dist/workflow/visits.js.map +0 -1
  207. package/skills/archmax-harness/references/hooks-and-scripts.md +0 -89
@@ -14,7 +14,7 @@ instructions: |- # standing direction for the whole run (warning
14
14
  Records live in skills/order-data/assets/orders.json; write artifacts under scratchpad/.
15
15
 
16
16
  Answer only from records you have read; never fabricate.
17
- runtime: { engine: archmax-harness, version: "2" }
17
+ runtime: { engine: archmax-harness, version: "3" } # 3 is the only contract; omitted = 3
18
18
  disabled: false # true = out of service: no new turns; parked runs still drain
19
19
  settings: # sandbox limits: timeoutMs, memoryLimitBytes, maxPtcCalls,
20
20
  timeoutMs: 15000 # maxResultChars, prompt_cache: { enabled, ttl }
@@ -23,9 +23,7 @@ tests: # case suite config (no tests.config.js exists)
23
23
  maxConcurrency: 1 # only 1 accepted
24
24
  caseTimeoutMs: 120000 # per-case wall clock, distinct from settings.timeoutMs
25
25
  judge: {} # required for grade:; {} = env default model, or { model, modelOptions }
26
- budget: { maxModelCalls: 50 } # model calls one turn may make across ALL states (default 50); raise for long turns
27
- metadata: { canvas: {} } # host data, never read; accepted at root, state, rubric — leave as found
28
- extensions: { hooks: [] } # host-registered hook kinds; rarely authored
26
+ metadata: { canvas: {} } # host data, never read; accepted at root and on a state — leave as found
29
27
 
30
28
  tools: # tool governance, workflow level
31
29
  allow_always: # granted in EVERY state; a state's allow adds to or narrows it.
@@ -48,7 +46,7 @@ skills: # skill governance, workflow level — SLUGS, n
48
46
 
49
47
  states:
50
48
  triage: # key = slug = identity (^[a-z0-9]+(-[a-z0-9]+)*$)
51
- type: agent # agent (default) | human
49
+ type: agent # agent (default) | human | grader | code (grader/code = automated)
52
50
  title: Triage request # label for people/hosts; reaches no model call
53
51
  summary: Record the refund decision for review. # ditto: an authoring/host label, NOT in the prompt
54
52
  triggers: # a trigger is declared on the state it ENTERS; key = id
@@ -66,17 +64,8 @@ states:
66
64
  # entry types: string integer number boolean date date-time object array file
67
65
  instructions: >-
68
66
  Record the decision in scratchpad/refund.json, then archmax_advance to
69
- review; never close the case yourself.
70
- before: # gates entry: ok/veto only; a veto here rejects the run
71
- - script: hooks/check-requester.js
72
- after: # gates the archmax_advance out (or completion, when terminal)
73
- - script: hooks/check-policy.js
74
- max_iterations: 2 # how many `correct`s before a hard veto (per hook; default 0)
75
- - rubric: # LLM grader, inline; the agent never sees it
76
- instructions: |- # the only required key: criteria + verdict (ok/correct/veto + reason)
77
- Judge the tone of the last assistant message …
78
- max_iterations: 1
79
- model: gpt-4.1-mini # optional override
67
+ check-policy; never close the case yourself. If a note sends the case
68
+ back, fix what it names and advance again.
80
69
  tools:
81
70
  allow: # adds to allow_always; entry = name | { tool, args: {<arg>: [globs]} } | { tool, paths }
82
71
  - lookup_customer
@@ -94,13 +83,27 @@ states:
94
83
  on_error: closed # where a terminal failure of this segment routes
95
84
  metadata: { x: 40, y: 180 }
96
85
  transitions: # none => terminal state
97
- - to: review # slug; must exist
98
- description: The decision is recorded and needs a person's approval. # what the agent routes
86
+ - to: check-policy # slug; must exist
87
+ description: The decision is recorded in scratchpad/refund.json. # what the agent routes
99
88
  # on. Say WHEN, never where. Omit it to route on the target's
100
89
  # instructions instead (target must have some); REQUIRED on a
101
- # human state's transitions, where it is the button label.
90
+ # human state's transitions (the button label) and on every edge
91
+ # INTO a grader or code state, like this one.
102
92
  type: none # approve | reject | refine | none — semantic on human states
103
93
 
94
+ check-policy: # CODE state: the runtime runs its script on entry, NO model call
95
+ type: code
96
+ script: scripts/check-policy.js # REQUIRED on a code state, refused on any other type; resolves
97
+ # to workflows/<slug>/scripts/check-policy.js (.js|.mjs, no `..`)
98
+ summary: Re-derive the decision from the refund policy. # instructions/model/budget/evidence/
99
+ # approvers here are validate ERRORS: nothing reads them
100
+ skills: { allow: [order-data] } # the script's tools are THIS state's surface: grant here
101
+ # what it reads or calls (another state's grant never reaches it)
102
+ on_error: closed # a throw, a timeout, or finishing undecided routes here
103
+ transitions: # the script takes one: tools.archmax_advance({ to, reason })
104
+ - { to: review, description: The recorded decision matches the policy. }
105
+ - { to: triage, description: The decision contradicts the policy; send it back with the fix. }
106
+
104
107
  review: # human state: parks with a decision record; a PERSON picks the edge
105
108
  type: human
106
109
  title: Review refund
@@ -110,27 +113,57 @@ states:
110
113
  approvers: [finance@acme.com]
111
114
  evidence: [scratchpad/refund.json] # plus whatever archmax_advance attached via `evidence:`
112
115
  transitions: # required; no self-edge; one target per labeled type
113
- - { to: closed, type: approve, description: Approve and close. }
116
+ - { to: reply, type: approve, description: Approve; tell the customer. }
114
117
  - { to: triage, type: refine, description: Send back with a comment. }
115
118
 
116
- closed: # bare key = terminal state with no declarations
119
+ reply: # agent state (type omitted)
120
+ instructions: >-
121
+ Draft the customer's email in scratchpad/reply.md, then archmax_advance to
122
+ grade-reply; if a note sends it back, revise the draft as it says.
123
+ transitions:
124
+ - { to: grade-reply, description: The email is drafted in scratchpad/reply.md. }
125
+
126
+ grade-reply: # GRADER state: an isolated grader judges WORK HANDED ON (a draft,
127
+ type: grader # a report), never a live answer: a turn's reply is every text
128
+ # the agent said, a draft sent back included
129
+ instructions: |- # REQUIRED: its criteria, appended to a compiled-in grader preamble
130
+ Judge only the tone of scratchpad/reply.md.
131
+ - Friendly and professional: advance to `send-reply`.
132
+ - Curt or cold: advance back to `reply`, saying exactly what to change.
133
+ - If archmax_get_history's trail already holds two steps with kind
134
+ "grader" and to "reply", raise `reply-tone` instead of sending it back.
135
+ model: gpt-4.1-mini # optional; resolved under the `grader` model role
136
+ budget: { maxTurns: 4, timeoutMs: 60000 } # ITS OWN model calls / run time; no maxParks
137
+ on_error: closed # fails closed: an undecided grader routes here
138
+ transitions: # REQUIRED, at least one; no evidence/approvers on a grader
139
+ - { to: send-reply, description: The draft is friendly and professional. }
140
+ - { to: reply, description: The tone is off; send it back naming what to change. }
141
+
142
+ send-reply: # TERMINAL code state: the session completes when the script
143
+ type: code # returns — "approve, then end" with no further model call
144
+ script: scripts/send-reply.js
145
+ tools: { allow: [send_email] } # the host tool its script calls, granted HERE
146
+
147
+ closed: # bare key = terminal (agent) state with no declarations
117
148
  ```
118
149
 
119
150
  ## Machine rules
120
151
 
121
152
  - **Movement.** The agent moves only by `archmax_advance({ to, reason, evidence? })`
122
- — one per message, edge validated, then the leaving state's `after` hooks,
123
- the target's `before` hooks, then the target's tools unlock. A state with no
124
- transitions is terminal; the run ends when the agent finishes there. Human
125
- decisions and `on_error` are the other two movers. `archmax_reset({ reason })`
153
+ — one per message, edge and `requires` validated, then the target's tools
154
+ unlock (or, for a grader or code target, the target runs at once). A state
155
+ with no transitions is terminal; the run ends when the agent finishes there.
156
+ Human decisions, `on_error`, and grader and code states' own `archmax_advance`
157
+ are the other movers. `archmax_reset({ reason })`
126
158
  returns to the entry state (forbid it via `forbid_always` when a run must
127
159
  never restart). No fan-out: sequence states; concurrency lives in
128
160
  sub-workflow calls.
129
161
  - **Entry.** At least one state declares `triggers`; one state per trigger id;
130
162
  `manual` is the entry the CLI, a host firing and a caller all use. A
131
163
  re-invoked finished session is a **new turn in the state it ended in**, not
132
- at the entry — give a state re-entry transitions if a conversation must move
133
- on, or park instead of finishing.
164
+ at the entry (one that completed in a terminal code state opens at its
165
+ trigger's entry) — give a state re-entry transitions if a conversation must
166
+ move on, or park instead of finishing.
134
167
  - **Variables.** One flat checkpointed `name → value` store, never declared.
135
168
  Host seeds (`--variables`, `createAgent({ variables })`, a delivery) are
136
169
  **locked**; the agent uses `archmax_get_variables`/`archmax_set_variables`
@@ -156,7 +189,8 @@ states:
156
189
  judgement and any state with a big tool surface or several transitions on
157
190
  the default, since a small model that routes badly costs more in retries
158
191
  than it saves. Repeating the workflow's id on a state is a validate warning.
159
- A rubric keeps its own `model`, a sub-workflow uses its own spec's, and a
192
+ A grader state's `model` is resolved under the `grader` model role
193
+ (`modelFactory("grader", env, id)`), a sub-workflow uses its own spec's, and a
160
194
  host that passes an explicit `model` instance to `createAgent` outranks
161
195
  every declared id (it must pass `modelFactory` to honour them).
162
196
  - **Parking.** A state that needs an event or a time calls
@@ -170,9 +204,9 @@ states:
170
204
  - **Failing.** When the work cannot be completed, the agent calls
171
205
  `archmax_raise({ code, reason })` (alone in its message; any state): the
172
206
  session ends at once `failed`, with the agent's free-form `code` and
173
- `reason` as the outcome's `exit` — no `on_error` route, no hook, no
174
- `returns` check. A session that never raises is a success, so it is for
175
- failure only. Forbid it (`forbid_always`, or a state's `forbid`) where the
207
+ `reason` as the outcome's `exit` — no `on_error` route, no `returns`
208
+ check. A session that never raises is a success, so it is for failure
209
+ only. Forbid it (`forbid_always`, or a state's `forbid`) where the
176
210
  agent must not end the run itself; a child that raises fails its caller's
177
211
  call with kind `raised`.
178
212
  - **Human states** park with a record built from `instructions`, `evidence`
@@ -182,23 +216,54 @@ states:
182
216
  reply-only turn (every tool call refused) and re-parks unchanged; only
183
217
  `decide` moves the run. A
184
218
  `refine` edge delivers the reviewer's comment as correction.
185
- - **Hooks.** `before`: ok/veto (veto rejects entry; on a start state, the
186
- run; routed through `on_error` if declared). `after`: ok/correct/veto on
187
- the outgoing advance or on completion of a terminal state; `correct` sends
188
- the agent back with the reason, bounded per hook by `max_iterations`
189
- (default 0 → a correct is a hard veto). A list runs in order and stops at
190
- the first non-ok. Errors and missing files veto (fail-closed). Hooks run
191
- on runtime authority: the state's `allow`/`forbid`/`skills`/`mounts` do not
192
- bind them; `forbid_always`, safety rules and the workflow's mount grants
193
- (any state's) do. Human states may not declare hooks.
219
+ - **Grader and code states** (automated states). A **code** state runs
220
+ `script: scripts/<x>.js` in the sandbox; a **grader** state runs an isolated
221
+ grader whose criteria are the state's `instructions`. Both read the session
222
+ with `archmax_get_history` (`{ messages, trail }`: the whole transcript, a
223
+ tool result inline in its tool message's `text`, and the trail; a script
224
+ calls `JSON.parse(await tools.archmax_get_history())`). Both run on
225
+ entry — however the session got there — with **no call of the agent's model**
226
+ (a chain of code states makes none at all), and leave like every state:
227
+ `archmax_advance` along one of their transitions, whose `reason` reaches the
228
+ next state as a `[code]`/`[grader]` runtime note and a `kind: code|grader`
229
+ trail step, or `archmax_raise`. A **terminal** code state completes the
230
+ session when its script returns. Throwing, timing out, a spent grader budget,
231
+ or a non-terminal state that finishes without either call **fails closed** →
232
+ `on_error`. Each is offered exactly its own state's surface (its grants and
233
+ one control set for both types: `archmax_advance`, `archmax_raise`, the
234
+ variable tools, `archmax_get_history`), governed like the agent's calls — never
235
+ `write_todos`, `archmax_eval`, `archmax_run`, `archmax_wait`,
236
+ `archmax_reset`, even when `allow_always` lists one (a state's own
237
+ `tools.allow` naming one is an error): an automated state cannot park.
238
+ There is no iteration budget: a state that gives up after N rounds counts
239
+ them in the trail. Per type, `validate` errors on: a code state's
240
+ `instructions`/`model`/`budget`/`evidence`/`approvers`; a grader without
241
+ `instructions` or without a transition, or with `evidence`/`approvers`/
242
+ `budget.maxParks`. There are **no `before:`/`after:` hooks and no root
243
+ `extensions:`** — a leftover key is a load error naming it. Script contract:
244
+ [`code-states-and-scripts.md`](code-states-and-scripts.md).
245
+ - **Automated-state patterns.** A deterministic check **in front of** a state:
246
+ make the trigger's entry (or the edge's target) a code state that advances
247
+ to the work or to a state that declines it. A check **behind** a state: point
248
+ the state's transition at a code state that advances onward, or back with
249
+ the fix as its `reason` — the agent reads it and advances again. **Approve,
250
+ then end**: approve into a terminal code state, which costs no model call.
251
+ Judgment (tone, completeness): a grader behind the graded state with an edge
252
+ back; its `instructions` say when to raise ("after two send-backs" = two
253
+ trail steps `{ kind: grader, to: <graded state> }`). Grade work the agent
254
+ hands on (a report, a draft), not a live answer: a turn's `reply` is every
255
+ text the agent said in it, so a draft sent back has reached the person.
194
256
  - **Budgets and `on_error`.** `budget.maxTurns`/`timeoutMs`/`maxParks` bound
195
- a state's segment; the root `budget.maxModelCalls` (default 50) bounds a whole
196
- turn across states, so a cycle between states ends there. A terminal failure (hook execution error, exhausted
197
- corrections, exhausted budget, exhausted parks) routes to `on_error`
198
- instead of failing the run; recoverable rejections (invalid edge, veto,
199
- in-budget correct) keep the agent in place. Declare `on_error` on states
200
- with strict `after` hooks or bounded loops. A **tool that throws** is
201
- neither: the call is answered with an error-status tool message carrying
257
+ a state's segment (on a grader: its own model calls and run time; a code
258
+ state takes no `budget`, `settings.timeoutMs` bounds its script). There is
259
+ no root `budget` (declaring one is a load error): a whole turn is bounded by
260
+ LangGraph's `recursionLimit` (400 unless the host's invoke config sets one),
261
+ and a turn that hits it — a cycle between states, say — ends the session
262
+ `failed` (`recursion-limit`). A terminal failure (exhausted budget, exhausted parks, a
263
+ grader or code state that fails) routes to `on_error` instead of failing the
264
+ run; recoverable rejections (invalid edge, unmet `requires`) keep the agent
265
+ in place. Declare `on_error` on every automated state and on bounded loops.
266
+ A **tool that throws** is neither: the call is answered with an error-status tool message carrying
202
267
  the error, the agent stays in the state and can retry or switch tools, and
203
268
  `on_error` never sees it (a park or a cancelled run still propagates).
204
269
  - **Sub-workflows are tools.** Allow `archmax_workflow_<slug>` (slug verbatim)
@@ -226,10 +291,12 @@ states:
226
291
  sub-run; fan out with parallel tool calls or `Promise.all` in a script
227
292
  (bounds: depth 3, 4 concurrent). A child's human state parks the child;
228
293
  a script's delegation cannot park and fails closed.
229
- - **Choosing a mechanism.** Deterministic work with no model → an `archmax_run`
230
- script. Delegated work that is itself a process or reused across workflows
231
- → a sub-workflow. Judging work already done → a rubric hook (never
232
- callable by the agent; `task` is disclosed nowhere and not grantable).
294
+ - **Choosing a mechanism.** Deterministic work the agent triggers → an
295
+ `archmax_run` script. Deterministic work the graph runs at a fixed point (a
296
+ screen, a policy check, a record) → a code state. Delegated work that is itself
297
+ a process or reused across workflows → a sub-workflow. Judging work already
298
+ done → a grader state. Neither automated kind is callable by the agent (`task`
299
+ is disclosed nowhere and not grantable).
233
300
  - **Prompt economy.** The static prompt + tool schemas are re-sent every
234
301
  model call. The static part carries the workflow's `title` + `instructions`
235
302
  and **no state of the graph**; a state's `instructions` and its **own**
@@ -245,14 +312,19 @@ states:
245
312
 
246
313
  Only the state it is in. Every model call is handed that state's outgoing edges
247
314
  and nothing else of the machine — no other state's slug, `title`, `summary`,
248
- hooks or transitions, and no count of the states:
315
+ script, criteria or transitions, and no count of the states:
249
316
 
250
317
  ```
251
318
  Transitions — choose one with `archmax_advance` when this state's work is done:
319
+ - to `check-policy` (code) — The decision is recorded in scratchpad/refund.json.
252
320
  - to `review` (human decision node) — The decision is recorded and needs a person's approval.
321
+ - to `grade-reply` (grader) — The email is drafted in scratchpad/reply.md.
253
322
  - to `closed` (terminal) — Nothing to refund; the case is answered.
254
323
  ```
255
324
 
325
+ A `(grader)` or `(code)` target runs on its own and may send the run straight
326
+ back with a note saying what to change.
327
+
256
328
  Two rules follow, and they are the ones authors get wrong:
257
329
 
258
330
  1. **Write the `description` for the source state, not the target.** The agent
@@ -260,12 +332,19 @@ Two rules follow, and they are the ones authors get wrong:
260
332
  `The refund is over $50, or the customer has asked twice.` Not `Go to
261
333
  refund-review.` — that tells a reader who already knows the graph something
262
334
  they cannot use, and tells this reader nothing.
263
- 2. **Routing conditions cannot live downstream.** A target's `summary` or
264
- `instructions` is never disclosed to the state routing into it. If the
265
- condition is "when the order is over 30 days old", it belongs on the edge.
335
+ 2. **Routing conditions cannot live downstream.** A target's `summary` is never
336
+ disclosed to the state routing into it, nor its `instructions` across a
337
+ described edge. If the condition is "when the order is over 30 days old", it
338
+ belongs on the edge.
266
339
 
267
- A missing or blank `description` is a **load error**. There is no fallback, and
268
- no way to see more of the graph.
340
+ An **undescribed** edge (no `description`, or a blank one) routes on its target's
341
+ `instructions` instead, quoted under the edge's line as what the agent will do
342
+ once there: leave one undescribed only when those instructions already say when
343
+ it applies. It is a **load error** where the target has no instructions, on a
344
+ human state's transitions (the description is the button label), and into a
345
+ grader or code state (a grader's instructions are criteria the work is never
346
+ shown; a code state has none). A code state's own edges may go undescribed: its
347
+ script routes. There is no other way to see more of the graph.
269
348
 
270
349
  ## Governance
271
350
 
@@ -282,6 +361,14 @@ Closed by default; **deny beats allow, and no narrower level widens a denial.**
282
361
  `essentialTools`. Any other tool needs an `allow`/`allow_always` entry. A
283
362
  state entry naming a granted tool **narrows** it there, and one naming a
284
363
  default tool the list omits grants it there. `task` is ungrantable (error).
364
+ - **In a grader or code state** the surface is what the state is granted (the
365
+ workflow-wide grant included), minus `write_todos`, `archmax_eval`,
366
+ `archmax_run`, `archmax_wait` and `archmax_reset` even when `allow_always` lists
367
+ them (naming one in the state's
368
+ own `tools.allow` is an error), plus one control set for both types:
369
+ `archmax_advance`, `archmax_raise`, `archmax_get_variables`,
370
+ `archmax_set_variables` and `archmax_get_history` — never `archmax_wait` or
371
+ `archmax_reset`.
285
372
  - **Entries**: bare name; `{ tool, args: { <arg>: ["glob", …] } }` (matches
286
373
  if any glob matches; `${{var}}` allowed). An argument the tool declares as a
287
374
  path (else `file_path`) is canonicalized first; any other argument (a URL, an
@@ -303,8 +390,10 @@ Closed by default; **deny beats allow, and no narrower level widens a denial.**
303
390
  in the prompt). `allow` adds, `forbid` subtracts, `allow: []` denies
304
391
  nothing. A `tools.allow` entry may still narrow *within* an enabled bundle.
305
392
  A state enabling no skill can run no script at all.
306
- - **Scripts' `tools.*` calls** are governed per call: an `archmax_run` script
307
- is bound like the model (grant every tool it calls); a hook is exempt from
308
- the state's lists but held to its workflow's mount grants. Neither may read
309
- `workflows/**` or write a read-only mount. A refused call throws inside the
310
- script.
393
+ - **Scripts' `tools.*` calls** are governed per call against the state they
394
+ run in: an `archmax_run` script is bound like the model (grant every tool it
395
+ calls in the agent's state); a code state's script is bound by **its own**
396
+ state's grants (`tools`, `skills`, `mounts`) — there is no runtime authority.
397
+ `tools` holds exactly that state's surface: anything else is `undefined`.
398
+ Neither may read `workflows/**` or write a read-only mount. A refused call
399
+ rejects inside the script.
@@ -11,7 +11,7 @@ export interface StateFlowRenderer {
11
11
  /**
12
12
  * Build a renderer that writes an append-only, hierarchical state flow to
13
13
  * `stream`. Assembly-time events (`interpreter-enabled`,
14
- * `hooks-summary`, `graph-topology`, `workflow-reset`) are ignored — the CLI
14
+ * `graph-topology`, `workflow-reset`) are ignored — the CLI
15
15
  * prints its own session header. The `advance` event only renders the agent's
16
16
  * one-sentence `reason` (the target itself is shown by the following `state-leave`).
17
17
  */
@@ -10,17 +10,17 @@
10
10
  *
11
11
  * The trail uses two indentation tiers so a session reads as a hierarchy:
12
12
  * state changes (`state-enter`, `state-leave`) sit at the outer margin, and
13
- * what happened *inside* a state (hooks, tool calls, the agent's own text,
14
- * quoted) is indented beneath it. Lifecycle phases are colour-coded — `before`
15
- * in blue, `after` in magenta. Assembly-time and high-frequency telemetry
16
- * events are dropped to keep the trail readable.
13
+ * what happened *inside* a state (a code state's script and its output, a
14
+ * grader's run, tool calls, the agent's own text, quoted) is indented beneath
15
+ * it. Code states are colour-coded blue, graders magenta. Assembly-time and
16
+ * high-frequency telemetry events are dropped to keep the trail readable.
17
17
  */
18
18
  import { isChildSessionOf } from "../sessions/scope.js";
19
19
  import { originLabel } from "../core/events.js";
20
20
  import { ADVANCE_TOOL, RAISE_TOOL } from "../machine/tool-names.js";
21
21
  import { exitCodeForVerdict } from "../testing/runner.js";
22
22
  import { createStyle, icons } from "./style.js";
23
- /** Indentation for per-state action lines (hooks, agent text). */
23
+ /** Indentation for per-state action lines (an automated run, agent text). */
24
24
  const ACTION_INDENT = " ";
25
25
  /** Deeper indentation for output nested under an action (e.g. script stdout). */
26
26
  const OUTPUT_INDENT = " ";
@@ -31,13 +31,12 @@ const LIST_INDENT = " ";
31
31
  /**
32
32
  * Build a renderer that writes an append-only, hierarchical state flow to
33
33
  * `stream`. Assembly-time events (`interpreter-enabled`,
34
- * `hooks-summary`, `graph-topology`, `workflow-reset`) are ignored — the CLI
34
+ * `graph-topology`, `workflow-reset`) are ignored — the CLI
35
35
  * prints its own session header. The `advance` event only renders the agent's
36
36
  * one-sentence `reason` (the target itself is shown by the following `state-leave`).
37
37
  */
38
38
  export function createStateFlowRenderer(stream, styleOverride) {
39
39
  const s = styleOverride ?? createStyle();
40
- const phaseColor = (phase) => (phase === "before" ? s.blue : s.magenta);
41
40
  const write = (line) => stream.write(`${line}\n`);
42
41
  const writeAgentText = (text) => {
43
42
  for (const line of text.split("\n"))
@@ -76,28 +75,22 @@ export function createStateFlowRenderer(stream, styleOverride) {
76
75
  write(`${s.yellow(icons.warn)} ${event.state} ${s.dim(icons.arrow)} ${s.yellow(event.to)} ` +
77
76
  s.dim(`(on_error: ${event.reason})`));
78
77
  break;
79
- case "hook-start":
80
- write(`${ACTION_INDENT}${phaseColor(event.phase)(`${icons.bullet} ${event.phase}`)} ${s.dim(event.label)}`);
78
+ case "code-start":
79
+ write(`${ACTION_INDENT}${s.blue(`${icons.bullet} code`)} ${s.dim(event.script)}`);
81
80
  break;
82
- case "hook-output":
81
+ case "code-output":
83
82
  write(`${OUTPUT_INDENT}${s.dim(event.line)}`);
84
83
  break;
85
- case "hook-passed":
86
- write(`${ACTION_INDENT}${s.green(icons.check)} ${s.dim(`${event.phase} passed`)}`);
87
- break;
88
- case "hook-verdict": {
89
- const missing = event.missing?.length ? ` (missing: ${event.missing.join(", ")})` : "";
90
- const mark = event.verdict === "ok"
91
- ? s.green(icons.check)
92
- : event.verdict === "veto"
93
- ? s.red(icons.cross)
94
- : s.yellow(icons.inProgress);
95
- write(`${ACTION_INDENT}${mark} ${phaseColor(event.phase)(event.phase)} ` +
96
- `${s.dim(`${event.verdict} — ${event.reason}${missing}`)}`);
84
+ case "code-result":
85
+ case "grader-result":
86
+ // A run that settled says nothing more: its move or its raise is the
87
+ // next line. Only a failure needs saying here.
88
+ if (event.status === "error") {
89
+ write(`${ACTION_INDENT}${s.red(`${icons.cross} ${event.type === "code-result" ? "code" : "grader"} failed`)} ${s.dim(event.reason ?? "")}`);
90
+ }
97
91
  break;
98
- }
99
- case "hook-rejected":
100
- write(`${ACTION_INDENT}${s.red(icons.cross)} ${s.red(`${event.phase} rejected`)} ${s.dim(event.reason)}`);
92
+ case "grader-start":
93
+ write(`${ACTION_INDENT}${s.magenta(`${icons.bullet} grader`)} ${s.dim("grading")}`);
101
94
  break;
102
95
  case "tool-called":
103
96
  // The transition tool is reported by the state lines and the advance
@@ -171,12 +164,9 @@ export function createStateFlowRenderer(stream, styleOverride) {
171
164
  break;
172
165
  case "workflow-reset":
173
166
  case "interpreter-enabled":
174
- case "hooks-summary":
175
167
  case "graph-topology":
176
168
  case "agent-text-delta":
177
169
  case "tool-result":
178
- case "rubric-start":
179
- case "rubric-result":
180
170
  case "model-usage":
181
171
  case "prompt-shaping":
182
172
  // Lifecycle summaries and high-frequency (GUI-oriented) telemetry.
@@ -1 +1 @@
1
- {"version":3,"file":"state-flow.js","sourceRoot":"","sources":["../../src/cli/state-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAmC,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,KAAK,EAAc,MAAM,YAAY,CAAC;AAW5D,kEAAkE;AAClE,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,iFAAiF;AACjF,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,mEAAmE;AACnE,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,sDAAsD;AACtD,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAuB,EACvB,aAAqB;IAErB,MAAM,CA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CAAC;YACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtE,KAAK,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,OAAO,CAAC,MAAM,iBAAiB,CAAC,CAAC;gBACpF,OAAO;YACT,CAAC;YACD,MAAM,IAAI,GAAG,CAAC,CAAa,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACtF,KAAK,MAAM,CAAC,IAAI,MAAM;gBAAE,KAAK,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAChF,KAAK,MAAM,CAAC,IAAI,MAAM;gBAAE,KAAK,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAClF,KAAK,MAAM,CAAC,IAAI,OAAO;gBAAE,KAAK,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACxF,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -34,7 +34,7 @@ export interface RunTurnInput {
34
34
  }
35
35
  /**
36
36
  * Report a turn's {@link Outcome}: an answer, a park (with what resumes it), a
37
- * rejection, a failure the agent raised, or a resume's result. Returns the exit
37
+ * rejection, a failure the session raised, or a resume's result. Returns the exit
38
38
  * code: a park is a success, a rejection or a failure is not.
39
39
  */
40
40
  export declare function printOutcome(style: Style, machine: WorkflowMachine, sessionId: string, outcome: Outcome): number;
package/dist/cli/turn.js CHANGED
@@ -100,7 +100,7 @@ function printParkMessage(style, reply) {
100
100
  }
101
101
  /**
102
102
  * Report a turn's {@link Outcome}: an answer, a park (with what resumes it), a
103
- * rejection, a failure the agent raised, or a resume's result. Returns the exit
103
+ * rejection, a failure the session raised, or a resume's result. Returns the exit
104
104
  * code: a park is a success, a rejection or a failure is not.
105
105
  */
106
106
  export function printOutcome(style, machine, sessionId, outcome) {
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * `archmax_run` scripts carry their human-facing contract as a leading JSDoc
3
3
  * block comment — the code-file analogue of a case file's `description`. Admin
4
- * UIs display only that description. Lifecycle hook scripts are NOT covered by this convention:
5
- * they are hand-authored files whose only validation is that the referenced
6
- * file exists. This module is the canonical extractor so consumers never
4
+ * UIs display only that description. A code state's script is NOT covered by this convention:
5
+ * it is a hand-authored file whose only validation is that the referenced file
6
+ * exists and imports nothing foreign. This module is the canonical extractor so consumers never
7
7
  * scrape comments themselves. It operates on source strings only (callers read
8
8
  * the file through their configured backend) and never touches the filesystem.
9
9
  */
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * `archmax_run` scripts carry their human-facing contract as a leading JSDoc
3
3
  * block comment — the code-file analogue of a case file's `description`. Admin
4
- * UIs display only that description. Lifecycle hook scripts are NOT covered by this convention:
5
- * they are hand-authored files whose only validation is that the referenced
6
- * file exists. This module is the canonical extractor so consumers never
4
+ * UIs display only that description. A code state's script is NOT covered by this convention:
5
+ * it is a hand-authored file whose only validation is that the referenced file
6
+ * exists and imports nothing foreign. This module is the canonical extractor so consumers never
7
7
  * scrape comments themselves. It operates on source strings only (callers read
8
8
  * the file through their configured backend) and never touches the filesystem.
9
9
  */
@@ -79,7 +79,7 @@ export type AnyModelCallRequest = ModelRequest;
79
79
  export type AnyToolCallHandler = ToolCallHandler;
80
80
  /** The handler that runs the model for a generic model-call request. */
81
81
  export type AnyModelCallHandler = (request: AnyModelCallRequest) => ModelCallResult | Promise<ModelCallResult>;
82
- /** The framework runtime handed to lifecycle hooks (context, configurable, signal, store). */
82
+ /** The framework runtime handed to middleware hooks (context, configurable, signal, store). */
83
83
  export type FrameworkRuntime = Runtime;
84
84
  export type { ToolMessage };
85
85
  /**
@@ -103,19 +103,12 @@ export declare function asStructuredTools(tools: ModelCallRequest["tools"] | und
103
103
  export declare function asModelCallResult(result: unknown, origin: string): ModelCallHookResult;
104
104
  /**
105
105
  * The `recursionLimit` a turn runs under when the caller names none. One invoke
106
- * is one whole turn across states — every hook, model call and tool batch is a
107
- * super-step — so this is generous by design: the authored budgets
108
- * (`budget.maxModelCalls`, `maxTurns`, `maxParks`) are the real bound, and
109
- * this only stops a run nothing else bounds. A governed invocation runs under
110
- * {@link turnStepLimit} of its workflow's turn budget, never below this.
106
+ * is one whole turn across states — every model call, tool batch and automated
107
+ * state is a super-step — so this is LangGraph's bound on a whole turn: a
108
+ * caller's own `recursionLimit` replaces it, and a state's `maxTurns` and
109
+ * `maxParks` bound the states that declare them.
111
110
  */
112
111
  export declare const DEFAULT_RECURSION_LIMIT = 400;
113
- /**
114
- * The step limit an invocation runs under when the caller names none: enough that
115
- * a workflow's turn budget, and the error handler it routes to, run out first, so
116
- * the governed bound ends the turn and the step limit only stops what it missed.
117
- */
118
- export declare function turnStepLimit(maxModelCalls: number): number;
119
112
  /** The input a Deep Agent graph is invoked with: messages plus any state channel. */
120
113
  export type AgentInput = Parameters<DeepAgent["invoke"]>[0];
121
114
  /** The settled state a Deep Agent graph resolves to. */
@@ -99,25 +99,12 @@ function describeModelResult(result) {
99
99
  // --- Defaults -----------------------------------------------------------------
100
100
  /**
101
101
  * The `recursionLimit` a turn runs under when the caller names none. One invoke
102
- * is one whole turn across states — every hook, model call and tool batch is a
103
- * super-step — so this is generous by design: the authored budgets
104
- * (`budget.maxModelCalls`, `maxTurns`, `maxParks`) are the real bound, and
105
- * this only stops a run nothing else bounds. A governed invocation runs under
106
- * {@link turnStepLimit} of its workflow's turn budget, never below this.
102
+ * is one whole turn across states — every model call, tool batch and automated
103
+ * state is a super-step — so this is LangGraph's bound on a whole turn: a
104
+ * caller's own `recursionLimit` replaces it, and a state's `maxTurns` and
105
+ * `maxParks` bound the states that declare them.
107
106
  */
108
107
  export const DEFAULT_RECURSION_LIMIT = 400;
109
- /** Graph steps one model call takes, with a step to spare (an advance cycle measures about 7). */
110
- const STEPS_PER_MODEL_CALL = 8;
111
- /** Model calls past the turn budget an `on_error` handler may make before the step limit stops it. */
112
- const HANDLER_CALLS = 10;
113
- /**
114
- * The step limit an invocation runs under when the caller names none: enough that
115
- * a workflow's turn budget, and the error handler it routes to, run out first, so
116
- * the governed bound ends the turn and the step limit only stops what it missed.
117
- */
118
- export function turnStepLimit(maxModelCalls) {
119
- return Math.max(DEFAULT_RECURSION_LIMIT, (maxModelCalls + HANDLER_CALLS) * STEPS_PER_MODEL_CALL);
120
- }
121
108
  /**
122
109
  * Narrow a compiled graph to {@link CompiledAgentGraph}. The governed and plain
123
110
  * graphs' declared state generics differ, so neither is assignable to a shared