@archmax-ai/harness 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -170
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/assembly/compose.js +2 -2
- package/dist/assembly/compose.js.map +1 -1
- package/dist/authoring-skill/archmax-harness/README.md +13 -15
- package/dist/authoring-skill/archmax-harness/SKILL.md +174 -264
- package/dist/authoring-skill/archmax-harness/references/backend-integration.md +244 -776
- package/dist/authoring-skill/archmax-harness/references/cases.md +178 -53
- package/dist/authoring-skill/archmax-harness/references/code-states-and-scripts.md +211 -100
- package/dist/authoring-skill/archmax-harness/references/diagnostics.md +57 -78
- package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +613 -2006
- package/dist/core/deepagents.d.ts +1 -2
- package/dist/core/deepagents.js +1 -2
- package/dist/core/deepagents.js.map +1 -1
- package/dist/kernel/kernel.js +2 -2
- package/dist/kernel/kernel.js.map +1 -1
- package/dist/machine/lint-spec.js +6 -5
- package/dist/machine/lint-spec.js.map +1 -1
- package/dist/machine/machine.d.ts +8 -10
- package/dist/machine/machine.js +11 -12
- package/dist/machine/machine.js.map +1 -1
- package/dist/machine/spec-schema.d.ts +1 -4
- package/dist/machine/spec-schema.js +66 -47
- package/dist/machine/spec-schema.js.map +1 -1
- package/dist/machine/tool-names.d.ts +24 -34
- package/dist/machine/tool-names.js +43 -63
- package/dist/machine/tool-names.js.map +1 -1
- package/dist/machine/types.d.ts +11 -10
- package/dist/machine/types.js.map +1 -1
- package/dist/public/spec.d.ts +5 -5
- package/dist/public/spec.js +5 -5
- package/dist/public/spec.js.map +1 -1
- package/dist/validate/validate.js +3 -3
- package/dist/validate/validate.js.map +1 -1
- package/dist/workflow/automated.js +6 -1
- package/dist/workflow/automated.js.map +1 -1
- package/dist/workflow/control-tools.js +0 -2
- package/dist/workflow/control-tools.js.map +1 -1
- package/dist/workflow/grader-state.d.ts +2 -2
- package/dist/workflow/grader-state.js +5 -15
- package/dist/workflow/grader-state.js.map +1 -1
- package/dist/workflow/middleware.js +2 -26
- package/dist/workflow/middleware.js.map +1 -1
- package/dist/workflow/on-error.js +0 -1
- package/dist/workflow/on-error.js.map +1 -1
- package/dist/workflow/parks.js +0 -1
- package/dist/workflow/parks.js.map +1 -1
- package/dist/workflow/render-prompt.d.ts +4 -5
- package/dist/workflow/render-prompt.js +24 -27
- package/dist/workflow/render-prompt.js.map +1 -1
- package/dist/workflow/state.d.ts +0 -9
- package/dist/workflow/state.js +0 -3
- package/dist/workflow/state.js.map +1 -1
- package/dist/workflow/turn-boundary.js +0 -1
- package/dist/workflow/turn-boundary.js.map +1 -1
- package/package.json +1 -2
- package/skills/archmax-harness/README.md +13 -15
- package/skills/archmax-harness/SKILL.md +174 -264
- package/skills/archmax-harness/references/backend-integration.md +244 -776
- package/skills/archmax-harness/references/cases.md +178 -53
- package/skills/archmax-harness/references/code-states-and-scripts.md +211 -100
- package/skills/archmax-harness/references/diagnostics.md +57 -78
- package/skills/archmax-harness/references/workflow-schema.md +613 -2006
- package/dist/authoring-skill/archmax-harness/references/code-state-and-test-scripts.md +0 -1424
- package/dist/authoring-skill/archmax-harness/references/wiring.md +0 -119
- package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +0 -402
- package/skills/archmax-harness/references/code-state-and-test-scripts.md +0 -1424
- package/skills/archmax-harness/references/wiring.md +0 -119
- package/skills/archmax-harness/references/workflow-yaml.md +0 -402
|
@@ -1,86 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Diagnostics
|
|
2
2
|
|
|
3
|
-
Load this when `validate` or `test` reports something
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Load this when `archmax validate` or `archmax test` reports something the message alone
|
|
4
|
+
does not fix. Every diagnostic names the file and the field. Fix errors first, then
|
|
5
|
+
every warning you can.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## `archmax validate`
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
| Diagnostic says | Fix |
|
|
9
|
+
| The diagnostic says | Fix |
|
|
12
10
|
| --- | --- |
|
|
13
|
-
|
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
| `
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| `
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
| `
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
| state
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
| `
|
|
46
|
-
|
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
|
|
|
50
|
-
| case: missing/over-long `title`/`description`; unknown key; assertion before action; `expect:` block; malformed regex; unknown trigger; `from:` missing | Fix the field named; assertions are steps; regexes are `"/p/f"` strings |
|
|
51
|
-
| `agent cannot read workflows/**` (instructions/evidence/workspace path) | Move the text to a skill bundle or the path to `scratchpad/` |
|
|
52
|
-
|
|
53
|
-
**Removed keys** you may meet (all load errors; details and migrations in
|
|
54
|
-
`references/workflow-schema.md#removed-keys-you-may-meet-in-an-older-workflow`):
|
|
55
|
-
`name:`→`title:`; `description:`→`instructions:`; `policy:`→`forbid_always`;
|
|
56
|
-
root `skills.allow`→`skills.allow_always`; state `type: wait`→`archmax_wait`;
|
|
57
|
-
`type: trigger`→`triggers:` on the entered state; `type: workflow`,
|
|
58
|
-
`workflow:`, `params:`, `for_each:`, `result:`→an agent state allowing
|
|
59
|
-
`archmax_workflow_<slug>` + `requires`; `parallel:`/`join:`→sequenced states;
|
|
60
|
-
transition `on:`→nothing (the resumed state picks its edge); state
|
|
61
|
-
`before:`/`after:` (with `{ script }`, `{ rubric }`, `subagent:`, custom kinds,
|
|
62
|
-
`max_iterations`/`max_corrections`)→code and grader states; root
|
|
63
|
-
`extensions:`→nothing; root `budget: { maxModelCalls }`→nothing (the
|
|
64
|
-
`recursionLimit` bounds a turn); single-file `WORKFLOW.md` with
|
|
65
|
-
frontmatter→`workflow.yaml` + prose.
|
|
11
|
+
| `Unrecognized key: "<k>"` | A typo, or a removed key: see [Removed keys](workflow-schema.md#removed-keys). `metadata` is the one free slot. |
|
|
12
|
+
| `Unrecognized key: "maxTurns"` at `states.<s>.budget` | Delete it. LangGraph's `recursionLimit` bounds a turn; a state's `budget` takes `timeoutMs` and `maxParks`. |
|
|
13
|
+
| `Unrecognized key: "budget"` at the root | Delete it: the `recursionLimit` bounds a turn. |
|
|
14
|
+
| `Unrecognized key: "before"` or `"after"` on a state, `"extensions"` at the root | Rewrite each check as a state: a `before` check as a code state in front of the state, an `after` check as a code state behind it, a rubric as a grader state behind it. Count rounds on the trail instead of `max_iterations`. Move `hooks/*.js` to `scripts/` and rewrite them to the code-state contract. |
|
|
15
|
+
| `Unrecognized key` for root `name`, `description`, `policy` | `title`, `instructions`, `tools.forbid_always`. A root `skills.allow` becomes `skills.allow_always` plus the state lists. |
|
|
16
|
+
| `transitions.<i>.description`: must be a non-empty string here: … | Add the condition under which the transition is taken. Say *when* (`The refund is over $50`), not *where*. The message says why this edge needs one: it is one of several, it leaves a human, grader or code state, it hands the session to one, it loops back, or its state has no `instructions`. Only an agent state's lone edge into another agent state may go without. |
|
|
17
|
+
| `transitions.<i>.description`: must be a string | A number or a list where the description goes: quote it, or remove it from a lone edge between agent states. |
|
|
18
|
+
| workflow slug or state key not kebab-case, or empty | Rename it, and update every `to`, `on_error` and `reachedState`. |
|
|
19
|
+
| transitions to, or `on_error` routes to, an undefined state | Fix the slug, or add the state. |
|
|
20
|
+
| no start state, or several states declare one trigger | Exactly one state declares each trigger id under `triggers:`. |
|
|
21
|
+
| trigger declares an unknown key (warning) | The runtime reads `session`, `message`, `connection`, `description`, `requires` and `returns`; it keeps other keys for the host. |
|
|
22
|
+
| code state declares no `script`, or `script` on another type | Add `script: scripts/<x>.js` to the code state; elsewhere, declare `type: code` or drop the key. |
|
|
23
|
+
| `script` must be a workflow-relative path inside `scripts/` ending in .js or .mjs | Write `scripts/<x>.js`: no `hooks/`, no `skills/…`, no `..`. |
|
|
24
|
+
| code state `<s>` script not found, or imports from `<x>` | Create the file in the workflow's `scripts/`, and import only from `@archmax-ai/harness/*`. |
|
|
25
|
+
| Code state declares `instructions` / `model` / `budget` / `evidence` / `approvers` | Drop it: a code state makes no model call and cannot park. Say what the script does in its JSDoc header and `summary`. |
|
|
26
|
+
| Grader state must declare `instructions` / at least one transition | Write its criteria, and give it a transition onward and one back to the state it grades. |
|
|
27
|
+
| Grader state declares `evidence` / `approvers` / `budget.maxParks` | Drop it: a grader presents nothing to a person and cannot park. |
|
|
28
|
+
| `<type>` state is never offered `write_todos` / `archmax_eval` / `archmax_run` / `archmax_wait` / `archmax_reset` | Drop the entry from the state's `tools.allow`. The same tools in `allow_always` are left out of that state without an error. |
|
|
29
|
+
| Human state must declare instructions or transitions; a transition to itself; two transitions of one type | Add them; point the transition at the state that does the further work; map each labelled type to one target. |
|
|
30
|
+
| `'*'` is not a tool name a grant may use | Move the wildcard into `forbid` or `forbid_always`. |
|
|
31
|
+
| allows `task` | Delete the entry: grade with a grader state, delegate with `archmax_workflow_<slug>`. |
|
|
32
|
+
| allows `archmax_run` on `skills/<x>/…`, which the state does not enable | Add `x` to the state's `skills.allow` (or `allow_always`), or drop the entry. |
|
|
33
|
+
| `tools.forbid_always` denies `archmax_advance` | Remove it: no state could move. |
|
|
34
|
+
| not a skill slug (a path or a glob) | Use the bundle's directory name; narrow paths with a `tools.allow` entry. |
|
|
35
|
+
| `${{…}}` is not a valid variable reference | Write `${{name}}` or `${{name.path}}`. |
|
|
36
|
+
| guards on `${{x}}`, but nothing guarantees it (warning) | Add `x` to an earlier state's or the trigger's `requires`, or seed it. |
|
|
37
|
+
| an allow entry on a path in `scratchpad/` (warning) | Drop it, or govern a path outside the reserved zones. |
|
|
38
|
+
| `tools.allow_always` grants none of the default tools (warning) | A declared list replaces them: list the ones the workflow needs, or remove the key. |
|
|
39
|
+
| a state both allows and forbids, forbids what nothing enables, repeats `allow_always`, or declares `allow: []` (warnings) | Drop the redundant entry. `forbid` is what subtracts. |
|
|
40
|
+
| a state declares the workflow's own `model` (warning) | Drop it, or name a different id. |
|
|
41
|
+
| no top-level `instructions` (warning) | Add the rules that hold for the whole session. |
|
|
42
|
+
| a state has several transitions but no `instructions` (warning) | Say how the agent decides which transition to take. |
|
|
43
|
+
| `maxConcurrency` above 1 | Set it to 1, or remove it. |
|
|
44
|
+
| `WORKFLOW.md` has frontmatter | Strip it: the machine is `workflow.yaml`. |
|
|
45
|
+
| `Unsupported runtime contract 'archmax-harness@1'` (or `@2`) | Rewrite any hooks as states (above), then set `version: "3"` or drop the `runtime` block. |
|
|
46
|
+
| case: missing or too long `title` or `description`, unknown key, assertion before an action, an `expect:` block, malformed regex, unknown trigger, missing `from:` file | Fix the field it names. Assertions are steps; regexes are `"/pattern/flags"` strings. |
|
|
47
|
+
| the agent cannot read `workflows/**` (an `instructions`, `evidence` or case `workspace` path) | Move the text into a skill bundle, or the path under `scratchpad/`. |
|
|
66
48
|
|
|
67
|
-
##
|
|
49
|
+
## A failed session
|
|
68
50
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
`code-result { state, status, durationMs, reason? }`, `grader-start { state }` and
|
|
75
|
-
`grader-result { state, status, durationMs, reason? }`; a failure then shows as
|
|
76
|
-
`state-error-routed` (its `on_error`) or a rejected session.
|
|
51
|
+
The CLI's state flow, on stderr, shows an automated state's run: `› code scripts/<x>.js`
|
|
52
|
+
with each `console.log` line beneath it, `› grader grading`, and `✖ code failed <reason>`
|
|
53
|
+
or `✖ grader failed <reason>`. With `--verbose`, or `onEvent` in a host, the events are
|
|
54
|
+
`code-start`, `code-output`, `code-result`, `grader-start` and `grader-result`. A failure
|
|
55
|
+
then shows as `state-error-routed` (its `on_error`) or as a rejected session.
|
|
77
56
|
|
|
78
|
-
|
|
|
57
|
+
| The reason says | Fix |
|
|
79
58
|
| --- | --- |
|
|
80
|
-
| `code state '<s>' finished without calling archmax_advance or archmax_raise` | Every path through a non-terminal state's script must advance or raise;
|
|
81
|
-
| `grader state '<s>' finished without calling
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `archmax_advance rejected: this state has decided` | A script or grader decided twice
|
|
85
|
-
| a tool refused, or `tools.<x>` is `undefined`,
|
|
86
|
-
|
|
|
59
|
+
| `code state '<s>' finished without calling archmax_advance or archmax_raise` | Every path through a non-terminal state's script must advance or raise; a return value does nothing. |
|
|
60
|
+
| `grader state '<s>' finished without calling archmax_advance or archmax_raise` | The grader answered in text. Say in its `instructions` exactly when to take each transition, and when to raise. |
|
|
61
|
+
| `exceeded its time budget (timeoutMs: N)` | Raise the state's `budget.timeoutMs`, or narrow what it must read. |
|
|
62
|
+
| `cannot advance from '<s>' to '<t>'`, or `cannot leave '<s>' yet: '<v>' …` | The target is not one of the state's transitions, or its `requires` are unmet. Fix the target, or set the variable first. |
|
|
63
|
+
| `archmax_advance rejected: this state has decided` | A script or grader decided twice. Only the first advance or raise counts. |
|
|
64
|
+
| a tool refused, or `tools.<x>` is `undefined`, in a code state | Grant it on the code state itself (`tools.allow`, `skills.allow`, `mounts.allow`). |
|
|
65
|
+
| the session `failed` with `recursion-limit` (`GraphRecursionError`) | The turn passed LangGraph's `recursionLimit` (400 unless the host sets one): states cycle within one turn, automated states advancing to each other or an agent looping. Add a way out, or count rounds on the trail and give up. |
|