roast-ai 0.4.0 → 0.4.2

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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +2 -2
  3. data/.gitignore +1 -0
  4. data/CHANGELOG.md +103 -0
  5. data/CLAUDE.md +55 -9
  6. data/Gemfile.lock +19 -10
  7. data/README.md +69 -3
  8. data/bin/console +1 -0
  9. data/docs/AGENT_STEPS.md +33 -9
  10. data/docs/VALIDATION.md +178 -0
  11. data/examples/agent_continue/add_documentation/prompt.md +5 -0
  12. data/examples/agent_continue/add_error_handling/prompt.md +5 -0
  13. data/examples/agent_continue/analyze_codebase/prompt.md +7 -0
  14. data/examples/agent_continue/combined_workflow.yml +24 -0
  15. data/examples/agent_continue/continue_adding_features/prompt.md +4 -0
  16. data/examples/agent_continue/create_integration_tests/prompt.md +3 -0
  17. data/examples/agent_continue/document_with_context/prompt.md +5 -0
  18. data/examples/agent_continue/explore_api/prompt.md +6 -0
  19. data/examples/agent_continue/implement_client/prompt.md +6 -0
  20. data/examples/agent_continue/inline_workflow.yml +20 -0
  21. data/examples/agent_continue/refactor_code/prompt.md +2 -0
  22. data/examples/agent_continue/verify_changes/prompt.md +6 -0
  23. data/examples/agent_continue/workflow.yml +27 -0
  24. data/examples/agent_workflow/workflow.png +0 -0
  25. data/examples/api_workflow/workflow.png +0 -0
  26. data/examples/apply_diff_demo/README.md +58 -0
  27. data/examples/apply_diff_demo/apply_simple_change/prompt.md +13 -0
  28. data/examples/apply_diff_demo/create_sample_file/prompt.md +11 -0
  29. data/examples/apply_diff_demo/workflow.yml +24 -0
  30. data/examples/available_tools_demo/workflow.png +0 -0
  31. data/examples/bash_prototyping/api_testing.png +0 -0
  32. data/examples/bash_prototyping/system_analysis.png +0 -0
  33. data/examples/case_when/workflow.png +0 -0
  34. data/examples/cmd/basic_workflow.png +0 -0
  35. data/examples/cmd/dev_workflow.png +0 -0
  36. data/examples/cmd/explorer_workflow.png +0 -0
  37. data/examples/conditional/simple_workflow.png +0 -0
  38. data/examples/conditional/workflow.png +0 -0
  39. data/examples/context_management_demo/README.md +43 -0
  40. data/examples/context_management_demo/workflow.yml +42 -0
  41. data/examples/direct_coerce_syntax/workflow.png +0 -0
  42. data/examples/dot_notation/workflow.png +0 -0
  43. data/examples/exit_on_error/workflow.png +0 -0
  44. data/examples/grading/rb_test_runner +1 -1
  45. data/examples/grading/workflow.png +0 -0
  46. data/examples/interpolation/workflow.png +0 -0
  47. data/examples/interpolation/workflow.yml +1 -1
  48. data/examples/iteration/workflow.png +0 -0
  49. data/examples/json_handling/workflow.png +0 -0
  50. data/examples/mcp/database_workflow.png +0 -0
  51. data/examples/mcp/env_demo/workflow.png +0 -0
  52. data/examples/mcp/filesystem_demo/workflow.png +0 -0
  53. data/examples/mcp/github_workflow.png +0 -0
  54. data/examples/mcp/multi_mcp_workflow.png +0 -0
  55. data/examples/mcp/workflow.png +0 -0
  56. data/examples/no_model_fallback/README.md +17 -0
  57. data/examples/no_model_fallback/analyze_file/prompt.md +1 -0
  58. data/examples/no_model_fallback/analyze_patterns/prompt.md +27 -0
  59. data/examples/no_model_fallback/generate_report_for_md/prompt.md +10 -0
  60. data/examples/no_model_fallback/generate_report_for_rb/prompt.md +3 -0
  61. data/examples/no_model_fallback/sample.rb +42 -0
  62. data/examples/no_model_fallback/workflow.yml +19 -0
  63. data/examples/openrouter_example/workflow.png +0 -0
  64. data/examples/pre_post_processing/workflow.png +0 -0
  65. data/examples/rspec_to_minitest/workflow.png +0 -0
  66. data/examples/shared_config/example_with_shared_config/workflow.png +0 -0
  67. data/examples/shared_config/shared.png +0 -0
  68. data/examples/single_target_prepost/workflow.png +0 -0
  69. data/examples/smart_coercion_defaults/workflow.png +0 -0
  70. data/examples/step_configuration/workflow.png +0 -0
  71. data/examples/swarm_example.yml +25 -0
  72. data/examples/tool_config_example/workflow.png +0 -0
  73. data/examples/user_input/funny_name/workflow.png +0 -0
  74. data/examples/user_input/simple_input_demo/workflow.png +0 -0
  75. data/examples/user_input/survey_workflow.png +0 -0
  76. data/examples/user_input/workflow.png +0 -0
  77. data/examples/workflow_generator/workflow.png +0 -0
  78. data/lib/roast/errors.rb +3 -0
  79. data/lib/roast/helpers/timeout_handler.rb +91 -0
  80. data/lib/roast/services/context_threshold_checker.rb +42 -0
  81. data/lib/roast/services/token_counting_service.rb +44 -0
  82. data/lib/roast/tools/apply_diff.rb +128 -0
  83. data/lib/roast/tools/bash.rb +15 -9
  84. data/lib/roast/tools/cmd.rb +32 -12
  85. data/lib/roast/tools/coding_agent.rb +65 -10
  86. data/lib/roast/tools/context_summarizer.rb +108 -0
  87. data/lib/roast/tools/swarm.rb +124 -0
  88. data/lib/roast/version.rb +1 -1
  89. data/lib/roast/workflow/agent_step.rb +9 -2
  90. data/lib/roast/workflow/base_iteration_step.rb +3 -2
  91. data/lib/roast/workflow/base_workflow.rb +41 -2
  92. data/lib/roast/workflow/command_executor.rb +3 -1
  93. data/lib/roast/workflow/configuration.rb +2 -1
  94. data/lib/roast/workflow/configuration_loader.rb +63 -1
  95. data/lib/roast/workflow/configuration_parser.rb +2 -0
  96. data/lib/roast/workflow/context_manager.rb +89 -0
  97. data/lib/roast/workflow/each_step.rb +1 -1
  98. data/lib/roast/workflow/input_step.rb +2 -0
  99. data/lib/roast/workflow/interpolator.rb +23 -1
  100. data/lib/roast/workflow/output_handler.rb +1 -1
  101. data/lib/roast/workflow/repeat_step.rb +1 -1
  102. data/lib/roast/workflow/replay_handler.rb +1 -1
  103. data/lib/roast/workflow/sqlite_state_repository.rb +342 -0
  104. data/lib/roast/workflow/state_manager.rb +2 -2
  105. data/lib/roast/workflow/state_repository_factory.rb +36 -0
  106. data/lib/roast/workflow/step_completion_reporter.rb +27 -0
  107. data/lib/roast/workflow/step_executor_coordinator.rb +19 -18
  108. data/lib/roast/workflow/step_executor_with_reporting.rb +68 -0
  109. data/lib/roast/workflow/step_loader.rb +1 -1
  110. data/lib/roast/workflow/step_name_extractor.rb +84 -0
  111. data/lib/roast/workflow/validation_command.rb +197 -0
  112. data/lib/roast/workflow/validators/base_validator.rb +44 -0
  113. data/lib/roast/workflow/validators/dependency_validator.rb +223 -0
  114. data/lib/roast/workflow/validators/linting_validator.rb +113 -0
  115. data/lib/roast/workflow/validators/schema_validator.rb +90 -0
  116. data/lib/roast/workflow/validators/step_collector.rb +57 -0
  117. data/lib/roast/workflow/validators/validation_orchestrator.rb +52 -0
  118. data/lib/roast/workflow/workflow_executor.rb +11 -4
  119. data/lib/roast/workflow/workflow_initializer.rb +80 -0
  120. data/lib/roast/workflow/workflow_runner.rb +6 -0
  121. data/lib/roast/workflow_diagram_generator.rb +298 -0
  122. data/lib/roast.rb +158 -0
  123. data/roast.gemspec +4 -1
  124. data/schema/workflow.json +77 -1
  125. metadata +129 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c0f1a837c5dafcaecb8443e93a4076c11566f1c3bea1d6835121628fbdf79a7
4
- data.tar.gz: ab3679b374486831cbf90ab3a259178d48d4e53d5d5dbdc2a2d43537399e4ca9
3
+ metadata.gz: d1822868d0357ade29fdbdd3feab6a1beff23ef97621de9e1a9cacee366d5897
4
+ data.tar.gz: 00b9aff47853dc8f1f4ffa89bf571975fbe414632909b682fe6caab4e64bee51
5
5
  SHA512:
6
- metadata.gz: 3061d9f04b7f886e3a6d588eb729e10062f6310d5973c7ed5181975f27a385c20d8ff8880ecb7e61abd54dfbd87795211313e1c9a6d2a630269d7c4559ae7cae
7
- data.tar.gz: 7962e4991590700003f3f8a827435214ef9aa90fa4324d34d3b421f11d5f647e43663e17189a0b43f81d6fa124bbf68a269f9674a493994832b9ab5c03f192a6
6
+ metadata.gz: 95c32a5e010460dfe2e584c7b0ba8b7d617dc965210fc00343bd2c1f647c847f3be41be0bb07a951a41b5aa1447c770b36f4eba97985543f510938044e85453b
7
+ data.tar.gz: d221ec8fba42b7187ae30fa4171e2700a7b81b1092693f9fdf1f168a37b6318482f5be8cf3f1be4e8650fe7a56d87ef2a0f93fea13f633e24c95734c285fd75b
@@ -23,8 +23,8 @@ jobs:
23
23
  BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
24
24
  steps:
25
25
  - uses: actions/checkout@v4
26
- - name: Install ripgrep
27
- run: sudo apt-get update && sudo apt-get install -y ripgrep
26
+ - name: Install dependencies
27
+ run: sudo apt-get update && sudo apt-get install -y ripgrep graphviz
28
28
  - uses: ruby/setup-ruby@v1
29
29
  with:
30
30
  ruby-version: ${{ matrix.ruby }}
data/.gitignore CHANGED
@@ -41,3 +41,4 @@ bin/thor
41
41
 
42
42
  gemfiles/*.lock
43
43
  bin/claude-swarm
44
+ *.gem
data/CHANGELOG.md CHANGED
@@ -5,6 +5,109 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.2] - 2025-06-20
9
+
10
+ ### Added
11
+ - **Multiline bash command support** (#289)
12
+ - Enhanced CommandExecutor to properly handle commands spanning multiple lines
13
+ - Enables sophisticated bash scripts in workflow steps
14
+ - Maintains backward compatibility with single-line commands
15
+ - **Comprehensive shell security enhancements** (#289)
16
+ - Smart interpolation that detects shell commands and escapes dangerous characters
17
+ - Protection against shell injection for all major metacharacters:
18
+ - Backslashes (`\`) to prevent path injection
19
+ - Double quotes (`"`) to prevent breaking quoted contexts
20
+ - Dollar signs (`$`) to prevent variable expansion
21
+ - Backticks (`` ` ``) to prevent command substitution
22
+ - Context-aware escaping only in shell commands, preserving text elsewhere
23
+ - **Early detection for missing Raix configuration** (#292)
24
+ - Provides helpful error messages when Raix is not properly initialized
25
+ - Shows example configuration for both OpenAI and OpenRouter
26
+ - Prevents cryptic "undefined method 'chat' for nil" errors
27
+ - **Exit early feature for input steps** (#291)
28
+ - Pressing Ctrl-C during input steps now exits cleanly
29
+ - No more confusing stack traces when canceling input
30
+ - **Default --dangerously-skip-permissions flag for CodingAgent** (#290)
31
+ - Avoids permission prompts during automated workflows
32
+ - Improves workflow automation experience
33
+
34
+ ### Fixed
35
+ - Test isolation issue causing CI failures (#289)
36
+ - Flaky test in StepExecutorRegistryTest due to executor registration conflicts (#289)
37
+ - Shell command interpolation security vulnerabilities (#289)
38
+ - Missing dependency declarations (cli-kit, sqlite3) (#292)
39
+
40
+ ### Changed
41
+ - Updated cli-kit dependency to ~> 5.0 for better error handling
42
+ - Updated sqlite3 dependency to ~> 2.6 to resolve version conflicts
43
+
44
+ [0.4.2]: https://github.com/Shopify/roast/compare/v0.4.1...v0.4.2
45
+
46
+ ## [0.4.1] - 2025-06-18
47
+
48
+ ### Added
49
+ - **SQLite session storage** as the default storage backend (#252)
50
+ - Provides better performance and advanced querying capabilities
51
+ - Sessions are stored in `~/.roast/sessions.db` by default (configurable via `ROAST_SESSIONS_DB`)
52
+ - New `roast sessions` command to list and filter stored sessions
53
+ - New `roast session <id>` command to view detailed session information
54
+ - Session cleanup with `roast sessions --cleanup --older-than <duration>`
55
+ - Filter sessions by status, workflow name, or age
56
+ - Maintains full backward compatibility with filesystem storage
57
+ - **`--file-storage` CLI option** to use legacy filesystem storage instead of SQLite
58
+ - Use `-f` or `--file-storage` flag to opt into filesystem storage
59
+ - Environment variable `ROAST_STATE_STORAGE=file` still supported for compatibility
60
+ - **Foundation for wait_for_event feature** (#251)
61
+ - New `roast resume` command infrastructure for resuming paused workflows
62
+ - Event storage and tracking in SQLite sessions table
63
+ - **Configurable agent step options** for CodingAgent (#266)
64
+ - New `continue` option for agent steps to maintain session context across multiple agent invocations
65
+ - New `include_context_summary` option to provide AI-generated workflow context summaries to agents
66
+ - Context summaries are intelligently tailored to the agent's specific task using LLM analysis
67
+ - Helps reduce token usage by including only relevant context information
68
+ - **Token consumption reporting** for step execution (#264)
69
+ - Displays token usage (prompt and completion) after each step execution
70
+ - Helps users monitor and optimize their LLM token consumption
71
+ - Automatically enabled for all workflow runs
72
+ - **Timeout functionality for bash and cmd steps** (#261)
73
+ - New `timeout` option for bash and cmd steps to prevent hanging commands
74
+ - Configurable timeout duration in seconds
75
+ - Commands are automatically terminated if they exceed the specified timeout
76
+ - Prevents workflows from getting stuck on unresponsive commands
77
+ - **Claude Swarm tool integration** (#254)
78
+ - New `Roast::Tools::Swarm` for integrating with Claude Swarm framework
79
+ - Enables using Swarm's multi-agent orchestration capabilities within Roast workflows
80
+ - Provides seamless handoffs between specialized AI agents
81
+ - **Workflow visualization with diagram command** (#256)
82
+ - New `roast diagram` command to generate visual representations of workflows
83
+ - Creates GraphViz-based diagrams showing workflow structure and flow
84
+ - Supports both DOT format output and PNG/SVG image generation
85
+ - Helps understand complex workflow logic at a glance
86
+ - **Comprehensive workflow validation** (#244)
87
+ - New `roast validate` command to check workflow syntax and structure
88
+ - Validates YAML syntax, step references, and configuration options
89
+ - Provides detailed error messages for invalid workflows
90
+ - Helps catch errors before running workflows
91
+ - **apply_diff tool** (#246)
92
+ - New built-in tool for applying unified diff patches to files
93
+ - Supports standard diff format for making precise file modifications
94
+ - Enables AI models to suggest changes in diff format
95
+ - More reliable than search-and-replace for complex edits
96
+ - **Model fallback mechanism** (#257)
97
+ - Workflows without explicit model configuration now use a sensible default
98
+ - Prevents errors when model is not specified at workflow or step level
99
+ - Improves user experience for simple workflows
100
+ - **Context management foundation for auto-compaction** (#264)
101
+ - Infrastructure for future automatic context size management
102
+ - Enables intelligent token usage optimization in long-running workflows
103
+
104
+ ### Changed
105
+ - Session storage now defaults to SQLite instead of filesystem
106
+ - Existing filesystem sessions remain accessible when using `--file-storage` flag
107
+ - No migration required - both storage backends can coexist
108
+
109
+ [0.4.1]: https://github.com/Shopify/roast/compare/v0.4.0...v0.4.1
110
+
8
111
  ## [0.4.0] - 2025-06-12
9
112
 
10
113
  ### Added
data/CLAUDE.md CHANGED
@@ -7,15 +7,12 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
7
7
  - Note that this project now uses Zeitwerk, which means you don't have to manually require project files anymore
8
8
 
9
9
  ## Commands
10
-
11
- - Default (tests + lint): `bundle exec rake`
12
- - Test all: `bundle exec test`
10
+ - Default THE SUITE RUNS FAST SO USE THIS IN MOST CASES (tests + lint w/autocorrect): `bundle exec rake`
13
11
  - Run single test: `bundle exec ruby -Itest test/path/to/test_file.rb`
14
12
  - Lint: `bundle exec rubocop`
15
13
  - Lint (with autocorrect, preferred): `bundle exec rubocop -A`
16
14
  - Whenever you want to run the whole test suite just run `bundle exec rake` to also run linting, and note the linting errors too (most will auto correct but not all)
17
15
  - **Run roast locally**: Use `bin/roast` (not `bundle exec roast` which may use the installed gem)
18
- - Alternative: `bundle exec exe/roast`
19
16
 
20
17
  ## Tech stack
21
18
  - `thor` and `cli-ui` for the CLI tool
@@ -23,7 +20,6 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
23
20
  - Prefer using the more literate `test "this is a test description" do` type of testing that we get from extending ActiveSupport::TestCase over the primitive XUnit-style def test_description headings for tests
24
21
 
25
22
  ## Code Style Guidelines
26
-
27
23
  - Naming: snake_case for variables/methods, CamelCase for classes/modules, ALL_CAPS for constants
28
24
  - Module structure: Use nested modules under the `Roast` namespace
29
25
  - Command pattern: Commands implement a `call` method and class-level `help` method
@@ -41,7 +37,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
41
37
  - Always leave a blank line after module includes and before the rest of the class
42
38
 
43
39
  ## Architecture Guidelines
44
-
40
+ - **SOLID principles are important** - don't violate them
45
41
  - **Maintain proper separation of concerns**: Don't mix unrelated concepts in the same class or module
46
42
  - Example: Conditional execution (if/unless) should NOT be mixed with iteration execution (each/repeat)
47
43
  - Each concept should have its own executor class and be handled separately
@@ -55,14 +51,64 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
51
  - When faced with the choice between working around an architectural issue or code smell versus actually diving into fixing the design issue or code smell, choose the latter more principled approach
56
52
  - When fixing code smells, you don't have to worry about internal backwards compatibility
57
53
 
58
- ## Guidance and Expectations
54
+ ## Workflow Configuration Syntax
55
+ - The `steps` key in the workflow configuration is an array of step names
56
+ - Only step names, inline prompts, and control flow keywords are allowed in the steps array
57
+ - Additional per-step configuration is provided in a top-level hash with the step name as the key, not within steps!!! (Very important)
58
+ - The reason that steps are not configured "inline" within the steps array is so that the shape of the workflow is as obvious as possible
59
+ - Step labels are inferred for most steps and optional for inline prompts, but required for steps that need custom configuration
60
+ - The result of running a step is stored in the `workflow.output` hash with the step label as the key
61
+
62
+ ## How Roast Tools Work (CRITICAL - READ THIS!)
63
+ **Tools in Roast are NOT explicitly invoked in workflow steps!** This is a fundamental concept that differs from many other workflow systems.
64
+
65
+ ### Key Concepts:
66
+ 1. **Tools are capabilities available to the LLM** - They are functions the LLM can choose to call while executing a step
67
+ 2. **Steps contain prompts** - Steps describe what needs to be done, not how to do it
68
+ 3. **The LLM decides when to use tools** - While executing a step's prompt, the LLM analyzes the task and calls tools as needed
69
+ 4. **Tools are registered, not declared in steps** - Use the `tools:` section to make tools available, but never use a `tool:` key in step configuration
70
+
71
+ ### Correct inline prompt syntax:
72
+ ```yaml
73
+ steps:
74
+ - analyze_code: |
75
+ Analyze the codebase and identify performance bottlenecks.
76
+ Use any available tools to read files and search for patterns.
77
+ ```
78
+
79
+ ### INCORRECT syntax (DO NOT USE):
80
+ ```yaml
81
+ # WRONG - no 'prompt:' key
82
+ steps:
83
+ - analyze_code:
84
+ prompt: "Analyze the codebase"
85
+
86
+ # WRONG - no 'tool:' key
87
+ steps:
88
+ - run_analysis:
89
+ tool: coding_agent
90
+ prompt: "Analyze code"
91
+ ```
92
+
93
+ ### How tools are actually used:
94
+ When the LLM executes the `analyze_code` step above, it might:
95
+ 1. Decide it needs to read files and call `read_file(path)`
96
+ 2. Decide it needs to search and call `grep(pattern, path)`
97
+ 3. Decide it needs Claude Swarm and call `swarm(prompt, config_path)`
98
+
99
+ The LLM makes these decisions based on the prompt and available tools, similar to how Claude (you) decides when to use Bash, Read, or other tools when responding to user requests.
59
100
 
101
+ ## Step Configuration
102
+ - The `path` key in a step configuration is the path to a Ruby file that defines a custom step.
103
+ - The `model` key in a step configuration is the model to use for the step.
104
+ - The `print_response` key in a step configuration is a boolean that determines whether the step's response should be printed to the console.
105
+
106
+ ## Coding Guidance and Expectations
60
107
  - Do not decide unilaterally to leave code for the sake of "backwards compatibility"... always run those decisions by me first.
61
108
  - Don't ever commit and push changes unless directly told to do so
62
- - You can't test input steps yourself, ask me to do it
109
+ - You can't test input steps yourself since they block, so ask me to do it manually
63
110
 
64
111
  ## Git Workflow Practices
65
-
66
112
  1. **Amending Commits**:
67
113
  - Use `git commit --amend --no-edit` to add staged changes to the last commit without changing the commit message
68
114
  - This is useful for incorporating small fixes or changes that belong with the previous commit
data/Gemfile.lock CHANGED
@@ -1,14 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roast-ai (0.4.0)
4
+ roast-ai (0.4.2)
5
5
  activesupport (>= 7.0)
6
+ cli-kit (~> 5.0)
6
7
  cli-ui (= 2.3.0)
7
8
  diff-lcs (~> 1.5)
8
9
  faraday-retry
9
10
  json-schema
10
11
  open_router (~> 0.3)
11
12
  raix (~> 1.0)
13
+ ruby-graphviz (~> 1.2)
14
+ sqlite3 (~> 2.6)
12
15
  thor (~> 1.3)
13
16
  zeitwerk (~> 2.6)
14
17
 
@@ -35,9 +38,11 @@ GEM
35
38
  benchmark (0.4.1)
36
39
  bigdecimal (3.2.2)
37
40
  cgi (0.5.0)
38
- claude_swarm (0.1.15)
41
+ claude_swarm (0.1.19)
39
42
  fast-mcp-annotations
40
43
  thor (~> 1.3)
44
+ cli-kit (5.0.1)
45
+ cli-ui (~> 2.0)
41
46
  cli-ui (2.3.0)
42
47
  coderay (1.1.3)
43
48
  concurrent-ruby (1.3.5)
@@ -82,11 +87,11 @@ GEM
82
87
  faraday-net_http (>= 2.0, < 3.5)
83
88
  json
84
89
  logger
85
- faraday-multipart (1.1.0)
90
+ faraday-multipart (1.1.1)
86
91
  multipart-post (~> 2.0)
87
- faraday-net_http (3.4.0)
92
+ faraday-net_http (3.4.1)
88
93
  net-http (>= 0.5.0)
89
- faraday-retry (2.3.1)
94
+ faraday-retry (2.3.2)
90
95
  faraday (~> 2.0)
91
96
  fast-mcp-annotations (1.5.2)
92
97
  addressable (~> 2.8)
@@ -131,7 +136,7 @@ GEM
131
136
  mime-types (3.7.0)
132
137
  logger
133
138
  mime-types-data (~> 3.2025, >= 3.2025.0507)
134
- mime-types-data (3.2025.0603)
139
+ mime-types-data (3.2025.0617)
135
140
  minitest (5.25.5)
136
141
  minitest-rg (5.3.0)
137
142
  minitest (~> 5.0)
@@ -149,7 +154,7 @@ GEM
149
154
  dotenv (>= 2)
150
155
  faraday (>= 1)
151
156
  faraday-multipart (>= 1)
152
- ostruct (0.6.1)
157
+ ostruct (0.6.2)
153
158
  parallel (1.27.0)
154
159
  parser (3.3.8.0)
155
160
  ast (~> 2.4.1)
@@ -174,7 +179,7 @@ GEM
174
179
  ffi (~> 1.0)
175
180
  regexp_parser (2.10.0)
176
181
  rexml (3.4.1)
177
- rubocop (1.76.0)
182
+ rubocop (1.77.0)
178
183
  json (~> 2.3)
179
184
  language_server-protocol (~> 3.17.0.2)
180
185
  lint_roller (~> 1.1.0)
@@ -182,14 +187,16 @@ GEM
182
187
  parser (>= 3.3.0.2)
183
188
  rainbow (>= 2.2.2, < 4.0)
184
189
  regexp_parser (>= 2.9.3, < 3.0)
185
- rubocop-ast (>= 1.45.0, < 2.0)
190
+ rubocop-ast (>= 1.45.1, < 2.0)
186
191
  ruby-progressbar (~> 1.7)
187
192
  unicode-display_width (>= 2.4.0, < 4.0)
188
- rubocop-ast (1.45.0)
193
+ rubocop-ast (1.45.1)
189
194
  parser (>= 3.3.7.2)
190
195
  prism (~> 1.4)
191
196
  rubocop-shopify (2.17.1)
192
197
  rubocop (~> 1.62)
198
+ ruby-graphviz (1.2.5)
199
+ rexml
193
200
  ruby-openai (7.4.0)
194
201
  event_stream_parser (>= 0.3.0, < 2.0.0)
195
202
  faraday (>= 1)
@@ -198,6 +205,8 @@ GEM
198
205
  ruby2_keywords (0.0.5)
199
206
  securerandom (0.4.1)
200
207
  shellany (0.0.1)
208
+ sqlite3 (2.6.0-arm64-darwin)
209
+ sqlite3 (2.6.0-x86_64-linux-gnu)
201
210
  thor (1.3.2)
202
211
  tzinfo (2.0.6)
203
212
  concurrent-ruby (~> 1.0)
data/README.md CHANGED
@@ -405,6 +405,72 @@ For typical AI workflows, the continuous conversation history provides seamless
405
405
  - `-c, --concise`: Use concise output templates (exposed as a boolean flag on `workflow`)
406
406
  - `-v, --verbose`: Show output from all steps as they execute
407
407
  - `-r, --replay STEP_NAME`: Resume a workflow from a specific step, optionally with a specific session timestamp
408
+ - `-f, --file-storage`: Use filesystem storage for sessions instead of SQLite (default: SQLite)
409
+
410
+ #### Workflow Validation
411
+
412
+ Roast provides a `validate` command to check workflow configuration files for errors and potential issues before execution:
413
+
414
+ ```bash
415
+ # Validate a specific workflow
416
+ roast validate workflow.yml
417
+
418
+ # Validate a workflow in a subdirectory
419
+ roast validate my_workflow
420
+
421
+ # Validate with strict mode (treats warnings as errors)
422
+ roast validate workflow.yml --strict
423
+ ```
424
+
425
+ The validator checks for:
426
+ - YAML syntax errors
427
+ - Missing required fields
428
+ - Invalid step references
429
+ - Circular dependencies
430
+ - Tool availability
431
+ - Prompt file existence
432
+ - Configuration consistency
433
+
434
+ This helps catch configuration errors early and ensures workflows will run smoothly.
435
+
436
+ #### Session Storage and Management
437
+
438
+ Roast uses SQLite by default for session storage, providing better performance and advanced querying capabilities. Sessions are automatically saved during workflow execution, capturing each step's state including conversation transcripts and outputs.
439
+
440
+ **Storage Options:**
441
+
442
+ ```bash
443
+ # Use default SQLite storage (recommended)
444
+ roast execute workflow.yml
445
+
446
+ # Use legacy filesystem storage
447
+ roast execute workflow.yml --file-storage
448
+
449
+ # Set storage type via environment variable
450
+ ROAST_STATE_STORAGE=file roast execute workflow.yml
451
+ ```
452
+
453
+ **Session Management Commands:**
454
+
455
+ ```bash
456
+ # List all sessions
457
+ roast sessions
458
+
459
+ # Filter sessions by status
460
+ roast sessions --status waiting
461
+
462
+ # Filter sessions by workflow
463
+ roast sessions --workflow my_workflow
464
+
465
+ # Show sessions older than 7 days
466
+ roast sessions --older-than 7d
467
+
468
+ # Clean up old sessions
469
+ roast sessions --cleanup --older-than 30d
470
+
471
+ # View detailed session information
472
+ roast session <session_id>
473
+ ```
408
474
 
409
475
  #### Session Replay
410
476
 
@@ -418,14 +484,14 @@ roast execute workflow.yml -r step_name
418
484
  roast execute workflow.yml -r 20250507_123456_789:step_name
419
485
  ```
420
486
 
421
- Sessions are automatically saved during workflow execution. Each step's state, including the conversation transcript and output, is persisted to a session directory. The session directories are organized by workflow name and file, with timestamps for each run.
422
-
423
487
  This feature is particularly useful when:
424
488
  - Debugging specific steps in a long workflow
425
489
  - Iterating on prompts without rerunning the entire workflow
426
490
  - Resuming after failures in long-running workflows
427
491
 
428
- Sessions are stored in the `.roast/sessions/` directory in your project. Note that there is no automatic cleanup of session data, so you might want to periodically delete old sessions yourself.
492
+ **Storage Locations:**
493
+ - SQLite: `~/.roast/sessions.db` (configurable via `ROAST_SESSIONS_DB`)
494
+ - Filesystem: `.roast/sessions/` directory in your project
429
495
 
430
496
  #### Target Option (`-t, --target`)
431
497
 
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
 
data/docs/AGENT_STEPS.md CHANGED
@@ -19,6 +19,35 @@ steps:
19
19
 
20
20
  Both file-based prompts (with directories like `implement_fix/prompt.md`) and inline prompts (text with spaces) are supported.
21
21
 
22
+ ## Agent Step Configuration Options
23
+
24
+ Agent steps support two special configuration options:
25
+
26
+ ### `continue` (boolean, default: false)
27
+ When set to `true`, the agent continues from its previous session instead of starting fresh. This is useful for iterative development where you want the agent to maintain context across multiple steps.
28
+
29
+ ### `include_context_summary` (boolean, default: false)
30
+ When set to `true`, the agent receives an AI-generated summary of the workflow context as a system directive. This summary is intelligently tailored to the agent's upcoming task, including only relevant information from previous steps. The summary is generated by analyzing:
31
+ - The agent's prompt to understand what context would be helpful
32
+ - Previous step outputs and their relevance to the current task
33
+ - Workflow description and configuration
34
+ - Current working directory
35
+
36
+ This helps the agent understand what has been done so far without overwhelming it with irrelevant details. NOTE: Without this option, the agent relies solely on what it is instructed to do either by the prompt or your specific step instructions.
37
+
38
+ ```yaml
39
+ steps:
40
+ - analyze_code
41
+ - implement_fix: ^Fix the issues identified in the analysis
42
+ - add_tests: ^Prepare and publish PR
43
+
44
+ implement_fix:
45
+ include_context_summary: true # Include a summary of the workflow context so far
46
+
47
+ add_tests:
48
+ continue: true # does not need context since is continuing from the previous step
49
+ ```
50
+
22
51
  ## When to Use Agent Steps
23
52
 
24
53
  ### Use Agent Steps When:
@@ -63,22 +92,18 @@ This benefits from LLM interpretation because:
63
92
  ```markdown
64
93
  Create a new migration file with the following specifications:
65
94
 
66
- 1. Use MultiEdit to create file: db/migrate/{{timestamp}}_add_user_preferences.rb
95
+ 1. Create a new migration file: db/migrate/{{timestamp}}_add_user_preferences.rb
67
96
  2. The migration must include:
68
97
  - Add column :users, :preferences, :jsonb, default: {}
69
98
  - Add index :users, :preferences, using: :gin
70
99
  - Add column :users, :notification_settings, :jsonb, default: {}
71
100
  3. Ensure proper up/down methods
72
101
  4. Follow Rails migration conventions exactly
73
-
74
- Required tools: MultiEdit
75
- Do not use Write tool for migrations.
76
102
  ```
77
103
 
78
104
  This is better as an agent step because:
79
- - It requires specific tool usage (MultiEdit, not Write)
80
105
  - The instructions are precise and technical
81
- - No interpretation needed - just execution
106
+ - No interpretation needed - just execution of steps known beforehand
82
107
 
83
108
  ### Example 2: Code Refactoring
84
109
 
@@ -216,9 +241,6 @@ Use exact module structure and method signatures shown.
216
241
  Use MultiEdit tool to update the following files:
217
242
  - app/models/user.rb: Add validation
218
243
  - test/models/user_test.rb: Add test case
219
-
220
- # Avoid in agent steps
221
- Update the user model with better validation
222
244
  ```
223
245
 
224
246
  2. **Include specific line numbers or code markers when possible**
@@ -261,4 +283,6 @@ Use exact module structure and method signatures shown.
261
283
 
262
284
  Agent steps are powerful when you need direct control over tool usage and precise execution of technical tasks. They complement regular steps by handling the implementation details while regular steps handle the analysis and planning.
263
285
 
286
+ The `continue` and `include_context_summary` options make agent steps even more powerful for iterative development workflows where maintaining context is important.
287
+
264
288
  Choose agent steps when precision matters more than interpretation. Choose regular steps when context and judgment are important.