@archmax-ai/harness 0.1.0 → 0.2.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 (77) hide show
  1. package/README.md +45 -4
  2. package/dist/assembly/compose.js +3 -5
  3. package/dist/assembly/compose.js.map +1 -1
  4. package/dist/assembly/delegation-registry.js +4 -2
  5. package/dist/assembly/delegation-registry.js.map +1 -1
  6. package/dist/authoring-skill/archmax-harness/README.md +24 -16
  7. package/dist/authoring-skill/archmax-harness/SKILL.md +7 -1
  8. package/dist/authoring-skill/archmax-harness/references/backend-integration.md +58 -2
  9. package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +66 -20
  10. package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +14 -4
  11. package/dist/cli/turn.d.ts +9 -4
  12. package/dist/cli/turn.js +35 -8
  13. package/dist/cli/turn.js.map +1 -1
  14. package/dist/cli.js +4 -5
  15. package/dist/cli.js.map +1 -1
  16. package/dist/index.d.ts +12 -0
  17. package/dist/index.js +15 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/machine/machine.d.ts +9 -0
  20. package/dist/machine/machine.js +13 -0
  21. package/dist/machine/machine.js.map +1 -1
  22. package/dist/machine/signature.d.ts +104 -0
  23. package/dist/machine/signature.js +210 -0
  24. package/dist/machine/signature.js.map +1 -0
  25. package/dist/machine/spec-schema.d.ts +158 -8
  26. package/dist/machine/spec-schema.js +78 -6
  27. package/dist/machine/spec-schema.js.map +1 -1
  28. package/dist/machine/triggers.d.ts +6 -2
  29. package/dist/machine/triggers.js +7 -2
  30. package/dist/machine/triggers.js.map +1 -1
  31. package/dist/machine/types.d.ts +7 -1
  32. package/dist/machine/types.js.map +1 -1
  33. package/dist/machine/variables.d.ts +2 -0
  34. package/dist/machine/variables.js +4 -0
  35. package/dist/machine/variables.js.map +1 -1
  36. package/dist/public/spec.d.ts +17 -2
  37. package/dist/public/spec.js +15 -1
  38. package/dist/public/spec.js.map +1 -1
  39. package/dist/sessions/resume.d.ts +4 -0
  40. package/dist/sessions/resume.js +8 -1
  41. package/dist/sessions/resume.js.map +1 -1
  42. package/dist/workflow/control-tools.d.ts +7 -2
  43. package/dist/workflow/control-tools.js +27 -2
  44. package/dist/workflow/control-tools.js.map +1 -1
  45. package/dist/workflow/governance.js +28 -19
  46. package/dist/workflow/governance.js.map +1 -1
  47. package/dist/workflow/middleware.js +5 -10
  48. package/dist/workflow/middleware.js.map +1 -1
  49. package/dist/workflow/prompt-cache.d.ts +0 -2
  50. package/dist/workflow/prompt-cache.js +0 -7
  51. package/dist/workflow/prompt-cache.js.map +1 -1
  52. package/dist/workflow/render-prompt.js +28 -7
  53. package/dist/workflow/render-prompt.js.map +1 -1
  54. package/dist/workflow/signature-checks.d.ts +22 -0
  55. package/dist/workflow/signature-checks.js +52 -0
  56. package/dist/workflow/signature-checks.js.map +1 -0
  57. package/dist/workflow/sub-workflow.d.ts +23 -16
  58. package/dist/workflow/sub-workflow.js +78 -14
  59. package/dist/workflow/sub-workflow.js.map +1 -1
  60. package/dist/workflow/tool-service.js +1 -1
  61. package/dist/workflow/tool-service.js.map +1 -1
  62. package/dist/workflow/turn-boundary.js +4 -5
  63. package/dist/workflow/turn-boundary.js.map +1 -1
  64. package/dist/workflow/workflow-tools.d.ts +17 -9
  65. package/dist/workflow/workflow-tools.js +30 -17
  66. package/dist/workflow/workflow-tools.js.map +1 -1
  67. package/package.json +2 -1
  68. package/skills/archmax-harness/README.md +82 -0
  69. package/skills/archmax-harness/SKILL.md +247 -0
  70. package/skills/archmax-harness/references/backend-integration.md +681 -0
  71. package/skills/archmax-harness/references/cases.md +41 -0
  72. package/skills/archmax-harness/references/diagnostics.md +51 -0
  73. package/skills/archmax-harness/references/hook-and-test-scripts.md +1070 -0
  74. package/skills/archmax-harness/references/hooks-and-scripts.md +82 -0
  75. package/skills/archmax-harness/references/wiring.md +101 -0
  76. package/skills/archmax-harness/references/workflow-schema.md +1677 -0
  77. package/skills/archmax-harness/references/workflow-yaml.md +251 -0
package/README.md CHANGED
@@ -47,6 +47,13 @@ whose output a person reads runs on a capable one.
47
47
  See [configuration](https://harness.archmax.ai/reference/configuration/) for
48
48
  every variable.
49
49
 
50
+ To have a coding agent (Claude Code, Cursor, Codex, …) author workflows for you, install the
51
+ authoring skill:
52
+
53
+ ```bash
54
+ npx skills add archmax-ai/harness
55
+ ```
56
+
50
57
  ## Quickstart
51
58
 
52
59
  ### A workspace
@@ -97,6 +104,28 @@ states:
97
104
  instructions: Judge the tone of the reply. Return ok, correct or veto with a reason.
98
105
  ```
99
106
 
107
+ A trigger may also declare the contract a caller relies on: what a firing must supply and what the
108
+ session guarantees when it completes. A delegating workflow, a host's MCP tool and a start form all
109
+ read the same declaration, and the runtime holds it at the boundary:
110
+
111
+ ```yaml
112
+ states:
113
+ intake:
114
+ triggers:
115
+ manual:
116
+ description: Refund one order and report what was refunded. # for callers, not the agent
117
+ requires:
118
+ - order_id # a bare name is untyped
119
+ - { name: due, type: date, description: The day the refund is due. }
120
+ returns:
121
+ - { name: total, type: number, description: Refunded amount in EUR. }
122
+ ```
123
+
124
+ A start whose `due` is not a real `YYYY-MM-DD` day is refused before any model call, and a session
125
+ that finishes with `total` unset or not a number is rejected. `signatureJsonSchema` on
126
+ `@archmax-ai/harness/spec` turns the same signature into a JSON Schema. See
127
+ [triggers](https://harness.archmax.ai/guides/triggers/#typing-a-signature).
128
+
100
129
  `examples/customer-support/` in this repository is a complete reference workspace.
101
130
 
102
131
  ### The CLI
@@ -155,10 +184,22 @@ The last two are browser-safe, with no runtime behind them. See the
155
184
 
156
185
  ### Authoring with a coding agent
157
186
 
158
- The package ships an authoring skill at `dist/authoring-skill/archmax-harness/`. It teaches a coding agent
159
- the schema, the hook contract, governance, human states, cases and the CLI. The
160
- `BUNDLED_AUTHORING_SKILL_DIR` export resolves to its parent directory, and the source is
161
- `skills/archmax-harness/`.
187
+ The authoring skill teaches a coding agent the schema, the hook contract, governance, human
188
+ states, cases and the CLI. Install it with the [skills CLI](https://skills.sh):
189
+
190
+ ```bash
191
+ npx skills add archmax-ai/harness
192
+ ```
193
+
194
+ That installs the latest version from GitHub. To pin the skill to the SDK version your project
195
+ depends on, install the copy shipped inside the package instead, after `npm install`:
196
+
197
+ ```bash
198
+ npx skills add ./node_modules/@archmax-ai/harness
199
+ ```
200
+
201
+ For skills middleware in your own agent, the `BUNDLED_AUTHORING_SKILL_DIR` export resolves to
202
+ the packaged copy. The source is `skills/archmax-harness/`.
162
203
 
163
204
  ## Documentation
164
205
 
@@ -21,7 +21,7 @@ import { createQuickJsSandboxRuntime } from "../sandbox/runtime.js";
21
21
  import { createInterpreter } from "../sandbox/tools.js";
22
22
  import { createWorkflowInstrumentation } from "../workflow/middleware.js";
23
23
  import { resolveHookScript, workflowPaths } from "../workflow/paths.js";
24
- import { createProviderCacheMiddleware, modelIdOf, NATIVE_CACHE_STRATEGIES, resolveCacheStrategy, resolvePromptCacheConfig, unsupportedCacheMessage, } from "../workflow/prompt-cache.js";
24
+ import { createProviderCacheMiddleware, modelIdOf, NATIVE_CACHE_STRATEGIES, resolveCacheStrategy, resolvePromptCacheConfig, } from "../workflow/prompt-cache.js";
25
25
  import { renderWorkflowPrompt, stripHtmlComments } from "../workflow/render-prompt.js";
26
26
  import { describeMachineTopology } from "../workflow/session-artifacts.js";
27
27
  import { workflowStateSchema } from "../workflow/state.js";
@@ -141,10 +141,8 @@ function resolveStateModels(ctx, machine, workflow, cacheEnabled) {
141
141
  let strategy = strategies.get(model);
142
142
  if (strategy === undefined) {
143
143
  strategy = resolveCacheStrategy(model, cacheEnabled);
144
- // Reported per distinct model: a workflow mixing ids can have one model
145
- // with no mechanism and another with one.
146
- if (strategy === "unsupported")
147
- warn(unsupportedCacheMessage(model));
144
+ // `unsupported` is not warned about: the providers behind such a model cache
145
+ // a stable prefix automatically, and the `prompt-shaping` event names it.
148
146
  strategies.set(model, strategy);
149
147
  }
150
148
  return strategy;
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js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AO,CAAC,SAAS,CAAC,CAAC;YACnC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAC/B,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAChC,CAAC;QACD,SAAS,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,yBAAyB,CAAC;QAC5E,6EAA6E;QAC7E,+CAA+C;QAC/C,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC7D,MAAM,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,CAC9B,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,oBAAoB,EAAE,MAAe,CAAC,CAAC;SAClF;KACF,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,OAAwB,EAAE,MAAc;IAC/D,OAAO;QACL,GAAG,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QACvF,GAAG,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,IAAI,EAAE,EAAE,MAAM,CAAC;QAC/E,GAAG,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,IAAI,EAAE,EAAE,MAAM,CAAC;KAChF,CAAC;AACJ,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,GAAoB,EAAE,IAAqB;IAC1E,OAAO,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;AACjD,CAAC"}
@@ -103,10 +103,12 @@ export function createDelegationRegistry(ctx, root) {
103
103
  async signature(target) {
104
104
  const { machine } = await load(target);
105
105
  const title = machine.spec.title?.trim();
106
+ const signature = machine.signatureForTrigger(MANUAL_TRIGGER);
106
107
  return {
107
- requires: machine.requiresForTrigger(MANUAL_TRIGGER),
108
- returns: machine.returnsForTrigger(MANUAL_TRIGGER),
108
+ ...(signature?.requires.length ? { requires: signature.requires } : {}),
109
+ ...(signature?.returns.length ? { returns: signature.returns } : {}),
109
110
  ...(title ? { title } : {}),
111
+ ...(signature?.description ? { description: signature.description } : {}),
110
112
  // Reported, not enforced here: a disabled target still binds a tool so
111
113
  // disabling a leaf does not fail every caller; the dispatcher refuses.
112
114
  ...(machine.disabled ? { disabled: true } : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"delegation-registry.js","sourceRoot":"","sources":["../../src/assembly/delegation-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,gBAAgB,GAIjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAwB,MAAM,cAAc,CAAC;AAO3G,gFAAgF;AAChF,MAAM,UAAU,wBAAwB,CAAC,GAAoB,EAAE,IAAqB;IAClF,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuC,CAAC;IAChE;;;;OAIG;IACH,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsC,CAAC;IAE5D,SAAS,IAAI,CAAC,MAAc;QAC1B,IAAI,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,yEAAyE;YACzE,sDAA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AQ,CAAC;AAClB,CAAC"}
@@ -12,29 +12,37 @@ Cursor, Codex, …) how to **build with** the
12
12
 
13
13
  ## Install
14
14
 
15
- **From the installed `@archmax-ai/harness` package (primary for runtime consumers)** —
16
- the skill ships inside the npm package, so it always matches the installed SDK
17
- version instead of a synced copy:
15
+ **Via the skills CLI (primary)** — from the public GitHub repository:
18
16
 
19
- ```ts
20
- import { BUNDLED_AUTHORING_SKILL_DIR } from "@archmax-ai/harness";
21
- // <BUNDLED_AUTHORING_SKILL_DIR>/archmax-harness/SKILL.md (+ references/) — the constant
22
- // is the dist/authoring-skill directory holding archmax-harness/. Point an install CLI at
23
- // the skill itself:
24
- // npx skills add ./node_modules/@archmax-ai/harness/dist/authoring-skill/archmax-harness
17
+ ```bash
18
+ npx skills add archmax-ai/harness
25
19
  ```
26
20
 
27
- **Via the skills CLI from a checkout (coding-agent / development use)**:
21
+ Add `-g` to install globally, or `-a <agent>` to target a specific coding agent.
22
+
23
+ **From the installed `@archmax-ai/harness` package** — the skill ships inside the
24
+ npm package, so this copy always matches the installed SDK version. After
25
+ `npm install`:
28
26
 
29
27
  ```bash
30
- npx skills add <owner>/<repo> # once this repo is public, from its root
31
- # or point at the subfolder directly:
32
- npx skills add ./skills/archmax-harness
28
+ npx skills add ./node_modules/@archmax-ai/harness
29
+ ```
30
+
31
+ `npx skills experimental_sync` picks it up too, along with any other skill in
32
+ `node_modules`. The package ships this directory as `skills/archmax-harness/`
33
+ (for installers) and as `dist/authoring-skill/archmax-harness/` (for
34
+ `BUNDLED_AUTHORING_SKILL_DIR`).
35
+
36
+ ```ts
37
+ import { BUNDLED_AUTHORING_SKILL_DIR } from "@archmax-ai/harness";
38
+ // <BUNDLED_AUTHORING_SKILL_DIR>/archmax-harness/SKILL.md (+ references/) — the
39
+ // constant is the dist/authoring-skill directory, for skills middleware.
33
40
  ```
34
41
 
35
- Replace `<owner>/<repo>` with this repository's GitHub slug. Skills appear on
36
- skills.sh automatically via install telemetry — there is no separate submission
37
- step.
42
+ **From a checkout of this repository**: `npx skills add ./skills/archmax-harness`.
43
+
44
+ Skills appear on skills.sh automatically via install telemetry — there is no
45
+ separate submission step.
38
46
 
39
47
  ## What's inside
40
48
 
@@ -56,7 +56,13 @@ then verify. Do not write a file, validate, and discover the next file.
56
56
  terminal states (no `transitions`), the edges between them — and for each
57
57
  edge, the *condition* under which it is taken. That condition is the edge's
58
58
  required `description`, and it is the only thing the agent will know about
59
- where the edge leads.
59
+ where the edge leads. If something outside the session calls the workflow
60
+ (another workflow, a host's MCP tool or form), give its trigger a
61
+ `description` for the caller and a `requires`/`returns` signature, typing an
62
+ entry (`{ name, type, description }`; `string` `integer` `number` `boolean`
63
+ `date` `date-time` `object` `array`) where the caller must build or read the
64
+ value. The runtime holds typed entries at start, at `archmax_set_variables`
65
+ and at completion ([`references/workflow-schema.md`](references/workflow-schema.md)).
60
66
  2. **Decide the file set** from the sketch: `workflow.yaml` always; one
61
67
  `hooks/<check>.js` per *deterministic* gate; one inline `rubric:` per
62
68
  *judgment* gate (tone, completeness); cases — one happy path per branch,
@@ -13,6 +13,7 @@ package's `dist/index.d.ts`.
13
13
  - [Agent](#workflowruntime)
14
14
  - [Running a workflow](#running-a-workflow)
15
15
  - [Human-in-the-loop](#human-in-the-loop)
16
+ - [Exposing a workflow to outside callers (MCP, forms, APIs)](#exposing-a-workflow-to-outside-callers)
16
17
  - [Lifecycle events (live visualization)](#lifecycle-events)
17
18
  - [Session artifacts (historical visualization)](#run-artifacts)
18
19
  - [Model configuration](#model-configuration)
@@ -79,6 +80,7 @@ From `@archmax-ai/harness` (`src/index.ts`):
79
80
  | `SessionStoreRequiredError`, `SessionStoreCapabilityError` | class | Assembly / capability errors for run storage |
80
81
  | `workflowStateSchema`, `workflowPaths`, `sessionPaths`, `runArtifactPaths` | schema/fn | State schema + path helpers |
81
82
  | `runTests`, `RunTestsOptions`, `CaseResult` | fn/type | Run a workflow's cases — [against your own agent](#cases-against-your-agent) |
83
+ | `SIGNATURE_TYPES`, `normalizeSignature`, `signatureForTrigger`, `signatureJsonSchema`, `signatureValueIssues` | const/fn | A trigger's typed signature as JSON Schema and its conformance rule — [exposing a workflow](#exposing-a-workflow-to-outside-callers); also on `@archmax-ai/harness/spec` |
82
84
 
83
85
  ## createAgent options
84
86
 
@@ -246,7 +248,8 @@ if (result.status === WORKFLOW_STATUSES.awaitingDecision && result.pendingDecisi
246
248
  // host-side assembly, and no need to re-read the spec.
247
249
  // When they pick:
248
250
  const outcome = await agent.workflow.decide(sessionId, { target: chosenTo, comment });
249
- // DecideOutcome: { status?, workflowState?, reparked, state?, messages }
251
+ // DecideOutcome: { status?, workflowState?, reparked, state?, reply, rejected?, messages }
252
+ // `rejected` says why when status is "rejected"; Outcome from send() carries it too.
250
253
  if (outcome.reparked) { /* parked again at another human state */ }
251
254
  }
252
255
  ```
@@ -328,6 +331,59 @@ in (available in every state). To continue *mid-state* instead — inside the st
328
331
  that stopped, with the arrival in its transcript — the turn must park rather than
329
332
  finish.
330
333
 
334
+ ## Exposing a workflow to outside callers
335
+
336
+ A workflow's trigger signature (`requires`/`returns`, optionally typed) is the
337
+ contract the runtime already enforces at the session boundary. A host that
338
+ exposes a workflow as an MCP tool, an OpenAPI operation or a typed start form
339
+ builds its schema **from that signature**, with the helpers on the browser-safe
340
+ `@archmax-ai/harness/spec` subpath (also on the root, as the same bindings), so
341
+ the published contract and the enforced one cannot drift:
342
+
343
+ ```ts
344
+ import {
345
+ parseMachineSpec,
346
+ signatureForTrigger,
347
+ signatureJsonSchema,
348
+ signatureValueIssues,
349
+ } from "@archmax-ai/harness/spec";
350
+
351
+ const parsed = parseMachineSpec(yaml.parse(workflowYaml));
352
+ if (!parsed.ok) throw new Error(parsed.issues.map((i) => `${i.path}: ${i.message}`).join("\n"));
353
+ const signature = signatureForTrigger(parsed.spec, "manual"); // { description?, requires, returns }
354
+
355
+ // MCP tool (or an OpenAPI request/response body): the same mapping the delegation tool uses.
356
+ const mcpTool = {
357
+ name: "refund-order",
358
+ description: signature?.description, // caller-facing; never shown to the session's agent
359
+ inputSchema: signatureJsonSchema(signature?.requires ?? []),
360
+ outputSchema: signatureJsonSchema(signature?.returns ?? []),
361
+ };
362
+
363
+ // On a request, before any session opens: the rule the turn boundary applies.
364
+ const issues = signatureValueIssues(signature?.requires ?? [], body);
365
+ if (issues.length) return reply(400, issues.map((i) => i.message)); // { kind, name, type?, found?, message }
366
+
367
+ // A turn needs a message; an MCP call has none of its own, so say what was asked.
368
+ const outcome = await agent.workflow!.send(sessionId, { message: "Refund the order.", variables: body });
369
+ ```
370
+
371
+ - `signatureJsonSchema(entries)` → `{ type: "object", properties, required }`:
372
+ one property per entry in declaration order, every name required,
373
+ `date`/`date-time` as `{ type: "string", format }`, an untyped entry as `{}`,
374
+ an entry's `description` carried over. It adds no `additionalProperties`; set
375
+ it for your own ingress.
376
+ - `signatureValueIssues(entries, values)` → one issue per missing name and per
377
+ non-conforming value; `[]` means the turn boundary will not refuse the map for
378
+ its signature. It **never coerces**: a form that collects text converts
379
+ `"4"` to `4` before it validates or seeds.
380
+ - A trigger's `description` is written for the caller. Use it as the MCP tool
381
+ or operation description. The session's own model never sees it.
382
+ - A host that reads specs itself must read `requires`/`returns` through
383
+ `normalizeSignature` (both spellings → `{ name, type?, description? }[]`),
384
+ never as `string[]`: an entry may be an object. Hosts must be on the release
385
+ that introduced typed entries before any workspace they read uses them.
386
+
331
387
  ## Lifecycle events
332
388
 
333
389
  Pass `onEvent`; every `WorkflowLifecycleEvent` carries a `level`
@@ -342,7 +398,7 @@ Pass `onEvent`; every `WorkflowLifecycleEvent` carries a `level`
342
398
  | `parked` (`awaiting: "input"`) / `delivered` | the agent parked the run (`{ state, sessionId, reason, resumeAt?, callId }` — the `archmax_wait` call) / an event resumed it (`{ state, trigger, to }`, where `to` is the same state) |
343
399
  | `agent-text` | complete assistant message in a state (`{ state, text, messageId }` — always the id the message is stored under; absent only on a `partial: true` event from a failed turn) |
344
400
  | `agent-text-delta` | streaming text chunk (`{ state, text, messageId? }`) — flows for every run, even when the graph is driven with `invoke` |
345
- | `tool-called` / `tool-result` / `tool-blocked` | tool passed governance (`callId`, `args`) / settled (`callId`, `status`, `durationMs`, `output` preview) / denied. **Every** governed call, `archmax_advance` included — so a UI drawing a row per call draws one per transition; filter it if you already draw transitions from `advance`/`state-leave` |
401
+ | `tool-called` / `tool-result` / `tool-blocked` | tool passed governance (`callId`, `args`) / settled (`callId`, `status`, `durationMs`, `output` preview) / denied. **Every** governed call, `archmax_advance` included — so a UI drawing a row per call draws one per transition; filter it if you already draw transitions from `advance`/`state-leave`. A tool that **throws** settles `status: "error"` with the error's message as `output` while the turn **continues**: the model reads the same message as the call's answer, and nothing is thrown out of `send` — read tool failures here |
346
402
  | `rubric-start` / `rubric-result` | grading-rubric dispatch bracketed by `dispatchId`, with the rubric's `name` |
347
403
  | `model-usage` | per model call provider token usage: `inputTokens` (the total, of which the cache counts are a breakdown), `outputTokens`, `cacheReadTokens`, `cacheCreationTokens`, `model?` (the id the call was priced against), `costUsd?` |
348
404
  | `prompt-shaping` | assembly-time payload summary: resolved `profile`, prompt-cache mechanism, `withheld` built-ins |
@@ -280,7 +280,8 @@ states:
280
280
  # id, in declaration order (one state, one
281
281
  # behavior, several ways in).
282
282
  # The value is the declaration (see below):
283
- # session/message/connection/requires/returns
283
+ # session/message/connection/description/
284
+ # requires/returns
284
285
  # plus any key the HOST adds — preserved,
285
286
  # lint-warned, never interpreted.
286
287
  # NO `entry:` and NO `name:` inside a declaration:
@@ -517,8 +518,13 @@ states:
517
518
  enrich:
518
519
  triggers:
519
520
  manual: # the one entry: CLI, host firing, or a caller
520
- requires: [order_id] # a firing must supply these to start
521
- returns: [enrichment_file, delayed] # the run guarantees these when it completes
521
+ description: Enrich one order and say whether it is late. # for callers only
522
+ requires: # a firing must supply these to start
523
+ - order_id # bare name = untyped
524
+ - { name: due, type: date, description: The day the order is due. }
525
+ returns: # the run guarantees these when it completes
526
+ - enrichment_file
527
+ - { name: delayed, type: boolean }
522
528
  ```
523
529
 
524
530
  - There is no `entry:` key and no root block: the state a declaration sits on is
@@ -529,14 +535,37 @@ states:
529
535
  - `requires:` / `returns:` are the run's **signature**, and both are enforced. A
530
536
  firing that does not supply every `requires` name does not start; a run that
531
537
  reaches a terminal state without every `returns` name set is rejected (a run
532
- that *parks* is not checked — it has not finished). Both take the same grammar
533
- as a state's `requires:`: a list of run-variable names, nothing more — what a
534
- variable holds belongs in the `instructions` that set it. The names are
538
+ that *parks* is not checked — it has not finished). Each entry is a bare
539
+ run-variable name (**untyped**: any value, `null` included) or a strict object
540
+ `{ name, type?, description? }` naming one; the spellings mix in one list and
541
+ names are distinct across both. What the agent must *do* to produce a
542
+ variable still belongs in the `instructions` that set it. The names — with
543
+ type and description when declared, as `name (type) — description` — are
535
544
  rendered into the prompt under the trigger's entry state, so the agent is told
536
545
  what to produce before it can be failed for omitting it. A trigger's
537
546
  `requires:` also **guarantees** the variable for `${{…}}` guards, so `validate`
538
547
  stops warning about a guard bound to it. This is what makes delegation
539
548
  checkable — see [Sub-workflows are tools](#sub-workflows-are-tools).
549
+ - **`type`** is one of `string`, `integer` (no fractional part), `number`
550
+ (finite), `boolean`, `date` (RFC 3339 `YYYY-MM-DD`, a real calendar day),
551
+ `date-time` (RFC 3339 with a mandatory `Z`/`±hh:mm` offset), `object` (not an
552
+ array) or `array`. Nothing is coerced (`"4"` is not an `integer`) and a typed
553
+ entry never takes `null`. It is held **at the start** (a mistyped seed is
554
+ refused before any model call), **at the write** (`archmax_set_variables` of a
555
+ mistyped typed return of the current trigger is a correctable refusal,
556
+ nothing written) and **at completion** (a mistyped typed return rejects the
557
+ run — in practice a script or hook write). There are no enums, item or
558
+ property schemas, ranges or optional inputs. An unknown `type`, an unknown
559
+ entry key (`default:`) or an empty `description` fails load.
560
+ - **When to type.** Type an entry when something outside the session reads the
561
+ contract: a delegating model that must build the argument, a host publishing an
562
+ MCP tool or a start form. Leave it bare when any value will do. Typing a
563
+ `returns` entry also tells the agent the shape to write.
564
+ - **`description` on the declaration** says, for a **caller**, what calling this
565
+ entry does. It leads the delegation tool's description and a host's MCP tool
566
+ description; it never reaches the model of the session it starts (that
567
+ session's brief is its `instructions`). An entry's own `description` is
568
+ different: it *is* shown to the agent, beside the name.
540
569
  - `session:` is a **dotted path over the run's variables** — the same syntax
541
570
  `${{…}}` guards use, including array indices and negative indices
542
571
  (`-1` = last). No script, no callback: name where the host already puts the
@@ -1123,7 +1152,9 @@ Two failure classes, routed differently:
1123
1152
 
1124
1153
  - **Recoverable rejections keep the agent in place**: an invalid edge in
1125
1154
  `archmax_advance`, a deliberate hook `veto`, or an in-budget `correct` — the
1126
- agent sees the reason and retries within the same state.
1155
+ agent sees the reason and retries within the same state. A **tool that
1156
+ throws** is answered the same way: its error message is the call's
1157
+ error-status answer, and it never routes to `on_error`.
1127
1158
  - **Terminal failures route to `on_error`**: a hook *execution error*, an
1128
1159
  exhausted iteration budget (`max_iterations` used up), or an exhausted
1129
1160
  `budget` (`maxTurns`/`timeoutMs`). With `on_error: <state>` declared, the run
@@ -1186,8 +1217,10 @@ enrich:
1186
1217
  ```
1187
1218
 
1188
1219
  - **The target's signature is the call signature.** Its `manual` trigger's
1189
- `requires:` are the tool's required parameters; its `returns:` are what the
1190
- result carries:
1220
+ `requires:` are the tool's required parameters (typed in the tool schema
1221
+ where the entries are typed, by the same mapping `signatureJsonSchema`
1222
+ publishes); its `returns:` are what the result carries; its `description`
1223
+ leads the tool description, and its `instructions` never reach the caller:
1191
1224
 
1192
1225
  ```
1193
1226
  archmax_workflow_enrich-account({ account_id: "acct-42" })
@@ -1221,9 +1254,14 @@ enrich:
1221
1254
  no target may call none; `tools.forbid_always` blocks a delegation tool like any
1222
1255
  other.
1223
1256
  - **A failure is a tool error** the calling agent can handle; the state's
1224
- `on_error` catches the turn if it cannot. Depth, cycle, missing-input and
1225
- **disabled-target** refusals are blocked calls — nothing ran, so correct the call
1226
- and retry.
1257
+ `on_error` catches the turn if it cannot. Depth, cycle, missing-input
1258
+ (`missing-param`), mistyped-input (`invalid-param`), unresolvable-reference
1259
+ (`unresolved-param`) and **disabled-target** refusals are blocked calls —
1260
+ nothing ran, so correct the call and retry. A child whose returns are unset
1261
+ (`missing-return`) or mistyped (`invalid-return`) is a failure: it ran.
1262
+ - **A whole-argument reference keeps its type.** `{ quantity: "${{count}}" }`
1263
+ seeds the child with the number `count` holds, so it satisfies an `integer`
1264
+ parameter; `{ note: "order ${{order_id}}" }` is substituted as text.
1227
1265
  - **A `disabled: true` target is refused at dispatch, not at assembly.** The tool is
1228
1266
  still bound and the caller still assembles (disabling one leaf must not take every
1229
1267
  caller — or its parked sessions — offline); the call is a blocked call of kind
@@ -1244,8 +1282,12 @@ enrich:
1244
1282
  enrich:
1245
1283
  triggers:
1246
1284
  manual:
1247
- requires: [order_id] # a caller must supply these
1248
- returns: [enrichment_file, delayed] # the child guarantees it sets these
1285
+ description: Enrich one order. # leads the caller's tool description
1286
+ requires: # a caller must supply these
1287
+ - { name: order_id, type: string, description: The order to enrich. }
1288
+ returns: # the child guarantees it sets these
1289
+ - enrichment_file
1290
+ - { name: delayed, type: boolean }
1249
1291
  ```
1250
1292
 
1251
1293
  Develop it standalone on the same contract:
@@ -1255,10 +1297,13 @@ enrich:
1255
1297
  A dispatch missing a `requires` name is **refused before the child is
1256
1298
  composed**; a child that completes without every `returns` name set is
1257
1299
  **rejected** rather than handing back half a contract (a child that *parks* is
1258
- not checked — it has not finished). Both are lists of names only: what a
1259
- variable holds belongs in the state `instructions` that set it. The names are
1260
- rendered into the child's prompt under its entry state, so it is told what to
1261
- produce before it can be failed for omitting it.
1300
+ not checked — it has not finished). A typed entry is held to its type at both
1301
+ ends: a mistyped argument is refused `invalid-param` before the child runs, and
1302
+ a mistyped return fails the call `invalid-return`. What the child must *do* to
1303
+ produce a variable belongs in the state `instructions` that set it. The names,
1304
+ with type and description where declared, are rendered into the child's prompt
1305
+ under its entry state, so it is told what to produce before it can be failed
1306
+ for omitting it.
1262
1307
  - **The call answers with the returns, by name.** A signed target answers
1263
1308
  `{ message, returns: { enrichment_file, delayed } }`; one declaring no
1264
1309
  `returns:` answers with the closing message alone. The message keeps its own
@@ -1267,8 +1312,9 @@ enrich:
1267
1312
  agent records what it needs with `archmax_set_variables`, or a script writes it,
1268
1313
  and the calling state's `requires:` is what makes that mandatory.
1269
1314
  - **Mocks are held to the same contract.** An `archmax_workflow_<slug>` mock for a
1270
- signed target supplies `returns:`, and one that omits a declared name fails the
1271
- mocked dispatch — a mock stands in for the sub-run, never for its agreement.
1315
+ signed target supplies `returns:`, and one that omits a declared name
1316
+ (`missing-return`) or supplies a mistyped typed one (`invalid-return`) fails
1317
+ the mocked dispatch — a mock stands in for the sub-run, never for its agreement.
1272
1318
  - **No prose crosses the boundary.** A sub-run gets no instruction from its
1273
1319
  caller — it works from its own state `instructions` plus the arguments it was
1274
1320
  seeded with as locked variables, both of which reach the model through the
@@ -44,8 +44,12 @@ states:
44
44
  session: conversation_id # dotted path over variables: which conversation a firing joins
45
45
  message: false # or a dotted path to the message text; false = firings carry none
46
46
  connection: mail # host access connection; other keys preserved with a warning
47
- requires: [order_id] # variables a firing must supply (a caller's required params)
47
+ description: Record one refund decision. # for CALLERS (delegating model, MCP client); never the agent
48
+ requires: # variables a firing must supply (a caller's required params):
49
+ - order_id # a bare name is untyped (any value, null included)
50
+ - { name: due, type: date, description: The day it is due. } # typed: held at the boundary
48
51
  returns: [result_file] # variables the run guarantees on completion (a caller's result)
52
+ # entry types: string integer number boolean date date-time object array
49
53
  instructions: >-
50
54
  Record the decision in scratchpad/refund.json, then archmax_advance to
51
55
  review; never close the case yourself.
@@ -163,11 +167,17 @@ states:
163
167
  corrections, exhausted budget, exhausted parks) routes to `on_error`
164
168
  instead of failing the run; recoverable rejections (invalid edge, veto,
165
169
  in-budget correct) keep the agent in place. Declare `on_error` on states
166
- with strict `after` hooks or bounded loops.
170
+ with strict `after` hooks or bounded loops. A **tool that throws** is
171
+ neither: the call is answered with an error-status tool message carrying
172
+ the error, the agent stays in the state and can retry or switch tools, and
173
+ `on_error` never sees it (a park or a cancelled run still propagates).
167
174
  - **Sub-workflows are tools.** Allow `archmax_workflow_<slug>` (slug verbatim)
168
175
  and the sibling `workflows/<slug>/` is callable: its `manual` trigger's
169
- `requires` are the parameters, its `returns` the result
170
- (`{ message, returns }`). Nothing captures the result — the caller records
176
+ `requires` are the parameters (typed where the entries are typed; a
177
+ mistyped argument is refused `invalid-param`, and `"${{count}}"` alone
178
+ passes the value with its own type), its `returns` the result
179
+ (`{ message, returns }`; a mistyped typed return fails `invalid-return`).
180
+ The trigger's `description` leads the tool description. Nothing captures the result — the caller records
171
181
  what it needs with `archmax_set_variables`, made mandatory by `requires`.
172
182
  The child is a separate session with a fresh transcript, sees only its
173
183
  arguments (as locked variables), and shares no prose. One call = one
@@ -19,7 +19,8 @@ type Transition = {
19
19
  };
20
20
  /** The context a person needs to decide a parked human state, from the spec — nothing is rendered to a file. */
21
21
  export declare function printDecisionContext(machine: WorkflowMachine, state: string, transitions: Transition[], evidence?: string[], write?: (line: string) => void): void;
22
- export declare function printResumed(style: Style, sessionId: string, verb: string, outcome: DecideOutcome): void;
22
+ /** Report a resume's result. Returns the exit code: 1 when the session ended rejected. */
23
+ export declare function printResumed(style: Style, sessionId: string, verb: string, outcome: DecideOutcome): number;
23
24
  export declare function printReply(style: Style, sessionId: string, outcome: ReplyOutcome): void;
24
25
  export interface RunTurnInput {
25
26
  workflow: string;
@@ -29,13 +30,17 @@ export interface RunTurnInput {
29
30
  sessionId?: string;
30
31
  sessionPath?: string;
31
32
  }
32
- /** Report a turn's {@link Outcome}: an answer, a park (with what resumes it), or a resume's result. */
33
- export declare function printOutcome(style: Style, machine: WorkflowMachine, sessionId: string, outcome: Outcome): void;
33
+ /**
34
+ * Report a turn's {@link Outcome}: an answer, a park (with what resumes it), a
35
+ * rejection, or a resume's result. Returns the exit code: a park is a success,
36
+ * a rejection is not.
37
+ */
38
+ export declare function printOutcome(style: Style, machine: WorkflowMachine, sessionId: string, outcome: Outcome): number;
34
39
  /**
35
40
  * Drive one turn: name the session the firing belongs to, send the turn through
36
41
  * `workflow.send` — which delivers, replies or opens a turn as the session's
37
42
  * state dictates — and report how it ended. Returns the exit code; a park is a
38
- * successful outcome.
43
+ * successful outcome, a rejected session a failed one.
39
44
  */
40
45
  export declare function driveTurn(agent: Agent, style: Style, usage: UsageTracker, input: RunTurnInput): Promise<number>;
41
46
  export {};