@bastani/atomic 0.9.20-alpha.6 → 0.9.20-alpha.8
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/CHANGELOG.md +46 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/package.json +2 -2
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +18 -8
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +27 -0
- package/dist/builtin/workflows/README.md +5 -19
- package/dist/builtin/workflows/builtin/{chunk-deq63d9p.js → chunk-7bzcersz.js} +30 -19
- package/dist/builtin/workflows/builtin/goal.js +1 -1
- package/dist/builtin/workflows/builtin/index.js +1 -1
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +10 -9
- package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +4 -4
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +96 -23
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +75 -27
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +72 -26
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +58 -22
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +118 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +70 -29
- package/dist/builtin/workflows/skills/prompt-engineer/references/core_prompting.md +1 -1
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +95 -32
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +79 -30
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +139 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -4
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +389 -719
- package/dist/builtin/workflows/src/index.js +17 -7
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +3 -1
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +3 -0
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +4 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +6 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-tasks.d.ts +9 -0
- package/dist/core/agent-session-tasks.d.ts.map +1 -1
- package/dist/core/agent-session-tasks.js +68 -16
- package/dist/core/agent-session-tasks.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +9 -21
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +2 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +5 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/execution-model-router.d.ts +14 -0
- package/dist/core/execution-model-router.d.ts.map +1 -1
- package/dist/core/execution-model-router.js +67 -21
- package/dist/core/execution-model-router.js.map +1 -1
- package/dist/core/fast-model-variants.d.ts +26 -0
- package/dist/core/fast-model-variants.d.ts.map +1 -1
- package/dist/core/fast-model-variants.js +40 -1
- package/dist/core/fast-model-variants.js.map +1 -1
- package/dist/core/model-runtime.d.ts +13 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +16 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/sdk-types.d.ts +5 -0
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +4 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/skill-catalog.d.ts.map +1 -1
- package/dist/core/skill-catalog.js +18 -6
- package/dist/core/skill-catalog.js.map +1 -1
- package/dist/core/structured-output/index.d.ts +1 -0
- package/dist/core/structured-output/index.d.ts.map +1 -1
- package/dist/core/structured-output/index.js +34 -26
- package/dist/core/structured-output/index.js.map +1 -1
- package/dist/core/structured-output/jev-client.d.ts +9 -0
- package/dist/core/structured-output/jev-client.d.ts.map +1 -1
- package/dist/core/structured-output/jev-client.js +57 -3
- package/dist/core/structured-output/jev-client.js.map +1 -1
- package/dist/core/structured-output/jev.d.ts.map +1 -1
- package/dist/core/structured-output/jev.js +35 -53
- package/dist/core/structured-output/jev.js.map +1 -1
- package/dist/core/structured-output/resolver.d.ts +32 -24
- package/dist/core/structured-output/resolver.d.ts.map +1 -1
- package/dist/core/structured-output/resolver.js +57 -9
- package/dist/core/structured-output/resolver.js.map +1 -1
- package/dist/core/structured-output/types.d.ts +8 -4
- package/dist/core/structured-output/types.d.ts.map +1 -1
- package/dist/core/structured-output/types.js.map +1 -1
- package/dist/core/tasks/child-command-owner.d.ts +34 -0
- package/dist/core/tasks/child-command-owner.d.ts.map +1 -0
- package/dist/core/tasks/child-command-owner.js +70 -0
- package/dist/core/tasks/child-command-owner.js.map +1 -0
- package/dist/core/tools/bash-pty-native.d.ts +5 -1
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.js +15 -7
- package/dist/core/tools/bash-pty-native.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +15 -13
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/kill.d.ts +2 -2
- package/dist/core/tools/kill.d.ts.map +1 -1
- package/dist/core/tools/kill.js +3 -4
- package/dist/core/tools/kill.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.js +3 -2
- package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
- package/dist/modes/interactive/components/startup-identity.d.ts +3 -0
- package/dist/modes/interactive/components/startup-identity.d.ts.map +1 -1
- package/dist/modes/interactive/components/startup-identity.js +11 -2
- package/dist/modes/interactive/components/startup-identity.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +2 -4
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +2 -0
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive/overlay-line-composite.d.ts +7 -0
- package/dist/modes/interactive/overlay-line-composite.d.ts.map +1 -0
- package/dist/modes/interactive/overlay-line-composite.js +24 -0
- package/dist/modes/interactive/overlay-line-composite.js.map +1 -0
- package/dist/modes/interactive-engine/isolated-auth.d.ts +16 -0
- package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js +27 -0
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +4 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +4 -1
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +7 -2
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +3 -1
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts +2 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +2 -2
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/child-process.d.ts +1 -0
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +7 -8
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +18 -1
- package/dist/utils/shell.js.map +1 -1
- package/docs/background-tasks.md +11 -2
- package/docs/environment-variables.md +1 -1
- package/docs/getting-started/first-session.md +2 -2
- package/docs/llama-cpp.md +2 -2
- package/docs/models/evals.md +47 -43
- package/docs/models/reference.md +1 -1
- package/docs/providers.md +14 -4
- package/docs/reference/cli.md +2 -2
- package/docs/rpc/examples.md +2 -0
- package/docs/sdk/reference.md +1 -1
- package/docs/sdk/structured-decisions.md +20 -14
- package/docs/settings.md +8 -8
- package/docs/skills.md +5 -1
- package/docs/subagents/reference.md +2 -2
- package/docs/subagents.md +1 -1
- package/docs/workflows/api-reference.md +5 -34
- package/docs/workflows/builtins.md +1 -1
- package/docs/workflows/operations.md +11 -77
- package/docs/workflows/reliable-design.md +14 -29
- package/docs/workflows.md +8 -7
- package/examples/rpc-client.ts +38 -0
- package/examples/rpc-extension-ui.ts +19 -5
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +65 -65
- package/package.json +7 -7
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_astra.md +0 -58
package/docs/sdk/reference.md
CHANGED
|
@@ -154,7 +154,7 @@ const builtinsOnly = await ModelRuntime.create({ modelsPath: null });
|
|
|
154
154
|
|
|
155
155
|
### Structured decisions
|
|
156
156
|
|
|
157
|
-
Use `inferStructuredOutput()` with an explicit inference model for a single schema-validated semantic decision without starting an agent session or executing tools. It supports ordinary configured models and the decision-only
|
|
157
|
+
Use `inferStructuredOutput()` with an explicit inference model for a single schema-validated semantic decision without starting an agent session or executing tools. It supports ordinary configured models and the decision-only Jev integrations listed by `getStructuredOutputProviders()` (direct TypeSafe, OpenRouter, Vercel AI Gateway, OpenCode Zen), and never reads `routerModel`. Gateway Jev reuses that gateway's existing authentication. The separate `inferRouterDecision()` entrypoint shares `routerModel` resolution for workflow-stage and subagent `model: "auto"` selection only. Neither API changes the selected chat model or the `structured_output` tool. See [Structured decisions](/sdk/structured-decisions) for state preparation, examples, provider limits and failure handling.
|
|
158
158
|
|
|
159
159
|
### System Prompt
|
|
160
160
|
|
|
@@ -7,13 +7,13 @@ description: Make a schema-validated structured decision without starting an age
|
|
|
7
7
|
|
|
8
8
|
Use `inferStructuredOutput()` from `@bastani/atomic` when an SDK integration needs one semantic decision before it performs an action. It returns a schema-validated value, the requested and responding model identities, and input/output token counts. It does not execute tools, start a session, or authorize an action.
|
|
9
9
|
|
|
10
|
-
`inferStructuredOutput()` takes an explicit inference model and never reads `routerModel`. The `structured_output` tool continues to use its session's model. Neither API changes the selected chat model. [
|
|
10
|
+
`inferStructuredOutput()` takes an explicit inference model and never reads `routerModel`. The `structured_output` tool continues to use its session's model. Neither API changes the selected chat model. [Workflow-stage](/workflows/operations#automatic-stage-models) and [subagent `model: "auto"`](/subagents/reference#automatic-model-selection) selection use the shared router entrypoint below.
|
|
11
11
|
|
|
12
12
|
## Select the inference model
|
|
13
13
|
|
|
14
|
-
For a general structured-output call, pass `model: { kind: "chat", fullId, model }` with a concrete model from the current registry, or `model: { kind: "jev", fullId: "typesafe-ai/jev-latest" }`. For
|
|
14
|
+
For a general structured-output call, pass `model: { kind: "chat", fullId, model }` with a concrete model from the current registry, or `model: { kind: "jev", fullId: "typesafe-ai/jev-latest" }`. For Jev through a gateway, use any `fullId` from `getStructuredOutputProviders()`: `openrouter/~typesafe/jev-latest`, `vercel-ai-gateway/typesafe-ai/jev`, `opencode/jev-1.13`, or `opencode/jev-1.13-free`. Setting `routerModel` or exporting a TypeSafe key does not change this explicit selection.
|
|
15
15
|
|
|
16
|
-
`inferRouterDecision()` is the shared entrypoint for
|
|
16
|
+
`inferRouterDecision()` is the shared entrypoint for automatic subagent/workflow-stage model selection. Only this entrypoint consults `routerModel` in [settings.json](/settings#routermodel). It takes `settings`, `modelRegistry` and the invocation-time `currentModel` instead of an explicit inference `model`. Resolution is:
|
|
17
17
|
|
|
18
18
|
1. A nonempty explicit, exact `routerModel` value.
|
|
19
19
|
2. Otherwise `typesafe-ai/jev-latest` when Jev credentials are configured through `/login typesafe-ai` or `TYPESAFE_API_KEY`.
|
|
@@ -27,13 +27,19 @@ Pass the full `ModelRegistry` to use saved Jev credentials with either decision
|
|
|
27
27
|
|
|
28
28
|
OpenRouter Jev reuses the registry's existing OpenRouter sign-in or saved API key and normal `OPENROUTER_API_KEY` fallback. It never uses TypeSafe credentials. Minimal adapters use `OPENROUTER_API_KEY` for this selection. The Atomic ID includes `openrouter/`; the wire model is only `~typesafe/jev-latest`, sent to `https://openrouter.ai/api/alpha/decisions`. Both Jev selections accept the same Choice questions and return the same structured result. OpenRouter is explicit-only and does not change automatic selection precedence.
|
|
29
29
|
|
|
30
|
+
Vercel AI Gateway (`https://ai-gateway.vercel.sh/typesafe/v1/systemone`, wire model `typesafe-ai/jev`) and OpenCode Zen (`https://opencode.ai/zen/v1/systemone`, wire models `jev-1.13` and `jev-1.13-free`) follow the same rule with `AI_GATEWAY_API_KEY` and `OPENCODE_API_KEY` or that provider's `/login`. Their model IDs, `contextWindow`, and `cost` fields are read from the models.dev decision catalog bundled with `@bastani/pi-ai` (`getDecisionModels()`), so a gateway that drops or renames its Jev listing disappears from `getStructuredOutputProviders()` at the next catalog regeneration. Gateway Jev is explicit-only.
|
|
31
|
+
|
|
30
32
|
### Router repair attempts
|
|
31
33
|
|
|
32
|
-
By default, `inferRouterDecision()` gives each provider an initial attempt plus **up to three corrective retries** when an answer is malformed or fails the decision schema.
|
|
34
|
+
By default, `inferRouterDecision()` gives each provider an initial attempt plus **up to three corrective retries** when an answer is malformed or fails the decision schema. When a chat fallback exists, a failed Jev attempt switches to chat immediately instead of repairing on Jev; the chat fallback then gets at most four attempts, without a structured-decision time limit. A valid answer stops retries immediately; a valid `none` is not retried. Repairs may increase latency and provider usage, but never start a workflow or child before final validation.
|
|
35
|
+
|
|
36
|
+
Separately from output repairs, transient provider failures — connection errors and HTTP 408, 429 and 5xx — are retried up to three times with exponential backoff for both Jev and chat decision requests. Every request honors cancellation; an aborted request is never retried. Both decision APIs accept a `retry` policy (`{ enabled, maxRetries, baseDelayMs }`) to change this; `inferRouterDecision()` also reads `settings.retry` when available.
|
|
37
|
+
|
|
38
|
+
Input/configuration errors, cancellation, and stale-catalog rejection are not repaired. Generic `inferStructuredOutput()` gains the same transient-failure retries but no output repairs or provider fallback.
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
Any Jev failure switches to the current chat model when the invocation has a concrete current chat model — exhausted output repairs, HTTP and connection errors after their transient retries, missing or unresolvable credentials, response-size violations, and local context-budget rejection. This applies to explicit Jev `routerModel` selections as well as automatic ones. Context-budget failures switch before sending an oversized request; HTTP errors such as `max_tokens_exceeded` switch without repeating an unchanged request. A warning reports the safe failure reason and fallback model. The fallback gets its own initial attempt plus three corrective retries, using the original state, schema and constraints. The result includes `fallback: { from, to, reason }` and identifies the chat model in `model`. This can send routing context to your chat provider and incur its normal charges. Cancellation never triggers fallback.
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
For [workflow-stage](/workflows/operations#automatic-stage-models) and [subagent](/subagents/reference#automatic-model-selection) `model: "auto"`, a complete routing-inference failure — Jev and the chat structured-output fallback both — runs the stage or child on the current chat model with a recorded warning instead of failing, provided that model is available and satisfies every routing constraint. If ranking a fallback model fails after the primary was chosen, the primary is kept. Validation, eligibility, credential-screening failures and cancellation still fail as before.
|
|
37
43
|
|
|
38
44
|
## Prepare a decision
|
|
39
45
|
|
|
@@ -100,9 +106,9 @@ For runtime catalogs, build schema, state and Choice candidates from the same sn
|
|
|
100
106
|
|
|
101
107
|
Ordinary models receive one `structured_output` result tool with the supplied schema. Atomic uses provider-aware serialization, requests strict sampling where supported, and validates the returned arguments without coercing values or removing extra fields. Use `additionalProperties: false` for closed objects. Providers without strict sampling must still return valid arguments. `toolChoice: "auto"` also supports models that reject forced tool use. A prose-only response, extra tool call, truncated response or invalid result fails a generic `inferStructuredOutput()` call without a repair prompt; router calls can use the bounded repairs described above.
|
|
102
108
|
|
|
103
|
-
Ordinary requests
|
|
109
|
+
Ordinary requests use HTTP/SSE rather than WebSocket transport fallback, and disable configured Anthropic server-side fallbacks for this request only. Transient-failure retries are owned by the decision layer: each provider request sets `maxRetries: 0`, and custom provider implementations must honor these options and must not introduce their own inference retries or fallback requests.
|
|
104
110
|
|
|
105
|
-
[TypeSafe Jev](/providers#typesafe-jev) accepts shared state and typed questions instead of JSON-schema generation. Atomic packs independent questions together.
|
|
111
|
+
[TypeSafe Jev](/providers#typesafe-jev) accepts shared state and typed questions instead of JSON-schema generation. Atomic packs independent questions together. Both decision APIs retry transient provider failures up to three times; router calls can additionally repair malformed or schema-invalid answers within their attempt allowance. Question IDs are correlation keys, not instructions seen by Jev, so put complete semantics in each question's `instructions`. Describe the speculative premise of a conditional question and consume its answer only when that premise applies.
|
|
106
112
|
|
|
107
113
|
Choices with up to 255 options keep a single comparison when they fit the context budget. Larger or more verbose choices use a bounded tournament: every original option participates in stable batches of at most 255; each batch retains its top three by validated probabilities, with ties resolved by original order. Further shrinking rounds precede a final shared comparison. Probabilities are never compared across batches. Multiple named questions can mix small choices and tournaments; `decode` receives original option keys only after all judgments succeed. Empty choices fail; singletons still go to the provider when they fit.
|
|
108
114
|
|
|
@@ -112,11 +118,11 @@ Overflow requires multiple HTTP requests and can increase latency and billed inp
|
|
|
112
118
|
|
|
113
119
|
Jev documents limits of 32k tokens for state plus the longest question, and 64k for state plus all questions. Without an exact Jev tokenizer, Atomic uses conservative UTF-8 byte budgets of 24,000 and 48,000 respectively, reserving further framing headroom when packing. These checks include compiled instructions and criteria, apply even below 255 options, and may reject inputs the provider would accept.
|
|
114
120
|
|
|
115
|
-
The structured-decision transport never trims supplied state or sends an indivisible comparison that exceeds its local budget.
|
|
121
|
+
The structured-decision transport never trims supplied state or sends an indivisible comparison that exceeds its local budget. Router calls use that state with the current chat model, including for pinned Jev; general structured-output calls fail. A provider `max_tokens_exceeded` response still uses the same routing fallback policy without repeating the rejected request. Supply concise context or select a chat model with enough capacity when needed.
|
|
116
122
|
|
|
117
|
-
Automatic subagent and workflow-stage model selection prepares a [bounded task excerpt](/subagents/reference#automatic-model-selection) before calling this API. That excerpt preserves protected spans and does not replace the execution prompt.
|
|
123
|
+
Automatic subagent and workflow-stage model selection prepares a [bounded task excerpt](/subagents/reference#automatic-model-selection) before calling this API. That excerpt preserves protected spans and does not replace the execution prompt. Direct SDK decision calls do not apply this task-excerpt policy.
|
|
118
124
|
|
|
119
|
-
Jev response bodies are limited to 1 MiB per request. Atomic validates
|
|
125
|
+
Jev response bodies are limited to 1 MiB per request. Atomic validates that every question receives a known Choice option; reported model, usage, probabilities and confidence are advisory and never reject an otherwise valid decision.
|
|
120
126
|
|
|
121
127
|
## Cancellation and failures
|
|
122
128
|
|
|
@@ -126,8 +132,8 @@ The `timeoutMs` request option and `DEFAULT_STRUCTURED_OUTPUT_TIMEOUT_MS` export
|
|
|
126
132
|
|
|
127
133
|
No result is returned for missing state, invalid configuration, unrepaired malformed output or an unrecovered provider failure. Keep action admission after the awaited result and check cancellation again at that boundary. Neither API runs recursive agents or provider probes.
|
|
128
134
|
|
|
129
|
-
Jev errors report the SDK error class, HTTP status, recognized machine error codes such as `max_tokens_exceeded`, and a validated TypeSafe request ID when available. Raw error bodies, arbitrary messages and credentials are not exposed.
|
|
135
|
+
Jev errors report the SDK error class, HTTP status, recognized machine error codes such as `max_tokens_exceeded`, and a validated TypeSafe request ID when available. Raw error bodies, arbitrary messages and credentials are not exposed. Transient HTTP failures are retried up to three times before an error is reported; there is no body logging, including when `TYPESAFE_LOG_LEVEL` is set.
|
|
130
136
|
|
|
131
|
-
For direct Jev, HTTP 401 means check `/login typesafe-ai` or `TYPESAFE_API_KEY`; for OpenRouter Jev, check `/login openrouter` or `OPENROUTER_API_KEY`. HTTP 400 or 422 means check the state/question contract or reported context limit; 403 means access denied, 404 means check the endpoint/model, and 429 or 529 means
|
|
137
|
+
For direct Jev, HTTP 401 means check `/login typesafe-ai` or `TYPESAFE_API_KEY`; for OpenRouter Jev, check `/login openrouter` or `OPENROUTER_API_KEY`. HTTP 400 or 422 means check the state/question contract or reported context limit; 403 means access denied, 404 means check the endpoint/model, and a reported 429 or 529 means the provider stayed rate limited or overloaded through the automatic retries.
|
|
132
138
|
|
|
133
|
-
Malformed Jev response errors include a static diagnostic code, without response values or routing context
|
|
139
|
+
Malformed Jev response errors include a static diagnostic code, without response values or routing context: `choice_key` means an answer named no known Choice option (or was missing), and a non-JSON body reports malformed JSON. Include the code when reporting a failure. Router calls may repair these errors before returning a final failure; generic calls fail immediately. No decision naming an unknown option is accepted.
|
package/docs/settings.md
CHANGED
|
@@ -55,7 +55,7 @@ See [Herdr](/herdr) for state aggregation, reporter conflicts, privacy, and Herd
|
|
|
55
55
|
|---------|------|---------|-------------|
|
|
56
56
|
| `defaultProvider` | string | - | Startup provider, saved automatically when you switch models interactively |
|
|
57
57
|
| `defaultModel` | string | - | Startup model ID, saved automatically when you switch models interactively |
|
|
58
|
-
| `routerModel` | string | `""` | Inference model for
|
|
58
|
+
| `routerModel` | string | `""` | Inference model for workflow-stage and subagent `model: "auto"` selection only. Exact `provider/model`; empty selects Jev when its credentials are configured through `/login` or `TYPESAFE_API_KEY`, otherwise the current chat model. Does not change chat or `structured_output` tool inference. |
|
|
59
59
|
| `defaultThinkingLevel` | string | - | Startup thinking level, saved automatically on interactive model/thinking changes: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"`; clamped to the active model's supported levels |
|
|
60
60
|
| `modelThinkingLevels` | object | - | Per-model startup thinking levels keyed by `"provider/modelId"`; updated automatically on interactive model/thinking changes, or configured from `/settings` → Default thinking level per model |
|
|
61
61
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
|
|
@@ -79,17 +79,17 @@ Normal automatic selection of an available authenticated model remains enabled i
|
|
|
79
79
|
{ "routerModel": "" }
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Use `/settings` → **Router model** to change the effective selection. If the project already defines `routerModel`, the picker edits that project override; otherwise it saves the global default in `~/.atomic/agent/settings.json`. The picker identifies which scope it will save. Choose **Automatic** to save `""` in that scope, **typesafe-ai/jev-latest** for direct Jev, **openrouter/~typesafe/jev-latest** for Jev using your existing OpenRouter login or `OPENROUTER_API_KEY`, or search available chat models by provider/model ID.
|
|
82
|
+
Use `/settings` → **Router model** to change the effective selection. If the project already defines `routerModel`, the picker edits that project override; otherwise it saves the global default in `~/.atomic/agent/settings.json`. The picker identifies which scope it will save. Choose **Automatic** to save `""` in that scope, **typesafe-ai/jev-latest** for direct Jev, **openrouter/~typesafe/jev-latest** for Jev using your existing OpenRouter login or `OPENROUTER_API_KEY`, a Vercel AI Gateway or OpenCode Zen Jev ID (`vercel-ai-gateway/typesafe-ai/jev`, `opencode/jev-1.13`, `opencode/jev-1.13-free`) using that provider's credentials, or search available chat models by provider/model ID. The Jev options are offered here without appearing in `/model`. Run `/reload` or restart Atomic to apply the saved choice to an already-running isolated engine.
|
|
83
83
|
|
|
84
|
-
A nonempty explicit model takes precedence over automatic Jev selection. Use an exact catalog ID without a reasoning suffix, or
|
|
84
|
+
A nonempty explicit model takes precedence over automatic Jev selection. Use an exact catalog ID without a reasoning suffix, or a decision-only ID returned by `getStructuredOutputProviders()`, such as `typesafe-ai/jev-latest`, `openrouter/~typesafe/jev-latest`, `vercel-ai-gateway/typesafe-ai/jev`, or `opencode/jev-1.13`. Replace old `typesafe-ai/jev` settings with `typesafe-ai/jev-latest`. An invalid explicit ID, `auto`, non-string value or surrounding whitespace fails the decision instead of silently changing providers. An explicit empty project value overrides a global selection and restores the configured-direct-Jev/current-chat precedence. OpenRouter, Vercel AI Gateway, and OpenCode Zen credentials alone do not select Jev automatically.
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Any Jev failure — HTTP or connection errors, missing credentials, context-budget rejection, or exhausted structured-output repairs — switches routing to your current chat model, whether Jev was selected automatically or pinned explicitly. Transient failures (connection errors, HTTP 408, 429 and 5xx) are first retried up to three times with backoff, and each provider gets an initial attempt plus three corrective retries for invalid output, using the same context. Routing has no built-in wall-clock deadline; cancel the request to stop waiting. Independent provider, credential-preparation and enclosing tool-request limits still apply. Atomic reports the fallback; it can incur chat-provider charges. Cancellation and local input-validation failures do not trigger fallback.
|
|
87
87
|
|
|
88
|
-
Automatic subagent and workflow-stage model selection uses a bounded excerpt for long tasks, keeping the beginning, end, and `<keepContext>...</keepContext>` spans. Only the router's copy is shortened; execution receives the full task and hard model constraints stay enforced. Put essential model-selection requirements in protected spans. Unprotected middle text may be omitted, so excerpts can affect model choice. This does not truncate
|
|
88
|
+
Automatic subagent and workflow-stage model selection uses a bounded excerpt for long tasks, keeping the beginning, end, and `<keepContext>...</keepContext>` spans. Only the router's copy is shortened; execution receives the full task and hard model constraints stay enforced. Put essential model-selection requirements in protected spans. Unprotected middle text may be omitted, so excerpts can affect model choice. This does not truncate general structured decisions.
|
|
89
89
|
|
|
90
|
-
If protected content or the remaining request still exceeds Jev's conservative context budget,
|
|
90
|
+
If protected content or the remaining request still exceeds Jev's conservative context budget, routing switches to the current chat model, including for a pinned Jev selection. Large candidate sets are split into bounded comparisons without dropping candidates before evaluation.
|
|
91
91
|
|
|
92
|
-
This setting selects
|
|
92
|
+
This setting selects inference for [workflow-stage `model: "auto"`](/workflows/authoring#automatic-stage-model-selection) and [subagent `model: "auto"`](/subagents/reference#automatic-model-selection). It does not directly select the child execution model or change the selected chat model, `structured_output` tool, or general structured-output inference. The selected router provider receives the routing context, so choose a provider permitted to process that data. Authenticate direct Jev with `/login typesafe-ai` or `TYPESAFE_API_KEY`, and gateway Jev (OpenRouter, Vercel AI Gateway, OpenCode Zen) with that gateway's existing credentials. See [Structured decisions](/sdk/structured-decisions) and [TypeSafe Jev](/providers#typesafe-jev).
|
|
93
93
|
|
|
94
94
|
Remove secrets from routing tasks, inputs, and workflow descriptions/contracts before calling the tool. A routing-context credential error stops before inference or launch. Known configured credentials are screened even when they belong to a provider other than the router. Remove the credential from the supplied context or registered definition, reload a changed definition, then retry explicitly. The guard does not detect every possible secret.
|
|
95
95
|
|
|
@@ -208,7 +208,7 @@ Atomic stores only UTC date, version, and an aggregate count, retained as aggreg
|
|
|
208
208
|
|
|
209
209
|
Opt out by setting `enableInstallTelemetry` to `false` in `settings.json`, or by setting `ATOMIC_TELEMETRY=0` (`PI_TELEMETRY=0` remains a legacy alias). `ATOMIC_TELEMETRY=1`/`true`/`yes` forces the ping on even when the setting is false. `ATOMIC_TELEMETRY` wins when both it and `PI_TELEMETRY` are set.
|
|
210
210
|
|
|
211
|
-
Set `ATOMIC_SKIP_VERSION_CHECK=1` to disable the Atomic version update check. Use `--offline` or `ATOMIC_OFFLINE=1` to disable all startup network operations described here, including update checks, package update checks,
|
|
211
|
+
Set `ATOMIC_SKIP_VERSION_CHECK=1` to disable the Atomic version update check. Use `--offline` or `ATOMIC_OFFLINE=1` to disable all startup network operations described here, including update checks, package update checks, install/update telemetry, and model catalog refreshes. Legacy `PI_*` aliases are also supported for app-specific environment variables.
|
|
212
212
|
|
|
213
213
|
On a genuine first run, Atomic previews available themes and asks whether to opt into analytics. The choice and locally generated identifier are stored as `enableAnalytics` and `trackingId`; analytics remains off unless explicitly enabled.
|
|
214
214
|
|
package/docs/skills.md
CHANGED
|
@@ -82,10 +82,14 @@ This is progressive disclosure: only descriptions are always in context, full in
|
|
|
82
82
|
|
|
83
83
|
### Built-in prompt engineering guidance
|
|
84
84
|
|
|
85
|
-
The bundled `/skill:prompt-engineer` creates, optimizes, evaluates, and troubleshoots prompts for GPT and Claude models. Its small routing file points to separate, source-attributed guides for GPT-6 Astra, GPT-5.6, GPT-5.5, Claude Fable 5.1, Claude Fable 5, Claude Opus 5, Claude Opus 4.8, and Claude Sonnet 5. Read the target model's page, or both relevant pages for a migration, without loading every guide. Shared references cover prompt structure, tools, evaluation, and instruction audits; model defaults, effort, verification, and API compatibility stay in their own pages.
|
|
85
|
+
The bundled `/skill:prompt-engineer` creates, optimizes, evaluates, and troubleshoots prompts for GPT and Claude models. Its small routing file points to separate, source-attributed guides for GPT-6 Astra, GPT-5.6, GPT-5.5, Claude Fable 5.1, Claude Fable 5, Claude Opus 5.5, Claude Opus 5, Claude Opus 4.8, and Claude Sonnet 5. Read the target model's page, or both relevant pages for a migration, without loading every guide. Shared references cover prompt structure, tools, evaluation, and instruction audits; model defaults, effort, verification, and API compatibility stay in their own pages.
|
|
86
|
+
|
|
87
|
+
Each model guide pairs an observed behavior with a prompt adjustment, example wording, and caveats. Choose the patterns that address your task instead of copying the whole guide; compatibility notes explain when a prompt also needs provider or application support.
|
|
86
88
|
|
|
87
89
|
Astra guidance distills [OpenAI's model guide](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-6-astra) into completion and permission rules, proportionate verification, useful parallel delegation, concise writing, and API migration checks. An instruction audit based on [Eric Provencher's advice](https://x.com/pvncher/status/2095991462416490862) explains how to shorten skill descriptions, use small routing files with optional references, remove obsolete recipes, and define safe local work and stopping points. It preserves binding repository requirements and separates API features from capabilities actually exposed by the host.
|
|
88
90
|
|
|
91
|
+
Opus 5.5 guidance covers its always-on thinking and medium-effort API default, progress updates returned in thinking blocks, bounded continuations for unattended work, and pasted-content boundaries. Use it when migrating Opus 5 prompts or troubleshooting silent or prematurely stopped tool loops; verify provider and host support before applying API-specific controls.
|
|
92
|
+
|
|
89
93
|
The skill no longer recommends response prefilling, which returns an error on Claude 4.6 and later, or visible chain-of-thought as a primary technique. Use explicit output instructions, schemas, tools, or post-processing instead of prefilling. Request conclusions, citations, commands, and observed results rather than reconstructed private reasoning; such requests can trigger Claude Fable 5's `reasoning_extraction` safeguard and force a model fallback.
|
|
90
94
|
|
|
91
95
|
### Built-in visual explanation guidance
|
|
@@ -39,9 +39,9 @@ Routing has no built-in wall-clock deadline. Slow decisions can finish; cancel t
|
|
|
39
39
|
|
|
40
40
|
The result records a primary `{ model, effort }` and up to two ordered `fallbacks`, each with its own model and effort. Atomic ranks three distinct eligible provider/model IDs, or all available IDs when fewer than three qualify. It selects each rank from the remaining models, excluding all efforts of earlier choices. A supported `"off"` is distinct from `null`, which means no configurable reasoning. The catalog reflects configured authentication, not proof of valid credentials, quota, or entitlement.
|
|
41
41
|
|
|
42
|
-
The child does not start if no candidates are eligible,
|
|
42
|
+
The child does not start if no candidates are eligible, availability changes, or cancellation occurs. Oversized Jev context, a Jev HTTP or connection failure, missing Jev credentials, or exhausted output repairs triggers a reported switch to the current chat model, whether the router was selected automatically or pinned; transient provider failures are retried up to three times first. The chat model gets its own output-repair allowance. If routing inference fails completely — Jev and the chat structured-output fallback both — the child runs on the current chat model instead of failing, with a reported warning, but only when that model is available and satisfies every routing constraint (such as `allowedModels` and effort, cost, context and input limits). Otherwise the launch fails. Invalid inputs, conflicting constraints, cancellation and stale-catalog failures never trigger fallback. No partial decision can launch a child.
|
|
43
43
|
|
|
44
|
-
For large eligible sets, Jev uses tournament requests without a shared decision deadline. Every eligible pair enters a batch of at most 255; three per batch reach the finalist comparison. Verbose choices can split below 255 options to respect context budgets. Each batch contains only its candidate descriptions and repeats the same routing task or excerpt. Tournaments and repairs can increase latency and usage, and grouping can affect the winner. If the task or a comparison still cannot fit,
|
|
44
|
+
For large eligible sets, Jev uses tournament requests without a shared decision deadline. Every eligible pair enters a batch of at most 255; three per batch reach the finalist comparison. Verbose choices can split below 255 options to respect context budgets. Each batch contains only its candidate descriptions and repeats the same routing task or excerpt. Tournaments and repairs can increase latency and usage, and grouping can affect the winner. If the task or a comparison still cannot fit, routing uses the current chat model, including for a pinned Jev selection. See [structured decision limits](/sdk/structured-decisions#provider-behavior-and-limits).
|
|
45
45
|
|
|
46
46
|
Execution tries the ranked models in order before remaining configured fallbacks and the current chat model, subject to normal retry rules and hard constraints. Duplicate model IDs are attempted only at their first position. Each ranked candidate retains its selected effort. Ranking can require up to three selection passes. Metadata preserves the ordered decision separately from the model and effort actually used; workflow checkpoints restore that order without rerouting.
|
|
47
47
|
|
package/docs/subagents.md
CHANGED
|
@@ -270,7 +270,7 @@ subagent({ agent: "worker", task: "Implement the approved fix.", progress: true
|
|
|
270
270
|
|
|
271
271
|
## Delegation and child boundaries
|
|
272
272
|
|
|
273
|
-
Delegation is exactly one level deep and cannot be configured. Children complete their assigned tasks directly; they cannot launch or kill other children. They may inspect definitions and status with `list`, `get`, and `status`; management-restricted children also cannot `create`, `update`, or `delete` definitions.
|
|
273
|
+
Delegation is exactly one level deep and cannot be configured. Children complete their assigned tasks directly; they cannot launch or kill other children. Children can still run background shells. Those shells appear in the parent's `/tasks`: the main chat's, or the current workflow stage's. See [Shells started by subagents](/background-tasks#shells-started-by-subagents). They may inspect definitions and status with `list`, `get`, and `status`; management-restricted children also cannot `create`, `update`, or `delete` definitions.
|
|
274
274
|
|
|
275
275
|
Child prompts omit parent orchestration artifacts and prior subagent control traffic. Tool availability does not grant delegation authority. The parent remains responsible for orchestration.
|
|
276
276
|
|
|
@@ -9,42 +9,15 @@ Use this reference while authoring definitions or integrating the workflow SDK p
|
|
|
9
9
|
|
|
10
10
|
## Model-tool launch contract
|
|
11
11
|
|
|
12
|
-
The model-facing `workflow` tool is distinct from the `workflow(spec)` authoring function below.
|
|
12
|
+
The model-facing `workflow` tool is distinct from the `workflow(spec)` authoring function below. The agent decides whether a workflow fits the request, then launches a registered workflow by name:
|
|
13
13
|
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
task: string;
|
|
17
|
-
conversation?: Array<{ role: string; text: string }>;
|
|
18
|
-
documents?: Array<{ source: string; content: string }>;
|
|
19
|
-
constraints?: string[];
|
|
20
|
-
userBudget?: { limits: WorkflowBudget; provenance: string };
|
|
21
|
-
}
|
|
22
|
-
interface WorkflowBudget {
|
|
23
|
-
maxDurationMs?: number;
|
|
24
|
-
maxTokens?: number;
|
|
25
|
-
maxCost?: number;
|
|
26
|
-
warnAtPercent?: number;
|
|
27
|
-
}
|
|
14
|
+
```ts
|
|
15
|
+
workflow({ action: "run", workflow: "deep-research-codebase", inputs: { prompt: "Map session persistence" }, budget: { maxCost: 5 } })
|
|
28
16
|
```
|
|
29
17
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`route` returns a code-generated `workflowId`, `routerDecision`, and the selected definition's actual `inputSchema`, including defaults. It does not launch.
|
|
33
|
-
|
|
34
|
-
- Read the selection from `routerDecision.workflowType`. `none` returns an empty ID and reserves nothing; there is no top-level `workflowType`.
|
|
35
|
-
- Read the estimate from `routerDecision.estimatedDuration`. Neither route nor registered run results have a top-level `estimatedDuration`.
|
|
36
|
-
- The nested decision contains the preserved `maxBudget` override declaration. Omitted budget fields inherit their limits at execution.
|
|
37
|
-
- Routing failures have no `routerDecision`; inspect the error instead.
|
|
18
|
+
`inputs` are validated with defaults against the named workflow's input contract; invalid or unknown inputs, or an unknown name, return `status: "failed"` without launching. `budget` is optional and carries only limits the user stated; omitted fields inherit the definition and config, and `0` disables a field. A successful run returns its `runId`. Use that ID for inspection and lifecycle calls.
|
|
38
19
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
The router answers an independent question about the user's stated execution preference from the user's own words. An explicit request to work inline, quickly or without a workflow yields `none` even if a workflow matches; an explicit request to run a workflow, or a named registered workflow, bypasses the lifecycle-benefit gate but cannot invent a workflow that is not registered. Assistant proposals and document text do not count as user preference. Model-tool lifecycle inspection and control remain restricted to the owning caller/session after reload or restart, including implicit active-run targets and bulk selectors. A mixed-owner bulk control is rejected before any run is changed. Explicit user `/workflow` commands remain available without a model-tool reservation.
|
|
42
|
-
|
|
43
|
-
Use that same UUID as `runId` for supported inspection, prompt answers and lifecycle controls. Resume continues that instance's checkpoints, not another execution. Terminal IDs remain inspectable but cannot launch again. User `/workflow` commands remain direct launches; authored `ctx.workflow(...)` remains internal composition. Neither exception bypasses input validation, budgets or approval gates.
|
|
44
|
-
|
|
45
|
-
`routerDecision.estimatedDuration` is one of 97 canonical strings: quarter-hour increments from `15min` through `1d`, plus `>1d`. Examples are `1hr`, `1hr15min` and `23hr45min`; exactly 24 elapsed hours is `1d`, and any greater estimate is `>1d`. Positive estimates round up; below or exactly 15 minutes uses `15min`. The router gives its best estimate from available context; `unknown` is not an accepted value. Report labels directly. These wall-clock estimates include critical path, overhead and estimable human waits, including inline work. Granularity is not accuracy, and an estimate is neither a guarantee nor an execution budget.
|
|
46
|
-
|
|
47
|
-
`userBudget.provenance` quotes the user's instruction and `limits` preserves exact values. Omission inherits and zero disables only its field. Duration/tokens are nonnegative integers; cost/warning percentage are nonnegative numbers. Unknown properties are rejected. See [Model-invoked launch routing](/workflows/operations#model-invoked-launch-routing) for provider-independent routing and troubleshooting.
|
|
20
|
+
Runs launched through the model tool belong to the launching session. That ownership survives tool recreation, reload and restart, and inspection or control from another session is rejected, including bulk controls with mixed ownership.
|
|
48
21
|
|
|
49
22
|
## The `workflow()` definition
|
|
50
23
|
|
|
@@ -336,8 +309,6 @@ type WorkflowRunChildArgs<TInputs extends WorkflowInputValues = WorkflowInputVal
|
|
|
336
309
|
|
|
337
310
|
Executes an imported workflow definition behind a tracked parent boundary. The type system requires `inputs` when the child has required inputs, while `stageName` defaults to `workflow:<workflow-name>`.
|
|
338
311
|
|
|
339
|
-
This programmatic composition does not invoke the model-tool launch router and does not require routing `state`.
|
|
340
|
-
|
|
341
312
|
```typescript
|
|
342
313
|
const child = await ctx.workflow(sharedResearch, {
|
|
343
314
|
inputs: { topic: ctx.inputs.topic },
|
|
@@ -58,7 +58,7 @@ List and run it like any other workflow:
|
|
|
58
58
|
|
|
59
59
|
Named workflow runs execute in the background. By default, after launch expect a full run id and monitor it with `/workflow status <run-id>`, F2, or `/workflow connect <run-id>`. A definition with `autoAttach: true` instead opens the graph overlay as soon as an interactive top-level named launch through `/workflow <name>` or the registered `workflow` tool is accepted. This option does not affect headless launches or nested `ctx.workflow(...)` calls, and existing input-form launch behavior is unchanged.
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
For deliberately authored multi-item graphs, see [Task queues and software factories](/workflows/reliable-design#task-queues-and-software-factories). To start a workflow, use `workflow({ action: "run", workflow: "<name>", inputs: {...} })` after inspecting its required inputs with `workflow({ action: "inputs", workflow: "<name>" })`.
|
|
62
62
|
|
|
63
63
|
The below-editor `BACKGROUND` panel shows top-level runs, elapsed time, stage progress, and live tools. A blue `?` marks human-input waits; a single question may show a preview and connect command. Narrow terminals show counts only. Use `/workflow status` or `/workflow connect` for full details, including resumable quit runs that have left the panel. See [panel controls](/workflows/operations#reading-and-scrolling-the-panel).
|
|
64
64
|
|
|
@@ -8,7 +8,7 @@ For stages authored with `model: "auto"`, Atomic ranks up to three distinct elig
|
|
|
8
8
|
|
|
9
9
|
Model selection uses the actual stage prompt, stage name, hard constraints, eligible model catalog, and compact dated evaluation records, not full human guides. Stage system and appended system prompts are not sent to the model router. Put requirements that should influence model selection in the stage prompt; the execution session still receives its configured system prompts.
|
|
10
10
|
|
|
11
|
-
Malformed or schema-invalid routing answers receive up to three corrective retries after the initial attempt, independently for Jev and any current-chat fallback. Model selection has no built-in wall-clock deadline; cancellation and independent provider limits still apply.
|
|
11
|
+
Malformed or schema-invalid routing answers receive up to three corrective retries after the initial attempt, independently for Jev and any current-chat fallback, and transient provider failures (connection errors, HTTP 408, 429 and 5xx) are retried up to three times with backoff. Model selection has no built-in wall-clock deadline; cancellation and independent provider limits still apply. Any Jev failure triggers a reported switch to the current chat model, whether the router was selected automatically or pinned. If routing inference fails completely — Jev and the chat structured-output fallback both — the stage runs on the current chat model instead of failing, with a recorded warning, but only when that model is available and satisfies every routing constraint (such as `allowedModels` and effort, cost, context and input limits). Otherwise the stage fails. An empty eligible catalog, stale decisions, credential-bearing routing context and cancellation still prevent stage execution without fallback. Choose router and chat providers permitted to receive the stage task and reference context.
|
|
12
12
|
|
|
13
13
|
Replay reuses recorded results without routing. Resume of a saved auto stage retains its verified selection and revalidates it against the current catalog and restrictions before fresh session admission, without a hidden new decision. If it is no longer eligible, resume fails rather than choosing another model. See [authoring automatic stages](/workflows/authoring#automatic-stage-model-selection).
|
|
14
14
|
|
|
@@ -101,7 +101,7 @@ workflow({ action: "models" })
|
|
|
101
101
|
The workflow tool action surface is:
|
|
102
102
|
|
|
103
103
|
- discovery: `list`, `get`, `inputs`, plus `models` for the configured model catalog
|
|
104
|
-
- execution: `
|
|
104
|
+
- execution: `run` with the workflow name and validated `inputs`
|
|
105
105
|
- inspection: `status`, `stages`, `stage`, `transcript`
|
|
106
106
|
- prompt response: `answer`; run control: `pause`, `quit`, `resume`; free-form stage communication: ordinary Intercom `send`/live `ask` to `workflow:<rootRunId>/<segment>[/<segment>...]` path targets, including `*` and `**` globs
|
|
107
107
|
- rediscovery: `reload`
|
|
@@ -138,22 +138,14 @@ Named launches wait only for **startup admission**, not for workflow completion.
|
|
|
138
138
|
|
|
139
139
|
A model may launch in the foreground only when the user explicitly requests it or foreground execution is technically required, and it must tell the user before launching.
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
Inspect the workflow's input contract, then launch it by name:
|
|
142
142
|
|
|
143
143
|
```ts
|
|
144
|
-
workflow({
|
|
145
|
-
|
|
146
|
-
state: {
|
|
147
|
-
task: "Map the workflow runtime by subsystem, with parallel research and a synthesis.",
|
|
148
|
-
conversation: [{ role: "user", text: "Read-only research; do not edit files." }],
|
|
149
|
-
documents: [{ source: "Approved research brief", content: "Compare discovery, dispatch, execution and persistence." }],
|
|
150
|
-
},
|
|
151
|
-
})
|
|
152
|
-
// Inspect the returned inputSchema, then use the returned workflowId:
|
|
153
|
-
workflow({ action: "run", workflowId: "returned-execution-id", inputs: { prompt: "map workflow runtime by subsystem" } })
|
|
144
|
+
workflow({ action: "inputs", workflow: "fan-out-and-synthesize" })
|
|
145
|
+
workflow({ action: "run", workflow: "fan-out-and-synthesize", inputs: { prompt: "Map the workflow runtime by subsystem" } })
|
|
154
146
|
```
|
|
155
147
|
|
|
156
|
-
|
|
148
|
+
You can also use the command line with key=value arguments:
|
|
157
149
|
|
|
158
150
|
```text
|
|
159
151
|
/workflow fan-out-and-synthesize prompt="map workflow runtime by subsystem" max_concurrency=4
|
|
@@ -175,66 +167,6 @@ Withdrawing an SDK adapter cancels its current presentation, not the durable app
|
|
|
175
167
|
|
|
176
168
|
Graph node cards show each model stage's effective model and thinking level above its status, including after fallback and durable resume. Long model names are truncated first, preserving the complete thinking level and a canonical `-fast` model suffix. This suffix is model identity, not a separate fast-mode switch or proof of service tier. Thinking `off` is omitted; stages without a model show no model placeholder. Tool nodes retain their `durable tool` body, and the `BACKGROUND` summary is unchanged.
|
|
177
169
|
|
|
178
|
-
## Model-invoked launch routing
|
|
179
|
-
|
|
180
|
-
Call `workflow route` with the actual request, relevant message text/document excerpts, and explicit constraints in `state`, not file paths in place of content. If it returns `none`, continue inline. Otherwise use its input contract to prepare inputs, then call `workflow run` with the registered workflow ID. Ask only for genuinely missing information.
|
|
181
|
-
|
|
182
|
-
`state.task` is the actual request. Optional `conversation` contains attributed `{ role, text }` messages; optional `documents` contains `{ source, content }` excerpts or clearly labeled faithful summaries. Preserve uncertainty and explicit constraints. Empty arrays are valid. Paths/URLs are provenance metadata, not implicit reads. Read authorized sources before routing when needed; if unavailable, state that limitation in the content. Remove secrets before transmission. Document quotations do not become user authorization.
|
|
183
|
-
|
|
184
|
-
Only route performs inference. Run rejects omitted/empty/unknown/foreign/stale IDs and name overrides. It accepts the selected schema's explicit inputs without resending state, rerouting or calling an extraction model. Invalid inputs do not consume a valid reservation. User `/workflow` commands and authored `ctx.workflow(...)` remain direct and internal execution paths respectively, with their existing safety contracts.
|
|
185
|
-
|
|
186
|
-
If the user specified budget limits, preserve exact values in `state.userBudget.limits` and quote the instruction in `provenance`. Omission inherits limits and zero disables only its field. A reservation is permission to attempt validated admission, not blanket approval for side effects.
|
|
187
|
-
|
|
188
|
-
### Choose the inference model
|
|
189
|
-
|
|
190
|
-
Set `routerModel` in [settings.json](/settings#routermodel), not workflow extension config:
|
|
191
|
-
|
|
192
|
-
```json
|
|
193
|
-
{ "routerModel": "" }
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
A nonempty exact concrete `provider/model` selection wins. Choose `openrouter/~typesafe/jev-latest` explicitly to use Jev with your existing OpenRouter login or `OPENROUTER_API_KEY`, without TypeSafe credentials. Otherwise configured direct Jev credentials, saved through `/login typesafe-ai` or supplied by `TYPESAFE_API_KEY`, select `typesafe-ai/jev-latest`; without direct Jev credentials, Atomic uses the current chat model at invocation time. `"auto"`, unknown explicit selections, and malformed settings fail rather than silently selecting another provider. This setting selects only routing inference: it does not change the chat model, workflow stage models, or the `structured_output` tool. Configured credentials do not prove service access.
|
|
197
|
-
|
|
198
|
-
The router has no separate wall-clock deadline. By default, each provider gets an initial attempt plus three corrective retries for malformed or schema-invalid answers. A valid decision stops repairs; a valid `none` is never rerouted. With an empty `routerModel`, oversized Jev context, a Jev HTTP or connection failure, or exhausted output repairs triggers a reported switch to the current chat model, which gets its own repair allowance. Explicit router selections remain pinned. Invalid inputs, cancellation and stale-catalog rejection do not trigger fallback. Neither repairs nor fallback can launch a duplicate workflow. The enclosing workflow-tool request still has its two-minute deadline, and provider limits remain unchanged.
|
|
199
|
-
|
|
200
|
-
Jev asks independent questions about workflow fit, authorization, lifecycle benefit, the user's stated execution preference and duration. Code composes the answers: an explicit user request to work inline yields `none`, an explicit request for a workflow bypasses the lifecycle-benefit gate, and otherwise the fit, authorization and benefit judgments decide. Preference is judged from the user's own words in `state`, never supplied by the calling assistant. Atomic preserves exact user budgets in code rather than asking Jev to choose numbers. Workflow contracts appear only with their candidate, not as a second complete catalog repeated in every batch.
|
|
201
|
-
|
|
202
|
-
Catalogs above 255 choices, or verbose comparisons that exceed the context budget, use tournament requests. Every workflow participates, three candidates survive each batch, and finalists receive a shared comparison. `none` remains available in the final comparison even if eliminated earlier, so overflow never forces a launch.
|
|
203
|
-
|
|
204
|
-
Large catalogs and repairs can increase latency and usage, and grouping can affect selection. State is never trimmed, and no partial decision can launch a workflow. If task context or a comparison cannot fit, automatic routing reports a switch to chat; pinned Jev fails before sending an oversized request. Supply only relevant messages and document excerpts, preserving requirements and uncertainty. See [structured decision limits](/sdk/structured-decisions#provider-behavior-and-limits).
|
|
205
|
-
|
|
206
|
-
### Read the decision
|
|
207
|
-
|
|
208
|
-
Route results appear as structured JSON inside a `WORKFLOW ROUTE` box. They expose `workflowId`, `routerDecision`, and the named selection's actual `inputSchema` with defaults.
|
|
209
|
-
|
|
210
|
-
Read `routerDecision.workflowType` and `routerDecision.estimatedDuration`, not top-level fields. The nested decision also contains the preserved `maxBudget` override declaration; omitted budget fields inherit their limits at execution. Routing failures have no `routerDecision`; inspect the error instead.
|
|
211
|
-
|
|
212
|
-
Reservations are not executing runs and do not appear in run listings. They expire with the owning tool/session and invalidate when the registry or selected schema changes. Route again rather than reusing a stale ID.
|
|
213
|
-
|
|
214
|
-
Admitted instances retain caller/session ownership across tool recreation, reload, and restart. Model-tool inspection and control authorize the resolved target, including implicit active-run targets. Bulk controls reject mixed ownership before changing any run. Explicit user `/workflow` commands retain their direct-access exception.
|
|
215
|
-
|
|
216
|
-
Duration labels are quarter-hour increments from `15min` through `1d`, plus `>1d`. Report the labels directly, for example `1hr15min`. Positive estimates round up, including work under 15 minutes; exactly 24 elapsed hours is `1d`, anything greater is `>1d`. The router gives its best estimate from available context. Wall-clock estimates include overhead, critical path and estimable human waits, including inline work. Granularity does not imply accuracy; estimates are neither guarantees nor execution budgets.
|
|
217
|
-
|
|
218
|
-
| Decision | Result and next step |
|
|
219
|
-
| --- | --- |
|
|
220
|
-
| `workflowType: "none"` | `workflowId: ""`, `status: "not_launched"`. Continue inline; the task has not been completed. |
|
|
221
|
-
| Named selection | `status: "reserved"`, unique `workflowId`, actual `inputSchema`. Prepare inputs, then run that ID. |
|
|
222
|
-
| Missing/invalid run inputs | `status: "needs_input"`, same ID, exact `inputContract` and validation feedback. Correct inputs and retry without rerouting. |
|
|
223
|
-
| Successful run admission | The reserved ID becomes the run ID. Inspect/control that instance; duplicates cannot create another executor. |
|
|
224
|
-
|
|
225
|
-
Keep the same ID for status, inspection, pause/resume, pending-prompt answers and cancellation. Concurrent run/resume requests cannot own two executors. Resume preserves completed checkpoints. A terminal ID supports inspection, not relaunch; a new execution requires a new route. Different IDs may execute independently in parallel.
|
|
226
|
-
|
|
227
|
-
Routing, provider and launch failures remain errors, never `none` or successful execution. If a response is lost, inspect the reserved ID; retrying cannot launch a second instance.
|
|
228
|
-
|
|
229
|
-
`maxBudget` preserves exact explicit user limits, including zero and omitted fields, even when no workflow launches. An empty object means inherit for a selected workflow, not unlimited execution. No workflow budget is installed for inline work, but the user's limits and authorization still apply. Run does not accept top-level budget overrides; route again to change constraints. Estimates never authorize adding or expanding limits.
|
|
230
|
-
|
|
231
|
-
Missing context, invalid output after the repair allowance, unrecovered provider errors, timeout and cancellation are failures, not `none` decisions. They prevent launch and expose no fabricated `routerDecision`. Correct the reported problem and retry explicitly when authorized. Cancellation or a late response cannot start a workflow after the routing attempt ends. The separate two-minute workflow-tool request deadline still covers the whole request, including subsequent startup admission.
|
|
232
|
-
|
|
233
|
-
### Reload and authored workflows
|
|
234
|
-
|
|
235
|
-
Creating a workflow is an ordinary file-authoring operation. After a successful `/workflow reload` or `/reload`, its actual registered name becomes a routing candidate automatically. Removed and renamed workflows disappear; replacements use their new contracts. There is no special authoring category in router output.
|
|
236
|
-
|
|
237
|
-
If a reload changes the registry while a decision is pending, Atomic refuses the stale approval before launch, including a definition replaced under the same name. Inspect the current contract and retry with fresh state; Atomic does not make a second inference automatically. A fatal refresh failure retains the previous catalog and its matching routing choices/context. A workflow registered as `none` collides with the inline sentinel and blocks model-tool routing: rename it and reload. Explicit user `/workflow` commands remain available.
|
|
238
170
|
|
|
239
171
|
## Workflow Commands
|
|
240
172
|
|
|
@@ -644,7 +576,7 @@ Set `failureMode: "return"` when a failed check is expected data for a later rep
|
|
|
644
576
|
|
|
645
577
|
On resume, completed top-level `ctx.tool` nodes retain their graph identity and cached outcomes, including concurrent `Promise.all` fan-out. A `failureMode: "return"` checkpoint, success or `return_failure`, is reused rather than running the callback again. All continuation attempts use the same run identity and checkpoint history.
|
|
646
578
|
|
|
647
|
-
|
|
579
|
+
Resume must match the retained workflow/checkpoint contract; do not change tool names or arguments to replay completed side effects. Inspection-only throwing records are not success checkpoints, so unfinished calls may execute again. Topology mismatches fail closed before unmatched live work is admitted; retained prompt answers and the prior resumable snapshot remain available for a corrected retry. An effect without a saved checkpoint is not guaranteed exactly once.
|
|
648
580
|
|
|
649
581
|
Recoverable output is explicit data flow. Atomic does not add a failed tool outcome to a later stage prompt. The workflow author must place the needed fields in `prompt`, `previous`, an output, or an artifact. Each persisted error text field is best-effort secret-redacted with the workflow persistence rules and limited to 16 KiB of UTF-8; truncated fields keep the final bytes with a marker. Keep the database sensitive even with this filter.
|
|
650
582
|
|
|
@@ -858,15 +790,17 @@ Run `/workflow reload` after adding, editing, renaming, or deleting workflow mod
|
|
|
858
790
|
|
|
859
791
|
Reload is safe while workflows run: existing runs keep their starting definitions and controls, and new launches use the refreshed registry. A fatal refresh failure retains the previous registry. Top-level `/reload` also replaces extensions but preserves live runs in the same process. After a process exit, use explicit resume to replay checkpoints and retry only unfinished work.
|
|
860
792
|
|
|
793
|
+
`/new`, `/fork`, and `/resume` are different: they leave the current session, so they quit running workflows. When any are running, Atomic asks first ("Quit N running workflows and start a new session?"). Confirming quits each run immediately at its last checkpoint; declining, or a confirmation prompt that fails, cancels the command and the runs keep going. Without an interactive UI (RPC, or an extension that switches sessions), the switch proceeds and the runs are quit the same way. Resume a quit run later with `/workflow resume`.
|
|
794
|
+
|
|
861
795
|
The `/workflow` argument-completion popup reads that same live registry. Project, user, package-provided, and built-in workflow names therefore appear immediately after reload both after `/workflow ` and after `/workflow inputs `; restarting Atomic is not required.
|
|
862
796
|
|
|
863
797
|
A successful rescan may still contain per-resource diagnostics. Both reload surfaces show `CONFIG_INVALID`, `IMPORT_FAILED`, `INVALID_DEFINITION`, `PATH_NOT_FOUND`, and duplicate-name diagnostics instead of reporting bare success while silently skipping a resource. Valid sibling workflows remain available. Fix the reported source/path and reload again; no process restart is required.
|
|
864
798
|
|
|
865
799
|
## Run budgets
|
|
866
800
|
|
|
867
|
-
Set an optional `budget` on workflow extension config or an authored definition.
|
|
801
|
+
Set an optional `budget` on workflow extension config or an authored definition. Direct workflow `run` calls use the registered workflow's declared budget and an optional user-provided `budget` override. Approved `resume` calls may supply `budget`. Each field resolves independently: run override, then definition, then config default. Omission inherits; `0` disables only its dimension.
|
|
868
802
|
|
|
869
|
-
Budgets are operator-selected. Never invent a cap or convert an estimate into one.
|
|
803
|
+
Budgets are operator-selected. Never invent a cap or convert an estimate into one. Pass only the fields and values the user requested. Raising an exhausted budget requires approval.
|
|
870
804
|
|
|
871
805
|
```ts
|
|
872
806
|
export default workflow({
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Use this guide to turn an objective into an acyclic, evidence-producing workflow with explicit contracts, context boundaries, verification, and stop conditions. Read [Custom Workflow Authoring](/workflows/authoring) first if you have not built a workflow definition yet.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The agent decides whether a workflow fits. Well-defined, authorized work that benefits from durable stages, checkpoints, dependencies, recovery, review loops or approval gates runs as a workflow; brainstorming, discussion, unclear goals, simple bounded work, or an explicit request to work inline, quickly or without a workflow stays inline. To launch, inspect the input contract with `workflow inputs`, then call `workflow run` with the registered workflow name and inputs. Ask only for genuinely missing information.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Preserve the user's actual words, uncertainty and preferences; do not turn discussion into an implementation objective. User-issued `/workflow` commands launch directly and authored `ctx.workflow(...)` remains internal composition. For workflow authoring, carry the [domain/environment verification and media evidence contract](/workflows/verification) into worker, reviewer and final handoff prompts.
|
|
8
8
|
|
|
9
9
|
## Choosing an Execution Shape
|
|
10
10
|
|
|
11
|
-
The following architecture pass applies only to deliberate definition authoring and composition
|
|
11
|
+
The following architecture pass applies only to deliberate definition authoring and composition. Authoring a definition adds a candidate, not a launch commitment.
|
|
12
12
|
|
|
13
|
-
> **Authored multi-item orchestration:** Enumerate requested implementation items and prove their dependencies. For deliberately composed execution, keep independent items in bounded concurrent top-level runs with explicit worktrees and root failure boundaries; preserve ordered composition only for real code, artifact, contract, decision, approval, or merged-result dependencies.
|
|
13
|
+
> **Authored multi-item orchestration:** Enumerate requested implementation items and prove their dependencies. For deliberately composed execution, keep independent items in bounded concurrent top-level runs with explicit worktrees and root failure boundaries; preserve ordered composition only for real code, artifact, contract, decision, approval, or merged-result dependencies.
|
|
14
14
|
|
|
15
15
|
The shapes, cheapest first:
|
|
16
16
|
|
|
@@ -79,11 +79,11 @@ node | prerequisites | duration range and source | shared resources | evidence n
|
|
|
79
79
|
- Start long CI/check waits when their candidate is ready and overlap independent review, documentation, or handoff preparation that neither mutates that candidate nor needs its check results. Use supported concurrency, keep workflow-owned CI launch/wait/result checks in durable `ctx.tool` nodes with finite timeouts and cancellation, and join required results before acceptance, merge, or publication. Background admission is not check completion.
|
|
80
80
|
- Record the checked commit or artifact identity. Later edits invalidate affected results, so rerun those checks for the new candidate. Never reuse a green check from an older commit as proof for a changed head. Do not alter repository protections, required checks, or concurrency limits to shorten the estimate.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
When you decide to run a workflow, give a brief wall-clock estimate from available project evidence such as CI timings, test history and prior workflow runs. Say which inputs are unknown. An estimate is not measured timing, a guarantee or a `budget` override. Preserve brainstorming and unclear interactive intent instead of inventing an objective or pre-announcing a workflow.
|
|
83
83
|
|
|
84
|
-
Proceed with inherited budget limits without asking the user to choose a budget before each launch; preserve existing budget limits and approval gates. When the user does state a limit, pass only the fields they named
|
|
84
|
+
Proceed with inherited budget limits without asking the user to choose a budget before each launch; preserve existing budget limits and approval gates. When the user does state a limit, pass only the fields they named as the `run` call's `budget`. Omission inherits the workflow declaration and config; zero disables only the specified field. Never convert an estimate into a cap.
|
|
85
85
|
|
|
86
|
-
For example, with hypothetical timings, 6 minutes of implementation followed by independent 12-minute CI and 4-minute read-only review branches, then a 1-minute handoff, has a 19-minute critical path, not a 23-minute sum. Queue delays, repairs, and human approval can extend that. Authored scheduling analysis must cite actual project evidence rather than reuse these illustrative numbers
|
|
86
|
+
For example, with hypothetical timings, 6 minutes of implementation followed by independent 12-minute CI and 4-minute read-only review branches, then a 1-minute handoff, has a 19-minute critical path, not a 23-minute sum. Queue delays, repairs, and human approval can extend that. Authored scheduling analysis must cite actual project evidence rather than reuse these illustrative numbers.
|
|
87
87
|
|
|
88
88
|
Revise the remaining-time estimate at lifecycle updates only when new evidence materially changes the path. Keep the normal heartbeat cadence and end-turn/no-polling rules. At completion, report actual elapsed time against the estimate and identify the main bottleneck to improve the next schedule. These are agent design/reporting instructions, not an automatic scheduler or ETA feature.
|
|
89
89
|
|
|
@@ -291,25 +291,15 @@ export default workflow({
|
|
|
291
291
|
|
|
292
292
|
The workflow binding creates or validates the reusable worktree before `run` starts. The first durable tool then creates or checks out the requested feature branch, so worktree setup's detached checkout never becomes the implementation branch. The item run owns branch setup → implementation → bounded review/repair → deterministic checks → push → PR creation. A failed review or check fails that item before push/PR.
|
|
293
293
|
|
|
294
|
-
|
|
294
|
+
For each item, inspect the workflow's inputs with `workflow({ action: "inputs", workflow: "<name>" })`, then prepare inputs and launch with `workflow({ action: "run", workflow: "<name>", inputs: {...} })`. Item runs are top-level and independent. Admit no third run until one ends to preserve the bound of 2. Explicit user `/workflow` commands remain available for deliberate exact-name launches.
|
|
295
295
|
|
|
296
296
|
```ts
|
|
297
|
-
workflow({ action: "
|
|
298
|
-
task: "Fix cache-key normalization for issue #2101 and create its PR after validation.",
|
|
299
|
-
constraints: ["Use ../atomic-issue-2101 and branch fix/2101-cache-key; at most two concurrent item runs."],
|
|
300
|
-
}})
|
|
301
|
-
// If the returned inputSchema declares these inputs:
|
|
302
|
-
workflow({ action: "run", workflowId: "returned-id-for-2101", inputs: {
|
|
297
|
+
workflow({ action: "run", workflow: "issue-to-pr", inputs: {
|
|
303
298
|
issue: "#2101 fix cache-key normalization",
|
|
304
299
|
git_worktree_dir: "../atomic-issue-2101", base_ref: "origin/main", pr_base: "main",
|
|
305
300
|
branch: "fix/2101-cache-key", checks: [["npm", "run", "test:unit", "--", "test/unit/cache-key.test.ts"]],
|
|
306
301
|
}})
|
|
307
|
-
|
|
308
|
-
workflow({ action: "route", state: {
|
|
309
|
-
task: "Correct CLI help output for issue #2102 and create its PR after validation.",
|
|
310
|
-
constraints: ["Use ../atomic-issue-2102 and branch fix/2102-cli-help; at most two concurrent item runs."],
|
|
311
|
-
}})
|
|
312
|
-
workflow({ action: "run", workflowId: "returned-id-for-2102", inputs: {
|
|
302
|
+
workflow({ action: "run", workflow: "issue-to-pr", inputs: {
|
|
313
303
|
issue: "#2102 correct CLI help output",
|
|
314
304
|
git_worktree_dir: "../atomic-issue-2102", base_ref: "origin/main", pr_base: "main",
|
|
315
305
|
branch: "fix/2102-cli-help", checks: [["npm", "run", "test:unit", "--", "test/unit/cli-help.test.ts"]],
|
|
@@ -342,16 +332,16 @@ The factory self-prompt is: **enumerate → inspect and classify dependencies
|
|
|
342
332
|
|
|
343
333
|
### Prompting the choice
|
|
344
334
|
|
|
345
|
-
Humans can
|
|
335
|
+
Humans can steer the agent's choice or deliberately request definition authoring:
|
|
346
336
|
|
|
347
|
-
- **Name the shape or installed workflow.**
|
|
337
|
+
- **Name the shape or installed workflow.** "Do this quickly", "do this inline", "use subagents to investigate", "run ralph", or "write a custom workflow for this" tell the agent how to run the work. The agent honors them.
|
|
348
338
|
- **State acceptance criteria.** Verbatim criteria make the objective provable and define reviewer and reducer contracts.
|
|
349
339
|
- **State the loop.** "Iterate until tests pass" or "review and fix until approved" defines a hard workflow stop condition.
|
|
350
340
|
- **State the evidence.** A QA video, test output, generated artifact, or reviewer sign-off tells the graph which gates it needs.
|
|
351
341
|
- **State the boundary.** "Work in a separate worktree", "do not create a PR", or "stop after implementation" separates implementation from final actions.
|
|
352
342
|
- **State the queue policy.** Say how to split, order, isolate, and bound queued items; otherwise Atomic runs the [dependency-triage and bounded-dispatch playbook](/workflows/reliable-design#task-queues-and-software-factories) before implementation. Ordinary list order and per-item "create a PR after" wording do not create a cross-item dependency.
|
|
353
343
|
|
|
354
|
-
Absent these controls,
|
|
344
|
+
Absent these controls, the agent decides workflow suitability and selection from the task and the user's words, without fabricating preferences.
|
|
355
345
|
|
|
356
346
|
## The Run Contract
|
|
357
347
|
|
|
@@ -450,12 +440,7 @@ The tags are plain text, so they work anywhere text becomes a stage prompt — y
|
|
|
450
440
|
**Run inputs.** Workflows inject their inputs into stage prompts, so anything you tag in an input is inherited by the stages that receive it:
|
|
451
441
|
|
|
452
442
|
```
|
|
453
|
-
workflow({ action: "
|
|
454
|
-
task: "Research and implement issue #2170. Do not touch the release pipeline.",
|
|
455
|
-
documents: [{ source: "issue #2170", content: issueBody }],
|
|
456
|
-
}})
|
|
457
|
-
// Inspect inputSchema before preparing these inputs:
|
|
458
|
-
workflow({ action: "run", workflowId: "returned-execution-id", inputs: {
|
|
443
|
+
workflow({ action: "run", workflow: "ralph", inputs: {
|
|
459
444
|
prompt: "<keepContext>\nResearch and implement issue #2170. Do not touch the release pipeline.\n</keepContext>\n\n" + issueBody,
|
|
460
445
|
acceptance_criteria: "<keepContext>\n1. ...\n2. ...\n</keepContext>",
|
|
461
446
|
}})
|