@archmax-ai/harness 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +3 -1
  2. package/dist/assembly/compose.d.ts +40 -3
  3. package/dist/assembly/compose.js +85 -8
  4. package/dist/assembly/compose.js.map +1 -1
  5. package/dist/assembly/delegation-registry.js +5 -2
  6. package/dist/assembly/delegation-registry.js.map +1 -1
  7. package/dist/assembly/image-reads.d.ts +53 -0
  8. package/dist/assembly/image-reads.js +163 -0
  9. package/dist/assembly/image-reads.js.map +1 -0
  10. package/dist/assembly/index.d.ts +21 -0
  11. package/dist/assembly/index.js +7 -1
  12. package/dist/assembly/index.js.map +1 -1
  13. package/dist/assembly/plain.js +10 -4
  14. package/dist/assembly/plain.js.map +1 -1
  15. package/dist/authoring-skill/archmax-harness/references/backend-integration.md +59 -1
  16. package/dist/authoring-skill/archmax-harness/references/hook-and-test-scripts.md +27 -1
  17. package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +71 -22
  18. package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +24 -5
  19. package/dist/core/binary-read.d.ts +44 -0
  20. package/dist/core/binary-read.js +93 -0
  21. package/dist/core/binary-read.js.map +1 -0
  22. package/dist/core/binary-types.d.ts +19 -0
  23. package/dist/core/binary-types.js +54 -0
  24. package/dist/core/binary-types.js.map +1 -0
  25. package/dist/core/file-operations.d.ts +43 -0
  26. package/dist/core/file-operations.js +368 -0
  27. package/dist/core/file-operations.js.map +1 -0
  28. package/dist/core/path-mapping.d.ts +17 -3
  29. package/dist/core/path-mapping.js +32 -1
  30. package/dist/core/path-mapping.js.map +1 -1
  31. package/dist/core/platform-prompt.generated.js +1 -1
  32. package/dist/core/platform-prompt.generated.js.map +1 -1
  33. package/dist/core/prompt.d.ts +27 -0
  34. package/dist/core/prompt.js +65 -5
  35. package/dist/core/prompt.js.map +1 -1
  36. package/dist/core/raw-download.d.ts +16 -0
  37. package/dist/core/raw-download.js +56 -0
  38. package/dist/core/raw-download.js.map +1 -0
  39. package/dist/core/session-zone.d.ts +9 -1
  40. package/dist/core/session-zone.js +15 -0
  41. package/dist/core/session-zone.js.map +1 -1
  42. package/dist/core/tool-context.d.ts +27 -0
  43. package/dist/core/tool-context.js +14 -0
  44. package/dist/core/tool-context.js.map +1 -0
  45. package/dist/core/tool-telemetry.js +2 -1
  46. package/dist/core/tool-telemetry.js.map +1 -1
  47. package/dist/core/workspace-context.js +1 -0
  48. package/dist/core/workspace-context.js.map +1 -1
  49. package/dist/core/workspace-router.d.ts +30 -1
  50. package/dist/core/workspace-router.js +80 -3
  51. package/dist/core/workspace-router.js.map +1 -1
  52. package/dist/index.d.ts +11 -1
  53. package/dist/index.js +3 -1
  54. package/dist/index.js.map +1 -1
  55. package/dist/kernel/kernel.js +198 -119
  56. package/dist/kernel/kernel.js.map +1 -1
  57. package/dist/machine/allow.d.ts +22 -0
  58. package/dist/machine/allow.js +47 -15
  59. package/dist/machine/allow.js.map +1 -1
  60. package/dist/machine/lint-spec.js +12 -3
  61. package/dist/machine/lint-spec.js.map +1 -1
  62. package/dist/machine/machine.d.ts +15 -1
  63. package/dist/machine/machine.js +43 -8
  64. package/dist/machine/machine.js.map +1 -1
  65. package/dist/machine/spec-schema.js +14 -0
  66. package/dist/machine/spec-schema.js.map +1 -1
  67. package/dist/machine/tool-names.d.ts +27 -7
  68. package/dist/machine/tool-names.js +43 -13
  69. package/dist/machine/tool-names.js.map +1 -1
  70. package/dist/machine/tool-paths.d.ts +64 -0
  71. package/dist/machine/tool-paths.js +155 -0
  72. package/dist/machine/tool-paths.js.map +1 -0
  73. package/dist/public/spec.d.ts +11 -1
  74. package/dist/public/spec.js +10 -1
  75. package/dist/public/spec.js.map +1 -1
  76. package/dist/validate/validate.js +10 -5
  77. package/dist/validate/validate.js.map +1 -1
  78. package/dist/workflow/agent-tools.d.ts +20 -1
  79. package/dist/workflow/agent-tools.js +35 -1
  80. package/dist/workflow/agent-tools.js.map +1 -1
  81. package/dist/workflow/control-tools.d.ts +4 -1
  82. package/dist/workflow/control-tools.js +16 -9
  83. package/dist/workflow/control-tools.js.map +1 -1
  84. package/dist/workflow/governance.d.ts +2 -0
  85. package/dist/workflow/governance.js +1 -0
  86. package/dist/workflow/governance.js.map +1 -1
  87. package/dist/workflow/middleware.d.ts +2 -0
  88. package/dist/workflow/middleware.js +27 -12
  89. package/dist/workflow/middleware.js.map +1 -1
  90. package/dist/workflow/on-error.js +3 -2
  91. package/dist/workflow/on-error.js.map +1 -1
  92. package/dist/workflow/parks.js +5 -5
  93. package/dist/workflow/parks.js.map +1 -1
  94. package/dist/workflow/render-prompt.d.ts +2 -0
  95. package/dist/workflow/render-prompt.js +9 -3
  96. package/dist/workflow/render-prompt.js.map +1 -1
  97. package/dist/workflow/returns-check.d.ts +35 -0
  98. package/dist/workflow/returns-check.js +10 -0
  99. package/dist/workflow/returns-check.js.map +1 -0
  100. package/dist/workflow/signature-checks.d.ts +26 -1
  101. package/dist/workflow/signature-checks.js +35 -10
  102. package/dist/workflow/signature-checks.js.map +1 -1
  103. package/dist/workflow/state.d.ts +75 -1
  104. package/dist/workflow/state.js +83 -0
  105. package/dist/workflow/state.js.map +1 -1
  106. package/dist/workflow/sub-workflow.d.ts +16 -5
  107. package/dist/workflow/sub-workflow.js +84 -37
  108. package/dist/workflow/sub-workflow.js.map +1 -1
  109. package/dist/workflow/tool-service.js +57 -10
  110. package/dist/workflow/tool-service.js.map +1 -1
  111. package/dist/workflow/turn-boundary.d.ts +8 -7
  112. package/dist/workflow/turn-boundary.js +10 -9
  113. package/dist/workflow/turn-boundary.js.map +1 -1
  114. package/dist/workflow/workflow-tools.js +5 -1
  115. package/dist/workflow/workflow-tools.js.map +1 -1
  116. package/package.json +1 -1
  117. package/skills/archmax-harness/references/backend-integration.md +59 -1
  118. package/skills/archmax-harness/references/hook-and-test-scripts.md +27 -1
  119. package/skills/archmax-harness/references/workflow-schema.md +71 -22
  120. package/skills/archmax-harness/references/workflow-yaml.md +24 -5
@@ -1 +1 @@
1
- {"version":3,"file":"tool-service.js","sourceRoot":"","sources":["../../src/workflow/tool-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAwC,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAA8B,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAsB1D;;;;;;;;;GASG;AACH,SAAS,QAAQ,CAAC,KAAc;IAC9B,MAAM,QAAQ,GAAI,KAA8C,EAAE,QAAQ,CAAC;IAC3E,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAAE,OAAO,GAAG,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAwC,CAAC;QAC/D,MAAM,KAAK,GAAG,GAAG,EAAE,UA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B,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnD,CAAC,CAAC,CAAC;gBACH,OAAO,OAAO,CAAC,OAAO,CAAC;YACzB,CAAC;YACD;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;IAED,OAAO;QACL,cAAc;QACd,aAAa;QACb,iBAAiB;QACjB,UAAU;QACV,iBAAiB;QACjB,kBAAkB;QAClB,cAAc,CAAC,SAAiB;YAC9B,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAChC,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"tool-service.js","sourceRoot":"","sources":["../../src/workflow/tool-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAIlB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAA8B,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAsB1D;;;;;;;;;GASG;AACH,SAAS,QAAQ,CAAC,KAAc;IA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,CAAC,CAAC;gBACxB,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;oBACtD,MAAM,OAAO,GAAG,kBAAkB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;oBACzE,0FAA0F;oBAC1F,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;wBACpB,IAAI,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;wBACvH,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC;wBACrD,IAAI,OAAO,KAAK,KAAK,QAAQ;4BAAE,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC;oBAClG,CAAC;oBACD,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnD,CAAC,CAAC,CAAC;gBACH,OAAO,OAAO,CAAC,OAAO,CAAC;YACzB,CAAC;YACD;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;IAED,OAAO;QACL,cAAc;QACd,aAAa;QACb,iBAAiB;QACjB,UAAU;QACV,iBAAiB;QACjB,kBAAkB;QAClB,cAAc,CAAC,SAAiB;YAC9B,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC9B,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * The turn boundary: what happens once per invoke, before any model call.
3
3
  *
4
- * A turn boundary resets the turn's mechanics (rejected, raised, iterations,
5
- * beforeDone, parkCounts, park records and phase, replyOnly, the turn budget)
6
- * and retains the conversation (position, entryState, variables, transcript,
7
- * trail, files). Every ingress that begins a turn arrives here; a park
8
- * resumption re-enters at its own suspension through a `Command` and never
9
- * crosses this boundary — which is what makes "a disabled machine starts
10
- * nothing, finishes what it started" a property of the graph's shape.
4
+ * A turn boundary resets the turn's mechanics (rejected, failedDelegations,
5
+ * raised, iterations, beforeDone, parkCounts, park records and phase,
6
+ * replyOnly, the turn budget) and retains the conversation (position,
7
+ * entryState, variables, transcript, trail, files). Every ingress that begins
8
+ * a turn arrives here; a park resumption re-enters at its own suspension
9
+ * through a `Command` and never crosses this boundary — which is what makes "a
10
+ * disabled machine starts nothing, finishes what it started" a property of the
11
+ * graph's shape.
11
12
  */
12
13
  import { type WorkflowEventEmitter, type WorkflowEventHandler } from "../core/events.js";
13
14
  import type { Workspace } from "../core/workspace.js";
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * The turn boundary: what happens once per invoke, before any model call.
3
3
  *
4
- * A turn boundary resets the turn's mechanics (rejected, raised, iterations,
5
- * beforeDone, parkCounts, park records and phase, replyOnly, the turn budget)
6
- * and retains the conversation (position, entryState, variables, transcript,
7
- * trail, files). Every ingress that begins a turn arrives here; a park
8
- * resumption re-enters at its own suspension through a `Command` and never
9
- * crosses this boundary — which is what makes "a disabled machine starts
10
- * nothing, finishes what it started" a property of the graph's shape.
4
+ * A turn boundary resets the turn's mechanics (rejected, failedDelegations,
5
+ * raised, iterations, beforeDone, parkCounts, park records and phase,
6
+ * replyOnly, the turn budget) and retains the conversation (position,
7
+ * entryState, variables, transcript, trail, files). Every ingress that begins
8
+ * a turn arrives here; a park resumption re-enters at its own suspension
9
+ * through a `Command` and never crosses this boundary — which is what makes "a
10
+ * disabled machine starts nothing, finishes what it started" a property of the
11
+ * graph's shape.
11
12
  */
12
13
  import { SESSION_ORIGIN } from "../core/events.js";
13
14
  import { MANUAL_TRIGGER } from "../machine/triggers.js";
@@ -15,7 +16,7 @@ import { buildSeededVariables, TITLE_VARIABLE, TRIGGER_VARIABLE, } from "../mach
15
16
  import { decisionRecordFor } from "./parks.js";
16
17
  import { requiresRefusal } from "./signature-checks.js";
17
18
  import { writeSpecSnapshotIfAbsent } from "./snapshot.js";
18
- import { readVariables, readWorkflowState, reseedAll, WORKFLOW_STATUSES, } from "./state.js";
19
+ import { NO_PENDING_FAILURE, readVariables, readWorkflowState, reseedAll, WORKFLOW_STATUSES, } from "./state.js";
19
20
  import { sessionScopeFrom, seedVariablesFrom } from "../sessions/scope.js";
20
21
  /**
21
22
  * Open a turn: resolve where it begins, refuse it if the machine cannot serve
@@ -103,7 +104,7 @@ export async function openTurn(ctx, state, runtime) {
103
104
  }
104
105
  return {
105
106
  workflowState: position,
106
- rejected: null,
107
+ ...NO_PENDING_FAILURE,
107
108
  raised: null,
108
109
  iterations: {},
109
110
  beforeDone: {},
@@ -1 +1 @@
1
- {"version":3,"file":"turn-boundary.js","sourceRoot":"","sources":["../../src/workflow/turn-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAwD,MAAM,mBAAmB,CAAC;AAGzG,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,iBAAiB,GAGlB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiB3E;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,GAAwB,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B,GAAG,kBAAkB;QACrB,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,yEAAyE;QACzE,4EAA4E;QAC5E,gFAAgF;QAChF,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,IAAI;QACrB,kBAAkB,EAAE,IAAI;QACxB,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,IAAI;QAChB,iFAAiF;QACjF,UAAU;QACV,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,MAAM,EAAE,iBAAiB,CAAC,OAAO;QACjC,OAAO;QACP,SAAS,EAAE,gBAAgB;QAC3B,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAsB,CAAC;QACvG,GAAG,QAAQ;KACZ,CAAC;AACJ,CAAC"}
@@ -35,9 +35,13 @@ export function delegationToolDescription(target) {
35
35
  }
36
36
  parts.push(returns.length
37
37
  ? `The result carries ${quoteList(returns)} under 'returns', alongside the ` +
38
- `workflow's closing message under 'message'.`
38
+ `workflow's closing message under 'message'. A run that finished without setting some ` +
39
+ `of them returns the ones it set, with a 'note' under 'returns' naming the rest.`
39
40
  : `The result is the workflow's closing message.`);
40
41
  parts.push(`One call runs it once; call it again (in the same turn) to run several at once.`);
42
+ parts.push(`A call whose run fails answers with an error, and that failure fails your current state ` +
43
+ `when you finish, unless a later call of this workflow from the same state succeeds. ` +
44
+ `Each success recovers one failed call: the one it repeats, else the oldest.`);
41
45
  return parts.join(" ");
42
46
  }
43
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-tools.js","sourceRoot":"","sources":["../../src/workflow/workflow-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,IAAI,EA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AAQ,CAAC,OAAgB;IAChC,MAAM,EAAE,GAAI,OAAgD,EAAE,UAAU,CAAC;IACzE,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,SAAS,SAAS,CAAC,KAAe;IAChC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/C,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;AAC9E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archmax-ai/harness",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
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": [
@@ -81,6 +81,7 @@ From `@archmax-ai/harness` (`src/index.ts`):
81
81
  | `SessionStoreRequiredError`, `SessionStoreCapabilityError` | class | Assembly / capability errors for run storage |
82
82
  | `workflowStateSchema`, `workflowPaths`, `sessionPaths`, `runArtifactPaths` | schema/fn | State schema + path helpers |
83
83
  | `runTests`, `RunTestsOptions`, `CaseResult` | fn/type | Run a workflow's cases — [against your own agent](#cases-against-your-agent) |
84
+ | `toolsFromMap`, `AgentToolDescriptor`, `ToolContext`, `ToolPaths`, `PathAccess`, `ToolPathsError` | fn/type/class | Host tools: a `name → descriptor` map, each descriptor's declared `paths` and a handler handed the turn's workspace — [host tools](#host-tools) |
84
85
  | `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` |
85
86
 
86
87
  ## createAgent options
@@ -98,6 +99,10 @@ All optional (`CreateAgentParams`, `src/assembly/index.ts`):
98
99
  | `mounts` | `Record<string, MountSpec>` | Authored mounts as a `CompositeBackend` route table: key → backend, or `{ backend, readOnly, governed, searchable }`. Trailing slash = directory mount; no slash = exact-path file mount (`"/AGENTS.md"`). Read-only unless declared otherwise. `governed: true` hands the spec's `mounts` block the decision of **which states** may reach it (closed by default, like a skill bundle) and whether each may write there; a mount not so declared is visible in every state exactly as today, so a table that marks nothing behaves unchanged. `readOnly` is a **ceiling** the spec cannot lift: a grant may narrow a writable mount to reads in a state, never open a read-only one. A key may be several segments deep (`"/catalogs/eu/"`); its **first** segment is what is reserved, so `/workflows/x/` fails as `/workflows/` does. Omitted on the default backend: `defaultMounts(rootDir)` (the conventional table — `/skills/`, `/.platform/`, `/AGENTS.md`, none governed — extend with `{ ...defaultMounts(root), "/templates/": … }`). Omitted with a custom `backend`: nothing authored is served; expose subtrees with `mountSubtree(backend, "skills")`. A key colliding with a run area — or naming the authoring-plane prefix (`/workflows/`) — throws `MountCollisionError`. `searchable: false` declares a mount the runtime never searches on its own initiative: a root-wide `grep`/`glob` fans out over the other mounts only, while a search the agent addresses at the mount (or a path inside it) still reaches its backend and returns the backend's own answer — matches or `{ error }` — verbatim. Use it for a backend that must refuse searches (a remote folder served live). Listing and reading are unchanged, the prompt marks it "browse only", names arrive as `MountPrefixes.unsearchable`, and it is ignored on a file mount. |
99
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. |
100
101
  | `systemPrompt` | `string` | Appended after workspace `AGENTS.md`. |
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. |
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
+ | `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`. |
101
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. |
102
107
  | `middleware` | `AgentMiddleware[]` | Extra middleware appended after workflow instrumentation. |
103
108
  | `onEvent` | `WorkflowEventHandler` | Subscribe to all lifecycle diagnostics; suppresses console output when set. |
@@ -429,7 +434,8 @@ opening, a human park, run-start seeding.
429
434
  rides its own event so that rule needs no exception, and it is safe there because
430
435
  a title is bounded to one short line by its write check. Indexing a run's title on
431
436
  your own record is a handler for this event and nothing else — no checkpoint read,
432
- which matters when you install your own checkpointer.
437
+ which matters when you install your own checkpointer. A sub-workflow's child is not
438
+ asked to name itself, so it emits none unless its caller passed a `title` down.
433
439
 
434
440
  ### Reading tokens and cost
435
441
 
@@ -595,6 +601,58 @@ A custom `backend` **requires** an explicit `sessionStore` — assembly throws
595
601
  Persisting the session zone off-box (an S3-backed session store) is how you share run
596
602
  state across a worker fleet and an API.
597
603
 
604
+ `downloadFiles`, `uploadFiles` and `delete` are optional in the protocol and stay
605
+ optional in the workspace: a store with only the required methods serves skills,
606
+ reads and text copies. `downloadFiles` is always present and reads a store without
607
+ it through `readRaw` (exact bytes or `permission_denied`, never altered text);
608
+ `uploadFiles` is present when the session store has it, and a mount without it
609
+ refuses that file; `delete` answers a store without it with an error. What each
610
+ buys the file operations (`copy_file`, `move_file`, `remove_file`): a write to a
611
+ binary-typed path (an image, a PDF) carries **base64**, which the backend's
612
+ `write` must decode — Deep Agents' convention, with the extensions in
613
+ `BINARY_MIME_TYPES` on `@archmax-ai/harness/spec`. Other bytes the text channel
614
+ cannot carry (a `.docx`, a `.zip`, Latin-1 text) need `uploadFiles`, and a move
615
+ or removal needs `delete`. Every copy is read back; a store that kept something
616
+ else is refused, never reported as copied. A read-only mount refuses an upload
617
+ and a delete itself. Deep Agents is handed the workspace without `delete`, so its
618
+ own recursive `delete` tool never exists: `remove_file` is the one way to delete
619
+ a file.
620
+
621
+ ### Host tools
622
+
623
+ A host tool built with `toolsFromMap` reaches the workspace the way the
624
+ built-in file tools do — no second routing table:
625
+
626
+ ```ts
627
+ const tools = toolsFromMap({
628
+ get_markdown: {
629
+ description: "Read a document as Markdown.",
630
+ inputSchema: { type: "object", properties: { path: { type: "string" } }, required: ["path"] },
631
+ paths: { path: "read" }, // governed like read_file's file_path
632
+ handler: async (input, { workspace }) => {
633
+ const raw = await workspace.readRaw(String(input.path));
634
+ return raw.error ? `Error: ${raw.error}` : toMarkdown(raw.data!);
635
+ },
636
+ },
637
+ });
638
+ const agent = await createAgent({ tools, essentialTools: ["get_markdown"] });
639
+ ```
640
+
641
+ - `paths` declares the arguments that name workspace paths and how the call
642
+ uses each. Every path rule binds them: the read-only zone, the runtime's own
643
+ areas, the skills and mounts the state was given (`mount.not-allowed`,
644
+ `skill.not-allowed`), a mount's `access: read` (`mount.read-only` for a
645
+ `write` or `remove`), inherited denials and `paths:` guards. A refused call
646
+ never runs the handler. No declaration, no path rules. An argument may hold a
647
+ list of paths (`files: string[]`), each governed; any other shape is refused.
648
+ Declaring paths only narrows: `scratchpad/` is open in every state to the
649
+ always-on tools, so a tool a state must grant stays refused where it is not.
650
+ - `context.workspace` is the turn's workspace, bound to the session — the
651
+ instance `read_file` uses — with `downloadFiles`, `uploadFiles` (when the
652
+ session store has it) and `delete` besides the text methods. The plain agent
653
+ hands the same context. Outside a turn, reading it throws; the property is
654
+ non-enumerable there, so comparing or logging the context does not.
655
+
598
656
  ## Cases against your agent
599
657
 
600
658
  `runTests` runs a workflow's cases — declarative YAML documents
@@ -163,7 +163,7 @@ export default async function hook({ state, phase, trigger, variables, messages,
163
163
  | `variables` | The run's variables as a plain `name → value` map, including the built-in `trigger`. Structured values are present whole (`variables.order.items[0].sku`). **Read-only**: assigning changes nothing, and the variable tools are absent from `tools.*` — a hook that could write variables would be editing the governance inputs of the state it judges. |
164
164
  | `messages` | The recent transcript (last 24 messages), newest last, as `{ role, text, toolCalls? }`. `role` is `user`, `assistant`, `tool` (with `tool: <name>`), `system`, or **`runtime`** — a note the runtime wrote (an arrival, a decision, an error route, a completion check; `note` names the kind). A hook that reacts to narration matches `role === "runtime"`, never a `[bracket]` prefix in a user message. |
165
165
  | `from`, `to`, `reason` | Present on `after` hooks: the transition the agent is attempting (`reason` is the agent's `archmax_advance` reason). |
166
- | `tools` | The privileged tool-call bridge (async), camelCased: `await tools.readFile({ file_path: "skills/order-data/assets/orders.json" })` → file text. See [Governance](#governance-of-tools-calls). |
166
+ | `tools` | The privileged tool-call bridge (async), camelCased: `await tools.readFile({ file_path: "skills/order-data/assets/orders.json" })` → file text, or the binary notice for a binary file (see below). See [Governance](#governance-of-tools-calls). |
167
167
 
168
168
  **The verdict** — the three helpers are globals:
169
169
 
@@ -231,6 +231,32 @@ try {
231
231
  }
232
232
  ```
233
233
 
234
+ A **binary file** is not a refusal and does not throw: reads are text only, so
235
+ `tools.readFile` on an image, audio, video, PDF or PowerPoint file, or on any
236
+ file whose content holds a NUL byte (an archive, an Office document), resolves to
237
+ the notice `Error: '<path>' is a binary file (<type>, <size>) and was not read;
238
+ read_file returns text files only.` instead of content — an image too, even when
239
+ the host turned on `images`, which shows images to the model only. A missing file reads as
240
+ an `Error: …` string the same way. A script that parses what it read checks
241
+ first:
242
+
243
+ ```js
244
+ const text = await tools.readFile({ file_path: "scratchpad/upload.json" });
245
+ const upload = text.startsWith("Error:") ? null : JSON.parse(text);
246
+ ```
247
+
248
+ To **duplicate, move or delete** a file — a template, an image, a `.docx` —
249
+ call `tools.copyFile({ source, destination, overwrite? })`,
250
+ `tools.moveFile({ source, destination, overwrite? })` or
251
+ `tools.removeFile({ file_path })` instead of reading and writing it back. The
252
+ bytes move, binary files included, with no `readFile` line limit, and each
253
+ call resolves to one line (`Copied '<source>' to '<destination>' (<size>).`,
254
+ `Moved …`, `Removed '<path>'.`). They are governed by their declared paths like
255
+ any other call, so a governance refusal (a destination in a read-only mount, a
256
+ disabled skill's file) throws. A failure the operation itself meets (a missing
257
+ source, a directory, an existing destination without `overwrite: true`)
258
+ resolves to an `Error: …` string instead.
259
+
234
260
  **Authoring rule for `archmax_run` scripts:** if sandboxed code calls `tools.X`,
235
261
  the state's `allow` list must cover `tool: X` (with any argument constraints the
236
262
  script's call satisfies), or the call is blocked. Grant it per state with
@@ -535,9 +535,15 @@ states:
535
535
  wiring the SDK already reads, and a loose declaration that swallowed one would
536
536
  start the run somewhere you did not say.
537
537
  - `requires:` / `returns:` are the run's **signature**, and both are enforced. A
538
- firing that does not supply every `requires` name does not start; a run that
539
- reaches a terminal state without every `returns` name set is rejected (a run
540
- that *parks* is not checked — it has not finished). Each entry is a bare
538
+ firing that does not supply every `requires` name does not start. `returns`
539
+ is checked once as the run finishes, and **nothing is handed back**: a
540
+ sub-workflow child with a name unset **completes**, and its caller gets the
541
+ returns it set plus `note: "Not all return variables were set by the
542
+ sub-workflow: '<name>' was not set."`; a top-level run with a name unset is
543
+ **rejected**; a typed one mistyped rejects either way. A run that *parks* is
544
+ not checked — it has not finished. `note` is reserved: a `returns` list may
545
+ not declare it. Want the model to try again? Check the returns in a terminal
546
+ `after` hook, which can `correct`. Each entry is a bare
541
547
  run-variable name (**untyped**: any value, `null` included) or a strict object
542
548
  `{ name, type?, description? }` naming one; the spellings mix in one list and
543
549
  names are distinct across both. What the agent must *do* to produce a
@@ -630,8 +636,8 @@ silently granting nothing. A host tool may never claim the prefix. Deep Agents'
630
636
  (`read_file`, `task`, …) keep their own names.
631
637
 
632
638
  - A state with **no `tools` block** gets the **always-on tools only**
633
- (`ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`, `write_todos`,
634
- `archmax_eval`, `archmax_run`, `task`, plus the always-allowed `archmax_advance` and `allow_always`
639
+ (`ls`, `read_file`, `write_file`, `edit_file`, `copy_file`, `move_file`, `remove_file`, `glob`,
640
+ `grep`, `write_todos`, `archmax_eval`, `archmax_run`, plus the always-allowed `archmax_advance` and `allow_always`
635
641
  grants — minus
636
642
  whatever a `forbid` list denies there, and read-only-zone protection).
637
643
  Governance is closed by default; there is no way to declare a fully open state.
@@ -710,8 +716,8 @@ platform-provided tool resolves through when its collection has several) and
710
716
  runtime matches governance by `tool` name alone and never reads `source`.
711
717
 
712
718
  **The model is closed by default, and a denial beats every grant.** Every state always has the
713
- **always-on tools** (`ls`, `read_file`, `write_file`, `edit_file`, `glob`,
714
- `grep`, `write_todos`, `archmax_eval`, `archmax_run`). One built-in is **never
719
+ **always-on tools** (`ls`, `read_file`, `write_file`, `edit_file`, `copy_file`, `move_file`,
720
+ `remove_file`, `glob`, `grep`, `write_todos`, `archmax_eval`, `archmax_run`). One built-in is **never
715
721
  disclosed** and grantable by nothing: `task`, the runtime's own dispatch for
716
722
  grading rubrics — a rubric grades the agent rather than serving it, so naming
717
723
  `task` in an allow entry is a `validate` error and the kernel refuses the call.
@@ -722,7 +728,24 @@ default because the `tools.*` calls its code makes are decided against the activ
722
728
  state by the same kernel: it adds computation over what the state permits, not
723
729
  access. `archmax_run` — executing an authored script **file** — is always on on
724
730
  the same terms (the script is a file the state could already read); declare it
725
- per state to **narrow** which files may run there. Any other tool
731
+ per state to **narrow** which files may run there. The file operations —
732
+ `copy_file({ source, destination, overwrite? })`, `move_file` (same arguments)
733
+ and `remove_file({ file_path })` — are always on on the same terms: every tool
734
+ **declares its path arguments** with how the call uses each (`read`, `list`,
735
+ `search`, `write`, `remove`, `execute`), and every path rule reads that
736
+ declaration. `copy_file` reads `source` and writes `destination`; `move_file`
737
+ **removes** `source`, so a move out of a read-only mount is refused before
738
+ anything is written; a removal is refused wherever a write is. A call naming
739
+ several paths is refused when any one is, naming the argument. `paths:` in an
740
+ entry guards every declared path argument: a grant needs all of them to match
741
+ (`{ tool: copy_file, paths: [skills/**, reports/**] }`), a denial needs one
742
+ (`{ tool: "*", paths: [secrets/**] }` blocks a copy in or out). A host tool that
743
+ declares its paths (`toolPaths`, or a descriptor's `paths`) is governed the same
744
+ way; an argument may hold a list of paths, each one governed (and each one
745
+ tested by a `paths:` guard), and any other shape is refused
746
+ (`tool.path-argument`). `scratchpad/` is open in every state to the always-on
747
+ tools only — a host tool a state must grant stays refused where it is not
748
+ granted, whatever its paths. Any other tool
726
749
  must be declared in the state's `tools.allow` or workflow-level
727
750
  `tools.allow_always`. A `tools.allow` entry naming an always-on tool **narrows**
728
751
  it for that state.
@@ -984,7 +1007,7 @@ the host at assembly (`variables`, every seed locked), the agent mid-run
984
1007
 
985
1008
  | | `trigger` | `title` |
986
1009
  |---|---|---|
987
- | Set by | the runtime, at every arrival | the **agent**, prompted by the platform prompt |
1010
+ | Set by | the runtime, at every arrival | the **agent**, prompted by the platform prompt (a sub-workflow child is not) |
988
1011
  | Locked | always | **never**, by any route |
989
1012
  | Guaranteed set | yes | no — absent until written |
990
1013
  | In a trigger's `requires:` | accepted | accepted (seeded unlocked) |
@@ -993,7 +1016,10 @@ the host at assembly (`variables`, every seed locked), the agent mid-run
993
1016
  `trigger` holds the current turn's trigger id. `title` holds a short one-line label
994
1017
  naming the task the run is doing; the platform system prompt asks the agent to set
995
1018
  one as its first activity and update it when the task changes significantly, so a
996
- host can name a run instead of showing a session id. A write must be a non-empty
1019
+ host can name a run instead of showing a session id. A sub-workflow's child is not
1020
+ asked — its title names a session nothing lists and is never returned — so its
1021
+ prompt leaves the step out; do not write "set the title" into a child's state
1022
+ `instructions` to bring it back. A write must be a non-empty
997
1023
  single-line string of at most 200 characters (stored trimmed) and must not pass
998
1024
  `lock: true` — both are refused, atomically, like every other `set_variables`
999
1025
  rejection. A host may seed a `title`; it lands **unlocked** (the one exception to
@@ -1286,11 +1312,21 @@ enrich:
1286
1312
  no target may call none; `tools.forbid_always` blocks a delegation tool like any
1287
1313
  other.
1288
1314
  - **A failure is a tool error** the calling agent can handle; the state's
1289
- `on_error` catches the turn if it cannot. Depth, cycle, missing-input
1315
+ `on_error` catches the turn if it cannot. Each failed call is recorded on
1316
+ its own, with its arguments, and stays the calling state's failure until a
1317
+ **later** successful call of the same workflow from the same state recovers
1318
+ it. One success recovers **one** failed call: the one whose arguments it
1319
+ repeats (compared after `${{…}}` resolves, key order ignored), else the
1320
+ oldest — so two parallel calls that failed need two successes. A sibling
1321
+ call in the same batch, another workflow's success, or a rejection with
1322
+ another cause (a terminal kernel block, exhausted parks) recovers nothing,
1323
+ and the route names every outstanding failure with its arguments. An
1324
+ advance, a park or a reset clears them, as it clears any pending rejection. Depth, cycle, missing-input
1290
1325
  (`missing-param`), mistyped-input (`invalid-param`), unresolvable-reference
1291
1326
  (`unresolved-param`) and **disabled-target** refusals are blocked calls —
1292
- nothing ran, so correct the call and retry. A child whose returns are unset
1293
- (`missing-return`) or mistyped (`invalid-return`) is a failure: it ran.
1327
+ nothing ran, so correct the call and retry. A child whose returns are
1328
+ mistyped (`invalid-return`) is a failure: it ran. One that left returns unset
1329
+ is not: the call answers with what it set and a `note`.
1294
1330
  - **A whole-argument reference keeps its type.** `{ quantity: "${{count}}" }`
1295
1331
  seeds the child with the number `count` holds, so it satisfies an `integer`
1296
1332
  parameter; `{ note: "order ${{order_id}}" }` is substituted as text.
@@ -1327,9 +1363,11 @@ enrich:
1327
1363
  reads `manual` either way, so the machine cannot branch on having been called.
1328
1364
 
1329
1365
  A dispatch missing a `requires` name is **refused before the child is
1330
- composed**; a child that completes without every `returns` name set is
1331
- **rejected** rather than handing back half a contract (a child that *parks* is
1332
- not checked — it has not finished). A typed entry is held to its type at both
1366
+ composed**; a child that completes without every `returns` name set
1367
+ **completes anyway**, and the call answers with the returns it set plus a
1368
+ `note` naming the rest — no second attempt is spent, and the caller decides
1369
+ (a child that *parks* is not checked — it has not finished; a child that
1370
+ raises fails the call `raised`). A typed entry is held to its type at both
1333
1371
  ends: a mistyped argument is refused `invalid-param` before the child runs, and
1334
1372
  a mistyped return fails the call `invalid-return`. What the child must *do* to
1335
1373
  produce a variable belongs in the state `instructions` that set it. The names,
@@ -1344,13 +1382,24 @@ enrich:
1344
1382
  agent records what it needs with `archmax_set_variables`, or a script writes it,
1345
1383
  and the calling state's `requires:` is what makes that mandatory.
1346
1384
  - **Mocks are held to the same contract.** An `archmax_workflow_<slug>` mock for a
1347
- signed target supplies `returns:`, and one that omits a declared name
1348
- (`missing-return`) or supplies a mistyped typed one (`invalid-return`) fails
1349
- the mocked dispatch — a mock stands in for the sub-run, never for its agreement.
1385
+ signed target supplies `returns:`. One that supplies a mistyped typed one
1386
+ (`invalid-return`) fails the mocked dispatch, and one that omits a declared
1387
+ name answers like a real child that left it unset: what it supplied, plus a
1388
+ `note` — a mock stands in for the sub-run, never for its agreement.
1350
1389
  - **No prose crosses the boundary.** A sub-run gets no instruction from its
1351
- caller — it works from its own state `instructions` plus the arguments it was
1352
- seeded with as locked variables, both of which reach the model through the
1353
- system prompt. Nothing to author, nothing to keep in sync.
1390
+ caller — it works from its own state `instructions` (system prompt) plus the
1391
+ arguments it was seeded with as locked variables, whose values its opening
1392
+ message lists: strings JSON-quoted, numbers and booleans as written. A list,
1393
+ an object, `null`, a value rendering past 200 characters, or one past the
1394
+ message's 1,000-character total is only named, with `archmax_get_variables`
1395
+ as the way to read it. Nothing to author, nothing to keep in sync, and nothing
1396
+ in the child's state `instructions` should say "read your inputs first".
1397
+ - **A child goes straight to its work.** Its prompt leaves out the platform
1398
+ prompt's "Name the run first" step (a child's `title` is never returned), so a
1399
+ one-state child with short scalar inputs spends its first model call on the
1400
+ state's work. A workspace overriding the platform prompt
1401
+ (`.platform/system/GRAPH_STATE.md`) keeps that by wrapping what children skip
1402
+ in `<!-- top-level-only -->` … `<!-- /top-level-only -->` lines.
1354
1403
  - **Same agent, isolated context, shared session.** Same model, backend, host
1355
1404
  tools; its **own** grading rubrics, from its own spec; a fresh transcript; the child's *own* per-state
1356
1405
  `tools.allow`. It shares the run's session, so it writes `scratchpad/…` and
@@ -48,7 +48,8 @@ states:
48
48
  requires: # variables a firing must supply (a caller's required params):
49
49
  - order_id # a bare name is untyped (any value, null included)
50
50
  - { name: due, type: date, description: The day it is due. } # typed: held at the boundary
51
- returns: [result_file] # variables the run guarantees on completion (a caller's result)
51
+ returns: [result_file] # variables the run guarantees on completion (a caller's result);
52
+ # short of them: a child returns what it set + a `note`; a top-level run is rejected
52
53
  # entry types: string integer number boolean date date-time object array
53
54
  instructions: >-
54
55
  Record the decision in scratchpad/refund.json, then archmax_advance to
@@ -119,7 +120,8 @@ states:
119
120
  Host seeds (`--variables`, `createAgent({ variables })`, a delivery) are
120
121
  **locked**; the agent uses `archmax_get_variables`/`archmax_set_variables`
121
122
  (`lock: true` to freeze). Reserved: `trigger` (current trigger id, always
122
- locked) and `title` (the run's one-line task label, agent-owned). A
123
+ locked) and `title` (the run's one-line task label, agent-owned; a
124
+ sub-workflow child is not asked for one). A
123
125
  `${{name}}` / `${{a.b.-1.c}}` reference works in `tools.allow` globs
124
126
  (guard) and inside any text tool argument the model writes (exact
125
127
  substitution, no retyping) — but not in scripts, which read
@@ -185,7 +187,16 @@ states:
185
187
  `requires` are the parameters (typed where the entries are typed; a
186
188
  mistyped argument is refused `invalid-param`, and `"${{count}}"` alone
187
189
  passes the value with its own type), its `returns` the result
188
- (`{ message, returns }`; a mistyped typed return fails `invalid-return`).
190
+ (`{ message, returns }`; a child finishing with some unset completes, and
191
+ `returns` holds what it set plus a `note` naming the rest; a mistyped typed
192
+ return fails `invalid-return`). Each failed call is the
193
+ calling state's failure, recorded with its arguments and routed through
194
+ `on_error` when the agent finishes unless a later successful call of the
195
+ same workflow from the same state recovers it first. One success recovers
196
+ one failed call: the one whose arguments it repeats (compared after
197
+ `${{…}}` resolves, key order ignored), else the oldest. A sibling in the
198
+ same batch does not count; another workflow's success recovers nothing;
199
+ the route names every outstanding failure with its arguments.
189
200
  The trigger's `description` leads the tool description. Nothing captures the result — the caller records
190
201
  what it needs with `archmax_set_variables`, made mandatory by `requires`.
191
202
  The child is a separate session with a fresh transcript, sees only its
@@ -239,7 +250,8 @@ no way to see more of the graph.
239
250
  Closed by default; **deny beats allow, and no narrower level widens a denial.**
240
251
 
241
252
  - **Always on, never declared**: `ls`, `read_file`, `write_file`,
242
- `edit_file`, `glob`, `grep`, `write_todos`, `archmax_eval`, `archmax_run`,
253
+ `edit_file`, `copy_file`, `move_file`, `remove_file`, `glob`, `grep`,
254
+ `write_todos`, `archmax_eval`, `archmax_run`,
243
255
  and the controls `archmax_advance`, `archmax_reset`, `archmax_wait`,
244
256
  `archmax_raise`, `archmax_get_variables`, `archmax_set_variables`. Any other
245
257
  tool needs an
@@ -247,8 +259,15 @@ Closed by default; **deny beats allow, and no narrower level widens a denial.**
247
259
  it. `task` is ungrantable (error).
248
260
  - **Entries**: bare name; `{ tool, args: { <arg>: ["glob", …] } }` (matches
249
261
  if any glob matches; `${{var}}` allowed); `{ tool, paths: [...] }`
250
- (shorthand for `args.file_path`). `"*"` as the tool is legal only in a
262
+ (guards every path argument the tool declares — all must match to grant,
263
+ any matching denies). `"*"` as the tool is legal only in a
251
264
  forbid list. Globs match dot-segments (`secrets/**` covers `secrets/.env`).
265
+ - **Path rules read declared path arguments**: `copy_file`/`move_file` take
266
+ `{ source, destination, overwrite? }` (copy reads `source`, move removes it;
267
+ both write `destination`), `remove_file` takes `{ file_path }`. A removal is
268
+ refused wherever a write is; a call naming several paths is refused when any
269
+ one is. An existing destination is refused unless `overwrite: true`.
270
+ `forbid: [{ tool: "*", paths: [secrets/**] }]` blocks a copy in or out.
252
271
  - **Skills** are governed by **slug**, never path. Enabling a bundle makes
253
272
  `skills/<slug>/**` readable and its scripts runnable with no `tools.allow`
254
273
  entry; a disabled bundle is unreachable **and invisible** (not listed, not