@archmax-ai/harness 0.9.0 → 1.0.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.
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 +1 -1
  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
@@ -1 +1 @@
1
- {"version":3,"file":"deepagents.js","sourceRoot":"","sources":["../../src/core/deepagents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AA+GrD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA4C;IAC5E,OAAO,CAAC,KAAK,IAAI,EAAE,CAAgC,CAAC;AACtD,CAAC;AAgBD,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAc;IAC7C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,oBAAoB,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK,CAAC;AACjF,CAAC;AAED,yEAAyE;AACzE,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC;AACxD,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACvC,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAA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GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAmC3C;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,OAAO,KAA2B,CAAC;AACrC,CAAC;AAkCD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,KAA0B;IACxD,OAAO,KAA4C,CAAC;AACtD,CAAC"}
@@ -3,12 +3,11 @@
3
3
  * machine-governed workflow runs. Every runtime diagnostic flows through this
4
4
  * single typed stream; callers subscribe via `onEvent` on
5
5
  * `CreateWorkflowAgentOptions`. With no subscriber, the harness installs
6
- * {@link consoleEventHandler} (`[workflow]` / `[interpreter]` / `[rubrics]`
7
- * console output).
6
+ * {@link consoleEventHandler} (`[workflow]` / `[interpreter]` console output).
8
7
  *
9
8
  * Two visual tiers: **node-change** events (`state-enter`, `state-leave`) render
10
- * at the outer level; **action** events (`hook-*`, `advance`, `agent-text`)
11
- * happen within a node and render indented beneath it.
9
+ * at the outer level; **action** events (`code-*`, `grader-*`, `advance`,
10
+ * `agent-text`) happen within a node and render indented beneath it.
12
11
  *
13
12
  * `callId` pairing rule: every event a tool call causes carries that call's
14
13
  * `callId` — its own `tool-called`/`tool-result` pair and the effects it produced
@@ -26,13 +25,14 @@ export type WorkflowEventLevel = "info" | "warn" | "error";
26
25
  */
27
26
  export declare const SESSION_ORIGIN = "__start__";
28
27
  /**
29
- * Where a tool call came from, on the tool events. Absent means the model called
30
- * the tool directly; a value marks a programmatic call from inside a sandbox
31
- * script (`script`) or a lifecycle hook (`lifecycle`).
28
+ * Where a tool call came from, on the tool events. Absent means a model called
29
+ * the tool — the session's agent, or a grader in a grader state; `script` marks
30
+ * a programmatic call from inside a sandbox script — the agent's
31
+ * `archmax_eval`/`archmax_run`, or a code state's script.
32
32
  */
33
- export type ToolEventOrigin = "script" | "lifecycle";
33
+ export type ToolEventOrigin = "script";
34
34
  /** How a programmatic tool call's origin reads in human-facing output. */
35
- export declare function originLabel(origin: ToolEventOrigin): string;
35
+ export declare function originLabel(_origin: ToolEventOrigin): string;
36
36
  /**
37
37
  * Event payloads, without the severity level (added by the emitter). Every
38
38
  * `state` field carries a **state slug** — never a `title`, so a retitled node
@@ -43,9 +43,6 @@ export type WorkflowEventPayload = {
43
43
  } | {
44
44
  type: "skills-loaded";
45
45
  names: string[];
46
- } | {
47
- type: "hooks-summary";
48
- summary: string;
49
46
  } | {
50
47
  type: "graph-topology";
51
48
  topology: string;
@@ -69,32 +66,28 @@ export type WorkflowEventPayload = {
69
66
  to: string;
70
67
  reason: string;
71
68
  } | {
72
- type: "hook-start";
69
+ type: "code-start";
73
70
  state: string;
74
- phase: "before" | "after";
75
- label: string;
71
+ script: string;
76
72
  } | {
77
- type: "hook-output";
73
+ type: "code-output";
78
74
  state: string;
79
75
  line: string;
80
76
  } | {
81
- type: "hook-passed";
77
+ type: "code-result";
82
78
  state: string;
83
- phase: "before" | "after";
79
+ status: "ok" | "error";
80
+ durationMs: number;
81
+ reason?: string;
84
82
  } | {
85
- type: "hook-verdict";
83
+ type: "grader-start";
86
84
  state: string;
87
- phase: "before" | "after";
88
- label: string;
89
- /** The hook's verdict, kept as the exact kernel vocabulary (never widened). */
90
- verdict: "ok" | "correct" | "veto";
91
- reason: string;
92
- missing?: string[];
93
85
  } | {
94
- type: "hook-rejected";
86
+ type: "grader-result";
95
87
  state: string;
96
- phase: "before" | "after";
97
- reason: string;
88
+ status: "ok" | "error";
89
+ durationMs: number;
90
+ reason?: string;
98
91
  } | {
99
92
  type: "advance";
100
93
  from: string;
@@ -160,10 +153,10 @@ export type WorkflowEventPayload = {
160
153
  sessionId: string;
161
154
  } | {
162
155
  type: "raised";
163
- /** The state the agent raised in; the session's position stays there. */
156
+ /** The state the raise was made in; the session's position stays there. */
164
157
  state: string;
165
158
  sessionId: string;
166
- /** The agent's own short code for what failed. */
159
+ /** The raiser's own short code for what failed. */
167
160
  code: string;
168
161
  reason: string;
169
162
  /** The `archmax_raise` call, matching its `tool-called`/`tool-result` pair. */
@@ -228,18 +221,6 @@ export type WorkflowEventPayload = {
228
221
  callId?: string;
229
222
  args?: Record<string, unknown>;
230
223
  origin?: ToolEventOrigin;
231
- } | {
232
- type: "rubric-start";
233
- state: string;
234
- name: string;
235
- dispatchId: string;
236
- } | {
237
- type: "rubric-result";
238
- state: string;
239
- name: string;
240
- dispatchId: string;
241
- status: "ok" | "error";
242
- durationMs: number;
243
224
  } | {
244
225
  type: "sub-workflow-start";
245
226
  /** The state the call was made from. */
@@ -3,12 +3,11 @@
3
3
  * machine-governed workflow runs. Every runtime diagnostic flows through this
4
4
  * single typed stream; callers subscribe via `onEvent` on
5
5
  * `CreateWorkflowAgentOptions`. With no subscriber, the harness installs
6
- * {@link consoleEventHandler} (`[workflow]` / `[interpreter]` / `[rubrics]`
7
- * console output).
6
+ * {@link consoleEventHandler} (`[workflow]` / `[interpreter]` console output).
8
7
  *
9
8
  * Two visual tiers: **node-change** events (`state-enter`, `state-leave`) render
10
- * at the outer level; **action** events (`hook-*`, `advance`, `agent-text`)
11
- * happen within a node and render indented beneath it.
9
+ * at the outer level; **action** events (`code-*`, `grader-*`, `advance`,
10
+ * `agent-text`) happen within a node and render indented beneath it.
12
11
  *
13
12
  * `callId` pairing rule: every event a tool call causes carries that call's
14
13
  * `callId` — its own `tool-called`/`tool-result` pair and the effects it produced
@@ -26,18 +25,18 @@ import { AsyncLocalStorage } from "node:async_hooks";
26
25
  */
27
26
  export const SESSION_ORIGIN = "__start__";
28
27
  /** How a programmatic tool call's origin reads in human-facing output. */
29
- export function originLabel(origin) {
30
- return origin === "script" ? "script" : "lifecycle hook";
28
+ export function originLabel(_origin) {
29
+ return "script";
31
30
  }
32
31
  function defaultLevel(event) {
33
32
  switch (event.type) {
34
33
  case "warning":
35
34
  case "tool-blocked":
36
- case "hook-rejected":
37
35
  case "raised":
38
36
  return "warn";
39
37
  case "tool-result":
40
- case "rubric-result":
38
+ case "code-result":
39
+ case "grader-result":
41
40
  case "sub-workflow-result":
42
41
  return event.status === "error" ? "warn" : "info";
43
42
  default:
@@ -111,11 +110,9 @@ export function createWorkflowEventEmitter(handler) {
111
110
  export function renderEventLine(event) {
112
111
  switch (event.type) {
113
112
  case "interpreter-enabled":
114
- return "[interpreter] enabled (ptc: all agent tools)";
113
+ return "[interpreter] enabled (ptc: the active state's tools)";
115
114
  case "skills-loaded":
116
115
  return `[skills] loaded: ${event.names.join(", ")}`;
117
- case "hooks-summary":
118
- return `[workflow] lifecycle: ${event.summary}`;
119
116
  case "graph-topology":
120
117
  return `[workflow] LangGraph graph:\n ${event.topology}`;
121
118
  case "warning":
@@ -128,18 +125,20 @@ export function renderEventLine(event) {
128
125
  return `[workflow] leaving node '${event.state}' -> workflowState=${event.next}`;
129
126
  case "state-error-routed":
130
127
  return `[workflow] '${event.state}' failed -> routing to on_error '${event.to}': ${event.reason}`;
131
- case "hook-start":
132
- return `[workflow] ${event.phase} '${event.state}': running ${event.label}`;
133
- case "hook-output":
128
+ case "code-start":
129
+ return `[workflow] code state '${event.state}': running ${event.script}`;
130
+ case "code-output":
134
131
  return `[workflow:${event.state}] ${event.line}`;
135
- case "hook-passed":
136
- return `[workflow] '${event.state}' ${event.phase}-script passed`;
137
- case "hook-verdict": {
138
- const missing = event.missing?.length ? ` (missing: ${event.missing.join(", ")})` : "";
139
- return `[workflow:${event.state}] ${event.label}: ${event.verdict.toUpperCase()} — ${event.reason}${missing}`;
140
- }
141
- case "hook-rejected":
142
- return `[workflow] '${event.state}' ${event.phase} REJECTED: ${event.reason}`;
132
+ case "code-result":
133
+ return event.status === "ok"
134
+ ? `[workflow] code state '${event.state}' finished (${event.durationMs}ms)`
135
+ : `[workflow] code state '${event.state}' FAILED: ${event.reason ?? "unknown error"}`;
136
+ case "grader-start":
137
+ return `[workflow] grader state '${event.state}': grading`;
138
+ case "grader-result":
139
+ return event.status === "ok"
140
+ ? `[workflow] grader state '${event.state}' decided (${event.durationMs}ms)`
141
+ : `[workflow] grader state '${event.state}' FAILED: ${event.reason ?? "unknown error"}`;
143
142
  case "advance":
144
143
  return event.from === SESSION_ORIGIN
145
144
  ? `[workflow] entering start state '${event.to}'`
@@ -184,8 +183,6 @@ export function renderEventLine(event) {
184
183
  case "agent-text":
185
184
  case "agent-text-delta":
186
185
  case "tool-result":
187
- case "rubric-start":
188
- case "rubric-result":
189
186
  case "model-usage":
190
187
  // Accounting is not console output: the CLI renders its own usage footer
191
188
  // from its own subscriber, so a line here would duplicate it.
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/core/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAS1C,0EAA0E;AAC1E,MAAM,UAAU,WAAW,CAAC,MAAuB;IACjD,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC3D,CAAC;AAuUD,SAAS,YAAY,CAAC,KAA2B;IAC/C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,SAAS,CAAC;QACf,KAAK,cAAc,CAAC;QACpB,KAAK,eAAe,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC;QAChB,KAAK,aAAa,CAAC;QACnB,KAAK,eAAe,CAAC;QACrB,KAAK,qBAAqB;YACxB,OAAO,KAAK,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QACpD;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,YAAY,GAAG,IAAI,iBAAiB,EAAgB,CAAC;AAS3D;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAI,OAAuD,EAAE,EAAW;IACtG,MAAM,OAAO,GAAG,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turnAnchorOf(messages: unknown): TurnAnchor;
42
42
  export declare function anchorIndex(messages: readonly unknown[], anchor: TurnAnchor): number;
43
43
  /**
44
44
  * What the agent said during the turn that began at `anchor`: each assistant
45
- * text, in order, joined by a blank line. A completion check's revision request
46
- * (an `after` note) takes back what came before it, so a rejected draft never
47
- * reaches the person; no other note does. Empty when the turn said nothing.
45
+ * text, in order, joined by a blank line. Empty when the turn said nothing.
48
46
  */
49
47
  export declare function turnReply(messages: unknown[], anchor: TurnAnchor): string;
50
48
  /**
@@ -53,11 +51,12 @@ export declare function turnReply(messages: unknown[], anchor: TurnAnchor): stri
53
51
  * - `decision` — a person picked an edge at a human state and the session was routed
54
52
  * - `event` — a trigger firing was delivered to a parked session
55
53
  * - `error` — a failed state was routed to its `on_error` target
56
- * - `after` — a terminal state's completion check asked for a revision
54
+ * - `grader` — a grader state moved the session (its reason is what the next state reads) or ended it
55
+ * - `code` — a code state moved the session or ended it
57
56
  * - `sub-workflow` — a resumed child's result, handed back to its caller
58
57
  * - `opening` — the fixed line a child session's own transcript opens with
59
58
  */
60
- export type RuntimeNoteKind = "decision" | "event" | "error" | "after" | "sub-workflow" | "opening";
59
+ export type RuntimeNoteKind = "decision" | "event" | "error" | "grader" | "code" | "sub-workflow" | "opening";
61
60
  /** Where the marker lives on a message: `additional_kwargs.archmax.note`. */
62
61
  export declare const NOTE_KEY = "archmax";
63
62
  /**
@@ -74,16 +74,11 @@ function messageIdOf(message) {
74
74
  }
75
75
  /**
76
76
  * What the agent said during the turn that began at `anchor`: each assistant
77
- * text, in order, joined by a blank line. A completion check's revision request
78
- * (an `after` note) takes back what came before it, so a rejected draft never
79
- * reaches the person; no other note does. Empty when the turn said nothing.
77
+ * text, in order, joined by a blank line. Empty when the turn said nothing.
80
78
  */
81
79
  export function turnReply(messages, anchor) {
82
- const start = anchorIndex(messages, anchor);
83
- let said = [];
84
- for (const message of messages.slice(start)) {
85
- if (runtimeNoteKind(message) === "after")
86
- said = [];
80
+ const said = [];
81
+ for (const message of messages.slice(anchorIndex(messages, anchor))) {
87
82
  if (!isAiMessage(message) || isRuntimeNote(message))
88
83
  continue;
89
84
  const text = contentToString(message.content).trim();
@@ -1 +1 @@
1
- {"version":3,"file":"message-readers.js","sourceRoot":"","sources":["../../src/core/message-readers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,KAAK,EAAE,MAAM;IACb,EAAE,EAAE,WAAW;IACf,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,MAAM,GAAG,GAAG,OAAkC,CAAC;IAC/C,MAAM,CAAC,GACJ,GAAG,CAAC,QAAuC,EAAE,EAAE;QAC/C,GAAG,CAAC,OAAsC,EAAE,EAAE;QAC/C,GAAG,CAAC,IAAI;QACR,GAAG,CAAC,IAAI;QACR,EAAE,CAAC;IACL,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,MAAM,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,WAAW,CAAC;AACzC,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,MAAM,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,QAAmB;IAC/C,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,OAAO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O,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAI,QAAsB;IAChD,IAAI,GAAG,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9B,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAAE,GAAG,EAAE,CAAC;IACpD,IAAI,GAAG,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACvB,IAAI,KAAK,GAAG,GAAG,CAAC;IAChB,OAAO,KAAK,GAAG,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAAE,KAAK,EAAE,CAAC;IAC5D,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC;IAChD,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO;aACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,OAAO,IAAI,KAAK,QAAQ;YACtB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,OAAQ,IAA0B,EAAE,IAAI,KAAK,QAAQ;gBACrD,CAAC,CAAE,IAAyB,CAAC,IAAI;gBACjC,CAAC,CAAC,EAAE,CACT;aACA,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -25,25 +25,3 @@ export declare function runtimeNote(kind: RuntimeNoteKind, text: string): BaseMe
25
25
  * session has to open with a request, so it is marked rather than reshaped.
26
26
  */
27
27
  export declare function humanNote(kind: RuntimeNoteKind, text: string): HumanMessage;
28
- export interface HistoryEntry {
29
- role: string;
30
- content: string;
31
- toolCalls?: {
32
- name: string;
33
- args: unknown;
34
- }[];
35
- }
36
- export interface RunContext {
37
- history: HistoryEntry[];
38
- userRequest: string;
39
- }
40
- /**
41
- * Build the view a rubric grader reads: the messages from `visitStart` on (the
42
- * visit its hook sees) plus the person's latest message.
43
- *
44
- * `userRequest` is read from the **whole** list, not the visit: a grader asked
45
- * whether the reply satisfies the request must see the request, which an
46
- * earlier state usually received (issue #61). It is the latest user message,
47
- * not the first: a later turn is answering the question asked in that turn.
48
- */
49
- export declare function runContextFromMessages(messages: unknown[], visitStart?: number): RunContext;
@@ -1,7 +1,7 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { AIMessage, HumanMessage, ToolMessage } from "@langchain/core/messages";
3
3
  import { NOTE_TOOL } from "../machine/tool-names.js";
4
- import { contentToString, messageTypeOf, NOTE_KEY, ROLE_BY_TYPE } from "./message-readers.js";
4
+ import { NOTE_KEY } from "./message-readers.js";
5
5
  // The readers are pure and live in `message-readers.ts` (the `@archmax-ai/harness/messages`
6
6
  // subpath); re-exported so every runtime importer keeps one module for both halves.
7
7
  export { anchorIndex, contentToString, isAiMessage, isHumanMessage, isRuntimeNote, lastAgentText, lastMessageIsHuman, lastTurn, messagesSince, messageTypeOf, opensTurn, runtimeNoteKind, spokeSinceLastHumanMessage, turnAnchorOf, turnReply, } from "./message-readers.js";
@@ -49,35 +49,4 @@ export function runtimeNote(kind, text) {
49
49
  export function humanNote(kind, text) {
50
50
  return new HumanMessage({ content: text, additional_kwargs: marker(kind) });
51
51
  }
52
- /** One message as a hook reads it: its role, its text, and any tool calls it made. */
53
- function historyEntry(m) {
54
- const msg = m;
55
- const type = messageTypeOf(m) || "?";
56
- const role = ROLE_BY_TYPE[type] ?? type;
57
- const entry = { role, content: contentToString(msg.content) };
58
- const toolCalls = msg.tool_calls;
59
- if (Array.isArray(toolCalls) && toolCalls.length > 0) {
60
- entry.toolCalls = toolCalls.map((c) => {
61
- const call = c;
62
- return { name: String(call.name ?? ""), args: call.args ?? {} };
63
- });
64
- }
65
- return entry;
66
- }
67
- /**
68
- * Build the view a rubric grader reads: the messages from `visitStart` on (the
69
- * visit its hook sees) plus the person's latest message.
70
- *
71
- * `userRequest` is read from the **whole** list, not the visit: a grader asked
72
- * whether the reply satisfies the request must see the request, which an
73
- * earlier state usually received (issue #61). It is the latest user message,
74
- * not the first: a later turn is answering the question asked in that turn.
75
- */
76
- export function runContextFromMessages(messages, visitStart = 0) {
77
- const all = Array.isArray(messages) ? messages : [];
78
- const history = all.slice(visitStart).map(historyEntry);
79
- const latest = [...all].reverse().find((m) => (ROLE_BY_TYPE[messageTypeOf(m) || "?"] ?? "") === "user");
80
- const userRequest = latest !== undefined ? contentToString(latest.content) : "";
81
- return { history, userRequest };
82
- }
83
52
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/core/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAwB,MAAM,sBAAsB,CAAC;AAEpH,4FAA4F;AAC5F,oFAAoF;AACpF,OAAO,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,EACf,0BAA0B,EAC1B,YAAY,EACZ,SAAS,GAGV,MAAM,sBAAsB,CAAC;AAE9B,0DAA0D;AAC1D,SAAS,MAAM,CAAC,IAAqB;IACnC,OAAO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M,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9E,CAAC"}
@@ -104,9 +104,9 @@ export function resolveMounts(table = {}) {
104
104
  * Deliberately short, and deliberately missing every {@link AUTHORING_PREFIXES}
105
105
  * prefix. That plane is not workspace furniture the agent browses: it is what the
106
106
  * runtime enforces the run *with*, served by the authoring backend and reachable by
107
- * no tool call. `workflows/` holds the spec — its grading rubrics included, so a run
108
- * cannot read the criteria it is judged against — plus the prose addendum, the hook
109
- * scripts, and the cases grading the run.
107
+ * no tool call. `workflows/` holds the spec — its grader states' criteria
108
+ * included, so a session cannot read the criteria it is judged against — plus
109
+ * the prose addendum, the code-state scripts, and the cases testing the run.
110
110
  *
111
111
  * What ships in a skill bundle is the other kind of script — the ones the *agent*
112
112
  * runs with `archmax_run` — together with the data a state reads
@@ -1,4 +1,4 @@
1
1
  // Generated from platform-prompt.md by scripts/generate-platform-prompt.mjs. Do not edit.
2
2
  /** The bundled platform prompt: how to move through the graph and which tools are the runtime's. */
3
- export const PLATFORM_PROMPT = "# Graph state execution\n\nYou run inside a **declarative workflow graph**: you occupy one **state** at a\ntime, and its spec governs which tools you may call and which files you may read\nor write.\n\n## How you move\n\n<!-- top-level-only -->\n1. **Name the run first.** Before anything else in your first turn, call\n **`archmax_set_variables({ \"variables\": { \"title\": \"<a few words>\" } })`** — see\n \"Naming the run\" below.\n<!-- /top-level-only -->\n2. Do the current state's work. Write files where its instructions or listed\n mounts say; `scratchpad/` is only the default.\n3. Call **`archmax_advance({ \"to\": \"<next>\", \"reason\": \"<one sentence>\" })`**,\n choosing `to` from the transitions under \"Current state\" by their descriptions.\n `to` takes the target's **slug** — the backticked token on the transition line.\n A parenthesized note gives the edge's type (`approve`, `reject`, `refine`) and\n marks a **human decision node** or a **terminal** target. A state with no\n transitions says so: the run ends there, so finish its work and stop.\n4. The runtime validates the edge and runs this state's `after` hook and then the\n target's `before` hook — either may send you back to correct or veto the move —\n before the next state's tools unlock.\n\n**One transition per message.** A second `archmax_advance` in the same message is\nrefused; chain states over successive turns.\n\n**Text alone ends your turn.** A message with no tool call is the last thing you\ndo until someone writes again: the run stays where it is, and whatever you meant\nto do next never happens. So when the work is to tell the person something *and\nthen* advance, wait or raise, write that text and make the call in the **same\nmessage**.\n\n**A conversation keeps its position.** A new message finds you in the state your\nlast turn ended in. When that state can serve it, stay and answer there: a new\nmessage is not a reason to reset. If it cannot — no transition reaches what was\nasked, or an earlier turn took a wrong path — call\n**`archmax_reset({ \"reason\": \"<one sentence>\" })`** to return to the state the\nconversation began in. The conversation and every file written so far are kept.\nA reset only ever goes back there, so never call it while you are still in that\nstate — nothing has moved you out of it since the conversation began or since\nyour last reset.\n\n**A terminal state you moved into never serves a follow-up.** When a message lands\non a run that was *already sitting* in a terminal state it moved into, reset\n**before** answering, or you skip every state the answer depends on. Three cases\ntake no reset: a run you parked with `archmax_wait`, which resumes where it was on\npurpose; a terminal state you were routed into *this turn*, by your own advance or\na person's decision — do its work, then stop; and a terminal state the\nconversation began in, where a reset would leave you exactly where you are —\nanswer there. Never reset out of a state you just arrived in, and never\n`archmax_wait` for the runtime to move you.\n\n### Waiting and deciding\n\n- Something has to **arrive** from outside the run — an event, a callback, a reply\n someone sends in their own time → call\n **`archmax_wait({ \"reason\": \"<what you are waiting for>\" })`** and stop. You\n resume in **this same state**, with what arrived in your transcript and any\n values it carried in the variables. Waiting for a *time*? Add `\"until\": \"1d\"` (a\n duration or an ISO-8601 instant); an earlier event still resumes you.\n- Someone has to **decide**, approve, review or choose → `archmax_advance` into the\n **human decision node** the author declared for it. The runtime parks the run\n there and presents the options itself: do the work its transitions require,\n advance in, and stop. Never advance out of one yourself, and never `archmax_wait`\n to ask for a decision.\n\n### When the work fails\n\nIf the task **cannot be completed** — a system it depends on keeps failing, what it\nneeds does not exist, the request is one this workflow cannot serve — try to\nrecover once or twice (a retry, another tool, another approach). If that fails\ntoo, call **`archmax_raise({ \"code\": \"<short-token>\", \"reason\": \"<what failed>\" })`**:\nit ends the session as a failure from any state, and whoever started the run\nreads your `code` (e.g. `orders-unavailable`) and `reason`. **When you are about to\ntell the person the task cannot be done, make that call in the same message**: the\nmessage's text is what they read, and no other tool call goes with it. A reply\nthat only explains the failure ends the run as a success. Never raise to finish\nwork that worked, or in place of `archmax_wait`, `archmax_reset` or a human node.\n\n### The state you are in\n\nThe active state's **`instructions`** arrive under a \"Current state\" heading:\nfollow them. You are shown the edges out of this state and nothing else of the\ngraph — there is no map of the workflow to consult. Do not guess at slugs, and do\nnot treat a state named anywhere else (a message, a file, your own earlier turns)\nas somewhere you can move to. Skills the state may use are listed under \"Skills\navailable in this state\", each naming the `SKILL.md` to read first.\n\n**`before`/`after` hooks** run on their own and may approve, ask for a\ncorrection, or block the run: fix the work rather than arguing with it.\n\n## Tools\n\nTool access is **closed by default**: you see only the active state's tools, and\na state may narrow a tool's arguments (e.g. `write_file` to one path). Tools named\n`archmax_*` are the runtime's controls. A blocked call names the tool, the state\nand the policy: fix the call, or advance if you are done.\n\n**Write code instead of many calls.** **`archmax_eval({ \"code\": \"…\" })`**, when\nyour tools include it, runs JavaScript in a sandbox where `tools.*` calls your tools,\ngoverned exactly as your own calls are. Reach for it by default for loops,\nfilters, arithmetic, or more than about two calls whose results feed each other:\n**only your last expression and whatever you `console.log` come back to you**, so\nthe rest of what those tools returned never enters the conversation. The REPL\nkeeps its state between calls. Your code cannot read the run's variables:\ninterpolate a scalar one into it with `${{name}}` (below), or use\n**`archmax_run({ \"file_path\": \"…\" })`**, the same sandbox subject to the state's\npath constraints, whose script receives whole structured values as\n`args.variables`.\n\n<!-- top-level-only -->\n**Naming the run.** `title` is a reserved run variable: a one-line label of a few\nwords (`Refund for order A-1042`) that tells this run apart in a list of runs.\nThis is step 1 above, and it is not optional. Write it from what the request\nalready says, **before** the state's own work and before any other tool call — it\nis a label, not a plan, so never read anything to produce one — and it still goes\nfirst when the state's instructions tell you to do something else first. After\nthat, leave it alone unless the conversation **as a whole** has moved to a\nsubject the old title no longer describes. Judge that against the whole\nconversation, not its latest message: a follow-up, a detail, a correction or a\nside question on the same subject keeps the title. When you do rename, name what\nthe whole conversation is about. Never pass `lock` with it: that call is refused.\n\n<!-- /top-level-only -->\n**Reference a run variable instead of retyping it.** In any text argument,\n`${{name}}` (or `${{name.path.to.value}}`) is replaced with that variable's value\nbefore the call runs, also **inside** a longer string and as often as you like:\n\n```\n\"Thanks — your refund is on its way.\n\n--- Original message ---\n\n${{inbound.text}}\"\n```\n\nPrefer the reference to writing the value out: the value is what you spend tokens\non, and a reference cannot paraphrase, truncate or mistype it.\n`archmax_get_variables` shows what is set; a reference that does not resolve\nrefuses the call and says why. To write `${{…}}` literally, double the dollar:\n`$${{name}}`.\n";
3
+ export const PLATFORM_PROMPT = "# Graph state execution\n\nYou run inside a **declarative workflow graph**: you occupy one **state** at a\ntime, and its spec governs which tools you may call and which files you may read\nor write.\n\n## How you move\n\n<!-- top-level-only -->\n1. **Name the run first.** Before anything else in your first turn, call\n **`archmax_set_variables({ \"variables\": { \"title\": \"<a few words>\" } })`** — see\n \"Naming the run\" below.\n<!-- /top-level-only -->\n2. Do the current state's work. Write files where its instructions or listed\n mounts say; `scratchpad/` is only the default.\n3. Call **`archmax_advance({ \"to\": \"<next>\", \"reason\": \"<one sentence>\" })`**,\n choosing `to` from the transitions under \"Current state\" by their descriptions.\n `to` takes the target's **slug** — the backticked token on the transition line.\n A parenthesized note gives the edge's type (`approve`, `reject`, `refine`) and\n marks a **human decision node**, a **grader**, a **code** state or a\n **terminal** target. A state with no transitions says so: the run ends there,\n so finish its work and stop.\n4. The runtime validates the edge, and the state's required variables, before the\n next state's tools unlock.\n\n**One transition per message.** A second `archmax_advance` in the same message is\nrefused; chain states over successive turns.\n\n**Text alone ends your turn.** A message with no tool call is the last thing you\ndo until someone writes again: the run stays where it is, and whatever you meant\nto do next never happens. So when the work is to tell the person something *and\nthen* advance, wait or raise, write that text and make the call in the **same\nmessage**.\n\n**A conversation keeps its position.** A new message finds you in the state your\nlast turn ended in. When that state can serve it, stay and answer there: a new\nmessage is not a reason to reset. If it cannot — no transition reaches what was\nasked, or an earlier turn took a wrong path — call\n**`archmax_reset({ \"reason\": \"<one sentence>\" })`** to return to the state the\nconversation began in. The conversation and every file written so far are kept.\nA reset only ever goes back there, so never call it while you are still in that\nstate — nothing has moved you out of it since the conversation began or since\nyour last reset.\n\n**A terminal state you moved into never serves a follow-up.** When a message lands\non a run that was *already sitting* in a terminal state it moved into, reset\n**before** answering, or you skip every state the answer depends on. Three cases\ntake no reset: a run you parked with `archmax_wait`, which resumes where it was on\npurpose; a terminal state you were routed into *this turn*, by your own advance or\na person's decision — do its work, then stop; and a terminal state the\nconversation began in, where a reset would leave you exactly where you are —\nanswer there. Never reset out of a state you just arrived in, and never\n`archmax_wait` for the runtime to move you.\n\n### Waiting and deciding\n\n- Something has to **arrive** from outside the run — an event, a callback, a reply\n someone sends in their own time → call\n **`archmax_wait({ \"reason\": \"<what you are waiting for>\" })`** and stop. You\n resume in **this same state**, with what arrived in your transcript and any\n values it carried in the variables. Waiting for a *time*? Add `\"until\": \"1d\"` (a\n duration or an ISO-8601 instant); an earlier event still resumes you.\n- Someone has to **decide**, approve, review or choose → `archmax_advance` into the\n **human decision node** the author declared for it. The runtime parks the run\n there and presents the options itself: do the work its transitions require,\n advance in, and stop. Never advance out of one yourself, and never `archmax_wait`\n to ask for a decision.\n\n### When the work fails\n\nIf the task **cannot be completed** — a system it depends on keeps failing, what it\nneeds does not exist, the request is one this workflow cannot serve — try to\nrecover once or twice (a retry, another tool, another approach). If that fails\ntoo, call **`archmax_raise({ \"code\": \"<short-token>\", \"reason\": \"<what failed>\" })`**:\nit ends the session as a failure from any state, and whoever started the run\nreads your `code` (e.g. `orders-unavailable`) and `reason`. **When you are about to\ntell the person the task cannot be done, make that call in the same message**: the\nmessage's text is what they read, and no other tool call goes with it. A reply\nthat only explains the failure ends the run as a success. Never raise to finish\nwork that worked, or in place of `archmax_wait`, `archmax_reset` or a human node.\n\n### The state you are in\n\nThe active state's **`instructions`** arrive under a \"Current state\" heading:\nfollow them. You are shown the edges out of this state and nothing else of the\ngraph — there is no map of the workflow to consult. Do not guess at slugs, and do\nnot treat a state named anywhere else (a message, a file, your own earlier turns)\nas somewhere you can move to. Skills the state may use are listed under \"Skills\navailable in this state\", each naming the `SKILL.md` to read first.\n\n**Grader and code states** run on their own, without you: a grader judges the\nwork so far, a code state runs the workflow's own checks. Either may move the run\non, end it, or send it back to you with a note saying what has to change — then\nfix the work rather than arguing with it, and advance again.\n\n## Tools\n\nTool access is **closed by default**: you see only the active state's tools, and\na state may narrow a tool's arguments (e.g. `write_file` to one path). Tools named\n`archmax_*` are the runtime's controls. A blocked call names the tool, the state\nand the policy: fix the call, or advance if you are done.\n\n**Write code instead of many calls.** **`archmax_eval({ \"code\": \"…\" })`**, when\nyour tools include it, runs JavaScript in a sandbox where `tools.*` calls your tools,\ngoverned exactly as your own calls are. Reach for it by default for loops,\nfilters, arithmetic, or more than about two calls whose results feed each other:\n**only your last expression and whatever you `console.log` come back to you**, so\nthe rest of what those tools returned never enters the conversation. The REPL\nkeeps its state between calls. Your code cannot read the run's variables:\ninterpolate a scalar one into it with `${{name}}` (below), or use\n**`archmax_run({ \"file_path\": \"…\" })`**, the same sandbox subject to the state's\npath constraints, whose script receives whole structured values as\n`args.variables`.\n\n<!-- top-level-only -->\n**Naming the run.** `title` is a reserved run variable: a one-line label of a few\nwords (`Refund for order A-1042`) that tells this run apart in a list of runs.\nThis is step 1 above, and it is not optional. Write it from what the request\nalready says, **before** the state's own work and before any other tool call — it\nis a label, not a plan, so never read anything to produce one — and it still goes\nfirst when the state's instructions tell you to do something else first. After\nthat, leave it alone unless the conversation **as a whole** has moved to a\nsubject the old title no longer describes. Judge that against the whole\nconversation, not its latest message: a follow-up, a detail, a correction or a\nside question on the same subject keeps the title. When you do rename, name what\nthe whole conversation is about. Never pass `lock` with it: that call is refused.\n\n<!-- /top-level-only -->\n**Reference a run variable instead of retyping it.** In any text argument,\n`${{name}}` (or `${{name.path.to.value}}`) is replaced with that variable's value\nbefore the call runs, also **inside** a longer string and as often as you like:\n\n```\n\"Thanks — your refund is on its way.\n\n--- Original message ---\n\n${{inbound.text}}\"\n```\n\nPrefer the reference to writing the value out: the value is what you spend tokens\non, and a reference cannot paraphrase, truncate or mistype it.\n`archmax_get_variables` shows what is set; a reference that does not resolve\nrefuses the call and says why. To write `${{…}}` literally, double the dollar:\n`$${{name}}`.\n";
4
4
  //# sourceMappingURL=platform-prompt.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-prompt.generated.js","sourceRoot":"","sources":["../../src/core/platform-prompt.generated.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAW,4+PAA4+P,CAAC"}
1
+ {"version":3,"file":"platform-prompt.generated.js","sourceRoot":"","sources":["../../src/core/platform-prompt.generated.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAW,ilQAAilQ,CAAC"}
@@ -43,7 +43,7 @@ export declare class SessionZoneRouter implements BackendProtocolV2 {
43
43
  /**
44
44
  * Bind id-free run-root addressing to `sessionId` for everything `fn` does
45
45
  * (the binding propagates through async continuations, so a whole agent
46
- * turn — including lifecycle hooks, sandboxed scripts, and the inner
46
+ * turn — including automated states, sandboxed scripts, and the inner
47
47
  * agent's own checkpoint writes — is covered by wrapping its `invoke`).
48
48
  * Concurrent sessions each carry their own binding.
49
49
  */
@@ -55,7 +55,7 @@ export class SessionZoneRouter {
55
55
  /**
56
56
  * Bind id-free run-root addressing to `sessionId` for everything `fn` does
57
57
  * (the binding propagates through async continuations, so a whole agent
58
- * turn — including lifecycle hooks, sandboxed scripts, and the inner
58
+ * turn — including automated states, sandboxed scripts, and the inner
59
59
  * agent's own checkpoint writes — is covered by wrapping its `invoke`).
60
60
  * Concurrent sessions each carry their own binding.
61
61
  */
@@ -50,7 +50,7 @@ export interface WorkspaceContextOptions {
50
50
  mounts?: Record<string, MountSpec>;
51
51
  /**
52
52
  * Backend serving the **authored governance plane** — `workflows/<slug>/`:
53
- * machine specs, prose addenda, lifecycle hook scripts, and offline test
53
+ * machine specs, prose addenda, code-state scripts, and offline test
54
54
  * cases. Read by the runtime, never routed into the agent's workspace
55
55
  * composite, so no agent tool and no PTC call can address it.
56
56
  *
@@ -3,7 +3,7 @@ import type { BackendProtocolV2, FileData, FileInfo } from "deepagents";
3
3
  * Single file-access layer for the runtime.
4
4
  *
5
5
  * Every read of a file in the agent workspace — machine config, system prompt,
6
- * hook scripts, `archmax_run` sources, lifecycle artifacts — flows
6
+ * code-state scripts, `archmax_run` sources, session artifacts — flows
7
7
  * through here so it is served by the configured LangChain Deep Agents
8
8
  * {@link BackendProtocolV2}. Swap the backend (filesystem, store, sandbox,
9
9
  * remote) and the whole runtime follows, with no direct `fs` coupling.
@@ -2,7 +2,7 @@
2
2
  * Single file-access layer for the runtime.
3
3
  *
4
4
  * Every read of a file in the agent workspace — machine config, system prompt,
5
- * hook scripts, `archmax_run` sources, lifecycle artifacts — flows
5
+ * code-state scripts, `archmax_run` sources, session artifacts — flows
6
6
  * through here so it is served by the configured LangChain Deep Agents
7
7
  * {@link BackendProtocolV2}. Swap the backend (filesystem, store, sandbox,
8
8
  * remote) and the whole runtime follows, with no direct `fs` coupling.
@@ -104,14 +104,14 @@ export type WorkspaceZone = "authored" | "run-internal" | "run-offload" | "run-o
104
104
  export declare function sessionAreaNames(): string[];
105
105
  /**
106
106
  * The authoring prefixes: the workspace-root names holding what the **runtime**
107
- * reads. `workflows/` carries the machine specs — grading rubrics included — the
108
- * prose addenda, the lifecycle hook scripts, and the offline test cases a session
109
- * is enforced with. It is served by the *authoring* backend and is not routed into
107
+ * reads. `workflows/` carries the machine specs — grader states' criteria
108
+ * included — the prose addenda, the code-state scripts, and the offline test
109
+ * cases a session is enforced with. It is served by the *authoring* backend and is not routed into
110
110
  * the agent's workspace composite.
111
111
  *
112
112
  * It is reserved rather than merely omitted: a workspace that mounted it would hand
113
113
  * a session its own spec, its sibling workflows' specs, the tests grading it, and
114
- * the criteria (with the iteration budget) of the rubric that vetoes it. Refusing
114
+ * the criteria a grader state judges it by, and the code its code states run. Refusing
115
115
  * the key makes the isolation a property of composition instead of a rule
116
116
  * something downstream could relax.
117
117
  *
@@ -64,14 +64,14 @@ const SESSION_AREA_SET = new Set(sessionAreaNames());
64
64
  // --- The authoring prefixes ------------------------------------------------------
65
65
  /**
66
66
  * The authoring prefixes: the workspace-root names holding what the **runtime**
67
- * reads. `workflows/` carries the machine specs — grading rubrics included — the
68
- * prose addenda, the lifecycle hook scripts, and the offline test cases a session
69
- * is enforced with. It is served by the *authoring* backend and is not routed into
67
+ * reads. `workflows/` carries the machine specs — grader states' criteria
68
+ * included — the prose addenda, the code-state scripts, and the offline test
69
+ * cases a session is enforced with. It is served by the *authoring* backend and is not routed into
70
70
  * the agent's workspace composite.
71
71
  *
72
72
  * It is reserved rather than merely omitted: a workspace that mounted it would hand
73
73
  * a session its own spec, its sibling workflows' specs, the tests grading it, and
74
- * the criteria (with the iteration budget) of the rubric that vetoes it. Refusing
74
+ * the criteria a grader state judges it by, and the code its code states run. Refusing
75
75
  * the key makes the isolation a property of composition instead of a rule
76
76
  * something downstream could relax.
77
77
  *
@@ -89,7 +89,7 @@ export const AUTHORING_PREFIXES = ["workflows"];
89
89
  * diagnostic describes the prefix the consumer actually named.
90
90
  */
91
91
  const AUTHORING_CONTENT = {
92
- workflows: "machine specs, grading rubrics, hook scripts, and test cases",
92
+ workflows: "machine specs, code-state scripts, and test cases",
93
93
  };
94
94
  /** Whether a bare root name is an authoring prefix. */
95
95
  export function isAuthoringPrefix(name) {
@@ -1 +1 @@
1
- {"version":3,"file":"zones.js","sourceRoot":"","sources":["../../src/core/zones.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAkDrD,sDAAsD;AACtD,MAAM,CAAC,MAAM,SAAS,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