@bastani/atomic 0.8.26-alpha.1 → 0.8.26-alpha.3

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +12 -0
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/CHANGELOG.md +12 -0
  5. package/dist/builtin/mcp/package.json +1 -1
  6. package/dist/builtin/subagents/CHANGELOG.md +13 -0
  7. package/dist/builtin/subagents/package.json +1 -1
  8. package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +8 -3
  9. package/dist/builtin/subagents/src/runs/foreground/execution.ts +42 -4
  10. package/dist/builtin/subagents/src/runs/shared/acceptance.ts +2 -1
  11. package/dist/builtin/subagents/src/runs/shared/worktree.ts +2 -2
  12. package/dist/builtin/web-access/CHANGELOG.md +12 -0
  13. package/dist/builtin/web-access/package.json +1 -1
  14. package/dist/builtin/workflows/CHANGELOG.md +19 -0
  15. package/dist/builtin/workflows/README.md +10 -8
  16. package/dist/builtin/workflows/builtin/index.d.ts +2 -0
  17. package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
  18. package/dist/builtin/workflows/builtin/ralph.ts +299 -89
  19. package/dist/builtin/workflows/package.json +1 -1
  20. package/dist/builtin/workflows/skills/create-spec/SKILL.md +14 -0
  21. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +28 -9
  22. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +6 -1
  23. package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -2
  24. package/dist/builtin/workflows/src/shared/store.ts +61 -7
  25. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +37 -2
  26. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  27. package/dist/core/atomic-guide-command.js +10 -8
  28. package/dist/core/atomic-guide-command.js.map +1 -1
  29. package/dist/core/footer-data-provider.d.ts.map +1 -1
  30. package/dist/core/footer-data-provider.js +3 -0
  31. package/dist/core/footer-data-provider.js.map +1 -1
  32. package/dist/core/package-manager.d.ts.map +1 -1
  33. package/dist/core/package-manager.js +14 -7
  34. package/dist/core/package-manager.js.map +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -0
  38. package/dist/index.js.map +1 -1
  39. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  40. package/dist/modes/interactive/components/footer.js +4 -1
  41. package/dist/modes/interactive/components/footer.js.map +1 -1
  42. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  43. package/dist/modes/interactive/interactive-mode.js +3 -2
  44. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  45. package/dist/utils/git-env.d.ts +10 -0
  46. package/dist/utils/git-env.d.ts.map +1 -0
  47. package/dist/utils/git-env.js +33 -0
  48. package/dist/utils/git-env.js.map +1 -0
  49. package/docs/quickstart.md +4 -4
  50. package/docs/workflows.md +16 -14
  51. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.26-alpha.3] - 2026-06-05
6
+
7
+ ### Changed
8
+
9
+ - Documented the builtin `ralph` workflow's safe default for PR creation, `create_pr=true` opt-in examples, omitted disabled `pr_report`, and final-stage-only provider-aware PR/MR/review creation instructions ([#1255](https://github.com/bastani-inc/atomic/issues/1255)).
10
+
11
+ ## [0.8.26-alpha.2] - 2026-06-05
12
+
13
+ ### Fixed
14
+
15
+ - Clarified overflow auto-compaction warnings in the TUI footer so automatic transcript compaction is reported distinctly from user-triggered compaction ([#1250](https://github.com/bastani-inc/atomic/issues/1250)).
16
+ - Fixed internal Git subprocesses to strip ambient repository-local Git environment variables before package-manager and footer branch lookups inspect a targeted working tree.
17
+
5
18
  ## [0.8.26-alpha.1] - 2026-06-05
6
19
 
7
20
  ### Fixed
@@ -4,6 +4,18 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.26-alpha.3] - 2026-06-05
8
+
9
+ ### Changed
10
+
11
+ - Bumped package version for the Atomic 0.8.26-alpha.3 prerelease.
12
+
13
+ ## [0.8.26-alpha.2] - 2026-06-05
14
+
15
+ ### Changed
16
+
17
+ - Bumped package version for the Atomic 0.8.26-alpha.2 prerelease.
18
+
7
19
  ## [0.8.26-alpha.1] - 2026-06-05
8
20
 
9
21
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.8.26-alpha.1",
3
+ "version": "0.8.26-alpha.3",
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": [
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.26-alpha.3] - 2026-06-05
11
+
12
+ ### Changed
13
+
14
+ - Bumped package version for the Atomic 0.8.26-alpha.3 prerelease.
15
+
16
+ ## [0.8.26-alpha.2] - 2026-06-05
17
+
18
+ ### Changed
19
+
20
+ - Bumped package version for the Atomic 0.8.26-alpha.2 prerelease.
21
+
10
22
  ## [0.8.26-alpha.1] - 2026-06-05
11
23
 
12
24
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.8.26-alpha.1",
3
+ "version": "0.8.26-alpha.3",
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,19 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.26-alpha.3] - 2026-06-05
6
+
7
+ ### Changed
8
+
9
+ - Bumped package version for the Atomic 0.8.26-alpha.3 prerelease.
10
+
11
+ ## [0.8.26-alpha.2] - 2026-06-05
12
+
13
+ ### Fixed
14
+
15
+ - Fixed the `no-staged-files` acceptance runtime check and subagent worktree Git commands to ignore ambient Git repository environment variables, so subagents inspect the intended working tree instead of a parent hook or unrelated worktree.
16
+ - Suppressed intermediate model fallback failure notes and live foreground failure updates from successful subagent runs while preserving final failures and raw per-attempt diagnostics ([#1226](https://github.com/bastani-inc/atomic/issues/1226)).
17
+
5
18
  ## [0.8.26-alpha.1] - 2026-06-05
6
19
 
7
20
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.8.26-alpha.1",
3
+ "version": "0.8.26-alpha.3",
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": [
@@ -650,6 +650,7 @@ async function runSingleStep(
650
650
  const attemptedModels: string[] = [];
651
651
  const modelAttempts: ModelAttempt[] = [];
652
652
  const attemptNotes: string[] = [];
653
+ const pendingAttemptNotes: string[] = [];
653
654
  const eventsPath = path.join(path.dirname(ctx.outputFile), "events.jsonl");
654
655
  let finalResult: RunPiStreamingResult | undefined;
655
656
  let finalFastMode: boolean | undefined;
@@ -768,9 +769,13 @@ async function runSingleStep(
768
769
  finalFastMode = attemptFastMode;
769
770
  finalOutputSnapshot = outputSnapshot;
770
771
  finalResult = { ...run, exitCode: effectiveExitCode, model: candidate ?? run.model, error, structuredOutput } as RunPiStreamingResult & { structuredOutput?: unknown };
771
- if (attempt.success || completionGuardTriggered) break;
772
- if (!isRetryableModelFailure(error) || index === candidates.length - 1) break;
773
- attemptNotes.push(formatModelAttemptNote(attempt, candidates[index + 1]));
772
+ if (attempt.success) break;
773
+ if (!completionGuardTriggered && isRetryableModelFailure(error) && index < candidates.length - 1) {
774
+ pendingAttemptNotes.push(formatModelAttemptNote(attempt, candidates[index + 1]));
775
+ continue;
776
+ }
777
+ attemptNotes.push(...pendingAttemptNotes);
778
+ break;
774
779
  }
775
780
 
776
781
  const rawOutput = finalResult?.finalOutput ?? "";
@@ -17,6 +17,7 @@ import {
17
17
  type AgentProgress,
18
18
  type ArtifactPaths,
19
19
  type ControlEvent,
20
+ type Details,
20
21
  type ModelAttempt,
21
22
  type RunSyncOptions,
22
23
  type SingleResult,
@@ -139,6 +140,29 @@ function snapshotResult(result: SingleResult, progress: AgentProgress): SingleRe
139
140
  };
140
141
  }
141
142
 
143
+ type RunSyncUpdate = import("@earendil-works/pi-agent-core").AgentToolResult<Details>;
144
+
145
+ function extractUpdateText(update: RunSyncUpdate): string | undefined {
146
+ const text = update.content
147
+ .map((item) => item.type === "text" ? item.text : undefined)
148
+ .filter((item): item is string => Boolean(item?.trim()))
149
+ .join("\n");
150
+ return text || undefined;
151
+ }
152
+
153
+ export function shouldSuppressIntermediateRetryableFailureUpdate(update: RunSyncUpdate): boolean {
154
+ const result = update.details?.results?.[0];
155
+ if (!result) return false;
156
+ const progress = update.details?.progress?.[0];
157
+ const status = result.progress?.status ?? progress?.status;
158
+ if (status !== "failed") return false;
159
+ const failureText = result.error
160
+ ?? result.progress?.error
161
+ ?? progress?.error
162
+ ?? extractUpdateText(update);
163
+ return isRetryableModelFailure(failureText);
164
+ }
165
+
142
166
  async function runSingleAttempt(
143
167
  runtimeCwd: string,
144
168
  agent: AgentConfig,
@@ -875,6 +899,7 @@ export async function runSync(
875
899
  const modelAttempts: ModelAttempt[] = [];
876
900
  const aggregateUsage = emptyUsage();
877
901
  const attemptNotes: string[] = [];
902
+ const pendingAttemptNotes: string[] = [];
878
903
  let totalToolCount = 0;
879
904
  let totalDurationMs = 0;
880
905
 
@@ -897,7 +922,18 @@ export async function runSync(
897
922
  const candidate = modelsToTry[i];
898
923
  if (candidate) attemptedModels.push(candidate);
899
924
  const outputSnapshot = captureSingleOutputSnapshot(options.outputPath);
900
- const result = await runSingleAttempt(runtimeCwd, agent, taskWithAcceptance, candidate, options, {
925
+ let attemptOptions = options;
926
+ if (i < modelsToTry.length - 1 && options.onUpdate) {
927
+ const forwardUpdate = options.onUpdate;
928
+ attemptOptions = {
929
+ ...options,
930
+ onUpdate: (update) => {
931
+ if (shouldSuppressIntermediateRetryableFailureUpdate(update)) return;
932
+ forwardUpdate(update);
933
+ },
934
+ };
935
+ }
936
+ const result = await runSingleAttempt(runtimeCwd, agent, taskWithAcceptance, candidate, attemptOptions, {
901
937
  sessionEnabled,
902
938
  systemPrompt,
903
939
  resolvedSkillNames: resolvedSkills.length > 0 ? resolvedSkills.map((skill) => skill.name) : undefined,
@@ -928,10 +964,12 @@ export async function runSync(
928
964
  if (attemptSucceeded) {
929
965
  break;
930
966
  }
931
- if (!isRetryableModelFailure(result.error) || i === modelsToTry.length - 1) {
932
- break;
967
+ if (isRetryableModelFailure(result.error) && i < modelsToTry.length - 1) {
968
+ pendingAttemptNotes.push(formatModelAttemptNote(attempt, modelsToTry[i + 1]));
969
+ continue;
933
970
  }
934
- attemptNotes.push(formatModelAttemptNote(attempt, modelsToTry[i + 1]));
971
+ attemptNotes.push(...pendingAttemptNotes);
972
+ break;
935
973
  }
936
974
 
937
975
  const result = lastResult ?? {
@@ -1,6 +1,7 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { spawnSync } from "node:child_process";
3
3
  import * as path from "node:path";
4
+ import { createGitEnvironment } from "@bastani/atomic";
4
5
  import type {
5
6
  AcceptanceConfig,
6
7
  AcceptanceEvidenceKind,
@@ -399,7 +400,7 @@ function reportEvidencePresent(report: AcceptanceReport, kind: AcceptanceEvidenc
399
400
  }
400
401
 
401
402
  function checkNoStagedFiles(cwd: string): AcceptanceRuntimeCheck {
402
- const result = spawnSync("git", ["status", "--short"], { cwd, encoding: "utf-8" });
403
+ const result = spawnSync("git", ["status", "--short"], { cwd, env: createGitEnvironment(), encoding: "utf-8" });
403
404
  if (result.status !== 0) {
404
405
  return { id: "no-staged-files", status: "not-applicable", message: "git status unavailable; no staged-files check skipped" };
405
406
  }
@@ -2,7 +2,7 @@ import { spawnSync } from "node:child_process";
2
2
  import * as fs from "node:fs";
3
3
  import * as os from "node:os";
4
4
  import * as path from "node:path";
5
- import { APP_NAME } from "@bastani/atomic";
5
+ import { APP_NAME, createGitEnvironment } from "@bastani/atomic";
6
6
 
7
7
  export interface WorktreeSetup {
8
8
  cwd: string;
@@ -82,7 +82,7 @@ interface RepoState {
82
82
  const DEFAULT_WORKTREE_SETUP_HOOK_TIMEOUT_MS = 30000;
83
83
 
84
84
  function runGit(cwd: string, args: string[]): GitResult {
85
- const result = spawnSync("git", ["-C", cwd, ...args], { encoding: "utf-8" });
85
+ const result = spawnSync("git", ["-C", cwd, ...args], { encoding: "utf-8", env: createGitEnvironment() });
86
86
  return {
87
87
  stdout: result.stdout ?? "",
88
88
  stderr: result.stderr ?? "",
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.26-alpha.3] - 2026-06-05
8
+
9
+ ### Changed
10
+
11
+ - Bumped package version for the Atomic 0.8.26-alpha.3 prerelease.
12
+
13
+ ## [0.8.26-alpha.2] - 2026-06-05
14
+
15
+ ### Changed
16
+
17
+ - Bumped package version for the Atomic 0.8.26-alpha.2 prerelease.
18
+
7
19
  ## [0.8.26-alpha.1] - 2026-06-05
8
20
 
9
21
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.8.26-alpha.1",
3
+ "version": "0.8.26-alpha.3",
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,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.26-alpha.3] - 2026-06-05
10
+
11
+ ### Changed
12
+
13
+ - Changed the builtin `ralph` workflow to include the workflow current working directory in every stage prompt so planner, implementation, simplification, review, and PR handoff stages keep repository work anchored to the workflow checkout.
14
+ - Changed the builtin `ralph` workflow to skip pull-request creation by default unless `create_pr=true`, omit `pr_report` when disabled, and keep provider-aware PR/MR/review creation instructions in the final stage ([#1255](https://github.com/bastani-inc/atomic/issues/1255)).
15
+
16
+ ## [0.8.26-alpha.2] - 2026-06-05
17
+
18
+ ### Changed
19
+
20
+ - Updated the `research-codebase` skill to capture a `breaking_changes_allowed` compatibility posture before research fanout, carry it through sub-agent prompts, and record it in research documents so downstream specs and workflows do not preserve legacy APIs by default when breaking changes are allowed ([#1225](https://github.com/bastani-inc/atomic/issues/1225)).
21
+
22
+ ### Fixed
23
+
24
+ - Fixed stage-local workflow HIL `input` and `editor` prompts losing draft text across Ctrl+D detach/reattach; drafts are kept live-only in memory and cleared when the prompt or run/stage exits ([#1179](https://github.com/bastani-inc/atomic/issues/1179)).
25
+ - Fixed workflow worktree Git commands to strip ambient repository-local Git environment variables before inspecting or creating targeted worktrees.
26
+ - Suppressed intermediate model fallback failure warnings from successful workflow stages while preserving final failures and raw per-attempt diagnostics ([#1226](https://github.com/bastani-inc/atomic/issues/1226)).
27
+
9
28
  ## [0.8.26-alpha.1] - 2026-06-05
10
29
 
11
30
  ### Fixed
@@ -587,20 +587,22 @@ Child workflow outputs: `result`, `status`, `approved`, `goal_id`, `objective`,
587
587
 
588
588
  ### `ralph`
589
589
 
590
- Plan → orchestrate → simplify → review PR-handoff workflow: write an RFC-style technical design document under `specs/`, delegate implementation through sub-agents, simplify recent changes, run parallel reviewers, iterate until approval or the loop limit, then prepare a pull-request report. Reviewers inspect repository infrastructure directly as needed; Ralph no longer runs separate `infra-*` discovery stages.
590
+ Plan → orchestrate → simplify → review workflow with optional final-stage PR handoff: write an RFC-style technical design document under `specs/`, delegate implementation through sub-agents, simplify recent changes, run parallel reviewers, and iterate until approval or the loop limit. Ralph 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 inspect provider credentials and attempt provider-appropriate PR/MR/review creation (for example GitHub `gh`, Azure Repos `az repos pr create`, or Sapling/Phabricator tooling). Ralph's own PR-creation instructions live in that final stage. Reviewers inspect repository infrastructure directly as needed; Ralph no longer runs separate `infra-*` discovery stages.
591
591
 
592
592
  ```text
593
593
  /workflow ralph prompt="Plan and migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop
594
+ /workflow ralph prompt="Plan and migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop create_pr=true
594
595
  ```
595
596
 
596
- | Input | Type | Required | Default | Description |
597
- | ------------- | -------- | -------- | ------------- | ------------------------------------------------------------- |
598
- | `prompt` | `text` | ✓ | — | Task, feature request, issue summary, or spec path to plan, execute, refine, review, and prepare for PR. |
599
- | `max_loops` | `number` | — | `10` | Maximum plan/orchestrate/review iterations before PR handoff. |
600
- | `base_branch` | `string` | — | `origin/main` | Branch reviewers and PR-prep compare the current delta with; also used to create a missing worktree. |
601
- | `git_worktree_dir` | `string` | — | `""` | Optional reusable Git worktree root. Empty runs in the invoking checkout; non-empty values run Ralph stages in the created/reused worktree. |
597
+ | Input | Type | Required | Default | Description |
598
+ | ------------------ | --------- | -------- | ------------- | ------------------------------------------------------------- |
599
+ | `prompt` | `text` | ✓ | — | Task, feature request, issue summary, or spec path to plan, execute, refine, and review. |
600
+ | `max_loops` | `number` | — | `10` | Maximum plan/orchestrate/review iterations before completion or optional final handoff. |
601
+ | `base_branch` | `string` | — | `origin/main` | Branch reviewers and the optional final stage compare the current delta with; also used to create a missing worktree. |
602
+ | `git_worktree_dir` | `string` | — | `""` | Optional reusable Git worktree root. Empty runs in the invoking checkout; non-empty values run Ralph stages in the created/reused worktree. |
603
+ | `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. |
602
604
 
603
- Child workflow outputs: `result`, `plan`, `plan_path`, `implementation_notes_path`, `pr_report`, `approved`, `iterations_completed`, `review_report`, and `review_report_path`.
605
+ Child workflow outputs: `result`, `plan`, `plan_path`, `implementation_notes_path`, `approved`, `iterations_completed`, `review_report`, and `review_report_path`. `pr_report` is included only when `create_pr=true` and the final `pull-request` stage runs.
604
606
 
605
607
  ### `open-claude-design`
606
608
 
@@ -70,12 +70,14 @@ export type RalphWorkflowInputs = WorkflowInputValues & {
70
70
  readonly max_loops: number;
71
71
  readonly base_branch: string;
72
72
  readonly git_worktree_dir: string;
73
+ readonly create_pr: boolean;
73
74
  };
74
75
  export type RalphWorkflowRunInputs = WorkflowInputValues & {
75
76
  readonly prompt: string;
76
77
  readonly max_loops?: number;
77
78
  readonly base_branch?: string;
78
79
  readonly git_worktree_dir?: string;
80
+ readonly create_pr?: boolean;
79
81
  };
80
82
  export type RalphWorkflowOutputs = WorkflowOutputValues & {
81
83
  readonly result?: string;
@@ -5,6 +5,7 @@ export type RalphWorkflowInputs = WorkflowInputValues & {
5
5
  readonly max_loops: number;
6
6
  readonly base_branch: string;
7
7
  readonly git_worktree_dir: string;
8
+ readonly create_pr: boolean;
8
9
  };
9
10
 
10
11
  export type RalphWorkflowRunInputs = WorkflowInputValues & {
@@ -12,6 +13,7 @@ export type RalphWorkflowRunInputs = WorkflowInputValues & {
12
13
  readonly max_loops?: number;
13
14
  readonly base_branch?: string;
14
15
  readonly git_worktree_dir?: string;
16
+ readonly create_pr?: boolean;
15
17
  };
16
18
 
17
19
  export type RalphWorkflowOutputs = WorkflowOutputValues & {