@bastani/atomic 0.8.28 → 0.8.29-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 (145) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/builtin/cursor/CHANGELOG.md +27 -0
  3. package/dist/builtin/cursor/LICENSE +26 -0
  4. package/dist/builtin/cursor/README.md +22 -0
  5. package/dist/builtin/cursor/index.ts +9 -0
  6. package/dist/builtin/cursor/package.json +46 -0
  7. package/dist/builtin/cursor/src/auth.ts +352 -0
  8. package/dist/builtin/cursor/src/catalog-cache.ts +155 -0
  9. package/dist/builtin/cursor/src/config.ts +123 -0
  10. package/dist/builtin/cursor/src/conversation-state.ts +135 -0
  11. package/dist/builtin/cursor/src/cursor-models-raw.json +583 -0
  12. package/dist/builtin/cursor/src/model-mapper.ts +270 -0
  13. package/dist/builtin/cursor/src/models.ts +54 -0
  14. package/dist/builtin/cursor/src/native-loader.ts +71 -0
  15. package/dist/builtin/cursor/src/proto/README.md +34 -0
  16. package/dist/builtin/cursor/src/proto/agent_pb.ts +15294 -0
  17. package/dist/builtin/cursor/src/proto/protobuf-codec.ts +717 -0
  18. package/dist/builtin/cursor/src/provider.ts +301 -0
  19. package/dist/builtin/cursor/src/stream.ts +564 -0
  20. package/dist/builtin/cursor/src/transport.ts +791 -0
  21. package/dist/builtin/intercom/CHANGELOG.md +4 -0
  22. package/dist/builtin/intercom/package.json +2 -2
  23. package/dist/builtin/intercom/skills/intercom/SKILL.md +5 -5
  24. package/dist/builtin/mcp/CHANGELOG.md +4 -0
  25. package/dist/builtin/mcp/package.json +3 -3
  26. package/dist/builtin/subagents/CHANGELOG.md +13 -0
  27. package/dist/builtin/subagents/README.md +7 -3
  28. package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -24
  29. package/dist/builtin/subagents/agents/debugger.md +3 -5
  30. package/dist/builtin/subagents/package.json +4 -4
  31. package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +2 -1
  32. package/dist/builtin/subagents/src/runs/foreground/execution.ts +2 -1
  33. package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +1 -0
  34. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +19 -2
  35. package/dist/builtin/subagents/src/runs/shared/structured-output.ts +271 -10
  36. package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +12 -39
  37. package/dist/builtin/subagents/src/shared/types.ts +5 -3
  38. package/dist/builtin/subagents/src/shared/utils.ts +50 -10
  39. package/dist/builtin/subagents/src/slash/saved-chain-mapping.ts +77 -0
  40. package/dist/builtin/subagents/src/slash/slash-commands.ts +1 -55
  41. package/dist/builtin/web-access/CHANGELOG.md +5 -1
  42. package/dist/builtin/web-access/README.md +1 -1
  43. package/dist/builtin/web-access/github-extract.ts +1 -1
  44. package/dist/builtin/web-access/package.json +3 -3
  45. package/dist/builtin/workflows/CHANGELOG.md +26 -0
  46. package/dist/builtin/workflows/README.md +28 -8
  47. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +9 -49
  48. package/dist/builtin/workflows/builtin/goal.ts +63 -106
  49. package/dist/builtin/workflows/builtin/index.d.ts +2 -0
  50. package/dist/builtin/workflows/builtin/open-claude-design.ts +31 -76
  51. package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
  52. package/dist/builtin/workflows/builtin/ralph.ts +227 -518
  53. package/dist/builtin/workflows/builtin/shared-prompts.ts +7 -0
  54. package/dist/builtin/workflows/package.json +2 -2
  55. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +17 -3
  56. package/dist/builtin/workflows/src/extension/wiring.ts +72 -9
  57. package/dist/builtin/workflows/src/extension/workflow-schema.ts +34 -0
  58. package/dist/builtin/workflows/src/runs/foreground/executor.ts +13 -2
  59. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +86 -14
  60. package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +11 -3
  61. package/dist/builtin/workflows/src/shared/types.ts +8 -4
  62. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +64 -2
  63. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +8 -8
  64. package/dist/builtin/workflows/src/tui/workflow-status.ts +2 -0
  65. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  66. package/dist/core/atomic-guide-command.js +7 -7
  67. package/dist/core/atomic-guide-command.js.map +1 -1
  68. package/dist/core/builtin-packages.d.ts.map +1 -1
  69. package/dist/core/builtin-packages.js +6 -0
  70. package/dist/core/builtin-packages.js.map +1 -1
  71. package/dist/core/extensions/index.d.ts +1 -1
  72. package/dist/core/extensions/index.d.ts.map +1 -1
  73. package/dist/core/extensions/index.js.map +1 -1
  74. package/dist/core/extensions/types.d.ts +20 -0
  75. package/dist/core/extensions/types.d.ts.map +1 -1
  76. package/dist/core/extensions/types.js.map +1 -1
  77. package/dist/core/model-resolver.d.ts +1 -0
  78. package/dist/core/model-resolver.d.ts.map +1 -1
  79. package/dist/core/model-resolver.js +17 -8
  80. package/dist/core/model-resolver.js.map +1 -1
  81. package/dist/core/package-manager.d.ts +11 -9
  82. package/dist/core/package-manager.d.ts.map +1 -1
  83. package/dist/core/package-manager.js +55 -10
  84. package/dist/core/package-manager.js.map +1 -1
  85. package/dist/core/project-trust.d.ts +1 -0
  86. package/dist/core/project-trust.d.ts.map +1 -1
  87. package/dist/core/project-trust.js +3 -3
  88. package/dist/core/project-trust.js.map +1 -1
  89. package/dist/core/resource-loader.d.ts +11 -2
  90. package/dist/core/resource-loader.d.ts.map +1 -1
  91. package/dist/core/resource-loader.js +72 -9
  92. package/dist/core/resource-loader.js.map +1 -1
  93. package/dist/core/sdk.d.ts +3 -3
  94. package/dist/core/sdk.d.ts.map +1 -1
  95. package/dist/core/sdk.js +5 -5
  96. package/dist/core/sdk.js.map +1 -1
  97. package/dist/core/tools/index.d.ts +1 -0
  98. package/dist/core/tools/index.d.ts.map +1 -1
  99. package/dist/core/tools/index.js +1 -0
  100. package/dist/core/tools/index.js.map +1 -1
  101. package/dist/core/tools/structured-output.d.ts +39 -0
  102. package/dist/core/tools/structured-output.d.ts.map +1 -0
  103. package/dist/core/tools/structured-output.js +141 -0
  104. package/dist/core/tools/structured-output.js.map +1 -0
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +1 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/main.d.ts.map +1 -1
  110. package/dist/main.js +36 -14
  111. package/dist/main.js.map +1 -1
  112. package/dist/modes/interactive/components/login-dialog.d.ts +3 -0
  113. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  114. package/dist/modes/interactive/components/login-dialog.js +16 -0
  115. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  116. package/dist/modes/interactive/interactive-mode.d.ts +11 -0
  117. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  118. package/dist/modes/interactive/interactive-mode.js +158 -11
  119. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  120. package/dist/modes/print-mode.d.ts.map +1 -1
  121. package/dist/modes/print-mode.js +39 -0
  122. package/dist/modes/print-mode.js.map +1 -1
  123. package/docs/custom-provider.md +1 -0
  124. package/docs/extensions.md +2 -2
  125. package/docs/models.md +2 -0
  126. package/docs/packages.md +3 -1
  127. package/docs/providers.md +15 -0
  128. package/docs/quickstart.md +3 -3
  129. package/docs/sdk.md +61 -0
  130. package/docs/security.md +1 -1
  131. package/docs/subagents.md +21 -0
  132. package/docs/usage.md +2 -0
  133. package/docs/workflows.md +28 -21
  134. package/examples/extensions/README.md +1 -1
  135. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  136. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  137. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  138. package/examples/extensions/gondolin/package-lock.json +2 -2
  139. package/examples/extensions/gondolin/package.json +1 -1
  140. package/examples/extensions/sandbox/package-lock.json +2 -2
  141. package/examples/extensions/sandbox/package.json +1 -1
  142. package/examples/extensions/structured-output.ts +22 -53
  143. package/examples/extensions/with-deps/package-lock.json +2 -2
  144. package/examples/extensions/with-deps/package.json +1 -1
  145. package/package.json +12 -9
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ### Changed
8
+
9
+ - Published a synchronized Atomic 0.8.29-alpha.1 prerelease with the upstream pi TUI dependency aligned to `^0.79.3`; no functional changes were made in the web-access extension.
10
+
7
11
  ## [0.8.28] - 2026-06-11
8
12
 
9
13
  ### Changed
@@ -434,7 +438,7 @@ All notable changes to this project will be documented in this file.
434
438
  ## [0.5.0] - 2026-02-01
435
439
 
436
440
  ### Added
437
- - GitHub repository clone extraction for `fetch_content` -- detects GitHub code URLs, clones repos to `/tmp/pi-github-repos/`, and returns actual file contents plus local path for further exploration with `read` and `bash`
441
+ - GitHub repository clone extraction for `fetch_content` -- detects GitHub code URLs, clones repos to `/tmp/atomic-github-repos/`, and returns actual file contents plus local path for further exploration with `read` and `bash`
438
442
  - Lightweight API fallback for oversized repos (>350MB) and commit SHA URLs via `gh api`
439
443
  - Clone cache with concurrent request deduplication (second request awaits first's clone)
440
444
  - `forceClone` parameter on `fetch_content` to override the size threshold
@@ -265,7 +265,7 @@ All config lives in `~/.pi/web-search.json`. Every field is optional.
265
265
  "enabled": true,
266
266
  "maxRepoSizeMB": 350,
267
267
  "cloneTimeoutSeconds": 30,
268
- "clonePath": "/tmp/pi-github-repos"
268
+ "clonePath": "/tmp/atomic-github-repos"
269
269
  },
270
270
  "youtube": {
271
271
  "enabled": true,
@@ -78,7 +78,7 @@ function loadGitHubConfig(): GitHubCloneConfig {
78
78
  enabled: true,
79
79
  maxRepoSizeMB: 350,
80
80
  cloneTimeoutSeconds: 30,
81
- clonePath: "/tmp/pi-github-repos",
81
+ clonePath: "/tmp/atomic-github-repos",
82
82
  };
83
83
 
84
84
  if (!existsSync(CONFIG_PATH)) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.8.28",
3
+ "version": "0.8.29-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": [
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@bastani/atomic": "*",
33
- "@earendil-works/pi-tui": "^0.78.1"
33
+ "@earendil-works/pi-tui": "^0.79.3"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@bastani/atomic": {
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "@mozilla/readability": "^0.6.0",
45
45
  "linkedom": "^0.18.12",
46
- "p-limit": "^6.1.0",
46
+ "p-limit": "^7.3.0",
47
47
  "turndown": "^7.2.0",
48
48
  "unpdf": "^1.6.2"
49
49
  }
@@ -6,6 +6,32 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Added
10
+
11
+ - Added opt-in schema-backed workflow item results: `ctx.stage(..., { schema })`, `ctx.task(..., { schema })`, `ctx.chain` items, and `ctx.parallel` items now receive a schema-specific `structured_output` tool only for that item, require the final tool call, return the parsed value from `ctx.stage().prompt(...)`, and expose parsed task values as `result.structured` while preserving formatted JSON handoff text ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
12
+
13
+ ### Changed
14
+
15
+ - Changed the builtin `ralph` workflow to start each iteration with `/skill:prompt-engineer` prompt-engineering and `/skill:research-codebase` research instead of an RFC/planner stage, pass the resulting research artifact to the orchestrator as primary implementation context, fork follow-up research from prior research session data, and feed unresolved reviewer findings into subsequent research passes ([#1371](https://github.com/bastani-inc/atomic/issues/1371)).
16
+ - Changed builtin `goal`, `ralph`, and `open-claude-design` decision gates to use schema-backed workflow `structured_output` stages with TypeBox-native schema builders instead of registering bespoke terminating custom tools or wrapping plain JSON schemas with `Type.Unsafe`.
17
+ - Changed the builtin `ralph` prompt-engineering stage to disable all tools while relying on the `/skill:prompt-engineer` skill prompt, keeping that first-pass rewrite focused and tool-free.
18
+ - Changed builtin `goal` worker/reviewer prompts and `ralph` orchestrator/reviewer prompts to request end-to-end verification when practical, using browser-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios.
19
+ - Aligned the workflows extension with upstream pi TUI `^0.79.3` so workflow graph, custom UI, and prompt-broker integrations inherit the latest shared TUI compatibility fixes.
20
+ - Documented the opt-in `structured_output` workflow path and clarified that ordinary workflow stages do not receive `structured_output` from the default tool registry; schema-enabled items auto-add the runtime tool to explicit `tools` allowlists ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
21
+ - Clarified that workflow `structured_output` gate schemas must be top-level object tool-argument schemas, with arrays and primitives wrapped in object fields before being returned through the terminating tool, and documented the one-`prompt()` limit for schema-backed `StageContext` result contracts ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
22
+ - Documented that terminating workflow-stage `structured_output` JSON stays inline even when large, while artifact-sized handoffs should still be saved to files when downstream stages do not need the full payload in context ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
23
+
24
+ ### Fixed
25
+
26
+ - Fixed direct workflow tool validation so schema-enabled `task`, `tasks`, `chain`, and `parallel` items reject array or primitive structured-output schemas at argument-validation time while accepting the same object-root contracts as runtime validation, including object-only `allOf` schemas ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
27
+ - Fixed schema-backed workflow stages to fail with a clear stage-level error when `prompt()` is called more than once on the same `StageContext`, rather than surfacing the lower-level structured-output single-use guard ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
28
+ - Fixed schema-backed workflow model fallback so an attempt that already captured a valid terminating `structured_output` result is treated as successful instead of retrying against fallback models and tripping the single-use result guard ([#1350](https://github.com/bastani-inc/atomic/issues/1350)).
29
+ - Fixed the workflow graph overlay remaining interactive when the parent/main-chat agent opens `ask_user_question`: the graph keeps focus, the parent question stays pending behind it with a clear “Main chat needs input — exit graph to answer.” status hint, hiding/exiting the graph focuses the pending question, and host custom-UI state changes no longer hide, restore, remount, or repaint the overlay ([#1353](https://github.com/bastani-inc/atomic/issues/1353)).
30
+ - Fixed builtin `ralph` skill-prompt stages to invoke bundled skills through `/skill:<name>` expansion so prompt engineering and research stages receive the intended skill instructions.
31
+ - Fixed concurrent workflow stage resource reloads to serialize temporary subagent child environment isolation so parallel stage startup cannot leave parent process child flags accidentally cleared.
32
+ - Fixed workflow stage sessions to keep bundled workflow package skills (`create-spec`, `impeccable`, `prompt-engineer`, `research-codebase`, and `skill-creator`) available while still disabling only the recursive workflows extension inside child sessions.
33
+ - Fixed workflow stage resource discovery so bundled subagent definitions stay available, `subagent` is active by default with the same two-hop nesting budget as main chat, and explicitly allowlisted bundled extension tools such as `subagent`, `web_search`, `fetch_content`, and `intercom` remain visible even when a workflow is launched from a subagent child process.
34
+
9
35
  ## [0.8.28] - 2026-06-11
10
36
 
11
37
  ### Added
@@ -264,6 +264,26 @@ Worktree semantics:
264
264
 
265
265
  For advanced integrations, the SDK also exports `setupGitWorktree(options)`, which returns `{ worktreeRoot, cwd, repositoryRoot, created }` and uses the same validation/path behavior as the executor.
266
266
 
267
+ ### Structured stage results
268
+
269
+ `structured_output` is opt-in for workflow items. Add `schema` to `ctx.stage`, `ctx.task`, `ctx.chain` items, or `ctx.parallel` items when the stage must finish with machine-readable JSON:
270
+
271
+ ```typescript
272
+ const Decision = Type.Object({
273
+ approved: Type.Boolean(),
274
+ findings: Type.Array(Type.String()),
275
+ }, { additionalProperties: false });
276
+
277
+ const decision = await ctx.stage("review-gate", { schema: Decision }).prompt(
278
+ "Review the artifact and return the decision.",
279
+ );
280
+ // decision.approved is typed from the schema.
281
+ ```
282
+
283
+ Atomic registers the canonical `structured_output` tool only for schema-enabled items, automatically adds it to explicit `tools` allowlists, and fails the item if the model completes without the final tool call. The schema is used directly as the tool argument contract, so wrap arrays or primitives in an object field such as `{ items: [...] }` or `{ value: ... }`. A schema-backed `StageContext` supports one `prompt()` call because the final-answer tool is an exact-once result contract; create another `ctx.stage(..., { schema })` for another structured prompt. `ctx.task`/`ctx.chain`/`ctx.parallel` results expose the parsed value as `result.structured` and keep `result.text` as formatted JSON for handoffs.
284
+
285
+ `subagent` is available as a default workflow-stage tool with the same default two-hop nesting budget as main chat: a stage can launch a subagent, and that child can launch one nested subagent before the guard blocks further delegation. `tools` allowlists apply to bundled extension tools as well as built-ins; if a stage sets `tools`, list every tool it should see. Workflow stages can explicitly list `subagent`, `web_search`, `fetch_content`, `intercom`, and other loaded extension tools, while `excludedTools` and `noTools: "all"` still win. Bundled `@bastani/subagents` agent definitions are available to the `subagent` tool in workflow stages, including workflows launched from a subagent child process.
286
+
267
287
  ### Model fallbacks
268
288
 
269
289
  Stages and high-level task helpers can retry transient provider/model failures with an ordered `fallbackModels` list. The primary `model` is tried first, then each fallback, and finally the current Atomic-selected model when available. Fallbacks are only used for retryable model/provider failures such as rate limits, quota/auth/provider outages, unavailable models, network timeouts, and 5xx errors — ordinary tool, shell, validation, cancellation, and workflow-code failures are not retried.
@@ -501,7 +521,7 @@ Prompt answer replay is live-memory only. `StageSnapshot.promptAnswerState` repo
501
521
  "async": "optional boolean to dispatch a run in the background",
502
522
  "intercom": "optional intercom coordination options",
503
523
  "chainDir": "optional directory for direct chain artifacts",
504
- "session/task options": "per-stage overrides also accepted at the top level and on direct task items — model, thinkingLevel, fallbackModels, tools, noTools, customTools, mcp, context, cwd, output, outputMode, reads, worktree, gitWorktreeDir, baseBranch, maxOutput, artifacts, and more"
524
+ "session/task options": "per-stage overrides also accepted at the top level and on direct task items — schema, model, thinkingLevel, fallbackModels, tools, noTools, customTools, mcp, context, cwd, output, outputMode, reads, worktree, gitWorktreeDir, baseBranch, maxOutput, artifacts, and more"
505
525
  }
506
526
  }
507
527
  ```
@@ -571,7 +591,7 @@ Child workflow outputs: `result`, `findings`, `research_doc_path`, `artifact_dir
571
591
 
572
592
  ### `goal`
573
593
 
574
- Goal Runner workflow: initialize a persisted goal ledger with a per-run goal id and lifecycle events, render goal-continuation context, run bounded worker LM turns, append receipts, run three independent reviewers, and let a TypeScript reducer decide `complete`, `continue`, `blocked`, or `needs_human`. Token budget behavior is intentionally excluded.
594
+ Goal Runner workflow: initialize a persisted goal ledger with a per-run goal id and lifecycle events, render goal-continuation context, run bounded worker LM turns, append receipts, run three independent reviewers, and let a TypeScript reducer decide `complete`, `continue`, `blocked`, or `needs_human`. Workers and reviewers are prompted to verify user-visible behavior end-to-end when practical with browser-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios. Token budget behavior is intentionally excluded.
575
595
 
576
596
  ```text
577
597
  /workflow goal objective="Migrate the database layer to Drizzle ORM" base_branch=develop
@@ -589,22 +609,22 @@ Child workflow outputs: `result`, `status`, `approved`, `goal_id`, `objective`,
589
609
 
590
610
  ### `ralph`
591
611
 
592
- Planorchestratesimplify → 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.
612
+ Prompt-engineeringresearchorchestrate → review workflow with optional final-stage PR handoff: transform the user prompt into a codebase and online research question with `/skill:prompt-engineer`, run `/skill:research-codebase` against it, write findings under `research/`, delegate implementation through sub-agents from that research, run parallel reviewers, and iterate until approval or the loop limit. Ralph's orchestrator and reviewers are prompted to verify user-visible behavior end-to-end when practical with browser-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios. Follow-up iterations pass unresolved review artifacts into prompt-engineering/research and fork research from prior research session data when available. 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.
593
613
 
594
614
  ```text
595
- /workflow ralph prompt="Plan and migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop
596
- /workflow ralph prompt="Plan and migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop create_pr=true
615
+ /workflow ralph prompt="Migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop
616
+ /workflow ralph prompt="Migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop create_pr=true
597
617
  ```
598
618
 
599
619
  | Input | Type | Required | Default | Description |
600
620
  | ------------------ | --------- | -------- | ------------- | ------------------------------------------------------------- |
601
- | `prompt` | `text` | ✓ | — | Task, feature request, issue summary, or spec path to plan, execute, refine, and review. |
602
- | `max_loops` | `number` | — | `10` | Maximum plan/orchestrate/review iterations before completion or optional final handoff. |
621
+ | `prompt` | `text` | ✓ | — | Task, feature request, issue summary, or spec path to research, execute, refine, and review. |
622
+ | `max_loops` | `number` | — | `10` | Maximum research/orchestrate/review iterations before completion or optional final handoff. |
603
623
  | `base_branch` | `string` | — | `origin/main` | Branch reviewers and the optional final stage compare the current delta with; also used to create a missing worktree. |
604
624
  | `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. |
605
625
  | `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. |
606
626
 
607
- 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.
627
+ Child workflow outputs: `result`, `plan` (latest transformed research question), `plan_path` (compatibility alias for `research_path`), `research`, `research_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.
608
628
 
609
629
  ### `open-claude-design`
610
630
 
@@ -44,27 +44,6 @@ interface DeepResearchCodebaseResult {
44
44
 
45
45
  const FILE_ONLY_OUTPUT = "file-only" satisfies WorkflowOutputMode;
46
46
 
47
- const CODEBASE_SKILLS = {
48
- locator:
49
- "codebase-locator — use this skill's search-first discipline when mapping where files, symbols, docs, tests, and configuration live.",
50
- analyzer:
51
- "codebase-analyzer — use this skill's evidence-driven deep-read style when explaining behavior, architecture, control flow, data flow, and edge cases.",
52
- patternFinder:
53
- "codebase-pattern-finder — use this skill's example-mining approach when separating reusable conventions from one-off details.",
54
- researchLocator:
55
- "codebase-research-locator — use this skill's historical-discovery approach when finding prior research, specs, ADRs, issues, and TODOs.",
56
- researchAnalyzer:
57
- "codebase-research-analyzer — use this skill's synthesis approach when extracting decisions, constraints, stale assumptions, and open questions from prior research.",
58
- onlineResearcher:
59
- "codebase-online-researcher — use this skill's source-citing approach when external documentation or ecosystem behavior materially affects the answer.",
60
- } as const;
61
-
62
- function codebaseSkillGuidance(
63
- ...skills: readonly (keyof typeof CODEBASE_SKILLS)[]
64
- ): string {
65
- return skills.map((skill) => CODEBASE_SKILLS[skill]).join("\n");
66
- }
67
-
68
47
  function taggedPrompt(sections: readonly PromptSection[]): string {
69
48
  return sections
70
49
  .map(([tag, content]) => {
@@ -446,11 +425,7 @@ export default defineWorkflow("deep-research-codebase")
446
425
  "role",
447
426
  "You are a senior codebase research scout preparing work for specialist agents.",
448
427
  ],
449
- ["objective", `Map the repository. Research question: ${prompt}`],
450
- [
451
- "codebase_skills",
452
- codebaseSkillGuidance("locator", "analyzer", "patternFinder"),
453
- ],
428
+ ["objective", `Map the repository using parallel codebase-locator, codebase-analyzer, and codebase-pattern-finder subagents. Research question: ${prompt}`],
454
429
  [
455
430
  "instructions",
456
431
  [
@@ -480,10 +455,9 @@ export default defineWorkflow("deep-research-codebase")
480
455
  ["role", "You locate prior project research and decision history."],
481
456
  [
482
457
  "objective",
483
- "Find existing docs, specs, ADRs, issues/PR notes, TODOs, and research artifacts relevant to the task.",
458
+ "Find existing docs, specs, ADRs, issues/PR notes, TODOs, and research artifacts relevant to the task using parallel codebase-research-locator subagents.",
484
459
  ],
485
460
  ["task", "{task}"],
486
- ["codebase_skills", codebaseSkillGuidance("researchLocator")],
487
461
  [
488
462
  "instructions",
489
463
  [
@@ -520,10 +494,9 @@ export default defineWorkflow("deep-research-codebase")
520
494
  ],
521
495
  [
522
496
  "objective",
523
- `Extract reusable historical context. Research question: ${prompt}`,
497
+ `Extract reusable historical context using parallel codebase-research-analyzer subagents. Research question: ${prompt}`,
524
498
  ],
525
499
  ["prior_research_locator_output", "{previous}"],
526
- ["codebase_skills", codebaseSkillGuidance("researchAnalyzer")],
527
500
  [
528
501
  "instructions",
529
502
  [
@@ -558,13 +531,9 @@ export default defineWorkflow("deep-research-codebase")
558
531
  ["role", "You turn scout research into clean work partitions."],
559
532
  [
560
533
  "objective",
561
- `Return at most ${partitionCap} independent partitions for this research question: ${prompt}`,
534
+ `Return at most ${partitionCap} independent partitions for this research question: ${prompt}. Use parallel codebase-locator, codebase-analyzer, and codebase-pattern-finder subagents.`,
562
535
  ],
563
536
  ["scout_output", "{previous}"],
564
- [
565
- "codebase_skills",
566
- codebaseSkillGuidance("locator", "analyzer", "patternFinder"),
567
- ],
568
537
  [
569
538
  "instructions",
570
539
  [
@@ -607,11 +576,11 @@ export default defineWorkflow("deep-research-codebase")
607
576
  "scout_context",
608
577
  `Read the scout artifact before making evidence claims: ${displayWorkflowPath(scoutPath)}\nCompact saved-output reference: {previous}`,
609
578
  ],
610
- ["codebase_skills", codebaseSkillGuidance("locator")],
611
579
  [
612
580
  "instructions",
613
581
  [
614
582
  "Find the highest-signal files, tests, docs, commands, configs, and symbols for this partition.",
583
+ "Use parallel codebase-locator subagents to explore different areas of the partition.",
615
584
  "Explain why each path matters for the research question.",
616
585
  "Prioritize exact paths and symbol names over broad descriptions.",
617
586
  "Flag areas that look relevant but could not be verified.",
@@ -643,11 +612,10 @@ export default defineWorkflow("deep-research-codebase")
643
612
  "scout_context",
644
613
  `Read the scout artifact before making evidence claims: ${displayWorkflowPath(scoutPath)}\nCompact saved-output reference: {previous}`,
645
614
  ],
646
- ["codebase_skills", codebaseSkillGuidance("patternFinder")],
647
615
  [
648
616
  "instructions",
649
617
  [
650
- "Identify recurring implementation patterns, abstractions, naming conventions, and anti-patterns in this partition.",
618
+ "Identify recurring implementation patterns, abstractions, naming conventions, and anti-patterns in this partition using parallel codebase-pattern-finder subagents.",
651
619
  "Use concrete examples with paths, symbols, or test names.",
652
620
  "Distinguish established conventions from one-off implementation details.",
653
621
  "Avoid generic advice that is not grounded in the repository.",
@@ -711,11 +679,10 @@ export default defineWorkflow("deep-research-codebase")
711
679
  "context",
712
680
  `Read these artifacts before analyzing: ${displayWorkflowPaths(analyzerReads)}\nCompact saved-output reference: {previous}`,
713
681
  ],
714
- ["codebase_skills", codebaseSkillGuidance("analyzer")],
715
682
  [
716
683
  "instructions",
717
684
  [
718
- "Analyze behavior, control flow, data flow, lifecycle, error handling, and test coverage for this partition.",
685
+ "Analyze behavior, control flow, data flow, lifecycle, error handling, and test coverage for this partition using parallel codebase-analyzer subagents.",
719
686
  "Build on the locator output; do not repeat file discovery except where needed as evidence.",
720
687
  "Call out edge cases, invariants, and coupling to other partitions.",
721
688
  "If evidence is incomplete, explain what remains unknown and how to verify it.",
@@ -747,11 +714,11 @@ export default defineWorkflow("deep-research-codebase")
747
714
  ["assignment", `Partition ${i}/${partitions.length}: ${partition}`],
748
715
  ["research_question", prompt],
749
716
  ["local_context", onlineResearcherLocalContext],
750
- ["codebase_skills", codebaseSkillGuidance("onlineResearcher")],
751
717
  [
752
718
  "instructions",
753
719
  [
754
720
  "Identify external library/framework behavior, standards, or docs that materially affect the local interpretation.",
721
+ "Use parallel codebase-online-researcher subagents to explore different angles of external research.",
755
722
  "Cite sources, package names, API names, versions, or documentation titles when available.",
756
723
  "Explain how each external fact applies to this repository.",
757
724
  "If external research is unnecessary or unavailable, say so and focus on local implications.",
@@ -829,14 +796,6 @@ export default defineWorkflow("deep-research-codebase")
829
796
  "specialist_reports",
830
797
  `Read the complete explorer handoff artifact(s) at ${displayWorkflowPaths(explorerPaths)}. They preserve every partition's Locator, Pattern Finder, Analyzer, and Online Researcher output from the original inline specialist handoff while keeping this prompt bounded.`,
831
798
  ],
832
- [
833
- "codebase_skills",
834
- codebaseSkillGuidance(
835
- "analyzer",
836
- "researchAnalyzer",
837
- "onlineResearcher",
838
- ),
839
- ],
840
799
  [
841
800
  "instructions",
842
801
  [
@@ -845,6 +804,7 @@ export default defineWorkflow("deep-research-codebase")
845
804
  "Prioritize claims supported by concrete paths, symbols, tests, docs, or cited external references.",
846
805
  "Resolve contradictions explicitly and preserve important uncertainty.",
847
806
  "Avoid inventing facts not supported by the supplied reports; state unknowns instead.",
807
+ "Use parallel codebase-analyzer, codebase-research-analyzer, and codebase-online-researcher subagents as needed to verify claims or fill critical gaps in the supplied reports.",
848
808
  "End with actionable next steps for a developer who will use this research.",
849
809
  ].join("\n"),
850
810
  ],
@@ -13,7 +13,7 @@ import { join } from "node:path";
13
13
  import { defineWorkflow } from "../src/workflows/define-workflow.js";
14
14
  import { Type } from "typebox";
15
15
  import type { WorkflowTaskResult } from "../src/shared/types.js";
16
- import { WORKER_PREFLIGHT_CONTRACT } from "./shared-prompts.js";
16
+ import { E2E_VERIFICATION_GUIDANCE, WORKER_PREFLIGHT_CONTRACT } from "./shared-prompts.js";
17
17
 
18
18
  const DEFAULT_MAX_TURNS = 10;
19
19
  // Goal Runner runs three independent reviewer personas; two approvals form a majority.
@@ -135,108 +135,64 @@ function positiveInteger(value: number | undefined, fallback: number): number {
135
135
  return floored >= 1 ? floored : fallback;
136
136
  }
137
137
 
138
- const reviewDecisionSchema = {
139
- type: "object",
140
- additionalProperties: false,
141
- required: [
142
- "findings",
143
- "overall_correctness",
144
- "overall_explanation",
145
- "overall_confidence_score",
146
- "goal_oracle_satisfied",
147
- "receipt_assessment",
148
- "verification_remaining",
149
- "stop_review_loop",
150
- ],
151
- properties: {
152
- findings: {
153
- type: "array",
154
- items: {
155
- type: "object",
156
- additionalProperties: false,
157
- required: ["title", "body", "confidence_score", "code_location"],
158
- properties: {
159
- title: { type: "string" },
160
- body: { type: "string" },
161
- confidence_score: { type: "number", minimum: 0, maximum: 1 },
162
- priority: { type: ["integer", "null"], minimum: 0, maximum: 3 },
163
- code_location: {
164
- type: "object",
165
- additionalProperties: false,
166
- required: ["absolute_file_path", "line_range"],
167
- properties: {
168
- absolute_file_path: { type: "string" },
169
- line_range: {
170
- type: "object",
171
- additionalProperties: false,
172
- required: ["start", "end"],
173
- properties: {
174
- start: { type: "integer", minimum: 1 },
175
- end: { type: "integer", minimum: 1 },
176
- },
177
- },
178
- },
138
+ const reviewFindingSchema = Type.Object(
139
+ {
140
+ title: Type.String(),
141
+ body: Type.String(),
142
+ confidence_score: Type.Number({ minimum: 0, maximum: 1 }),
143
+ priority: Type.Optional(
144
+ Type.Union([Type.Integer({ minimum: 0, maximum: 3 }), Type.Null()]),
145
+ ),
146
+ code_location: Type.Object(
147
+ {
148
+ absolute_file_path: Type.String(),
149
+ line_range: Type.Object(
150
+ {
151
+ start: Type.Integer({ minimum: 1 }),
152
+ end: Type.Integer({ minimum: 1 }),
179
153
  },
180
- },
154
+ { additionalProperties: false },
155
+ ),
181
156
  },
182
- },
183
- overall_correctness: {
184
- type: "string",
185
- enum: ["patch is correct", "patch is incorrect"],
186
- },
187
- overall_explanation: { type: "string" },
188
- overall_confidence_score: { type: "number", minimum: 0, maximum: 1 },
189
- goal_oracle_satisfied: { type: "boolean" },
190
- receipt_assessment: { type: "string" },
191
- verification_remaining: { type: "string" },
192
- stop_review_loop: { type: "boolean" },
193
- reviewer_error: {
194
- anyOf: [
195
- { type: "null" },
196
- {
197
- type: "object",
198
- additionalProperties: false,
199
- required: ["kind", "message", "attempted_recovery"],
200
- properties: {
201
- kind: {
202
- type: "string",
203
- enum: [
204
- "validation_unavailable",
205
- "dependency_unavailable",
206
- "tool_failure",
207
- "reviewer_failure",
208
- ],
209
- },
210
- message: { type: "string" },
211
- attempted_recovery: { type: "string" },
212
- },
213
- },
214
- ],
215
- },
157
+ { additionalProperties: false },
158
+ ),
216
159
  },
217
- } as const;
218
-
219
- const reviewDecisionTool = {
220
- name: "review_decision",
221
- label: "Review Decision",
222
- description:
223
- "Emit the final structured review verdict after inspecting the patch.",
224
- promptSnippet: "Emit the final review verdict as structured data",
225
- promptGuidelines: [
226
- "Call review_decision after completing review investigation and validation.",
227
- "This is a terminating structured-output tool; do not emit another assistant response after calling it.",
228
- ],
229
- parameters: reviewDecisionSchema,
230
- async execute(_toolCallId: string, params: ReviewDecision) {
231
- return {
232
- content: [
233
- { type: "text" as const, text: JSON.stringify(params, null, 2) },
234
- ],
235
- details: params,
236
- terminate: true,
237
- };
160
+ { additionalProperties: false },
161
+ );
162
+
163
+ const reviewerErrorSchema = Type.Object(
164
+ {
165
+ kind: Type.Union([
166
+ Type.Literal("validation_unavailable"),
167
+ Type.Literal("dependency_unavailable"),
168
+ Type.Literal("tool_failure"),
169
+ Type.Literal("reviewer_failure"),
170
+ ]),
171
+ message: Type.String(),
172
+ attempted_recovery: Type.String(),
238
173
  },
239
- };
174
+ { additionalProperties: false },
175
+ );
176
+
177
+ const reviewDecisionSchema = Type.Object(
178
+ {
179
+ findings: Type.Array(reviewFindingSchema),
180
+ overall_correctness: Type.Union([
181
+ Type.Literal("patch is correct"),
182
+ Type.Literal("patch is incorrect"),
183
+ ]),
184
+ overall_explanation: Type.String(),
185
+ overall_confidence_score: Type.Number({ minimum: 0, maximum: 1 }),
186
+ goal_oracle_satisfied: Type.Boolean(),
187
+ receipt_assessment: Type.String(),
188
+ verification_remaining: Type.String(),
189
+ stop_review_loop: Type.Boolean(),
190
+ reviewer_error: Type.Optional(
191
+ Type.Union([Type.Null(), reviewerErrorSchema]),
192
+ ),
193
+ },
194
+ { additionalProperties: false },
195
+ );
240
196
 
241
197
  const GOAL_CONTINUATION_REFERENCE = [
242
198
  "Continuation behavior:",
@@ -589,6 +545,7 @@ function renderGoalContinuationPrompt(
589
545
  ].join("\n"),
590
546
  ],
591
547
  ["goal_guidelines", GOAL_CONTINUATION_REFERENCE],
548
+ ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
592
549
  ]);
593
550
  }
594
551
 
@@ -619,6 +576,7 @@ function renderForkedGoalWorkerPrompt(
619
576
  renderLatestReviewArtifacts(latestReviewArtifactPaths),
620
577
  ].join("\n"),
621
578
  ],
579
+ ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
622
580
  ]);
623
581
  }
624
582
 
@@ -795,6 +753,7 @@ function renderReviewerPrompt(args: {
795
753
  ["goal_framework", GOAL_METHOD_REFERENCE],
796
754
  ["goal_guidelines", GOAL_CONTINUATION_REFERENCE],
797
755
  ["auditability", RECEIPT_EXPECTATIONS],
756
+ ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
798
757
  [
799
758
  "goal_context",
800
759
  [
@@ -829,8 +788,6 @@ function renderReviewerPrompt(args: {
829
788
  [
830
789
  "Inspect the actual diff/repository state rather than trusting stage summaries.",
831
790
  "Identify the smallest relevant validation set from repository evidence: targeted tests, lint, typecheck, build, generated-artifact checks, CI-equivalent scripts, or user-flow proof.",
832
- "When practical, include an end-to-end QA check that exercises the app the way a user would: use the tmux skill for terminal app environments and browser for web app environments.",
833
- "For web app environments, capture a screenshot as a certificate of correct completion when the UI state proves the objective; for terminal app environments, capture the terminal window/output that shows proof of correctness.",
834
791
  "Run or delegate focused validation when it is necessary to distinguish a real bug from a hunch.",
835
792
  "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.",
836
793
  "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.",
@@ -915,14 +872,14 @@ function renderReviewerPrompt(args: {
915
872
  [
916
873
  "output_format",
917
874
  [
918
- "You have a structured-output tool named review_decision. Use it after your investigation and validation attempts.",
875
+ "Use the schema-backed structured_output tool after your investigation and validation attempts.",
919
876
  "The tool terminates the turn and provides the structured data; do not emit a separate final assistant response after calling it.",
920
- "The review gate decides completion only by parsing the JSON object returned by this tool; invalid JSON, missing fields, reviewer_error, or stop_review_loop=false are treated as not approved for safety.",
877
+ "The review gate decides completion only from the JSON object captured by structured_output; invalid JSON, missing fields, reviewer_error, or stop_review_loop=false are treated as not approved for safety.",
921
878
  "Set stop_review_loop=true only when there are no P0/P1/P2 findings, overall_correctness is patch is correct, goal_oracle_satisfied is true, no objective-relevant verification remains, and reviewer_error is null/omitted.",
922
879
  "P3 nice-to-have findings are non-blocking when the rest of the approval contract is satisfied; do not use P3 for work required by the objective or verification oracle.",
923
880
  "If you hit a reviewer/tool/validation error, still return the object with stop_review_loop=false and reviewer_error populated instead of pretending the patch is approved.",
924
881
  [
925
- "The review_decision tool schema is authoritative; do not copy a hand-written JSON blob into the final response. Here is an example output:",
882
+ "The structured_output schema is authoritative; do not copy a hand-written JSON blob into the final response. Here is an example output:",
926
883
  "{",
927
884
  ' "findings": [',
928
885
  " {",
@@ -1080,8 +1037,8 @@ export default defineWorkflow("goal")
1080
1037
  "github-copilot/claude-opus-4.8:xhigh",
1081
1038
  "anthropic/claude-opus-4-8:xhigh"
1082
1039
  ],
1083
- tools: [...goalRunnerTools, reviewDecisionTool.name],
1084
- customTools: [reviewDecisionTool],
1040
+ tools: goalRunnerTools,
1041
+ schema: reviewDecisionSchema,
1085
1042
  };
1086
1043
 
1087
1044
  let latestReviews: ReviewRecord[] = [];
@@ -83,6 +83,8 @@ export type RalphWorkflowOutputs = WorkflowOutputValues & {
83
83
  readonly result?: string;
84
84
  readonly plan?: string;
85
85
  readonly plan_path?: string;
86
+ readonly research?: string;
87
+ readonly research_path?: string;
86
88
  readonly implementation_notes_path?: string;
87
89
  readonly pr_report?: string;
88
90
  readonly approved?: boolean;