@parcha/agentrun-dsl 0.1.0-beta.17 → 0.1.0-beta.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-dsl",
3
- "version": "0.1.0-beta.17",
3
+ "version": "0.1.0-beta.19",
4
4
  "description": "Composable, typed workflows for agents",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -687,6 +687,20 @@
687
687
  "type": "number",
688
688
  "title": "maxConcurrency"
689
689
  },
690
+ "onItemFailure": {
691
+ "description": "What an item's failure does: `stop` (the default) stops the map and the run; `collect` ends the item as a row\nof `failedAs` when its failure is an item failure (`isItemFailure`), and the other items finish.",
692
+ "enum": [
693
+ "collect",
694
+ "stop"
695
+ ],
696
+ "type": "string",
697
+ "title": "onItemFailure"
698
+ },
699
+ "failedAs": {
700
+ "description": "With `onItemFailure: \"collect\"`, the state key the map writes its failed items under, one row each in item order:\n`{ item_index, label, code, message }`. `as` stays aligned with the items, `null` in a failed item's slot.",
701
+ "type": "string",
702
+ "title": "failedAs"
703
+ },
690
704
  "metadata": {
691
705
  "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
692
706
  "type": "object",
@@ -58,6 +58,8 @@ A mandatory category with no valid `unknown` value needs a missing-facts path wh
58
58
  }
59
59
  ```
60
60
 
61
+ A dry run gives a boolean whose schema leaves it open (no `const` or `enum`) the value `false`, so an `escalate` on such a boolean being `false`, like this one, always fires there: the dry run reports `not_run` and names the escalation in `skipped`. The steps after it are not exercised, and that is not a defect to repair.
62
+
61
63
  For Jev nodes, use the bundled [decision design guide](references/jev-decisions.md), also returned by `describe` under `authoring.jev`. No separate TypeSafe skill installation or live documentation access is required to author this DSL. Give each decision the actual material it must judge: a researcher's summary is a claim, not an independent source. Let code perform exact operations and agents do open-ended research; use Jev for focused semantic decisions with complete context.
62
64
 
63
65
  ## Minimal typed example
@@ -25,7 +25,7 @@ This is the complete set. Each kind accepts exactly these fields; any other fiel
25
25
  - `extract`: `label`, `state`, `instructions`, `sopSection`, `out`, `as`, `requires`, `tools`, `effort`, `thinking`, `verify`, `tier`
26
26
  - `report`: `label`, `state`, `instructions`, `sopSection`, `requires`, `tools`, `effort`, `thinking`
27
27
  - `artifact`: `label`, `state`, `type`, `path`, `instructions`, `sopSection`, `requires`, `tools`, `effort`, `thinking`
28
- - `map`: `label`, `itemsPath`, `body`, `as`, `resultPath`, `maxConcurrency`
28
+ - `map`: `label`, `itemsPath`, `body`, `as`, `resultPath`, `maxConcurrency`, `onItemFailure`, `failedAs`
29
29
  - `parallel`: `label`, `branches`
30
30
  - `loop`: `label`, `body`, `until`, `maxIters`, `expect_iters`
31
31
  - `escalate`: `label`, `when`, `kind`, `stage`, `summary`
@@ -51,7 +51,7 @@ Their fields:
51
51
  - `out` names the schema the submission must satisfy; the value lands at `as`.
52
52
  - `requires` lists state paths that must hold evidence before the node runs, each produced upstream: missing values, null, blank strings, empty arrays and empty objects stop the run; `false` and `0` pass.
53
53
  - `tools` names tools the host offers. `[]` means no tools; omitting `tools` offers every tool the host allows. Never name a tool the host did not offer.
54
- - `effort` is minimal|low|medium|high; `thinking` is low|medium|high (never off); `tier` is fast|default|strong. They are requests to the host: resource ceilings are the host's.
54
+ - `effort` is minimal|low|medium|high; `thinking` is low|medium|high (never off); `tier` is fast|default|strong. They are requests to the host: resource ceilings are the host's. A node that names no `thinking` thinks at medium, unless its host sets another level.
55
55
  - An `agent` node may carry `budget_usd`, the most it asks to spend in dollars (above 0), which the host caps by what it has left, and `context`, fresh|fork: `fresh` (the default) sees only its instructions and state; `fork` asks the host to start it from the caller's transcript, which a host refuses where it has none.
56
56
  - `sopSection` names one heading of the host's SOP, or a list of them, as the exact text after "## ". The node receives those sections verbatim.
57
57
  - `verify` reviews a submission before it is accepted: {"out": a question schema with at least one boolean question, "state"?, "maxDrives"?: an integer >= 1 (default 2, no maximum), "override"?: {"below": a number in (0, 1), default 0.3}}. A boolean question named after a submission field doubts that field when its yes-probability is below `override.below`; any other boolean question is a requirement met at 0.5. A rejected submission returns to the same session with the reasons.
@@ -76,7 +76,7 @@ Typed questions answered by the host's judge in one request each: no tools, no s
76
76
  ### Control nodes
77
77
 
78
78
  - `chain`: non-empty `steps`, run in order.
79
- - `map`: `itemsPath` (an upstream list), `body` and `as`. The body sees `item` and `item_index`; `maxConcurrency` is a positive integer (default 4); `resultPath` selects one path from each completed item's state. Without `resultPath`, and with no `as` in the body, each item's result is its whole state, the mapped list included: set `resultPath` (or an `as` in the body) for a large map; the validator warns.
79
+ - `map`: `itemsPath` (an upstream list), `body` and `as`. The body sees `item` and `item_index`; `maxConcurrency` is a positive integer (default 4); `resultPath` selects one path from each completed item's state. Without `resultPath`, and with no `as` in the body, each item's result is its whole state, the mapped list included: set `resultPath` (or an `as` in the body) for a large map; the validator warns. `onItemFailure` is `stop` (default: the first failing item stops the map and the run) or `collect`. With `collect`, an item whose node fails (a call that failed after its retries, an agent that delivered no record, output that does not match its schema, a failed check) ends as {item_index, label, code, message} in the list at `failedAs`, the other items finish, and `as` stays aligned with the items: `as[i]` is item i's result, or `null` when item i failed. Filter the nulls explicitly if only successes are wanted. Gate on `failedAs` with `escalate` or a code node; never let failures pass silently. A crash, a cancel, an `escalate` inside the item or an effect whose outcome is unknown is never collected.
80
80
  - `parallel`: at least two `branches`, each starting from the state before the parallel node. Branches write disjoint keys and never read a sibling's writes.
81
81
  - `loop`: `body`, `until` (a predicate) and an integer `maxIters` of at least 1 (no maximum), optionally an integer `expect_iters` of at least 1 (priced passes). At the bound the state passes through with `until` unmet; follow the loop with an escalate or gate on that condition.
82
82
  - `escalate`: `when` (a predicate), and non-empty `kind`, `stage` and `summary`. When the predicate holds the run stops without output and returns the escalation with its interpolated summary.