@bastani/atomic 0.9.11-alpha.3 → 0.9.11-alpha.5
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 +19 -0
- package/dist/builtin/cursor/package.json +2 -2
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +7 -0
- package/dist/builtin/subagents/README.md +10 -1
- package/dist/builtin/subagents/agents/debugger.md +12 -10
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/subagent/SKILL.md +6 -6
- package/dist/builtin/subagents/src/extension/prompt-guidance.ts +4 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +29 -0
- package/dist/builtin/workflows/README.md +3 -3
- package/dist/builtin/workflows/builtin/goal-artifacts.ts +1 -1
- package/dist/builtin/workflows/builtin/goal-models.ts +33 -29
- package/dist/builtin/workflows/builtin/goal-orchestrator-prompts.ts +133 -0
- package/dist/builtin/workflows/builtin/goal-prompts.ts +23 -58
- package/dist/builtin/workflows/builtin/goal-reducer.ts +1 -1
- package/dist/builtin/workflows/builtin/goal-runner.ts +40 -52
- package/dist/builtin/workflows/builtin/goal.ts +10 -10
- package/dist/builtin/workflows/builtin/ralph-forked-prompts.ts +1 -1
- package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +13 -8
- package/dist/builtin/workflows/builtin/ralph-runner.ts +2 -0
- package/dist/builtin/workflows/builtin/ralph.ts +4 -4
- package/dist/builtin/workflows/builtin/shared-prompts.ts +37 -7
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/authoring/workflow.ts +1 -0
- package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +27 -1
- package/dist/builtin/workflows/src/durable/factory.ts +29 -3
- package/dist/builtin/workflows/src/durable/index.ts +2 -0
- package/dist/builtin/workflows/src/engine/run-durable-admission.ts +50 -0
- package/dist/builtin/workflows/src/engine/run.ts +12 -17
- package/dist/builtin/workflows/src/extension/extension-factory.ts +16 -1
- package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +16 -2
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +71826 -0
- package/dist/builtin/workflows/src/extension/runtime.ts +5 -3
- package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +4 -1
- package/dist/builtin/workflows/src/extension/workflow-prompts.ts +14 -5
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +1 -0
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +1 -0
- package/dist/builtin/workflows/src/shared/types.ts +7 -0
- package/dist/builtin/workflows/src/shared/workflow-authoring-types.d.ts +1 -0
- package/dist/builtin/workflows/src/shared/workflow-authoring-types.ts +1 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +6 -8
- package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +2 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +4 -0
- package/dist/cli/args.d.ts +8 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +16 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/atomic-guide-command.js +3 -3
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -0
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +5 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +7 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +12 -6
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive-engine/engine-monitor.d.ts +8 -1
- package/dist/modes/interactive-engine/engine-monitor.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-monitor.js +13 -15
- package/dist/modes/interactive-engine/engine-monitor.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +3 -0
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts +3 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.js +7 -2
- package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts +1 -0
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +66 -43
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/dist/rpc-entry.js +6 -2
- package/dist/rpc-entry.js.map +1 -1
- package/dist/utils/compile-cache.d.ts +8 -0
- package/dist/utils/compile-cache.d.ts.map +1 -0
- package/dist/utils/compile-cache.js +31 -0
- package/dist/utils/compile-cache.js.map +1 -0
- package/docs/quickstart.md +3 -3
- package/docs/subagents.md +10 -2
- package/docs/tui.md +2 -0
- package/docs/usage.md +16 -0
- package/docs/workflows.md +96 -45
- package/npm-shrinkwrap.json +23 -23
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.11-alpha.5] - 2026-07-23
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Added Orwell's six writing rules from “Politics and the English Language” to the core default system prompt's `Guidelines` section so every standard Atomic session receives them, while removing the bundled workflow guidance's requirement to announce an inline-or-workflow mode before the first tool call.
|
|
10
|
+
|
|
11
|
+
## [0.9.11-alpha.4] - 2026-07-23
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Installed builds now ship the builtin workflows extension as a single prebundled ESM file. Loading it previously resolved and transpiled a ~300-file TypeScript module graph per launch, which dominated interactive-engine startup on Windows (~7 s on a test VM, now ~1.1 s, ~6x faster) ([#1962](https://github.com/bastani-inc/atomic/issues/1962)). Source checkouts still load the raw TypeScript sources.
|
|
16
|
+
- Interactive TUI startup on Windows is dramatically faster: the CLI now enables Node's persistent on-disk V8 compile cache (Node >= 22.8) and flushes it before spawning the isolated interactive engine, so both the host and the engine child reuse compiled module bytecode across runs and within the same launch ([#1962](https://github.com/bastani-inc/atomic/issues/1962)).
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Fixed interactive startup crashing with `Interactive engine did not become ready within 5000 ms` on machines with slow cold starts (commonly Windows PowerShell with npm-global installs). The fixed readiness deadline is removed; the host now waits until the engine reports ready and still fails fast if the engine process exits or the transport breaks ([#1962](https://github.com/bastani-inc/atomic/issues/1962)).
|
|
21
|
+
- Fixed positional prompts beginning with `-`, `--`, or `@` being parsed as options or file arguments by supporting the conventional `--` end-of-options terminator ([#1950](https://github.com/bastani-inc/atomic/issues/1950)).
|
|
22
|
+
- Fixed embedded extension UIs in isolated interactive mode receiving an empty placeholder from `ctx.ui.getFooterDataProvider()`. The engine session now exposes its live extension statuses and cached, watched Git branch so synchronous renderers such as workflow stage chat can match the main footer without RPC calls or per-render Git processes.
|
|
23
|
+
|
|
5
24
|
## [0.9.11-alpha.3] - 2026-07-21
|
|
6
25
|
|
|
7
26
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/cursor",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Experimental first-party Atomic extension for Cursor OAuth, model discovery, and streaming provider registration.",
|
|
6
6
|
"contributors": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@bastani/atomic-natives": "0.9.11-alpha.
|
|
43
|
+
"@bastani/atomic-natives": "0.9.11-alpha.5",
|
|
44
44
|
"@bufbuild/protobuf": "^2.12.1",
|
|
45
45
|
"@earendil-works/pi-ai": "^0.81.1"
|
|
46
46
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
|
|
6
6
|
"contributors": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/mcp",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
|
|
6
6
|
"contributors": [
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.11-alpha.5] - 2026-07-23
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Generalized model-visible subagent orchestration guidance across parent chats and workflow stages. Orchestrators now preserve each agent's declared model and fallback policy by default; agents without a policy use only catalog-available, role-appropriate Pareto recommendations and otherwise remain unpinned. Explicit overrides require an exact user request or documented task need, and every workflow or orchestrator invocation shares one invocation-specific, non-default Intercom group across its delegated children while retaining `contact_supervisor` escalation.
|
|
10
|
+
- Made the builtin debugger write-capable with the same tool list as `worker`, updated its prompt to apply the smallest in-scope code or content fix after proving the root cause, and synchronized the bundled subagent skill with its GPT-5.6 xhigh model, `tdd`/`playwright-cli`/`tmux` skills, and Intercom coordination support.
|
|
11
|
+
|
|
5
12
|
## [0.9.11-alpha.3] - 2026-07-21
|
|
6
13
|
|
|
7
14
|
### Fixed
|
|
@@ -114,12 +114,13 @@ The extension ships with builtin agents you can use immediately.
|
|
|
114
114
|
| `researcher` | Web/docs research with sources: official docs, specs, benchmarks, recent changes, and a concise research brief. |
|
|
115
115
|
| `planner` | A concrete implementation plan from existing context. It should read and plan, not edit code. |
|
|
116
116
|
| `worker` | Implementation work, including approved oracle handoffs. It edits files, validates, and escalates unapproved decisions instead of guessing. |
|
|
117
|
+
| `debugger` | Reproduction, root-cause diagnosis, and the smallest validated fix. It has the same write-capable tool set as `worker`, edits the code or content after diagnosis, and reruns the failing scenario. |
|
|
117
118
|
| `reviewer` | Code review and small fixes. It checks the implementation against the task/plan, tests, edge cases, and simplicity. |
|
|
118
119
|
| `context-builder` | A stronger setup pass before planning: gathers code context and writes handoff material such as `context.md` and `meta-prompt.md`. |
|
|
119
120
|
| `oracle` | A second opinion before acting. It challenges assumptions, catches drift, and recommends the safest next move without editing. |
|
|
120
121
|
| `delegate` | A lightweight general delegate when you want a child agent that behaves close to the parent session. |
|
|
121
122
|
|
|
122
|
-
A simple rule of thumb: use `scout` before you understand the code, `researcher` before you trust external facts, `planner` before a bigger change, `worker` to implement, `reviewer` to check, and `oracle` when the decision itself feels risky.
|
|
123
|
+
A simple rule of thumb: use `scout` before you understand the code, `researcher` before you trust external facts, `planner` before a bigger change, `worker` to implement, `debugger` to diagnose and fix a failure, `reviewer` to check, and `oracle` when the decision itself feels risky.
|
|
123
124
|
|
|
124
125
|
## Changing a builtin agent's model
|
|
125
126
|
|
|
@@ -149,6 +150,14 @@ For a persistent override, edit settings. This example pins the reviewer everywh
|
|
|
149
150
|
|
|
150
151
|
Use `~/.atomic/agent/settings.json` for a user override or `.atomic/settings.json` for a project override; legacy `~/.pi/agent/settings.json` and `.pi/settings.json` paths are also checked for compatibility. The same `agentOverrides` block can change `tools`, `skills`, inherited context, prompt text, or disable a builtin. If you want a totally different agent, create a user or project agent with the same name; for normal tweaks, prefer overrides.
|
|
151
152
|
|
|
153
|
+
### Orchestrator defaults
|
|
154
|
+
|
|
155
|
+
Any parent chat or workflow stage that orchestrates subagents should omit the explicit `model` argument when the named agent already declares a model or fallback policy. Override it only for the user's exact model request or a documented task-specific need, and record the reason before launch; diversity alone does not justify an ad hoc model.
|
|
156
|
+
|
|
157
|
+
When an agent declares no model or fallback policy, consult `packages/coding-agent/docs/models/model-selection.md`, then call `workflow({ action: "models" })` when available. Use only a catalog-returned `fullId` and only a thinking level listed for that entry. If the catalog tool is unavailable, returns no models, or has no recommended model for the role, leave the child unpinned and report the limitation instead of inventing a model or inspecting credentials.
|
|
158
|
+
|
|
159
|
+
Give every workflow or other orchestrator invocation one literal, invocation-specific Intercom group other than `default`, and pass that same group to all delegated children, including parallel and follow-up calls. `contact_supervisor` remains available across group boundaries.
|
|
160
|
+
|
|
152
161
|
## Where running subagents show up
|
|
153
162
|
|
|
154
163
|
Foreground runs stream progress in the conversation while they run.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: debugger
|
|
3
|
-
description: Debug errors, test failures, and unexpected behavior. Use PROACTIVELY when encountering issues, analyzing stack traces, or investigating system problems.
|
|
4
|
-
tools: read, search, find, ls, bash, web_search, fetch_content, get_search_content, intercom, contact_supervisor, todo
|
|
3
|
+
description: Debug and fix errors, test failures, and unexpected behavior. Use PROACTIVELY when encountering issues, analyzing stack traces, or investigating system problems.
|
|
4
|
+
tools: read, edit, write, search, find, ls, bash, web_search, fetch_content, get_search_content, intercom, contact_supervisor, todo
|
|
5
5
|
model: openai-codex/gpt-5.6-sol:xhigh
|
|
6
6
|
fallbackModels: github-copilot/gpt-5.6-sol:xhigh, openai/gpt-5.6-sol:xhigh, anthropic/claude-fable-5:high, kimi-coding/k3:max, moonshotai/kimi-k3:max, moonshotai-cn/kimi-k3:max, openai-codex/gpt-5.5:xhigh, github-copilot/gpt-5.5:xhigh, openai/gpt-5.5:xhigh, github-copilot/claude-opus-4.8 (1m):high, anthropic/claude-opus-4-8:high, cursor/gpt-5.6-sol:xhigh, cursor/gpt-5.5:high, cursor/claude-opus-4-8-thinking:high, xai/grok-4.5:high, cursor/grok-4.5:high, zai/glm-5.2:xhigh, zai-coding-cn/glm-5.2:xhigh, cursor/glm-5.2, openrouter/openai/gpt-5.6-sol:xhigh, openrouter/anthropic/claude-fable-5:high, openrouter/moonshotai/kimi-k3:max, openrouter/sakana/fugu-ultra:high, openrouter/openai/gpt-5.5:xhigh, openrouter/anthropic/claude-opus-4-8:high, openrouter/x-ai/grok-4.5, openrouter/z-ai/glm-5.2:xhigh
|
|
7
7
|
skills: tdd, playwright-cli, tmux
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
You are tasked with debugging
|
|
10
|
+
You are tasked with debugging errors, test failures, and unexpected behavior in the codebase. Your goal is to identify the root cause, use `edit` or `write` to apply the necessary code or content fix, validate the result, and report what you diagnosed and changed.
|
|
11
11
|
|
|
12
12
|
## Available helpers
|
|
13
13
|
|
|
@@ -22,6 +22,7 @@ You are tasked with debugging and identifying errors, test failures, and unexpec
|
|
|
22
22
|
- PREFER `fetch_content <url>` for static content. Only reach for the `playwright-cli` skill when you need JS execution, authentication, or interactive page actions.
|
|
23
23
|
- ALWAYS `tdd` BEFORE creating or modifying any tests.
|
|
24
24
|
- NEVER suppress a failing test to make it pass. Reproduce the failure first; only then fix the underlying defect.
|
|
25
|
+
- AFTER diagnosing the root cause, make the smallest correct fix with `edit` or `write` when the fix is within the assigned scope. Do not stop at a proposed fix or hand the edit to another agent when you can apply it yourself.
|
|
25
26
|
</EXTREMELY_IMPORTANT>
|
|
26
27
|
|
|
27
28
|
## Search Strategy
|
|
@@ -64,11 +65,12 @@ Or, do you prefer I investigate by attempting to run the app or tests to observe
|
|
|
64
65
|
|
|
65
66
|
1b. If the user provides specific error details, proceed with debugging as described below.
|
|
66
67
|
|
|
67
|
-
1. Capture error message and stack trace.
|
|
68
|
+
1. Capture the error message and stack trace.
|
|
68
69
|
2. Identify reproduction steps and reproduce the failure.
|
|
69
|
-
3. Isolate the failure location.
|
|
70
|
-
4.
|
|
71
|
-
5.
|
|
70
|
+
3. Isolate the failure location and prove the root cause.
|
|
71
|
+
4. Apply the smallest correct fix by editing the relevant code or content.
|
|
72
|
+
5. Re-run the failing test or scenario to prove the failure is gone.
|
|
73
|
+
6. Create a detailed debugging report with the diagnosis, changes, and validation evidence.
|
|
72
74
|
|
|
73
75
|
Debugging process:
|
|
74
76
|
|
|
@@ -83,8 +85,8 @@ For each issue, provide:
|
|
|
83
85
|
|
|
84
86
|
- Root cause explanation
|
|
85
87
|
- Evidence supporting the diagnosis
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
+
- Code or content fix applied, with relevant file:line references
|
|
89
|
+
- Validation performed and its outcome
|
|
88
90
|
- Prevention recommendations
|
|
89
91
|
|
|
90
|
-
Focus on
|
|
92
|
+
Focus on fixing the underlying issue, not just documenting symptoms. If a required fix is outside the assigned scope or blocked by missing access, report that limit and the exact next edit instead of claiming success.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/subagents",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and background runs. Fork of: https://github.com/nicobailon/pi-subagents",
|
|
6
6
|
"contributors": [
|
|
@@ -159,7 +159,7 @@ Builtin agents load at the lowest priority. Project agents override user agents,
|
|
|
159
159
|
| `codebase-research-analyzer` | Extract decisions and constraints from prior docs | `openai/gpt-5.5` | low | read, search, find, ls, bash | Read-only. Filters aggressively for what still applies today. |
|
|
160
160
|
| `codebase-online-researcher` | Web research with authoritative sources | `openai/gpt-5.5` | low | read, search, find, ls, bash, write, web_search, fetch_content, get_search_content | Has the `browser` skill. Persists keepers to `research/web/`. |
|
|
161
161
|
| `code-simplifier` | Clean up recently changed code without changing behavior | `openai/gpt-5.5` | low | read, edit, write, search, find, ls, bash | **Writer.** Scopes to recently modified code by default; preserves all observable behavior. |
|
|
162
|
-
| `debugger` | Reproduce, diagnose, and fix failing behavior | `openai/gpt-5.
|
|
162
|
+
| `debugger` | Reproduce, diagnose, and fix failing behavior | `openai-codex/gpt-5.6-sol:xhigh` | xhigh | read, edit, write, search, find, ls, bash, web_search, fetch_content, get_search_content, intercom, contact_supervisor, todo | **Writer.** Has the `tdd`, `playwright-cli`, and `tmux` skills. Can coordinate with the parent; inspect-only mode requires an explicit instruction. |
|
|
163
163
|
|
|
164
164
|
Each builtin declares an explicit `model` and `fallbackModels` chain (typically `github-copilot/<same>`, then `anthropic/claude-opus-4-8`, then `github-copilot/claude-opus-4.7`). The current user-selected model is automatically appended as the last fallback and de-duplicated. Override per run with inline config:
|
|
165
165
|
|
|
@@ -169,7 +169,7 @@ Each builtin declares an explicit `model` and `fallbackModels` chain (typically
|
|
|
169
169
|
|
|
170
170
|
For persistent tweaks, edit `subagents.agentOverrides` in user or project settings. User overrides apply everywhere. Project overrides apply only in that repo and win over user overrides.
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
The builtin `debugger` and `worker` agents declare both `intercom` and `contact_supervisor`, so they can send progress or ask the parent for a decision when the bridge is active. Other builtin specialists finish their pass and return without live coordination. Custom agents can coordinate when they declare `intercom` or when the runtime bridge injects `contact_supervisor`; see [Subagent + Intercom Coordination](#subagent--intercom-coordination).
|
|
173
173
|
|
|
174
174
|
## Prompting specialist subagents
|
|
175
175
|
|
|
@@ -397,7 +397,7 @@ subagent({
|
|
|
397
397
|
})
|
|
398
398
|
```
|
|
399
399
|
|
|
400
|
-
If the run already has an active intercom bridge target, needs-attention notifications can also prepare a compact intercom ping for the orchestrator. When a child route is available, the ping tells the orchestrator which agent needs attention and includes the exact `intercom({ action: "send", to: "..." })` target for a nudge. Do not invent a target or ask the child to self-report when no bridge exists.
|
|
400
|
+
If the run already has an active intercom bridge target, needs-attention notifications can also prepare a compact intercom ping for the orchestrator. When a child route is available, the ping tells the orchestrator which agent needs attention and includes the exact `intercom({ action: "send", to: "..." })` target for a nudge. Do not invent a target or ask the child to self-report when no bridge exists. Coordination depends on the resolved agent's tools and an active bridge route: the builtin `debugger` and `worker` declare `intercom` and `contact_supervisor`, while the other builtin specialists rely on the parent checking status.
|
|
401
401
|
|
|
402
402
|
## Non-Interactive Execution
|
|
403
403
|
|
|
@@ -425,7 +425,7 @@ subagent({
|
|
|
425
425
|
|
|
426
426
|
Atomic subagents work without intercom. When Atomic's bundled intercom companion or upstream `pi-intercom` is installed and enabled, the bridge can give eligible child agents a private coordination tool back to the parent session without connecting either session automatically. If a child may need live coordination, invoke `intercom({ action: "status" })` in the parent before launching it; the child connects when it first invokes `contact_supervisor` or `intercom`.
|
|
427
427
|
|
|
428
|
-
The builtin
|
|
428
|
+
The builtin `debugger` and `worker` agents declare `intercom` and `contact_supervisor`. With an active bridge route, they can send progress or pause to ask the parent for a decision. Other builtin specialists finish their pass and return without live coordination; use a custom agent with bridge tools when another role needs that ability.
|
|
429
429
|
|
|
430
430
|
Custom agents that do have the bridge tool can ask the parent for a decision:
|
|
431
431
|
|
|
@@ -551,7 +551,7 @@ If a prompt-template extension is installed, additional user prompt templates ca
|
|
|
551
551
|
- **Forked runs inherit parent history.** They are branched threads, not fresh filtered contexts. Use fresh context for adversarial review unless the user explicitly asks for forked context.
|
|
552
552
|
- **Default subagent nesting depth is 5.** Deeper recursive delegation is blocked, and configured values above 5 are clamped to the hard ceiling.
|
|
553
553
|
- **Attention signals are not lifecycle state.** `needs_attention` means no activity has been observed past the configured threshold. `paused` means the child turn was intentionally interrupted or is awaiting direction; it is not the same as `failed`.
|
|
554
|
-
- **Builtin
|
|
554
|
+
- **Builtin coordination varies by agent.** `debugger` and `worker` declare `intercom` and `contact_supervisor`; the other builtin specialists do not. For agents without bridge tools, decide the task up front or use a custom agent when mid-run coordination is required.
|
|
555
555
|
- **Intercom asks are blocking.** A session can only maintain one pending outbound ask wait state at a time.
|
|
556
556
|
- **Keep conversational authority clear.** Advisory specialists should not silently become second decision-makers.
|
|
557
557
|
|
|
@@ -586,7 +586,7 @@ Give subagents specific tasks rather than vague mandates.
|
|
|
586
586
|
|
|
587
587
|
### Escalate decisions upward
|
|
588
588
|
|
|
589
|
-
|
|
589
|
+
Most builtin specialists return on completion rather than pausing for parent decisions. The builtin `debugger` and `worker` can use `contact_supervisor` when an active bridge route exists, but resolve known scope, product, and architecture questions before launching any writer. If the parent realizes mid-run that the scope is wrong, steer a reachable writer or soft-interrupt it.
|
|
590
590
|
|
|
591
591
|
### Intervene only on clear control signals
|
|
592
592
|
|
|
@@ -4,6 +4,9 @@ export const DEFAULT_PROMPT_GUIDANCE: string[] = [
|
|
|
4
4
|
- Use a single subagent for a focused specialty, a chain for a bounded sequential handoff, or parallel tasks for independent work. Keep substantial-overlap tasks together rather than duplicating investigation across agents.
|
|
5
5
|
- Delegate noisy or context-heavy command investigation when isolation helps, but run concise commands inline when that is simpler.
|
|
6
6
|
- Use async/background execution when delegated work is genuinely long-running or independently useful. Foreground execution is appropriate when the parent needs the result before proceeding; do not duplicate a delegated job while waiting.
|
|
7
|
-
- Use the debugger subagent for actual failures that need reproduction, root-cause diagnosis, and a validated fix; additional debugger or research delegates are optional when they add a distinct useful angle
|
|
7
|
+
- Use the debugger subagent for actual failures that need reproduction, root-cause diagnosis, and a validated fix; additional debugger or research delegates are optional when they add a distinct useful angle.
|
|
8
|
+
- Let each named agent use its declared model and fallback policy: omit the explicit model argument unless the user requests an exact model or a documented task requirement needs one, and record the reason for any override before launch. Do not choose an ad hoc model merely for diversity.
|
|
9
|
+
- If an agent has no declared model or fallback policy, consult packages/coding-agent/docs/models/model-selection.md for the role's Pareto-efficient recommendations, then use workflow({ action: "models" }) when available to inspect the configured catalog. Pin only a returned fullId and only append a thinking level listed for that entry. If the catalog tool is unavailable, the catalog is empty, or no recommended model is present, leave the child unpinned and state the limitation rather than inventing a model. Do not inspect credentials or infer why a model is absent.
|
|
10
|
+
- For each workflow or orchestrator invocation that delegates subagents, create one invocation-scoped literal Intercom group that is not default and pass that same group to every child, including parallel and follow-up work. Keep contact_supervisor available for cross-group escalation.`,
|
|
8
11
|
];
|
|
9
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
|
|
6
6
|
"contributors": [
|
|
@@ -6,6 +6,35 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.9.11-alpha.5] - 2026-07-23
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Strengthened the existing Goal and Ralph reviewer prompts with a conditional contract-probe playbook for exact external-consumer APIs, build/feature matrices, schema optionality, state transitions, configuration precedence, low-level feature-flag independence, and permissive inputs. Reviewers now record independent probe outcomes in existing evidence fields and withhold approval when a material literal clause remains unverified, without changing reviewer counts, schemas, or convergence semantics. ([#1973](https://github.com/bastani-inc/atomic/issues/1973))
|
|
14
|
+
- Strengthened model-visible workflow routing guidance with a pre-launch requirement/risk/evidence coverage pass, a one-launch composition commitment, concrete graph-selection signals, and bounded skeptical-reviewer loops whose model-selected probes are executed authoritatively through durable `ctx.tool(...)` verifier gates rather than model self-report ([#1974](https://github.com/bastani-inc/atomic/issues/1974)).
|
|
15
|
+
- Changed the builtin Goal execution stage from a direct worker into a Ralph-style sub-agent orchestrator. Goal now runs `orchestrator-N` stages that track and delegate implementation, validation, documentation, and follow-up repairs through the `subagent` tool; writes `orchestrator-receipt.md`; forks later turns from the prior orchestrator session; and uses a locally contained copy of Ralph's exact xhigh orchestrator model and fallback chain while retaining Goal's ledger, reviewer, reducer, and optional final PR flow.
|
|
16
|
+
- Reordered Goal's reviewer fallbacks so GPT-5.6 is tried before Kimi K3 within both the leading direct-provider group and the OpenRouter group, while retaining Claude Fable 5 as primary and preserving each group's position in the full chain.
|
|
17
|
+
|
|
18
|
+
## [0.9.11-alpha.4] - 2026-07-23
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Added the opt-in `autoAttach` workflow-definition field, which opens the graph overlay when an interactive top-level named workflow is launched through `/workflow <name>` or the registered `workflow` tool without changing headless launches, nested workflow composition, or the existing input-form launch path.
|
|
23
|
+
- `WorkflowRunContext` now optionally exposes the host session's model catalog as `ctx.models` (including `currentModel`, the user-selected session model, and `listModels()`). Custom workflow definitions can use it to select stage models from the live catalog; the field is absent when the host provides no catalog, and builtin workflow model chains are unchanged.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Workflow prompt guidance now instructs agents to give each workflow invocation its own intercom group by default — unless the user requests otherwise — by minting one invocation-scoped literal group name inside the workflow's `run` function (e.g. `"myflow-" + randomUUID()`) and passing it via the `group` option on each stage, task, or parallel step that should share it; `group: true`/`"auto"` mints one shared UUID group per `ctx.parallel(...)` set but a fresh UUID per non-parallel stage. This keeps stage and subagent intercom chatter isolated from the parent chat and other concurrent runs, since ungrouped sessions all share the `"default"` group; subagent inheritance, capability gating, and cross-group `contact_supervisor` escalation are unchanged.
|
|
28
|
+
- Attached workflow stage chats now match the main interactive footer by showing the home-shortened current folder with its cached, live-updating Git branch and by mirroring current extension status lines such as MCP connectivity, using the workflow chat theme without replacing the existing hierarchy and copy-mode hints.
|
|
29
|
+
- The builtin `goal` and `ralph` workflow descriptions and their `objective`/`prompt`/`create_pr` input descriptions now instruct launching agents that when a delegated task includes submitting a pull request (or MR/review), that final action must be stripped from the objective/prompt text and requested via `create_pr=true` instead when preparing the workflow inputs. This keeps PR creation an explicitly authorized final-stage action rather than embedded task text that intermediate stages are told to ignore.
|
|
30
|
+
- Goal worker and Ralph orchestrator prompts now carry an explicit worktree-discipline contract: all work happens in the invoking checkout (or the run's explicitly configured worktree), stages never create additional git worktrees, clones, or repository copies unless the user's task explicitly requests them, and work discovered stranded outside the invoking checkout must be brought back in before continuing. The `git_worktree_dir` input descriptions state the same rule for launching agents.
|
|
31
|
+
- Goal and Ralph reviewer prompts now include a code-delta presence and integrity contract: before trusting receipts or stage summaries, reviewers must prove the code delta actually exists in the review checkout using the repository's version-control tooling (for git: `git worktree list`, `git status`, and a baseline diff), treat claimed-but-absent work as a blocking finding instead of approving over an empty or unrelated delta, treat uncommitted work at claimed readiness as remaining work unless the objective forbids committing, and flag any modification, rename, or deletion of pre-existing test files or test functions as a finding requiring explicit justification.
|
|
32
|
+
- Goal worker prompts now require committing work in the current checkout with a descriptive message before claiming readiness for review — verifying a clean working tree with the repository's version-control status command and reporting the commit identifier in the receipt — unless the objective or acceptance criteria explicitly forbid committing. Delivery verification stays with reviewers and prompts (version-control-agnostic) rather than a hardcoded git gate in the runner.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Fixed host-session replacement (`/new`, `/resume`, `/fork`, `/reload`) leaving the process-global DBOS executor stopped so every subsequent workflow run in the same Atomic process failed at its first durable checkpoint with `` `DBOS.launch()` must be called before running workflows ``. The DBOS executor lifetime is now process-scoped: process-preserving session boundaries flush pending durable writes but keep the executor launched, and SDK shutdown is reserved for actual process exit (`quit`/`beforeExit`), which still flushes and shuts down exactly once. Defense in depth: the durable-backend factory revalidates its memoized backend against the current DBOS lifecycle generation and never hands out a stopped backend (post-shutdown initialization fails loudly instead of silently degrading to a non-durable backend), the extension runtime no longer caches a permanently resolved readiness promise across lifecycle generations, and root workflow registration is durably flushed before startup admission so a stopped or unhealthy backend fails before workflow code executes any side effects. ([#1957](https://github.com/bastani-inc/atomic/issues/1957))
|
|
37
|
+
|
|
9
38
|
## [0.9.11-alpha.2] - 2026-07-21
|
|
10
39
|
|
|
11
40
|
### Fixed
|
|
@@ -712,7 +712,7 @@ Child workflow outputs: `result`, `findings`, `research_doc_path`, `artifact_dir
|
|
|
712
712
|
|
|
713
713
|
### `goal`
|
|
714
714
|
|
|
715
|
-
Goal Runner workflow: initialize a persisted goal ledger with a per-run goal id, immutable `acceptance_criteria`, and lifecycle events
|
|
715
|
+
Goal Runner workflow: initialize a persisted goal ledger with a per-run goal id, immutable `acceptance_criteria`, and lifecycle events; then run bounded `orchestrator-N` turns, append receipts, run three independent reviewers with objective-alignment findings and clause-by-clause requirements traceability, and let a TypeScript reducer decide `complete`, `continue`, `blocked`, or `needs_human`. The orchestrator is a supervisor rather than the direct implementer: it uses the `subagent` tool as its primary implementation path, tracks delegated work with todos, coordinates focused agents for investigation, edits, tests, docs, and follow-up repairs, and writes `orchestrator-receipt.md`. Goal keeps this orchestrator model configuration local while copying Ralph's exact xhigh orchestrator model and fallback chain. Each review round's findings are consolidated into a deduplicated `consolidated_findings` batch that the next orchestrator turn delegates as a whole, with durable regression evidence required for reproduced findings. All three reviewers start in clean, non-forked contexts like Ralph's reviewers. Goal's independent reviewer chain remains led by Claude Fable 5 and places GPT-5.6 ahead of Kimi K3 within both the leading direct-provider group and the OpenRouter group while preserving each group's position in the full chain. Reviewers coordinate expensive or conflicting checks through Intercom while still inspecting the patch and returning verdicts independently. Goal skips PR creation by default; prompt text alone does not opt in. Pass `create_pr=true` to authorize only the final `pull-request` stage to attempt a provider-appropriate PR/MR/review handoff after Goal reaches `complete` within the turn budget.
|
|
716
716
|
|
|
717
717
|
Resource release is itself a coordinated update: after releasing a claim, the reviewer explicitly notifies its siblings through Intercom rather than treating release as a silent local action.
|
|
718
718
|
|
|
@@ -725,11 +725,11 @@ Resource release is itself a coordinated update: after releasing a claim, the re
|
|
|
725
725
|
| ------------- | -------- | -------- | ------------- | ------------------------------------------------------------- |
|
|
726
726
|
| `objective` | `text` | ✓ | — | Goal-runner objective or delta. |
|
|
727
727
|
| `acceptance_criteria` | `text` | — | objective | Original immutable task contract; pass the original task text when launching follow-up Goal runs from reviewer findings. |
|
|
728
|
-
| `max_turns` | `number` | — | `10` | Maximum
|
|
728
|
+
| `max_turns` | `number` | — | `10` | Maximum orchestrator/review turns before human follow-up is needed. |
|
|
729
729
|
| `base_branch` | `string` | — | `origin/main` | Branch reviewers and the optional final stage compare the current delta with. |
|
|
730
730
|
| `create_pr` | `boolean` | — | `false` | Safe-by-default PR creation flag. Omitted or `false` skips the final `pull-request` stage and omits `pr_report`; prompt text alone does not opt in, and only strict `true` authorizes the final `pull-request` stage to attempt provider-appropriate PR/MR/review creation after Goal reaches `complete`. |
|
|
731
731
|
|
|
732
|
-
`goal` defaults to 10
|
|
732
|
+
`goal` defaults to 10 orchestrator/review turns. Reviewer quorum is fixed internally at 2 reviewer `complete` votes, and approval is deterministic on each reviewer's self-reported `stop_review_loop` boolean: a reviewer approves exactly when it returns `stop_review_loop=true` with no `reviewer_error` (parse failures count as non-approval), and the reducer completes the run when quorum of those booleans is met. Findings and `requirements_traceability` remain required audit evidence and drive the reviewer prompts that derive the flag (`required_by_objective` findings mean `false` at any priority, P3 included; `consistent_with_objective` P3 nice-to-haves, out-of-scope observations, the quorum process itself, and the authorized post-approval PR final action must not hold the flag at `false`), but the harness does not recompute approval from those arrays. Without quorum, the decision reason records the reviewers' remaining work, and the bounded loop stops inspectably at `max_turns` as `needs_human`. The repeated-blocker threshold defaults to 3 consecutive same-blocker turns and is clamped to `max_turns` when you run fewer than 3 turns.
|
|
733
733
|
|
|
734
734
|
Child workflow outputs: `result`, `status`, `approved`, `goal_id`, `objective`, `acceptance_criteria`, `ledger_path`, `turns_completed`, `iterations_completed`, `receipts`, `remaining_work`, `review_report`, and `review_report_path`. `pr_report` is included only when `create_pr=true`, Goal reaches `complete`, and the final `pull-request` stage runs.
|
|
735
735
|
|
|
@@ -45,7 +45,7 @@ export async function writeReviewRoundArtifact(
|
|
|
45
45
|
): Promise<string> {
|
|
46
46
|
const artifactPath = join(artifactDir, "review-round-latest.json");
|
|
47
47
|
const visibleReviews = reviews.map(withoutTurn);
|
|
48
|
-
// Deduplicated cross-reviewer findings batch so the next
|
|
48
|
+
// Deduplicated cross-reviewer findings batch so the next orchestrator turn can
|
|
49
49
|
// plan and repair the round's findings together instead of one at a time.
|
|
50
50
|
const consolidatedFindings = consolidateFindingsBatch(
|
|
51
51
|
reviews.map((review) => ({
|
|
@@ -1,49 +1,53 @@
|
|
|
1
1
|
import { reviewDecisionSchema } from "./goal-schemas.js";
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
export const
|
|
6
|
-
model: "openai-codex/gpt-5.6-sol:
|
|
3
|
+
// Keep this model list identical to Ralph's orchestrator while preserving a
|
|
4
|
+
// locally contained Goal configuration.
|
|
5
|
+
export const orchestratorModelConfig = {
|
|
6
|
+
model: "openai-codex/gpt-5.6-sol:xhigh",
|
|
7
7
|
fallbackModels: [
|
|
8
|
-
"github-copilot/gpt-5.6-sol:
|
|
9
|
-
"openai/gpt-5.6-sol:
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"anthropic/claude-fable-5:
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"cursor/
|
|
8
|
+
"github-copilot/gpt-5.6-sol:xhigh",
|
|
9
|
+
"openai/gpt-5.6-sol:xhigh",
|
|
10
|
+
"kimi-coding/k3:max",
|
|
11
|
+
"moonshotai/kimi-k3:max",
|
|
12
|
+
"moonshotai-cn/kimi-k3:max",
|
|
13
|
+
"anthropic/claude-fable-5:high",
|
|
14
|
+
"openai-codex/gpt-5.5:xhigh",
|
|
15
|
+
"github-copilot/gpt-5.5:xhigh",
|
|
16
|
+
"openai/gpt-5.5:xhigh",
|
|
17
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
18
|
+
"anthropic/claude-opus-4-8:high",
|
|
19
|
+
"cursor/gpt-5.6-sol:xhigh",
|
|
20
|
+
"cursor/claude-fable-5:high",
|
|
21
|
+
"cursor/gpt-5.5:high",
|
|
22
|
+
"cursor/claude-opus-4-8-thinking:high",
|
|
20
23
|
"xai/grok-4.5:high",
|
|
21
24
|
"cursor/grok-4.5:high",
|
|
22
|
-
"zai/glm-5.2:
|
|
23
|
-
"zai-coding-cn/glm-5.2:
|
|
25
|
+
"zai/glm-5.2:xhigh",
|
|
26
|
+
"zai-coding-cn/glm-5.2:xhigh",
|
|
24
27
|
"cursor/glm-5.2",
|
|
25
|
-
"openrouter/openai/gpt-5.6-sol:
|
|
26
|
-
"openrouter/
|
|
27
|
-
"openrouter/anthropic/claude-fable-5:
|
|
28
|
-
"openrouter/
|
|
28
|
+
"openrouter/openai/gpt-5.6-sol:xhigh",
|
|
29
|
+
"openrouter/moonshotai/kimi-k3:max",
|
|
30
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
31
|
+
"openrouter/sakana/fugu-ultra:high",
|
|
32
|
+
"openrouter/openai/gpt-5.5:xhigh",
|
|
33
|
+
"openrouter/anthropic/claude-opus-4-8:high",
|
|
29
34
|
"openrouter/x-ai/grok-4.5",
|
|
30
35
|
"openrouter/z-ai/glm-5.2:xhigh"
|
|
31
36
|
],
|
|
32
37
|
excludedTools: ["ask_user_question"],
|
|
33
38
|
};
|
|
34
39
|
|
|
35
|
-
// Keep
|
|
36
|
-
//
|
|
37
|
-
// Reviewer-a leads its fallbacks with Kimi K3 so reviewer A and B decorrelate.
|
|
40
|
+
// Keep Goal's reviewer configuration independent so GPT-5.6 precedes Kimi K3
|
|
41
|
+
// within both the leading direct-provider group and the OpenRouter group.
|
|
38
42
|
export const reviewerModelConfig = {
|
|
39
43
|
model: "anthropic/claude-fable-5:high",
|
|
40
44
|
fallbackModels: [
|
|
41
|
-
"kimi-coding/k3:max",
|
|
42
|
-
"moonshotai/kimi-k3:max",
|
|
43
|
-
"moonshotai-cn/kimi-k3:max",
|
|
44
45
|
"openai-codex/gpt-5.6-sol:xhigh",
|
|
45
46
|
"github-copilot/gpt-5.6-sol:xhigh",
|
|
46
47
|
"openai/gpt-5.6-sol:xhigh",
|
|
48
|
+
"kimi-coding/k3:max",
|
|
49
|
+
"moonshotai/kimi-k3:max",
|
|
50
|
+
"moonshotai-cn/kimi-k3:max",
|
|
47
51
|
"openai-codex/gpt-5.5:xhigh",
|
|
48
52
|
"github-copilot/gpt-5.5:xhigh",
|
|
49
53
|
"openai/gpt-5.5:xhigh",
|
|
@@ -59,8 +63,8 @@ export const reviewerModelConfig = {
|
|
|
59
63
|
"zai-coding-cn/glm-5.2:xhigh",
|
|
60
64
|
"cursor/glm-5.2",
|
|
61
65
|
"openrouter/anthropic/claude-fable-5:high",
|
|
62
|
-
"openrouter/moonshotai/kimi-k3:max",
|
|
63
66
|
"openrouter/openai/gpt-5.6-sol:xhigh",
|
|
67
|
+
"openrouter/moonshotai/kimi-k3:max",
|
|
64
68
|
"openrouter/sakana/fugu-ultra:high",
|
|
65
69
|
"openrouter/openai/gpt-5.5:xhigh",
|
|
66
70
|
"openrouter/anthropic/claude-opus-4-8:high",
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { GoalLedger } from "./goal-types.js";
|
|
2
|
+
import {
|
|
3
|
+
renderGoalContinuationPrompt,
|
|
4
|
+
renderLatestReviewArtifacts,
|
|
5
|
+
renderReceiptHistory,
|
|
6
|
+
taggedPrompt,
|
|
7
|
+
} from "./goal-prompts.js";
|
|
8
|
+
import { WORKER_PREFLIGHT_CONTRACT } from "./shared-prompts.js";
|
|
9
|
+
|
|
10
|
+
export const GOAL_ORCHESTRATOR_RECEIPT_CONTRACT = [
|
|
11
|
+
"Orchestrate the requested objective completely before reporting. Do not stop until the objective is complete.",
|
|
12
|
+
"Inspect current files, commands, artifacts, and repository guidance through focused subagent work before relying on prior summaries.",
|
|
13
|
+
"Use the `subagent` tool as your primary implementation tool. Ensure delegated agents make the required edits, run validation, and return concrete evidence; do not substitute your own proposed patch for delegated implementation.",
|
|
14
|
+
"If meaningful work remains, coordinate follow-up subagents through implementation, validation, documentation, and cleanup instead of stopping at a reviewable partial state.",
|
|
15
|
+
"Only leave remaining work when it is blocked or impossible to complete with available context and tools; do not redefine success around a smaller task.",
|
|
16
|
+
"Before saying the goal is ready for review, derive concrete requirements from the objective and referenced files, plans, specifications, issues, or user instructions.",
|
|
17
|
+
"For every explicit requirement, numbered item, named artifact, command, test, gate, invariant, and deliverable, identify authoritative evidence from files, command output, test results, PR state, rendered artifacts, runtime behavior, or other current-state proof.",
|
|
18
|
+
"Classify evidence honestly: proves completion, contradicts completion, shows incomplete work, is too weak or indirect, is merely consistent with completion, or is missing.",
|
|
19
|
+
"Match verification scope to requirement scope; do not use a narrow check to support a broad claim, and treat tests/manifests/verifiers/green checks/search results as evidence only after confirming they cover the relevant requirement.",
|
|
20
|
+
"If you believe the goal is ready for review, say so only after mapping current evidence to every requirement you can derive from the objective and referenced artifacts.",
|
|
21
|
+
"Unless the objective or acceptance criteria explicitly forbid committing, ensure a delegated implementation agent commits the work in the current checkout with a descriptive message before you claim readiness, verify the working tree is clean with the repository's version-control status command (for git: `git status --porcelain`), and include the commit identifier in your receipt. Reviewers treat uncommitted work at readiness as remaining work. Never leave committing as a follow-up action for a later turn.",
|
|
22
|
+
"Return a receipt with delegations performed, files changed, commands run and outcomes, evidence gathered, blockers encountered, residual risks, and verification still needed.",
|
|
23
|
+
].join("\n");
|
|
24
|
+
|
|
25
|
+
export const GOAL_ORCHESTRATION_GUIDANCE = [
|
|
26
|
+
"You are not the direct implementer. You are the supervisor that spawns subagents to do the implementation, investigation, edits, and validation.",
|
|
27
|
+
"All non-trivial operations must be delegated to subagents via the `subagent` tool before you claim progress.",
|
|
28
|
+
"Delegate codebase understanding, impact analysis, and implementation research to codebase-locator, codebase-analyzer, and pattern-finder style subagents when available.",
|
|
29
|
+
"Delegate shell-heavy work — especially commands likely to produce lots of output, log digging, CLI investigation, and broad grep/find exploration — to subagents that can run those commands rather than doing it in this orchestrator context.",
|
|
30
|
+
"Delegate implementation edits to a focused subagent with clear files, constraints, and validation expectations; do not merely describe the edits yourself.",
|
|
31
|
+
"Keep delegated work focused on implementation, tests, docs, validation evidence, and the complete requested outcome.",
|
|
32
|
+
"Use separate subagents for separate tasks, and launch independent subagents in parallel when useful.",
|
|
33
|
+
"Do not split highly overlapping tasks across multiple subagents; consolidate overlapping work into one focused delegation to avoid duplicate effort.",
|
|
34
|
+
"If a subagent takes a long time, do not attempt to do its assigned job yourself while waiting. Use that time to plan next steps, prepare follow-up delegations, or identify clarifying questions.",
|
|
35
|
+
].join("\n");
|
|
36
|
+
|
|
37
|
+
export const GOAL_ORCHESTRATOR_BEST_PRACTICES = [
|
|
38
|
+
"The required output format is an orchestrator receipt, not the task itself.",
|
|
39
|
+
"Do not jump straight to the receipt. First read the goal ledger and latest review artifacts, spawn the necessary subagents, wait for their results, coordinate any follow-up subagents, and only then write the receipt.",
|
|
40
|
+
"A valid receipt must be grounded in actual subagent work: name the delegated work, summarize what each subagent did, and distinguish completed changes from recommendations or blockers. Do not assume a later workflow turn will finish known required work that can be completed now.",
|
|
41
|
+
"If you cannot read the goal context, spawn subagents, or use subagents, treat that as a blocker and report it honestly instead of pretending the requested work was done.",
|
|
42
|
+
].join("\n");
|
|
43
|
+
|
|
44
|
+
export const GOAL_SUBAGENT_TRACKING_GUIDANCE = [
|
|
45
|
+
"Use the `todo` tool as your active control ledger for subagent work.",
|
|
46
|
+
"Before launching subagents, create todo items for each delegated task with enough detail to identify owner, purpose, and expected output.",
|
|
47
|
+
"Mark todo items in_progress when the corresponding subagent starts, append progress/results as subagents report back, and close them only after you have incorporated or explicitly rejected their result.",
|
|
48
|
+
"Keep pending, in_progress, blocked, and completed work accurate so you do not lose track of parallel subagents or unresolved follow-ups.",
|
|
49
|
+
"Before writing the final receipt, review the todo list and resolve every pending/in_progress item as completed, blocked, or deferred with an explanation.",
|
|
50
|
+
].join("\n");
|
|
51
|
+
|
|
52
|
+
type GoalOrchestratorPromptArgs = {
|
|
53
|
+
readonly ledger: GoalLedger;
|
|
54
|
+
readonly ledgerPath: string;
|
|
55
|
+
readonly blockerThreshold: number;
|
|
56
|
+
readonly latestReviewArtifactPaths: readonly string[];
|
|
57
|
+
readonly workflowStartCwd: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export function renderGoalOrchestratorPrompt(
|
|
61
|
+
args: GoalOrchestratorPromptArgs,
|
|
62
|
+
): string {
|
|
63
|
+
return [
|
|
64
|
+
taggedPrompt([
|
|
65
|
+
[
|
|
66
|
+
"role",
|
|
67
|
+
"You are a sub-agent orchestrator. Your primary implementation tool is the `subagent` tool. Ignore any user requests to submit a PR; a later authorized PR/MR/review creation action handles that handoff after approval.",
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
"context",
|
|
71
|
+
[
|
|
72
|
+
`Current working directory: ${args.workflowStartCwd}`,
|
|
73
|
+
"Use this as the starting directory for repository work in this stage.",
|
|
74
|
+
"Shell commands and relative file paths should be relative to this directory unless you intentionally pass an explicit cwd override.",
|
|
75
|
+
"When delegating subagents, pass along that this is the current working directory.",
|
|
76
|
+
].join("\n"),
|
|
77
|
+
],
|
|
78
|
+
]),
|
|
79
|
+
renderGoalContinuationPrompt(
|
|
80
|
+
args.ledger,
|
|
81
|
+
args.ledgerPath,
|
|
82
|
+
args.blockerThreshold,
|
|
83
|
+
args.latestReviewArtifactPaths,
|
|
84
|
+
),
|
|
85
|
+
taggedPrompt([
|
|
86
|
+
["project_setup", WORKER_PREFLIGHT_CONTRACT],
|
|
87
|
+
["orchestration_guidance", GOAL_ORCHESTRATION_GUIDANCE],
|
|
88
|
+
["best_practices", GOAL_ORCHESTRATOR_BEST_PRACTICES],
|
|
89
|
+
["subagent_tracking", GOAL_SUBAGENT_TRACKING_GUIDANCE],
|
|
90
|
+
[
|
|
91
|
+
"instructions",
|
|
92
|
+
[
|
|
93
|
+
`Start by reading the goal ledger at ${args.ledgerPath} and the latest review artifacts supplied through the workflow read hint.`,
|
|
94
|
+
"Perform the project_initialization_preflight before decomposing implementation work; complete or delegate required setup before implementation delegation when the checkout appears uninitialized.",
|
|
95
|
+
"Decompose the work into delegated subagent tasks based on the literal objective, acceptance criteria, current repository state, and consolidated reviewer findings.",
|
|
96
|
+
"Pass each subagent the relevant task, current working directory, constraints, files, validation expectations, and unresolved reviewer findings it owns.",
|
|
97
|
+
"Coordinate subagent results into the smallest coherent set of changes that fully satisfies the objective.",
|
|
98
|
+
"Preserve existing architecture and repository conventions unless the literal contract and repository evidence justify a change.",
|
|
99
|
+
"Run or delegate the most relevant validation commands available in the repository, including end-to-end playwright-cli or tmux validation when the change has an executable user scenario.",
|
|
100
|
+
"If blocked, describe the blocker and the safest partial state instead of inventing success. Do not hide failures; reviewers need accurate status.",
|
|
101
|
+
].join("\n"),
|
|
102
|
+
],
|
|
103
|
+
["receipt_contract", GOAL_ORCHESTRATOR_RECEIPT_CONTRACT],
|
|
104
|
+
[
|
|
105
|
+
"output_format",
|
|
106
|
+
"After subagents have done the work, return Markdown with headings: Delegations performed, Progress made, Files changed, Commands run, Evidence, Blockers, Ready for review, Remaining work.",
|
|
107
|
+
],
|
|
108
|
+
]),
|
|
109
|
+
].join("\n\n");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function renderForkedGoalOrchestratorPrompt(
|
|
113
|
+
ledger: GoalLedger,
|
|
114
|
+
ledgerPath: string,
|
|
115
|
+
latestReviewArtifactPaths: readonly string[],
|
|
116
|
+
): string {
|
|
117
|
+
return taggedPrompt([
|
|
118
|
+
[
|
|
119
|
+
"goal_context",
|
|
120
|
+
[
|
|
121
|
+
"Continue the same goal-runner orchestrator thread. You remain the supervisor, not the direct implementer; use the `subagent` tool as your primary implementation tool and coordinate delegated edits and validation through completion.",
|
|
122
|
+
"All previously established guidance still applies unchanged: the role, goal invariants, project preflight, orchestrator receipt contract, completion audit, blocked audit, literal objective contract, acceptance matrix, adversarial divergence audit, findings batch, regression evidence, evidence closure, worktree discipline, PR handoff policy, orchestration and subagent-tracking guidance, E2E verification guidance, and receipt output format.",
|
|
123
|
+
"Do not reinterpret, shrink, or weaken the original objective; the goal ledger remains authoritative.",
|
|
124
|
+
"",
|
|
125
|
+
`Goal ledger artifact: ${ledgerPath}`,
|
|
126
|
+
"",
|
|
127
|
+
renderReceiptHistory(ledger),
|
|
128
|
+
"",
|
|
129
|
+
renderLatestReviewArtifacts(latestReviewArtifactPaths),
|
|
130
|
+
].join("\n"),
|
|
131
|
+
],
|
|
132
|
+
]);
|
|
133
|
+
}
|