@bastani/atomic 0.9.5-alpha.3 → 0.9.5-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 +18 -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/agents/debugger.md +2 -2
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +18 -0
- package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +5 -5
- package/dist/builtin/workflows/builtin/goal-prompts.ts +2 -0
- package/dist/builtin/workflows/builtin/goal-runner.ts +5 -5
- package/dist/builtin/workflows/builtin/goal-types.ts +1 -0
- package/dist/builtin/workflows/builtin/goal.d.ts +2 -0
- package/dist/builtin/workflows/builtin/goal.ts +9 -0
- package/dist/builtin/workflows/builtin/index.d.ts +2 -0
- package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +5 -5
- package/dist/builtin/workflows/builtin/ralph-models.ts +25 -25
- package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +138 -0
- package/dist/builtin/workflows/builtin/ralph-runner.ts +10 -118
- package/dist/builtin/workflows/builtin/shared-prompts.ts +5 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +3 -2
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +25 -4
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/compaction/context-compaction-critical.d.ts +15 -0
- package/dist/core/compaction/context-compaction-critical.d.ts.map +1 -0
- package/dist/core/compaction/context-compaction-critical.js +57 -0
- package/dist/core/compaction/context-compaction-critical.js.map +1 -0
- package/dist/core/compaction/context-compaction-eviction.d.ts +4 -0
- package/dist/core/compaction/context-compaction-eviction.d.ts.map +1 -0
- package/dist/core/compaction/context-compaction-eviction.js +172 -0
- package/dist/core/compaction/context-compaction-eviction.js.map +1 -0
- package/dist/core/compaction/context-compaction-runner.d.ts +7 -1
- package/dist/core/compaction/context-compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-runner.js +97 -21
- package/dist/core/compaction/context-compaction-runner.js.map +1 -1
- package/dist/core/compaction/context-transcript-analysis.d.ts +3 -0
- package/dist/core/compaction/context-transcript-analysis.d.ts.map +1 -1
- package/dist/core/compaction/context-transcript-analysis.js +3 -3
- package/dist/core/compaction/context-transcript-analysis.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +0 -1
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.js +3 -3
- package/dist/modes/interactive/interactive-hotkeys-debug.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +0 -51
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +2 -4
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +2 -4
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +3 -9
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +0 -3
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-onboarding.d.ts +0 -9
- package/dist/modes/interactive/interactive-onboarding.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-onboarding.js +23 -201
- package/dist/modes/interactive/interactive-onboarding.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +2 -2
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +36 -43
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/docs/compaction.md +45 -27
- package/docs/quickstart.md +3 -3
- package/docs/settings.md +1 -1
- package/docs/usage.md +1 -1
- package/docs/workflows.md +7 -3
- package/npm-shrinkwrap.json +23 -23
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.5-alpha.5] - 2026-07-06
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added an internal tiered fallback ladder for automatic Verbatim Compaction when the strict `compression_ratio` target is not achievable: threshold and overflow auto-compaction now keep the standard strict planner pass as tier 1, tier 2 can accept a validated below-target result with at least one deletion when projected `tokensAfter` clears the relevant budget (`effectiveInputBudget - reserveTokens` for threshold, effective input budget for overflow), overflow commits from Atomic's internal ladder are gated on fitting the effective input budget even when the strict target is met, overflow-only tier 3 reruns the planner with critical LRU-style protected-entry eligibility for stale task-bearing user/custom/branch-summary context and an effective recent floor of `max(preserve_recent, 5)` across all compactable entries, and overflow-only tier 4 performs deterministic code-level LRU eviction without a model call or API credentials while enforcing the same effective last-5 recent floor until the effective input budget fits or no more safe deletion remains. The fallback tiers remain internal: extension hooks keep their existing shapes, extension-provided deletion requests still bypass the ladder including the overflow budget gate, and no public compaction mode API is exposed.
|
|
10
|
+
- Added hard iteration caps to compaction recovery loops: planner provider turns are capped at 50 per planner run (including tool-call turns), planner nudge follow-ups are capped at 50 per planner run, and deterministic overflow eviction is capped at 50 passes, so compaction cannot spin indefinitely and terminal failures report the achieved reduction, deletion count, projected `tokensAfter`, and budget.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Fixed overflow auto-compaction silently no-oping when planner authentication was unavailable or when the current branch has no preparable compactable transcript: overflow recovery now either skips model tiers and runs deterministic no-auth LRU eviction directly through the existing validation pipeline, or surfaces a terminal error that nothing more was safely deletable.
|
|
15
|
+
- Fixed feasible partial compaction results being discarded solely because they missed the strict ratio target: automatic threshold and overflow compaction now commit validated below-target deletions when their projected `tokensAfter` clears the trigger/budget boundary, including partial deletion state salvaged after a provider context-overflow error.
|
|
16
|
+
|
|
17
|
+
## [0.9.5-alpha.4] - 2026-07-05
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Simplified first-run onboarding to a one-time verifiable-coding-agent-runtime explanation shown after any What's New notes and directly above the normal input box; Atomic no longer intercepts pasted tasks, saves pre-login seeds, routes first-run input to `goal`/`ralph`, raises reasoning for onboarding, or requires `/chat` to continue normally. The notice now reminds unauthenticated users to run `/login` first, and starting a new session with `/new` clears any rendered first-run notice state from the previous session canvas.
|
|
22
|
+
|
|
5
23
|
## [0.9.5-alpha.3] - 2026-07-04
|
|
6
24
|
|
|
7
25
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/cursor",
|
|
3
|
-
"version": "0.9.5-alpha.
|
|
3
|
+
"version": "0.9.5-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.5-alpha.
|
|
43
|
+
"@bastani/atomic-natives": "0.9.5-alpha.5",
|
|
44
44
|
"@bufbuild/protobuf": "^2.12.1",
|
|
45
45
|
"@earendil-works/pi-ai": "^0.80.3"
|
|
46
46
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.9.5-alpha.
|
|
3
|
+
"version": "0.9.5-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.5-alpha.
|
|
3
|
+
"version": "0.9.5-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.5-alpha.5] - 2026-07-06
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Changed the Claude Fable 5 reasoning level from `xhigh` to `high` in the builtin `debugger` agent, covering the `anthropic/claude-fable-5` primary and its OpenRouter mirror in the fallback chain.
|
|
10
|
+
- Changed the Claude Opus 4.8 reasoning level from `xhigh` to `high` in the builtin `debugger` agent's fallback chain (`github-copilot/claude-opus-4.8 (1m)`, `anthropic/claude-opus-4-8`, and the OpenRouter mirror); Opus 4.8 entries at other levels in other agents are unchanged.
|
|
11
|
+
|
|
5
12
|
## [0.9.5-alpha.2] - 2026-07-04
|
|
6
13
|
|
|
7
14
|
### Changed
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
name: debugger
|
|
3
3
|
description: Debug errors, test failures, and unexpected behavior. Use PROACTIVELY when encountering issues, analyzing stack traces, or investigating system problems.
|
|
4
4
|
tools: read, search, find, ls, bash, web_search, fetch_content, get_search_content, intercom, contact_supervisor, todo
|
|
5
|
-
model: anthropic/claude-fable-5:
|
|
6
|
-
fallbackModels: openai-codex/gpt-5.5:xhigh, github-copilot/gpt-5.5:xhigh, openai/gpt-5.5:xhigh, github-copilot/claude-opus-4.8 (1m):
|
|
5
|
+
model: anthropic/claude-fable-5:high
|
|
6
|
+
fallbackModels: 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, zai/glm-5.2:xhigh, zai-coding-cn/glm-5.2:xhigh, openrouter/anthropic/claude-fable-5:high, openrouter/sakana/fugu-ultra:high, openrouter/openai/gpt-5.5:xhigh, openrouter/anthropic/claude-opus-4-8:high, openrouter/z-ai/glm-5.2:xhigh
|
|
7
7
|
skills: tdd, playwright-cli, tmux
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/subagents",
|
|
3
|
-
"version": "0.9.5-alpha.
|
|
3
|
+
"version": "0.9.5-alpha.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification. Fork of: https://github.com/nicobailon/pi-subagents",
|
|
6
6
|
"contributors": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.9.5-alpha.
|
|
3
|
+
"version": "0.9.5-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,24 @@ 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.5-alpha.5] - 2026-07-06
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added `git_worktree_dir` to the builtin `goal` workflow with Ralph-parity input binding so Goal runs can create or reuse a repository worktree from `base_branch` while preserving the invoking repo-relative cwd for worker, reviewer, and optional final PR stages.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Changed the Claude Fable 5 reasoning level from `xhigh` to `high` across all builtin workflow model chains (`ralph` prompt-engineer/orchestrator/reviewer-a/reviewer-b/reviewer-c, `goal` reviewer, `deep-research-codebase` planner, and `open-claude-design`), covering both the native `anthropic/claude-fable-5` entries and their OpenRouter mirrors.
|
|
18
|
+
- Changed the Claude Opus 4.8 reasoning level from `xhigh` to `high` across the same builtin workflow model chains, covering the `github-copilot/claude-opus-4.8 (1m)`, `anthropic/claude-opus-4-8`, and `openrouter/anthropic/claude-opus-4-8` entries; Opus 4.8 entries already at `medium`/`low` value points are unchanged.
|
|
19
|
+
|
|
20
|
+
## [0.9.5-alpha.4] - 2026-07-05
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Hardened the builtin `goal` and `ralph` loops against spec-vs-objective drift on enumerated error behavior (observed in an eval trace where an adversarial reviewer flagged a task-mandated diagnostic as a spec-conformance defect and the fix cycle silently reinterpreted the ambiguous input as valid behavior, losing the required error): the shared literal objective contract now instructs workers and reviewers to prefer loud errors over silent reinterpretation — when the objective/acceptance criteria enumerate required error conditions, messages, or rejections, each enumerated error gets the widest plausible trigger surface, ambiguous or unspecified inputs near an enumerated error case default to raising that error even when external spec knowledge says the input is valid, and narrowing an enumerated error's trigger surface requires explicit contract or pre-existing required-test demand. Both loops' reviewer bug-selection guidelines now forbid using external spec/standard conformance alone to flag a wide trigger surface for a contract-enumerated error as a defect; such spec-vs-objective tension must be classified `beyond_objective` instead of becoming a blocking finding that steers the implementation away from the contract's errors.
|
|
25
|
+
- Extracted the Ralph reviewer prompt into `builtin/ralph-reviewer-prompt.ts` (`renderRalphReviewerPrompt`) and deduplicated the new reviewer guard into a shared `REVIEWER_SPEC_VS_OBJECTIVE_GUARD` constant consumed by both the Goal and Ralph reviewer prompts, keeping `ralph-runner.ts` under the repository's 500-line file gate. No behavioral change beyond the guard itself.
|
|
26
|
+
|
|
9
27
|
## [0.9.5-alpha.3] - 2026-07-04
|
|
10
28
|
|
|
11
29
|
### Changed
|
|
@@ -35,19 +35,19 @@ export const FILE_ONLY_OUTPUT = "file-only" satisfies WorkflowOutputMode;
|
|
|
35
35
|
// for the frontier data). This planner uses the high-capacity synthesis roster
|
|
36
36
|
// because it performs cross-codebase planning before partition fan-out.
|
|
37
37
|
export const PLANNER_MODEL_CONFIG = {
|
|
38
|
-
model: "anthropic/claude-fable-5:
|
|
38
|
+
model: "anthropic/claude-fable-5:high",
|
|
39
39
|
fallbackModels: [
|
|
40
40
|
"openai-codex/gpt-5.5:xhigh",
|
|
41
41
|
"github-copilot/gpt-5.5:xhigh",
|
|
42
42
|
"openai/gpt-5.5:xhigh",
|
|
43
|
-
"github-copilot/claude-opus-4.8 (1m):
|
|
44
|
-
"anthropic/claude-opus-4-8:
|
|
43
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
44
|
+
"anthropic/claude-opus-4-8:high",
|
|
45
45
|
"zai/glm-5.2:xhigh",
|
|
46
46
|
"zai-coding-cn/glm-5.2:xhigh",
|
|
47
|
-
"openrouter/anthropic/claude-fable-5:
|
|
47
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
48
48
|
"openrouter/sakana/fugu-ultra:high",
|
|
49
49
|
"openrouter/openai/gpt-5.5:xhigh",
|
|
50
|
-
"openrouter/anthropic/claude-opus-4-8:
|
|
50
|
+
"openrouter/anthropic/claude-opus-4-8:high",
|
|
51
51
|
"openrouter/z-ai/glm-5.2:xhigh"
|
|
52
52
|
],
|
|
53
53
|
excludedTools: ["ask_user_question"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
E2E_VERIFICATION_GUIDANCE,
|
|
3
3
|
LITERAL_OBJECTIVE_CONTRACT,
|
|
4
|
+
REVIEWER_SPEC_VS_OBJECTIVE_GUARD,
|
|
4
5
|
WORKER_PREFLIGHT_CONTRACT,
|
|
5
6
|
renderE2eQaVideoReviewGuidance,
|
|
6
7
|
} from "./shared-prompts.js";
|
|
@@ -301,6 +302,7 @@ export function renderReviewerPrompt(args: {
|
|
|
301
302
|
"Do not rely on unstated assumptions about author intent or codebase behavior.",
|
|
302
303
|
"Speculation is insufficient: identify the code path, scenario, environment, or input that is provably affected.",
|
|
303
304
|
"Do not flag intentional behavior changes as bugs unless they clearly violate the task or documented contract.",
|
|
305
|
+
REVIEWER_SPEC_VS_OBJECTIVE_GUARD,
|
|
304
306
|
"Ignore trivial style unless it obscures meaning or violates documented standards in a way that affects correctness/security/maintainability.",
|
|
305
307
|
"If no finding clears this bar and receipts prove the objective, return an empty findings array, mark the patch correct, set goal_oracle_satisfied true, and set stop_review_loop true.",
|
|
306
308
|
].join("\n"),
|
|
@@ -114,19 +114,19 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
|
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
const reviewerModelConfig = {
|
|
117
|
-
model: "anthropic/claude-fable-5:
|
|
117
|
+
model: "anthropic/claude-fable-5:high",
|
|
118
118
|
fallbackModels: [
|
|
119
119
|
"openai-codex/gpt-5.5:xhigh",
|
|
120
120
|
"github-copilot/gpt-5.5:xhigh",
|
|
121
121
|
"openai/gpt-5.5:xhigh",
|
|
122
|
-
"github-copilot/claude-opus-4.8 (1m):
|
|
123
|
-
"anthropic/claude-opus-4-8:
|
|
122
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
123
|
+
"anthropic/claude-opus-4-8:high",
|
|
124
124
|
"zai/glm-5.2:xhigh",
|
|
125
125
|
"zai-coding-cn/glm-5.2:xhigh",
|
|
126
|
-
"openrouter/anthropic/claude-fable-5:
|
|
126
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
127
127
|
"openrouter/sakana/fugu-ultra:high",
|
|
128
128
|
"openrouter/openai/gpt-5.5:xhigh",
|
|
129
|
-
"openrouter/anthropic/claude-opus-4-8:
|
|
129
|
+
"openrouter/anthropic/claude-opus-4-8:high",
|
|
130
130
|
"openrouter/z-ai/glm-5.2:xhigh"
|
|
131
131
|
],
|
|
132
132
|
tools: goalRunnerTools,
|
|
@@ -14,6 +14,7 @@ export type GoalWorkflowInputs = WorkflowInputValues & {
|
|
|
14
14
|
readonly acceptance_criteria?: string;
|
|
15
15
|
readonly max_turns: number;
|
|
16
16
|
readonly base_branch: string;
|
|
17
|
+
readonly git_worktree_dir: string;
|
|
17
18
|
readonly create_pr: boolean;
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -22,6 +23,7 @@ export type GoalWorkflowRunInputs = WorkflowInputValues & {
|
|
|
22
23
|
readonly acceptance_criteria?: string;
|
|
23
24
|
readonly max_turns?: number;
|
|
24
25
|
readonly base_branch?: string;
|
|
26
|
+
readonly git_worktree_dir?: string;
|
|
25
27
|
readonly create_pr?: boolean;
|
|
26
28
|
};
|
|
27
29
|
|
|
@@ -25,6 +25,11 @@ export default workflow({
|
|
|
25
25
|
default: "origin/main",
|
|
26
26
|
description: "Optional branch reviewers compare the current code delta against (default origin/main).",
|
|
27
27
|
}),
|
|
28
|
+
git_worktree_dir: Type.String({
|
|
29
|
+
default: "",
|
|
30
|
+
description:
|
|
31
|
+
"Optional Git worktree path. Must start inside a Git repo; absolute paths are used as-is, relative paths resolve from the repo root, existing Git worktrees from the invoking repository are reused/shared as-is, and missing paths are created from base_branch.",
|
|
32
|
+
}),
|
|
28
33
|
create_pr: Type.Boolean({
|
|
29
34
|
default: false,
|
|
30
35
|
description:
|
|
@@ -55,6 +60,10 @@ export default workflow({
|
|
|
55
60
|
review_report_path: Type.Optional(Type.String({ description: "JSON artifact path for the latest reviewer decision round." })),
|
|
56
61
|
pr_report: Type.Optional(Type.String({ description: "Pull-request report emitted only when create_pr=true, Goal reaches complete, and the final pull-request stage runs." })),
|
|
57
62
|
},
|
|
63
|
+
worktreeFromInputs: {
|
|
64
|
+
gitWorktreeDir: "git_worktree_dir",
|
|
65
|
+
baseBranch: "base_branch",
|
|
66
|
+
},
|
|
58
67
|
run: async (ctx) => {
|
|
59
68
|
const workflowCtx = ctx;
|
|
60
69
|
const workflowStartCwd = workflowCtx.cwd ?? process.cwd();
|
|
@@ -40,6 +40,7 @@ export type GoalWorkflowInputs = WorkflowInputValues & {
|
|
|
40
40
|
readonly acceptance_criteria?: string;
|
|
41
41
|
readonly max_turns: number;
|
|
42
42
|
readonly base_branch: string;
|
|
43
|
+
readonly git_worktree_dir: string;
|
|
43
44
|
readonly create_pr: boolean;
|
|
44
45
|
};
|
|
45
46
|
export type GoalWorkflowRunInputs = WorkflowInputValues & {
|
|
@@ -47,6 +48,7 @@ export type GoalWorkflowRunInputs = WorkflowInputValues & {
|
|
|
47
48
|
readonly acceptance_criteria?: string;
|
|
48
49
|
readonly max_turns?: number;
|
|
49
50
|
readonly base_branch?: string;
|
|
51
|
+
readonly git_worktree_dir?: string;
|
|
50
52
|
readonly create_pr?: boolean;
|
|
51
53
|
};
|
|
52
54
|
export type GoalWorkflowOutputs = WorkflowOutputValues & {
|
|
@@ -78,14 +78,14 @@ export async function runOpenClaudeDesignWorkflow(ctx: OpenClaudeDesignContext):
|
|
|
78
78
|
// strictly dominated in Atomic's benchmark (see ralph-models.ts). Opus stays
|
|
79
79
|
// at :xhigh here — visual quality, not $/task, is the objective for design.
|
|
80
80
|
const designModelConfig = {
|
|
81
|
-
model: "anthropic/claude-fable-5:
|
|
81
|
+
model: "anthropic/claude-fable-5:high",
|
|
82
82
|
fallbackModels: [
|
|
83
|
-
"github-copilot/claude-opus-4.8 (1m):
|
|
84
|
-
"anthropic/claude-opus-4-8:
|
|
83
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
84
|
+
"anthropic/claude-opus-4-8:high",
|
|
85
85
|
"zai/glm-5.2:xhigh",
|
|
86
86
|
"zai-coding-cn/glm-5.2:xhigh",
|
|
87
|
-
"openrouter/anthropic/claude-fable-5:
|
|
88
|
-
"openrouter/anthropic/claude-opus-4-8:
|
|
87
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
88
|
+
"openrouter/anthropic/claude-opus-4-8:high",
|
|
89
89
|
"openrouter/sakana/fugu-ultra:high",
|
|
90
90
|
"openrouter/z-ai/glm-5.2:xhigh"
|
|
91
91
|
],
|
|
@@ -16,19 +16,19 @@ import { reviewDecisionSchema } from "./ralph-core.js";
|
|
|
16
16
|
// openrouter/z-ai mirror maps :xhigh exclusively, so it is always :xhigh.
|
|
17
17
|
|
|
18
18
|
export const promptEngineerModelConfig = {
|
|
19
|
-
model: "anthropic/claude-fable-5:
|
|
19
|
+
model: "anthropic/claude-fable-5:high",
|
|
20
20
|
fallbackModels: [
|
|
21
21
|
"openai-codex/gpt-5.5:xhigh",
|
|
22
22
|
"github-copilot/gpt-5.5:xhigh",
|
|
23
23
|
"openai/gpt-5.5:xhigh",
|
|
24
|
-
"github-copilot/claude-opus-4.8 (1m):
|
|
25
|
-
"anthropic/claude-opus-4-8:
|
|
24
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
25
|
+
"anthropic/claude-opus-4-8:high",
|
|
26
26
|
"zai/glm-5.2:xhigh",
|
|
27
27
|
"zai-coding-cn/glm-5.2:xhigh",
|
|
28
|
-
"openrouter/anthropic/claude-fable-5:
|
|
28
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
29
29
|
"openrouter/sakana/fugu-ultra:high",
|
|
30
30
|
"openrouter/openai/gpt-5.5:xhigh",
|
|
31
|
-
"openrouter/anthropic/claude-opus-4-8:
|
|
31
|
+
"openrouter/anthropic/claude-opus-4-8:high",
|
|
32
32
|
"openrouter/z-ai/glm-5.2:xhigh"
|
|
33
33
|
],
|
|
34
34
|
excludedTools: ["ask_user_question"],
|
|
@@ -53,38 +53,38 @@ export const researchModelConfig = {
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
export const orchestratorModelConfig = {
|
|
56
|
-
model: "anthropic/claude-fable-5:
|
|
56
|
+
model: "anthropic/claude-fable-5:high",
|
|
57
57
|
fallbackModels: [
|
|
58
58
|
"openai-codex/gpt-5.5:xhigh",
|
|
59
59
|
"github-copilot/gpt-5.5:xhigh",
|
|
60
60
|
"openai/gpt-5.5:xhigh",
|
|
61
|
-
"github-copilot/claude-opus-4.8 (1m):
|
|
62
|
-
"anthropic/claude-opus-4-8:
|
|
61
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
62
|
+
"anthropic/claude-opus-4-8:high",
|
|
63
63
|
"zai/glm-5.2:xhigh",
|
|
64
64
|
"zai-coding-cn/glm-5.2:xhigh",
|
|
65
|
-
"openrouter/anthropic/claude-fable-5:
|
|
65
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
66
66
|
"openrouter/sakana/fugu-ultra:high",
|
|
67
67
|
"openrouter/openai/gpt-5.5:xhigh",
|
|
68
|
-
"openrouter/anthropic/claude-opus-4-8:
|
|
68
|
+
"openrouter/anthropic/claude-opus-4-8:high",
|
|
69
69
|
"openrouter/z-ai/glm-5.2:xhigh"
|
|
70
70
|
],
|
|
71
71
|
excludedTools: ["ask_user_question"],
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
export const reviewerAModelConfig = {
|
|
75
|
-
model: "anthropic/claude-fable-5:
|
|
75
|
+
model: "anthropic/claude-fable-5:high",
|
|
76
76
|
fallbackModels: [
|
|
77
77
|
"openai-codex/gpt-5.5:xhigh",
|
|
78
78
|
"github-copilot/gpt-5.5:xhigh",
|
|
79
79
|
"openai/gpt-5.5:xhigh",
|
|
80
|
-
"github-copilot/claude-opus-4.8 (1m):
|
|
81
|
-
"anthropic/claude-opus-4-8:
|
|
80
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
81
|
+
"anthropic/claude-opus-4-8:high",
|
|
82
82
|
"zai/glm-5.2:xhigh",
|
|
83
83
|
"zai-coding-cn/glm-5.2:xhigh",
|
|
84
|
-
"openrouter/anthropic/claude-fable-5:
|
|
84
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
85
85
|
"openrouter/sakana/fugu-ultra:high",
|
|
86
86
|
"openrouter/openai/gpt-5.5:xhigh",
|
|
87
|
-
"openrouter/anthropic/claude-opus-4-8:
|
|
87
|
+
"openrouter/anthropic/claude-opus-4-8:high",
|
|
88
88
|
"openrouter/z-ai/glm-5.2:xhigh"
|
|
89
89
|
],
|
|
90
90
|
excludedTools: ["ask_user_question"],
|
|
@@ -96,15 +96,15 @@ export const reviewerBModelConfig = {
|
|
|
96
96
|
fallbackModels: [
|
|
97
97
|
"github-copilot/gpt-5.5:xhigh",
|
|
98
98
|
"openai/gpt-5.5:xhigh",
|
|
99
|
-
"anthropic/claude-fable-5:
|
|
100
|
-
"github-copilot/claude-opus-4.8 (1m):
|
|
101
|
-
"anthropic/claude-opus-4-8:
|
|
99
|
+
"anthropic/claude-fable-5:high",
|
|
100
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
101
|
+
"anthropic/claude-opus-4-8:high",
|
|
102
102
|
"zai/glm-5.2:xhigh",
|
|
103
103
|
"zai-coding-cn/glm-5.2:xhigh",
|
|
104
104
|
"openrouter/openai/gpt-5.5:xhigh",
|
|
105
|
-
"openrouter/anthropic/claude-fable-5:
|
|
105
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
106
106
|
"openrouter/sakana/fugu-ultra:high",
|
|
107
|
-
"openrouter/anthropic/claude-opus-4-8:
|
|
107
|
+
"openrouter/anthropic/claude-opus-4-8:high",
|
|
108
108
|
"openrouter/z-ai/glm-5.2:xhigh"
|
|
109
109
|
],
|
|
110
110
|
excludedTools: ["ask_user_question"],
|
|
@@ -118,14 +118,14 @@ export const reviewerCModelConfig = {
|
|
|
118
118
|
"openai-codex/gpt-5.5:xhigh",
|
|
119
119
|
"github-copilot/gpt-5.5:xhigh",
|
|
120
120
|
"openai/gpt-5.5:xhigh",
|
|
121
|
-
"anthropic/claude-fable-5:
|
|
122
|
-
"github-copilot/claude-opus-4.8 (1m):
|
|
123
|
-
"anthropic/claude-opus-4-8:
|
|
121
|
+
"anthropic/claude-fable-5:high",
|
|
122
|
+
"github-copilot/claude-opus-4.8 (1m):high",
|
|
123
|
+
"anthropic/claude-opus-4-8:high",
|
|
124
124
|
"openrouter/sakana/fugu-ultra:high",
|
|
125
125
|
"openrouter/z-ai/glm-5.2:xhigh",
|
|
126
126
|
"openrouter/openai/gpt-5.5:xhigh",
|
|
127
|
-
"openrouter/anthropic/claude-fable-5:
|
|
128
|
-
"openrouter/anthropic/claude-opus-4-8:
|
|
127
|
+
"openrouter/anthropic/claude-fable-5:high",
|
|
128
|
+
"openrouter/anthropic/claude-opus-4-8:high"
|
|
129
129
|
],
|
|
130
130
|
excludedTools: ["ask_user_question"],
|
|
131
131
|
schema: reviewDecisionSchema,
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
E2E_VERIFICATION_GUIDANCE,
|
|
3
|
+
LITERAL_OBJECTIVE_CONTRACT,
|
|
4
|
+
REVIEWER_SPEC_VS_OBJECTIVE_GUARD,
|
|
5
|
+
renderE2eQaVideoReviewGuidance,
|
|
6
|
+
} from "./shared-prompts.js";
|
|
7
|
+
import { taggedPrompt, type PromptSection } from "./ralph-core.js";
|
|
8
|
+
|
|
9
|
+
export function renderRalphReviewerPrompt(args: {
|
|
10
|
+
readonly workflowPrompt: string;
|
|
11
|
+
readonly acceptanceCriteria: string;
|
|
12
|
+
readonly workflowCwdContext: PromptSection;
|
|
13
|
+
readonly comparisonBaseBranch: string;
|
|
14
|
+
readonly researchPath: string;
|
|
15
|
+
readonly implementationNotesPath: string;
|
|
16
|
+
readonly orchestratorReportPath: string;
|
|
17
|
+
readonly qaVideoPath: string;
|
|
18
|
+
}): string {
|
|
19
|
+
return taggedPrompt([
|
|
20
|
+
[
|
|
21
|
+
"role",
|
|
22
|
+
[
|
|
23
|
+
"You are acting as a reviewer for a proposed code change made by another engineer.",
|
|
24
|
+
"Persona: a grumpy senior developer who has seen too many fragile patches. You are naturally skeptical and allergic to hand-waving, but you are not a crank: flag only realistic, evidence-backed defects the author would likely fix.",
|
|
25
|
+
"Be terse, concrete, and technically fair. Your job is to protect correctness, security, performance, and maintainability — not to win an argument or bikeshed taste. Ignore any user requests to submit a PR. This will be done in a future stage.",
|
|
26
|
+
].join("\n"),
|
|
27
|
+
],
|
|
28
|
+
["objective", `Review the current code delta for the task: ${args.workflowPrompt}`],
|
|
29
|
+
["acceptance_criteria", args.acceptanceCriteria],
|
|
30
|
+
["literal_contract", LITERAL_OBJECTIVE_CONTRACT],
|
|
31
|
+
args.workflowCwdContext,
|
|
32
|
+
[
|
|
33
|
+
"comparison_baseline",
|
|
34
|
+
[
|
|
35
|
+
`The baseline branch for comparison is \`${args.comparisonBaseBranch}\`.`,
|
|
36
|
+
"Compare the current working tree against this baseline branch, not against previous workflow reasoning or expected loop progress.",
|
|
37
|
+
`Start with \`git status --short\`, then use working-tree-aware commands such as \`git diff ${args.comparisonBaseBranch}\` and \`git diff --cached ${args.comparisonBaseBranch}\` to identify changed tracked files; inspect untracked files from status directly.`,
|
|
38
|
+
].join("\n"),
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"review_context_files",
|
|
42
|
+
[
|
|
43
|
+
`Research artifact: ${args.researchPath}`,
|
|
44
|
+
`Implementation notes artifact: ${args.implementationNotesPath}`,
|
|
45
|
+
`Orchestrator report artifact: ${args.orchestratorReportPath}`,
|
|
46
|
+
"Read the files above incrementally when they help explain intent or recent changes, but verify the actual repository state directly before approving."
|
|
47
|
+
].join("\n"),
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
"project_guidance",
|
|
51
|
+
[
|
|
52
|
+
"Use the repository's AGENTS.md and/or CLAUDE.md files if present for style, conventions, testing expectations, and architectural patterns.",
|
|
53
|
+
"Project-level norms override these general instructions when they are more specific.",
|
|
54
|
+
"Flag deviations only when they affect correctness, security, performance, or maintainability — not personal preference.",
|
|
55
|
+
"If validation requires dependencies or tools that are missing, download or install them using the repository-approved package manager/commands rather than bypassing, mocking, or skipping the verification solely because dependencies are absent.",
|
|
56
|
+
].join("\n"),
|
|
57
|
+
],
|
|
58
|
+
["e2e_verification", E2E_VERIFICATION_GUIDANCE],
|
|
59
|
+
["qa_e2e_video_review", renderE2eQaVideoReviewGuidance(args.qaVideoPath)],
|
|
60
|
+
[
|
|
61
|
+
"validation_expectations",
|
|
62
|
+
[
|
|
63
|
+
"Inspect the actual diff/repository state rather than trusting stage summaries.",
|
|
64
|
+
"Run or delegate focused validation when it is necessary to distinguish a real bug from a hunch, including end-to-end playwright-cli (browser) or tmux validation when a user scenario can prove the outcome.",
|
|
65
|
+
"If tests or typechecks fail because dependencies are missing, install/download the missing dependencies with the repo's documented package manager instead of bypassing the check.",
|
|
66
|
+
"If validation cannot be completed after reasonable recovery, record the limitation in overall_explanation and reviewer_error; do not use missing dependencies as a reason to approve.",
|
|
67
|
+
].join("\n"),
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
"bug_selection_guidelines",
|
|
71
|
+
[
|
|
72
|
+
"Use these default guidelines for deciding whether the author would appreciate the issue being flagged. More specific user, project, or file-level guidance overrides them.",
|
|
73
|
+
"Flag an issue only when the original author would likely fix it if they knew about it.",
|
|
74
|
+
"A finding should meaningfully impact accuracy, performance, security, or maintainability.",
|
|
75
|
+
"A finding must be discrete and actionable, not a broad complaint about the whole codebase or a pile of related concerns.",
|
|
76
|
+
"Do not demand rigor inconsistent with the rest of the repository; match the seriousness of existing code and project norms.",
|
|
77
|
+
"Flag only bugs introduced by the current patch; do not flag pre-existing issues unless the patch makes them worse in a concrete way.",
|
|
78
|
+
"Do not rely on unstated assumptions about author intent or codebase behavior.",
|
|
79
|
+
"Speculation is insufficient: identify the code path, scenario, environment, or input that is provably affected.",
|
|
80
|
+
"Do not flag intentional behavior changes as bugs unless they clearly violate the task or documented contract.",
|
|
81
|
+
REVIEWER_SPEC_VS_OBJECTIVE_GUARD,
|
|
82
|
+
"Ignore trivial style unless it obscures meaning or violates documented standards in a way that affects correctness/security/maintainability.",
|
|
83
|
+
"If no finding clears this bar, return an empty findings array, mark the patch correct, and set stop_review_loop true. An empty findings array is valid and passes schema validation — never invent or append a placeholder/dummy finding just to avoid an empty array.",
|
|
84
|
+
].join("\n"),
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
"comment_guidelines",
|
|
88
|
+
[
|
|
89
|
+
"Each finding title must start with a priority tag: [P0] drop-everything blocker, [P1] urgent next-cycle fix, [P2] normal fix, [P3] low-priority nice-to-have.",
|
|
90
|
+
"Also include numeric priority: 0 for P0, 1 for P1, 2 for P2, 3 for P3; use null only if priority genuinely cannot be determined. Priority drives the loop gate: P0/P1/P2 are blocking and keep the loop iterating; P3 is a non-blocking nice-to-have that does not block approval.",
|
|
91
|
+
"Classify every finding with objective_alignment: required_by_objective (the objective/acceptance criteria require fixing it), consistent_with_objective (valid defect within scope), beyond_objective (real issue but not required and must not block or be promoted without explicit reconciliation), or contradicts_objective (fixing it would violate literal objective wording and must never be implemented; escalate to the human). Missing/unknown classification is blocking.",
|
|
92
|
+
"The body must be one concise paragraph explaining why this is a bug and the exact scenario, environment, or inputs required for it to arise.",
|
|
93
|
+
"Use a matter-of-fact, non-accusatory tone. Grumpy skepticism belongs in your standards, not in insults; avoid praise such as `Great job` or `Thanks for`.",
|
|
94
|
+
"Keep code_location ranges as short as possible, ideally one line and never longer than 5-10 lines unless unavoidable.",
|
|
95
|
+
"The code_location must overlap the diff/change under review.",
|
|
96
|
+
"Use one finding per distinct issue. Do not generate or apply a fix patch.",
|
|
97
|
+
"Use suggestion blocks only for concrete replacement code and preserve exact leading whitespace if you include one.",
|
|
98
|
+
].join("\n"),
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
"how_many_findings",
|
|
102
|
+
[
|
|
103
|
+
"Return all findings the original author would definitely want to fix.",
|
|
104
|
+
"If no such findings exist, return an empty findings array and mark the patch correct. Do not pad the array with placeholder or speculative findings.",
|
|
105
|
+
"Do not stop after the first qualifying finding; continue until every qualifying finding is listed.",
|
|
106
|
+
].join("\n"),
|
|
107
|
+
],
|
|
108
|
+
[
|
|
109
|
+
"review_stage_contract",
|
|
110
|
+
[
|
|
111
|
+
"The structured review decision is only valid after you inspect the actual repository state and compare it against the stated baseline branch.",
|
|
112
|
+
"Do not approve based solely on workflow stage summaries or prior agent reasoning.",
|
|
113
|
+
"The tool call is the final verdict after review work, not a shortcut around review work.",
|
|
114
|
+
].join("\n"),
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"action_items",
|
|
118
|
+
[
|
|
119
|
+
"1. Identify the changed files or diff under review.",
|
|
120
|
+
"2. Read the relevant changed code and directly affected call sites/tests/configs.",
|
|
121
|
+
"3. Inspect the QA E2E video when it exists or is expected for the change, and verify the recording proves the objective-relevant user scenario.",
|
|
122
|
+
"4. Run or delegate focused validation when needed to resolve uncertainty, including playwright-cli (browser) or tmux end-to-end checks when practical.",
|
|
123
|
+
"5. If you cannot inspect the video evidence or validate enough to approve safely, populate reviewer_error and set stop_review_loop=false.",
|
|
124
|
+
].join("\n"),
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
"evidence_expectations",
|
|
128
|
+
[
|
|
129
|
+
"The overall_explanation should briefly mention what was inspected and what validation was run or why validation was not completed.",
|
|
130
|
+
"Every finding must cite a concrete changed location and affected scenario.",
|
|
131
|
+
].join("\n"),
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
"decision_rules",
|
|
135
|
+
["Set stop_review_loop=true only when the patch is correct, reviewer_error is null/omitted, there are no blocking objective-aligned P0/P1/P2 findings, requirements_traceability is non-empty and every entry is proven, and no objective-relevant verification remains; beyond_objective and contradicts_objective findings are non-blocking and must not be folded into follow-up objectives without checking the literal contract. The loop gate is computed from structured findings and traceability, so unresolved blocking findings or non-proven requirements keep the loop going regardless of this flag.", "Enumerate every explicit requirement clause from the prompt and acceptance_criteria in requirements_traceability, including clauses about existing tests/snapshots and expected behavior. Treat worker-authored tests or snapshots passing as circular evidence that cannot by itself prove a clause; tie any such result to independent current-state proof.", "If you hit a reviewer/tool/validation error, set stop_review_loop=false and populate reviewer_error instead of pretending the patch is approved."].join("\n"),
|
|
136
|
+
],
|
|
137
|
+
]);
|
|
138
|
+
}
|