@archmax-ai/harness 0.7.1 → 0.8.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 (47) hide show
  1. package/README.md +11 -4
  2. package/dist/assembly/compose.d.ts +5 -3
  3. package/dist/assembly/compose.js +8 -5
  4. package/dist/assembly/compose.js.map +1 -1
  5. package/dist/assembly/index.d.ts +3 -2
  6. package/dist/assembly/index.js.map +1 -1
  7. package/dist/authoring-skill/archmax-harness/SKILL.md +9 -5
  8. package/dist/authoring-skill/archmax-harness/references/backend-integration.md +3 -2
  9. package/dist/authoring-skill/archmax-harness/references/diagnostics.md +5 -3
  10. package/dist/authoring-skill/archmax-harness/references/hook-and-test-scripts.md +5 -4
  11. package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +78 -46
  12. package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +30 -14
  13. package/dist/core/platform-prompt.generated.js +1 -1
  14. package/dist/core/platform-prompt.generated.js.map +1 -1
  15. package/dist/core/workspace-prompt.js +2 -1
  16. package/dist/core/workspace-prompt.js.map +1 -1
  17. package/dist/kernel/kernel.js +12 -8
  18. package/dist/kernel/kernel.js.map +1 -1
  19. package/dist/machine/lint-spec.js +62 -29
  20. package/dist/machine/lint-spec.js.map +1 -1
  21. package/dist/machine/machine.d.ts +33 -17
  22. package/dist/machine/machine.js +48 -28
  23. package/dist/machine/machine.js.map +1 -1
  24. package/dist/machine/spec-schema.d.ts +15 -7
  25. package/dist/machine/spec-schema.js +43 -15
  26. package/dist/machine/spec-schema.js.map +1 -1
  27. package/dist/machine/tool-names.d.ts +10 -7
  28. package/dist/machine/tool-names.js +11 -8
  29. package/dist/machine/tool-names.js.map +1 -1
  30. package/dist/machine/tool-paths.d.ts +4 -3
  31. package/dist/machine/tool-paths.js +4 -3
  32. package/dist/machine/tool-paths.js.map +1 -1
  33. package/dist/machine/types.d.ts +14 -8
  34. package/dist/machine/types.js.map +1 -1
  35. package/dist/public/spec.d.ts +3 -3
  36. package/dist/public/spec.js +3 -3
  37. package/dist/public/spec.js.map +1 -1
  38. package/dist/workflow/render-prompt.d.ts +2 -1
  39. package/dist/workflow/render-prompt.js +24 -5
  40. package/dist/workflow/render-prompt.js.map +1 -1
  41. package/package.json +1 -1
  42. package/skills/archmax-harness/SKILL.md +9 -5
  43. package/skills/archmax-harness/references/backend-integration.md +3 -2
  44. package/skills/archmax-harness/references/diagnostics.md +5 -3
  45. package/skills/archmax-harness/references/hook-and-test-scripts.md +5 -4
  46. package/skills/archmax-harness/references/workflow-schema.md +78 -46
  47. package/skills/archmax-harness/references/workflow-yaml.md +30 -14
@@ -18,9 +18,10 @@ export const PATH_ACCESSES = ["read", "list", "search", "write", "remove", "exec
18
18
  /** The accesses that change what is stored: refused wherever a write is. */
19
19
  export const MUTATING_ACCESSES = new Set(["write", "remove"]);
20
20
  /**
21
- * The accesses the always-open `scratchpad/` permits an essential tool in every
22
- * state, whatever the state's `allow` list says. Searching and executing are not
23
- * among them, and a tool a state must grant gets nothing from it.
21
+ * The accesses the always-open `scratchpad/` permits a default file tool the
22
+ * state is granted (or a host `essentialTools` tool), whatever the granting
23
+ * entry narrows. Searching and executing are not among them, and a tool the
24
+ * state is not granted gets nothing from it.
24
25
  */
25
26
  export const SCRATCHPAD_ACCESSES = new Set(["read", "list", "write", "remove"]);
26
27
  /** The accesses the context-offload areas permit: readable, never writable. */
@@ -1 +1 @@
1
- {"version":3,"file":"tool-paths.js","sourceRoot":"","sources":["../../src/machine/tool-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAQ7F,2CAA2C;AAC3C,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EA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AAO,KAAK,CAAC;QAC7D,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,UAAU,CAAC,KAA4B;IACrD,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC1C,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,KAA4B,EAAE,IAA6B;IACpG,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -15,11 +15,13 @@ import type { allowEntrySchema, hookSchema, forbidEntrySchema, hookSpecSchema, m
15
15
  */
16
16
  export type TransitionType = z.infer<typeof transitionTypeSchema>;
17
17
  /**
18
- * One outgoing edge of a state. `description` is **required and non-empty**: the
19
- * agent is disclosed the active state's edges and nothing else of the graph, so
20
- * this is the whole of what it routes on — write it for a reader standing in the
21
- * source state, which knows nothing of the target ("Refunds over $50", never "go
22
- * to refund-review"). At a human state it is also the decision's button label.
18
+ * One outgoing edge of a state. The agent is disclosed the active state's edges
19
+ * and nothing else of the graph, so `description` is what it routes on — write it
20
+ * for a reader standing in the source state, which knows nothing of the target
21
+ * ("Refunds over $50", never "go to refund-review"). An **undescribed** edge
22
+ * (absent, empty or blank) routes on the target state's `instructions` instead,
23
+ * which the edge then discloses; it loads only when the target has some. At a
24
+ * human state the description is also the decision's button label, and required.
23
25
  */
24
26
  export type MachineTransition = z.infer<typeof machineTransitionSchema>;
25
27
  /**
@@ -44,8 +46,9 @@ export type StateBudget = z.infer<typeof stateBudgetSchema>;
44
46
  export type AllowEntry = z.infer<typeof allowEntrySchema>;
45
47
  /**
46
48
  * Per-state tool governance. Allow-only: a state with `allow` permits exactly the
47
- * listed tools/arg-shapes (plus workflow-level `allow_always` grants and the
48
- * essential surface); a state without one gets the essential surface only.
49
+ * listed tools/arg-shapes plus the workflow-wide grant (the declared
50
+ * `allow_always`, else the default tools) and the host's `essentialTools`; a
51
+ * state without one gets those two only.
49
52
  */
50
53
  export type ToolsBlock = z.infer<typeof toolsBlockSchema>;
51
54
  /**
@@ -100,7 +103,10 @@ export type StateType = z.infer<typeof stateTypeSchema>;
100
103
  * `model` → the assembly's default, read once through `WorkflowMachine.modelFor`.
101
104
  */
102
105
  export type MachineState = z.infer<typeof machineStateSchema>;
103
- /** Workflow-level tool grants. */
106
+ /**
107
+ * Workflow-level tool governance. A declared `allow_always` is the whole
108
+ * workflow-wide grant; an absent one grants the default tools.
109
+ */
104
110
  export type WorkflowToolsConfig = z.infer<typeof workflowToolsConfigSchema>;
105
111
  /**
106
112
  * Workflow-level skill governance: `allow_always` is enabled in every state and
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/machine/types.ts"],"names":[],"mappings":"AA+OA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,IAAoC;IAC/D,MAAM,QAAQ,GAAI,IAAkD,EAAE,QAAQ,CAAC;IAC/E,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,KAAK,CAAC;AAC3E,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/machine/types.ts"],"names":[],"mappings":"AAqPA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,IAAoC;IAC/D,MAAM,QAAQ,GAAI,IAAkD,EAAE,QAAQ,CAAC;IAC/E,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,KAAK,CAAC;AAC3E,CAAC"}
@@ -122,11 +122,11 @@ isReservedToolName,
122
122
  HARNESS_CONTROL_TOOLS,
123
123
  /** Tools permitted in every state regardless of `allow`. */
124
124
  ALWAYS_ALLOWED_TOOLS,
125
- /** The always-on built-ins a state's own entry may narrow but `allow_always` cannot add to. */
126
- ESSENTIAL_TOOLS,
125
+ /** The workflow-wide grant when `tools.allow_always` is absent; a declared list replaces it. */
126
+ DEFAULT_TOOLS,
127
127
  /** Tools no list may grant (`task`). */
128
128
  UNGRANTABLE_TOOLS, ReservedToolNameError,
129
- /** The runtime's file operations, always on in every agent. */
129
+ /** The runtime's file operations, registered in every agent and among the default tools. */
130
130
  COPY_FILE_TOOL, MOVE_FILE_TOOL, REMOVE_FILE_TOOL, RUNTIME_FILE_TOOLS, } from "../machine/tool-names.js";
131
131
  /** Each built-in tool's path arguments and how a call uses each. */
132
132
  export { BUILT_IN_TOOL_PATHS, PATH_ACCESSES } from "../machine/tool-paths.js";
@@ -120,11 +120,11 @@ isReservedToolName,
120
120
  HARNESS_CONTROL_TOOLS,
121
121
  /** Tools permitted in every state regardless of `allow`. */
122
122
  ALWAYS_ALLOWED_TOOLS,
123
- /** The always-on built-ins a state's own entry may narrow but `allow_always` cannot add to. */
124
- ESSENTIAL_TOOLS,
123
+ /** The workflow-wide grant when `tools.allow_always` is absent; a declared list replaces it. */
124
+ DEFAULT_TOOLS,
125
125
  /** Tools no list may grant (`task`). */
126
126
  UNGRANTABLE_TOOLS, ReservedToolNameError,
127
- /** The runtime's file operations, always on in every agent. */
127
+ /** The runtime's file operations, registered in every agent and among the default tools. */
128
128
  COPY_FILE_TOOL, MOVE_FILE_TOOL, REMOVE_FILE_TOOL, RUNTIME_FILE_TOOLS, } from "../machine/tool-names.js";
129
129
  /** Each built-in tool's path arguments and how a call uses each. */
130
130
  export { BUILT_IN_TOOL_PATHS, PATH_ACCESSES } from "../machine/tool-paths.js";
@@ -1 +1 @@
1
- {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/public/spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,gFAAgF;AAEhF,OAAO;AACL,0HAA0H;AAC1H,iBAAiB;AACjB,iBAAiB;AACjB,kBAAkB;AAClB,0FAA0F;AAC1F,wBAAwB;AACxB,6EAA6E;AAC7E,mBAAmB;AACnB,sBAAsB;AACtB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB;AACjB,+DAA+D;AAC/D,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,UAAU,EACV,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,gCAAgC,EAChC,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB;AACpB,gFAAgF;AAChF,kBAAkB;AAClB,uFAAuF;AACvF,oBAAoB;AACpB,yEAAyE;AACzE,gBAAgB;AAChB,0EAA0E;AAC1E,UAAU,GACX,MAAM,2BAA2B,CAAC;AAgCnC,wEAAwE;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,mFAAmF;AAEnF,OAAO;AACL,+FAA+F;AAC/F,YAAY;AACZ,4DAA4D;AAC5D,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AAErC,iEAAiE;AACjE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L,gBAAgB;AAChB,qEAAqE;AACrE,SAAS;AACT,sGAAsG;AACtG,oBAAoB;AACpB,+FAA+F;AAC/F,aAAa;AACb,2DAA2D;AAC3D,YAAY;AACZ,oGAAoG;AACpG,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,8FAA8F;AAE9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/public/spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,gFAAgF;AAEhF,OAAO;AACL,0HAA0H;AAC1H,iBAAiB;AACjB,iBAAiB;AACjB,kBAAkB;AAClB,0FAA0F;AAC1F,wBAAwB;AACxB,6EAA6E;AAC7E,mBAAmB;AACnB,sBAAsB;AACtB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB;AACjB,+DAA+D;AAC/D,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,UAAU,EACV,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,gCAAgC,EAChC,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB;AACpB,gFAAgF;AAChF,kBAAkB;AAClB,uFAAuF;AACvF,oBAAoB;AACpB,yEAAyE;AACzE,gBAAgB;AAChB,0EAA0E;AAC1E,UAAU,GACX,MAAM,2BAA2B,CAAC;AAgCnC,wEAAwE;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,mFAAmF;AAEnF,OAAO;AACL,+FAA+F;AAC/F,YAAY;AACZ,4DAA4D;AAC5D,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AAErC,iEAAiE;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;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G;AACtG,oBAAoB;AACpB,+FAA+F;AAC/F,aAAa;AACb,2DAA2D;AAC3D,YAAY;AACZ,oGAAoG;AACpG,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,8FAA8F;AAE9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -17,7 +17,8 @@
17
17
  * No other state's slug, `title`, `summary`, hooks, budget or transitions is
18
18
  * rendered anywhere, and neither is a count of the states: a state the agent
19
19
  * cannot advance to is a state it cannot name. A state's `instructions` body is
20
- * surfaced only for the active state, by the caller.
20
+ * surfaced for the active state, by the caller, and — quoted, for choosing — for
21
+ * the target of an undescribed edge of the active state, by this renderer.
21
22
  */
22
23
  import type { WorkflowMachine } from "../machine/machine.js";
23
24
  /** What {@link renderStateGraph} needs about the run, beyond the state it is in. */
@@ -17,20 +17,27 @@
17
17
  * No other state's slug, `title`, `summary`, hooks, budget or transitions is
18
18
  * rendered anywhere, and neither is a count of the states: a state the agent
19
19
  * cannot advance to is a state it cannot name. A state's `instructions` body is
20
- * surfaced only for the active state, by the caller.
20
+ * surfaced for the active state, by the caller, and — quoted, for choosing — for
21
+ * the target of an undescribed edge of the active state, by this renderer.
21
22
  */
22
23
  import { afterHookLabel, hookKind, normalizeHooks } from "../lifecycle/hook-shape.js";
23
24
  import { ADVANCE_TOOL, SET_VARIABLES_TOOL } from "../machine/tool-names.js";
24
25
  /**
25
26
  * One outgoing edge: the target's slug (the exact token `archmax_advance` takes),
26
- * its declared `type`, and the required `description` the agent routes on.
27
+ * its declared `type`, and the `description` the agent routes on.
27
28
  *
28
29
  * The two markers a target may carry are disclosed because each changes what the
29
30
  * call must carry or what follows it — `evidence` is accepted only when the
30
31
  * target is a human state, and both markers mean *stop* rather than *continue*.
31
32
  * They disclose the **consequence of taking the edge**, not the state on the
32
- * other side of it: nothing of the target's own title, summary, instructions,
33
- * hooks or transitions is rendered.
33
+ * other side of it: nothing of the target's own title, summary, hooks or
34
+ * transitions is rendered.
35
+ *
36
+ * An **undescribed** edge (no description, or a blank one) is transparent: the
37
+ * target's `instructions` stand in for the description, quoted under the line
38
+ * and framed as what the agent will do once there — given for choosing the edge,
39
+ * not to be followed now. The author opts in per edge by leaving it undescribed;
40
+ * the schema refuses one whose target has no instructions to show.
34
41
  */
35
42
  function renderTransition(machine, edge) {
36
43
  const notes = [];
@@ -41,7 +48,19 @@ function renderTransition(machine, edge) {
41
48
  if (machine.isTerminal(edge.to))
42
49
  notes.push("terminal");
43
50
  const suffix = notes.length ? ` (${notes.join(", ")})` : "";
44
- return `- to \`${edge.to}\`${suffix} — ${edge.description.trim()}`;
51
+ const head = `- to \`${edge.to}\`${suffix}`;
52
+ const description = edge.description?.trim();
53
+ if (description)
54
+ return `${head} — ${description}`;
55
+ const instructions = machine.spec.states[edge.to]?.instructions?.trim() ?? "";
56
+ const quoted = instructions
57
+ .split("\n")
58
+ .map((line) => (line.trim() ? ` > ${line.trimEnd()}` : " >"));
59
+ return [
60
+ `${head} — no description; the instructions you will follow once in \`${edge.to}\`, ` +
61
+ `given only for choosing this edge:`,
62
+ ...(instructions ? quoted : []),
63
+ ].join("\n");
45
64
  }
46
65
  /**
47
66
  * The active state's hooks, by phase. A **rubric** hook renders as its bare kind
@@ -1 +1 @@
1
- {"version":3,"file":"render-prompt.js","sourceRoot":"","sources":["../../src/workflow/render-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGtF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG5E;;;;;;;;;;GAUG;AACH,SAAS,gBAAgB,CAAC,OAAwB,EAAE,IAAuB;IACzE,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,KAAK,CAAC,IAAI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,IAAI,CAAC,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,IAAI;SACR,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAC/B,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxB,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;SAC1B,IAAI,EAAE,CAAC;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archmax-ai/harness",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "Agents can't reliably follow a process. archmax harness makes them: a governed layer over LangChain Deep Agents that enforces a declarative workflow state machine on every step.",
6
6
  "keywords": [
@@ -55,8 +55,10 @@ then verify. Do not write a file, validate, and discover the next file.
55
55
  `triggers: { manual: }` (plus any host trigger ids that enter there),
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
- required `description`, and it is the only thing the agent will know about
59
- where the edge leads. If something outside the session calls the workflow
58
+ `description`, which is what the agent knows about where the edge leads. Leave
59
+ an edge undescribed only when the target's `instructions` already say when it
60
+ applies: the agent is then shown them instead (never on a human state's
61
+ transitions, whose description is the button label). If something outside the session calls the workflow
60
62
  (another workflow, a host's MCP tool or form), give its trigger a
61
63
  `description` for the caller and a `requires`/`returns` signature, typing an
62
64
  entry (`{ name, type, description }`; `string` `integer` `number` `boolean`
@@ -77,7 +79,9 @@ then verify. Do not write a file, validate, and discover the next file.
77
79
  `skills/<capability>/` bundle only for data, an `archmax_run` script, or
78
80
  guidance two or more states share identically; `AGENTS.md` only for a
79
81
  workspace-wide persona.
80
- 3. **Write `workflow.yaml`** from the skeleton in [`references/workflow-yaml.md`](references/workflow-yaml.md). Each state's behaviour
82
+ 3. **Write `workflow.yaml`** from the skeleton in [`references/workflow-yaml.md`](references/workflow-yaml.md),
83
+ keeping its `tools.allow_always` list of the twelve default tools: a declared
84
+ list replaces them, so drop only a tool this workflow must not have. Each state's behaviour
81
85
  goes inline in its `instructions`; run-wide rules once in the top-level
82
86
  `instructions`; nothing about the machine itself (the platform prompt and
83
87
  the disclosed edges already say it, and prose is billed on every call), and
@@ -212,8 +216,8 @@ Rules that follow:
212
216
  (`script.skill-only`): a script in `scratchpad/` or `hooks/` is unrunnable.
213
217
  - **Paths have no leading slash** (`skills/order-data/assets/orders.json`,
214
218
  `scratchpad/refund.json`); never author a `run/` prefix. `scratchpad/` is
215
- writable in every state regardless of `tools.allow`, so an allow entry
216
- inside it narrows nothing (warning); to govern *where* a result lands, name
219
+ writable in every state that is granted `write_file`, whatever its entry
220
+ narrows, so an allow entry inside it narrows nothing (warning); to govern *where* a result lands, name
217
221
  a non-reserved run path (`reports/*.json`) and allow it.
218
222
  - **Guidance has three homes, one per rule**: every workflow → `AGENTS.md`;
219
223
  the whole run → top-level `instructions` (`|-` literal block, since `>-`
@@ -100,7 +100,7 @@ All optional (`CreateAgentParams`, `src/assembly/index.ts`):
100
100
  | `sessionStore` | `SessionStore` | Physical storage for run state (checkpoints, artifacts, the per-session `scratchpad/`). Zero-config default: `createFilesystemSessionStore({ dir: "<rootDir>/sessions" })`. Required with a custom `backend` (else `SessionStoreRequiredError`). Build with `createBackendSessionStore({ backend, prefix? })` for S3-style storage or `createMemorySessionStore()` for ephemeral runs. |
101
101
  | `systemPrompt` | `string` | Appended after workspace `AGENTS.md`. |
102
102
  | `tools` | `StructuredTool[]` | Host tools, granted per state by `tools.allow`. Build them with `toolsFromMap` — see [host tools](#host-tools). A name starting `archmax_`, or naming a runtime file operation (`copy_file`, `move_file`, `remove_file`), throws `ReservedToolNameError`. |
103
- | `essentialTools` | `string[]` | Host tools treated as always on: disclosed and permitted in every state; a state's own entry still narrows one. |
103
+ | `essentialTools` | `string[]` | Host tools treated as always on: disclosed and permitted in every state, whatever the workflow's `tools.allow_always` declares; a state's own entry still narrows one. |
104
104
  | `images` | `boolean \| ImageReadOptions` | Show a model with vision the images it reads: the model's `read_file` of a PNG/JPEG/GIF/WebP answers with one line and the image is added to each later request as a `user` message after that batch of tool results, read per request — no bytes in history, checkpoints, events or scripts. `{ maxBytes?, keep? }` (default 10 MB, every image). Off by default; every other binary stays refused. |
105
105
  | `toolPaths` | `Record<string, ToolPaths>` | Each host tool's path arguments and how a call uses each (`read`, `list`, `search`, `write`, `remove`, `execute`): `{ get_markdown: { path: "read" } }`. Every path rule then governs them like the built-ins'. Wins over a descriptor's `paths`; declaring a built-in's paths throws `ToolPathsError`. |
106
106
  | `checkpointer` | `BaseCheckpointSaver` | Custom-adapter escape hatch; takes precedence over the session store for checkpoint persistence. Defaults to a durable `BackendCheckpointSaver` writing through the session store. Use `MemorySaver` for ephemeral runs. |
@@ -681,7 +681,8 @@ const agent = await createAgent({ tools, essentialTools: ["get_markdown"] });
681
681
  never runs the handler. No declaration, no path rules. An argument may hold a
682
682
  list of paths (`files: string[]`), each governed; any other shape is refused.
683
683
  Declaring paths only narrows: `scratchpad/` is open in every state to the
684
- always-on tools, so a tool a state must grant stays refused where it is not.
684
+ default file tools the state is granted and to `essentialTools`, so a tool a
685
+ state must grant stays refused where it is not.
685
686
  - `context.workspace` is the turn's workspace, bound to the session — the
686
687
  instance `read_file` uses — with `downloadFiles`, `uploadFiles` (when the
687
688
  session store has it) and `delete` besides the text methods. The plain agent
@@ -27,12 +27,14 @@ message alone. Migrations for removed keys in full:
27
27
  | not a skill slug (path/glob given) | Use the bundle directory name; narrow paths with a `tools.allow` entry |
28
28
  | `${{…}}` not a valid variable reference | `${{name}}` or `${{name.path}}`; snake_case names |
29
29
  | guards on `${{x}}` but no state requires it (warning) | Add `x` to an earlier state's `requires`, or seed it at assembly |
30
- | `allow` on a path in `scratchpad/` (warning) | Drop it, or govern a non-reserved run path instead |
31
- | `tools.allow_always` constrains essential tool (warning) | Narrow per state with `tools.allow` |
30
+ | `allow` or `allow_always` on a path in `scratchpad/` (warning) | Drop it, or govern a non-reserved run path instead |
31
+ | `tools.allow_always` is declared but grants none of the default tools (warning) | A declared list replaces the default tools: list the ones the workflow needs (`ls`, `read_file`, `write_file`, … as in the skeleton), or remove the key to grant them all |
32
32
  | state both allows and forbids / forbids what nothing enables / enables what allow_always already does / `skills: { allow: [] }` reads like a deny (warnings) | Drop the redundant entry; use `forbid` to subtract |
33
33
  | no top-level `instructions` (warning) | Add the standing block |
34
34
  | state has several transitions but no `instructions` (warning) | Add routing guidance so the agent classifies the request before it advances |
35
- | `transitions.<i>.description` must be a non-empty string (error) | Add the condition under which that edge is taken — it is the only thing the agent knows about it. Say *when*, not *where* |
35
+ | `transitions.<i>.description` must be a non-empty string here: '<target>' declares none (error) | The edge is undescribed and its target has no `instructions` to route on. Add the condition under which the edge is taken (say *when*, not *where*), or give the target instructions |
36
+ | `transitions.<i>.description` must be a non-empty string on a human state's transition (error) | It is the decision's button label: say what choosing it means |
37
+ | `transitions.<i>.description` must be a string (error) | Quote it, or omit it to route on the target's instructions |
36
38
  | trigger declares unknown key (warning) | Keys read: `session`, `message`, `connection`, `requires`, `returns`; others are preserved |
37
39
  | `maxConcurrency` above 1 | Set to 1 or remove |
38
40
  | `WORKFLOW.md` has frontmatter | Strip it; the machine is `workflow.yaml` |
@@ -275,8 +275,9 @@ resolves to an `Error: …` string instead.
275
275
  **Authoring rule for `archmax_run` scripts:** if sandboxed code calls `tools.X`,
276
276
  the state's `allow` list must cover `tool: X` (with any argument constraints the
277
277
  script's call satisfies), or the call is blocked. Grant it per state with
278
- `tools.allow`, or workflow-wide with `tools.allow_always`. Lifecycle hooks need
279
- no such grant.
278
+ `tools.allow`, or workflow-wide with `tools.allow_always`; a default tool such as
279
+ `read_file` is covered wherever the workflow-wide grant includes it. Lifecycle
280
+ hooks need no such grant.
280
281
 
281
282
  ### `archmax_run` scripts: the `args` contract
282
283
 
@@ -775,8 +776,8 @@ steps:
775
776
  Two operational notes:
776
777
 
777
778
  - Seeding writes the file; **reading it is still governed** — the triggered
778
- start state must allow the read tool the agent needs (`read_file` is an
779
- always-on tools unless a state narrows it).
779
+ start state must allow the read tool the agent needs (`read_file` is granted
780
+ wherever the workflow-wide grant includes it, unless a state narrows it).
780
781
  - Hosts that pin case sessions via `sessionIdForCase` reuse sessions across test
781
782
  runs: declared files are overwritten each run, but a file seeded by an
782
783
  _earlier_ run whose declaration was since removed can linger. The default
@@ -80,8 +80,8 @@ instructions?: string # the workflow's STANDING instructions — free-fo
80
80
  # simply ignored; use `instructions:`, rereading the
81
81
  # text as direction, not narration.
82
82
  # A test case's `description` is UNAFFECTED. A
83
- # TRANSITION's `description` is now REQUIRED and
84
- # non-empty (see `transitions` below).
83
+ # TRANSITION's `description` is what the agent routes
84
+ # on (see `transitions` below).
85
85
 
86
86
  disabled?: boolean # `true` = this machine STARTS NO NEW TURNS. Bounds
87
87
  # STARTING, not finishing.
@@ -146,7 +146,13 @@ tests?: # cases suite config (declarative data;
146
146
  # factory's `judge` role; other keys are errors
147
147
 
148
148
  tools?:
149
- allow_always?: AllowEntry[] # grants added to every state's allowlist
149
+ allow_always?: AllowEntry[] # the WORKFLOW-WIDE GRANT, in every state. ABSENT = the
150
+ # default tools (ls, read_file, write_file, edit_file,
151
+ # glob, grep, copy_file, move_file, remove_file,
152
+ # write_todos, archmax_eval, archmax_run). DECLARED
153
+ # ([] included) = exactly what it lists: it REPLACES
154
+ # the default tools, so list each one you want. A
155
+ # new workflow lists all twelve.
150
156
  forbid_always?: ForbidEntry[]
151
157
  # DENIED in EVERY state, and absolute: nothing reaches
152
158
  # past it — no state grant, allow_always entry,
@@ -312,8 +318,9 @@ states:
312
318
  # NO PART OF THE PROMPT — the model never reads it,
313
319
  # so it is free, and it can NOT carry routing logic.
314
320
  # The routing text the agent reads is the SOURCE
315
- # state's transition `description`s; nothing about a
316
- # target state is disclosed at all.
321
+ # state's transition `description`s, or a target's
322
+ # `instructions` where an edge is undescribed; a
323
+ # target's summary is never disclosed.
317
324
 
318
325
  instructions?: string # behavior guidance.
319
326
  # agent node: surfaced to the LLM while active.
@@ -328,13 +335,14 @@ states:
328
335
  # for a terminal state)
329
336
 
330
337
  tools?:
331
- allow?: AllowEntry[] # grants beyond the always-on tools (plus
332
- # allow_always grants and the always-allowed
333
- # archmax_advance); an entry naming
334
- # an always-on tool NARROWS it.
338
+ allow?: AllowEntry[] # grants beyond the workflow-wide grant (plus the
339
+ # always-allowed archmax_advance); an entry naming
340
+ # a tool that grant includes NARROWS it, and one
341
+ # naming a default tool a declared allow_always
342
+ # leaves out GRANTS it here.
335
343
  forbid?: ForbidEntry[] # what this state DENIES while active — beating the
336
- # workflow's allow_always, this state's own allow,
337
- # and the always-on surface alike. Deny beats allow.
344
+ # workflow-wide grant, this state's own allow,
345
+ # and a host's essentialTools alike. Deny beats allow.
338
346
  # Not inherited by a sub-workflow; a lifecycle hook
339
347
  # is exempt from it (runtime authority).
340
348
 
@@ -421,25 +429,35 @@ states:
421
429
  #
422
430
  # Transition = {
423
431
  # to: string # a declared state's SLUG
424
- # description: string # REQUIRED, non-empty
432
+ # description?: string # what the agent routes on
425
433
  # type?: "approve" | "reject" | "refine" | "none"
426
434
  # }
427
435
  #
428
436
  # THE AGENT SEES THIS STATE'S EDGES AND NOTHING
429
437
  # ELSE OF THE GRAPH — no other state's slug, title,
430
438
  # summary, hooks or transitions, and no count of
431
- # the states. So `description` is the whole of what
432
- # it knows about where an edge leads, and a missing
433
- # or blank one is a LOAD ERROR naming
434
- # states.<slug>.transitions.<i>.description.
439
+ # the states. So `description` is what it knows
440
+ # about where an edge leads. An UNDESCRIBED edge
441
+ # (absent/empty/blank) routes on the TARGET's
442
+ # `instructions` instead: the edge's line carries
443
+ # them, quoted, and nothing else of the target.
444
+ # LOAD ERRORS (states.<slug>.transitions.<i>.description):
445
+ # an undescribed edge whose target has no
446
+ # instructions; an undescribed transition of a
447
+ # HUMAN state (it is the button label); a
448
+ # non-string. An undescribed edge INTO a human
449
+ # state discloses that state's reviewer-facing
450
+ # instructions to the agent — describe it to keep
451
+ # them private.
435
452
  #
436
453
  # Write it for a reader standing in THIS state,
437
454
  # which knows nothing about the target:
438
455
  # GOOD: "The refund is over $50." (when)
439
456
  # BAD: "Go to refund-review." (where)
440
457
  # A routing condition CANNOT live in the target's
441
- # summary/instructions — those are never disclosed
442
- # to the state routing into it.
458
+ # summary, which is never disclosed; it lives in the
459
+ # target's instructions only when the edge is left
460
+ # undescribed.
443
461
  #
444
462
  # The rendered line marks a target that is a human
445
463
  # decision node or terminal (each changes the call
@@ -666,11 +684,12 @@ an entry naming an unprefixed variant governs a tool that does not exist,
666
684
  silently granting nothing. A host tool may never claim the prefix. Deep Agents' built-ins
667
685
  (`read_file`, `task`, …) keep their own names.
668
686
 
669
- - A state with **no `tools` block** gets the **always-on tools only**
670
- (`ls`, `read_file`, `write_file`, `edit_file`, `copy_file`, `move_file`, `remove_file`, `glob`,
671
- `grep`, `write_todos`, `archmax_eval`, `archmax_run`, plus the always-allowed `archmax_advance` and `allow_always`
672
- grants — minus
673
- whatever a `forbid` list denies there, and read-only-zone protection).
687
+ - A state with **no `tools` block** gets the **workflow-wide grant only**: what
688
+ `tools.allow_always` lists, or the default tools (`ls`, `read_file`, `write_file`,
689
+ `edit_file`, `copy_file`, `move_file`, `remove_file`, `glob`, `grep`, `write_todos`,
690
+ `archmax_eval`, `archmax_run`) when the key is absent, plus the always-allowed
691
+ `archmax_advance` and a host's `essentialTools`, minus whatever a `forbid` list
692
+ denies there, and read-only-zone protection.
674
693
  Governance is closed by default; there is no way to declare a fully open state.
675
694
  - `tools.forbid` on a state **denies** while that state is active, beating every
676
695
  grant that would otherwise reach it (see [Tool governance](#tool-governance)).
@@ -712,7 +731,8 @@ success.
712
731
  ```yaml
713
732
  transitions:
714
733
  - to: string # REQUIRED target state SLUG (must exist); never a title
715
- description?: string # shown to the agent (or human) to pick the edge
734
+ description?: string # shown to the agent (or human) to pick the edge; absent =
735
+ # the agent is shown the target's instructions instead
716
736
  type?: "approve" | "reject" | "refine" | "none" # default "none"
717
737
  ```
718
738
 
@@ -746,22 +766,30 @@ platform-provided tool resolves through when its collection has several) and
746
766
  `source` (any string: a host's own label for where the tool came from) — the
747
767
  runtime matches governance by `tool` name alone and never reads `source`.
748
768
 
749
- **The model is closed by default, and a denial beats every grant.** Every state always has the
750
- **always-on tools** (`ls`, `read_file`, `write_file`, `edit_file`, `copy_file`, `move_file`,
751
- `remove_file`, `glob`, `grep`, `write_todos`, `archmax_eval`, `archmax_run`). One built-in is **never
769
+ **The model is closed by default, and a denial beats every grant.** Every state has the
770
+ **workflow-wide grant**: what `tools.allow_always` lists, or, when the workflow does not
771
+ declare that key, the **default tools** (`ls`, `read_file`, `write_file`, `edit_file`,
772
+ `copy_file`, `move_file`, `remove_file`, `glob`, `grep`, `write_todos`, `archmax_eval`,
773
+ `archmax_run`). A declared list **replaces** the default tools, never adds to them:
774
+ `allow_always: []` grants no tool workflow-wide, and a list without `write_file` leaves
775
+ every state that does not name it unable to write. So a new workflow lists all twelve and
776
+ removes only what it must not have. Every state also has the always-allowed controls and
777
+ any tool the host passes as `essentialTools`, whatever the workflow declares. One built-in is **never
752
778
  disclosed** and grantable by nothing: `task`, the runtime's own dispatch for
753
779
  grading rubrics — a rubric grades the agent rather than serving it, so naming
754
780
  `task` in an allow entry is a `validate` error and the kernel refuses the call.
755
781
  The planning scratchpad `write_todos` and the sandbox
756
- `archmax_eval` are standard equipment — always disclosed, always permitted,
757
- no setting; only a `forbid` list refuses them. The interpreter is safe as a
782
+ `archmax_eval` are default tools: granted wherever the workflow-wide grant includes
783
+ them (everywhere, in a workflow without `allow_always`). `write_todos`'s prompt
784
+ guidance appears only when some state is granted it, and hooks run in the sandbox
785
+ whether or not the agent is granted `archmax_eval`. The interpreter is safe as a
758
786
  default because the `tools.*` calls its code makes are decided against the active
759
787
  state by the same kernel: it adds computation over what the state permits, not
760
- access. `archmax_run` — executing an authored script **file** — is always on on
788
+ access. `archmax_run` — executing an authored script **file** — is a default tool on
761
789
  the same terms (the script is a file the state could already read); declare it
762
790
  per state to **narrow** which files may run there. The file operations —
763
791
  `copy_file({ source, destination, overwrite? })`, `move_file` (same arguments)
764
- and `remove_file({ file_path })` — are always on on the same terms: every tool
792
+ and `remove_file({ file_path })` — are default tools on the same terms: every tool
765
793
  **declares its path arguments** with how the call uses each (`read`, `list`,
766
794
  `search`, `write`, `remove`, `execute`), and every path rule reads that
767
795
  declaration. `copy_file` reads `source` and writes `destination`; `move_file`
@@ -774,16 +802,19 @@ entry guards every declared path argument: a grant needs all of them to match
774
802
  declares its paths (`toolPaths`, or a descriptor's `paths`) is governed the same
775
803
  way; an argument may hold a list of paths, each one governed (and each one
776
804
  tested by a `paths:` guard), and any other shape is refused
777
- (`tool.path-argument`). `scratchpad/` is open in every state to the always-on
778
- tools only — a host tool a state must grant stays refused where it is not
779
- granted, whatever its paths. Any other tool
805
+ (`tool.path-argument`). `scratchpad/` is open in every state to each default file tool the state
806
+ is granted, whatever the granting entry narrows, and to a host's `essentialTools`.
807
+ A file tool the state is not granted gets nothing from it, and a host tool a state
808
+ must grant stays refused where it is not granted, whatever its paths. Any other tool
780
809
  must be declared in the state's `tools.allow` or workflow-level
781
- `tools.allow_always`. A `tools.allow` entry naming an always-on tool **narrows**
782
- it for that state.
810
+ `tools.allow_always`. A `tools.allow` entry naming a tool the workflow-wide grant
811
+ includes **narrows** it for that state. A guard on an `allow_always` entry is
812
+ enforced like any other (`{ tool: write_file, paths: [reports/**] }` binds in every
813
+ state that does not name `write_file`).
783
814
  Denial is declared beside the grant, in the same two positions and with the same
784
815
  entries: `tools.forbid_always` at the root denies in every state,
785
816
  `tools.forbid` on a state denies while it is active — subtracting from the
786
- workflow's grant, the state's own `allow` and the always-on surface alike.
817
+ workflow-wide grant, the state's own `allow` and a host's `essentialTools` alike.
787
818
  **Deny beats allow, and no narrower level widens a denial.** A forbid entry may
788
819
  name the tool `*` (every tool); `*` in an allow list is a load error. A lifecycle
789
820
  hook is exempt from the state's `allow` **and** its `forbid` — runtime authority,
@@ -803,17 +834,18 @@ Precedence (highest first):
803
834
  (and regardless of always-allowed): deny beats allow, and no narrower level
804
835
  widens a denial.
805
836
  2. **Always allowed**: `archmax_advance` (baked in, every state).
806
- 3. **Per-state `tools.allow`** — the listed tools/arg-shapes. An entry for an
807
- always-on tool (or one also in `allow_always`) takes precedence
808
- (**narrower wins** — the state's arg globs apply, not the broader grant).
809
- 4. **Essential built-ins** — always permitted when no state entry narrows
810
- them. Listing one in `allow_always` is inert (`archmax validate` warns).
811
- 5. **Workflow `tools.allow_always`** — grants tools that are not always on in every
812
- state.
837
+ 3. **Per-state `tools.allow`** — the listed tools/arg-shapes. An entry for a
838
+ tool the workflow-wide grant includes takes precedence (**narrower wins** —
839
+ the state's arg globs apply, not the broader grant); an entry for a default
840
+ tool a declared `allow_always` omits grants it in this state.
841
+ 4. **The workflow-wide grant** — the declared `tools.allow_always`, guards
842
+ included, or the default tools, unconstrained, when the key is absent.
843
+ 5. **The host's `essentialTools`** — always permitted when no state entry
844
+ narrows them, whatever the workflow declares.
813
845
  6. **Default**: everything else is blocked.
814
846
 
815
847
  **Progressive disclosure.** The model is only shown the active state's tool
816
- surface: always-on tools + `allow_always` + the state's entries + `archmax_advance`
848
+ surface: the workflow-wide grant + a host's `essentialTools` + the state's entries + `archmax_advance`
817
849
  (hidden in terminal states), minus every tool denied there by name. Disclosure is
818
850
  name-level (arg-constrained tools stay visible; the kernel enforces args at
819
851
  call time) and never replaces enforcement. **Skills are disclosed the same way**:
@@ -1839,7 +1871,7 @@ them. Its shape:
1839
1871
  - `orders-question` (terminal) answers from `skills/order-data/assets/orders.json`; an
1840
1872
  `after: { rubric: order-reply-tone }` grades the reply at completion.
1841
1873
  - `refund-request` records a decision to `scratchpad/refund.json` (no allow entry
1842
- narrows it — the working area is open in every state; what holds the agent to a
1874
+ narrows it — the working area is open to `write_file` wherever it is granted; what holds the agent to a
1843
1875
  correct file is the hook), runs `after: check-refund.js`, and pairs
1844
1876
  `budget.maxTurns: 24` with `on_error: escalation` so a terminal failure
1845
1877
  (hook error, exhausted corrections, exhausted budget) routes to escalation