roast-ai 0.1.0

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 (57) hide show
  1. checksums.yaml +7 -0
  2. data/.claude/settings.json +12 -0
  3. data/.github/workflows/ci.yaml +29 -0
  4. data/.github/workflows/cla.yml +22 -0
  5. data/.gitignore +13 -0
  6. data/.rspec +1 -0
  7. data/.rubocop.yml +12 -0
  8. data/.ruby-version +1 -0
  9. data/CHANGELOG.md +0 -0
  10. data/CLAUDE.md +31 -0
  11. data/CODE_OF_CONDUCT.md +133 -0
  12. data/CONTRIBUTING.md +35 -0
  13. data/Gemfile +19 -0
  14. data/Gemfile.lock +194 -0
  15. data/LICENSE.md +21 -0
  16. data/README.md +27 -0
  17. data/Rakefile +24 -0
  18. data/bin/console +11 -0
  19. data/examples/grading/analyze_coverage/prompt.md +52 -0
  20. data/examples/grading/calculate_final_grade.rb +67 -0
  21. data/examples/grading/format_result.rb +48 -0
  22. data/examples/grading/generate_grades/prompt.md +105 -0
  23. data/examples/grading/generate_recommendations/output.txt +17 -0
  24. data/examples/grading/generate_recommendations/prompt.md +60 -0
  25. data/examples/grading/run_coverage.rb +47 -0
  26. data/examples/grading/verify_mocks_and_stubs/prompt.md +12 -0
  27. data/examples/grading/verify_test_helpers/prompt.md +53 -0
  28. data/examples/grading/workflow.md +8 -0
  29. data/examples/grading/workflow.rb.md +6 -0
  30. data/examples/grading/workflow.ts+tsx.md +6 -0
  31. data/examples/grading/workflow.yml +46 -0
  32. data/exe/roast +17 -0
  33. data/lib/roast/helpers/function_caching_interceptor.rb +27 -0
  34. data/lib/roast/helpers/logger.rb +104 -0
  35. data/lib/roast/helpers/minitest_coverage_runner.rb +244 -0
  36. data/lib/roast/helpers/path_resolver.rb +148 -0
  37. data/lib/roast/helpers/prompt_loader.rb +97 -0
  38. data/lib/roast/helpers.rb +12 -0
  39. data/lib/roast/tools/cmd.rb +72 -0
  40. data/lib/roast/tools/grep.rb +43 -0
  41. data/lib/roast/tools/read_file.rb +49 -0
  42. data/lib/roast/tools/search_file.rb +51 -0
  43. data/lib/roast/tools/write_file.rb +60 -0
  44. data/lib/roast/tools.rb +50 -0
  45. data/lib/roast/version.rb +5 -0
  46. data/lib/roast/workflow/base_step.rb +94 -0
  47. data/lib/roast/workflow/base_workflow.rb +79 -0
  48. data/lib/roast/workflow/configuration.rb +117 -0
  49. data/lib/roast/workflow/configuration_parser.rb +92 -0
  50. data/lib/roast/workflow/validator.rb +37 -0
  51. data/lib/roast/workflow/workflow_executor.rb +119 -0
  52. data/lib/roast/workflow.rb +13 -0
  53. data/lib/roast.rb +40 -0
  54. data/roast.gemspec +44 -0
  55. data/schema/workflow.json +92 -0
  56. data/shipit.rubygems.yml +0 -0
  57. metadata +171 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d4f229785a3a00ff70e98323c5edc14f0722c113993de498136054eb7716b7aa
4
+ data.tar.gz: 5ec6dbc6d4d44d7cda7d451d0226b7eb7730942193d452fdd41c67c222d0c952
5
+ SHA512:
6
+ metadata.gz: cd9c770a184b0a93b16ddccec14100eb922d0432c15513497c0dccab9223b473054198c2af5b169d251b9fcb72aad3665c0339799ad72aa7054eeb03a3a1acec
7
+ data.tar.gz: 3414b3447e3636b80f224d5560b90981acfc018ab702ad0c4a152bfe203db79d070263d4a34ecca787a21a651f0ecc6715ed4ac3eef961f2fb825b56ebb3ae70
@@ -0,0 +1,12 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(bundle:*)",
5
+ "FileRead(*)",
6
+ "LS",
7
+ "Grep",
8
+ "Glob",
9
+ "Agent"
10
+ ]
11
+ }
12
+ }
@@ -0,0 +1,29 @@
1
+ name: ci
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ push:
8
+ branches:
9
+ - main
10
+ schedule:
11
+ - cron: '45 4 * * *'
12
+
13
+ jobs:
14
+ rubies:
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ os: [ubuntu]
19
+ ruby: ['3.4', 'ruby-head']
20
+ runs-on: ${{ matrix.os }}-latest
21
+ continue-on-error: ${{ matrix.ruby == 'ruby-head' }}
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+ bundler-cache: true
28
+ - run: bundle exec rake
29
+
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ .CLAUDE.local.md
10
+ .rspec_status
11
+ **/.claude/settings.local.json
12
+
13
+ **/CLAUDE.local.md
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,12 @@
1
+ inherit_gem:
2
+ rubocop-shopify: rubocop.yml
3
+
4
+ AllCops:
5
+ CacheRootDirectory: tmp
6
+ Exclude:
7
+ - 'bin/*'
8
+ - 'spec/fixtures/**/*'
9
+ - 'test/fixtures/**/*'
10
+ SuggestExtensions: false
11
+ TargetRubyVersion: 3.4
12
+ UseCache: true
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.2
data/CHANGELOG.md ADDED
File without changes
data/CLAUDE.md ADDED
@@ -0,0 +1,31 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## About the codebase
6
+ - This is a Ruby gem called Roast. Its purpose is to run AI workflows defined in a YAML file.
7
+
8
+ ## Commands
9
+
10
+ - Build: `bundle exec rake build`
11
+ - Test all: `bundle exec rspec`
12
+ - Run single test: `bundle exec rspec spec/path/to/test_file.rb`
13
+ - Lint: `bundle exec rubocop -A`
14
+ - Default (tests + lint): `bundle exec rake`
15
+
16
+ ## Tech stack
17
+ - `cli-kit` and `cli-ui` for the CLI tool
18
+ - Testing: Use Rspec, VCR for HTTP mocking, test files named with `_spec.rb` suffix
19
+
20
+ ## Code Style Guidelines
21
+
22
+ - Naming: snake_case for variables/methods, CamelCase for classes/modules, ALL_CAPS for constants
23
+ - Module structure: Use nested modules under the `Roast` namespace
24
+ - Command pattern: Commands implement a `call` method and class-level `help` method
25
+ - Error handling: Use custom exception classes and structured error handling
26
+ - Errors that should stop the program execution should `raise(CLI::Kit::Abort, "Error message")`
27
+ - Documentation: Include method/class documentation with examples when appropriate
28
+ - Dependencies: Prefer existing gems in the Gemfile before adding new ones
29
+ - Define class methods inside `class << self; end` declarations.
30
+ - Add runtime dependencies to `roast.gemspec`.
31
+ - Add development dependencies to `Gemfile`.
@@ -0,0 +1,133 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, caste, color, religion, or sexual
11
+ identity and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the overall
27
+ community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or advances of
32
+ any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email address,
36
+ without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official email address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ opensource@shopify.com.
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series of
87
+ actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or permanent
94
+ ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within the
114
+ community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.1, available at
120
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127
+ [https://www.contributor-covenant.org/translations][translations].
128
+
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,35 @@
1
+ # How to contribute
2
+
3
+ ## Things we will merge
4
+
5
+ * Bugfixes
6
+ * Performance improvements
7
+ * Features that are likely to be useful to the majority of Roast users
8
+ * Documentation updates that are concise and likely to be useful to the majority of Roast users
9
+
10
+ ## Things we won't merge
11
+
12
+ * Code that introduces considerable performance degrations
13
+ * Code that touches performance-critical parts of Roast and comes without benchmarks
14
+ * Features that are not important for most people (we want to keep the core Roast code small and tidy)
15
+ * Features that can easily be implemented on top of Roast
16
+ * Code that does not include tests
17
+ * Code that breaks existing tests
18
+ * Documentation changes that are verbose, incorrect or not important to most people (we want to keep it simple and easy to understand)
19
+
20
+ ## Workflow
21
+
22
+ * [Sign the CLA](https://cla.shopify.com/) if you haven't already
23
+ * Fork the Roast repository
24
+ * Create a new branch in your fork
25
+ * For updating [Roast documentation](https://shopify.github.io/roast/), create it from `gh-pages` branch. (You can skip tests.)
26
+ * If it makes sense, add tests for your code and/or run a performance benchmark
27
+ * Make sure all tests pass (`bundle exec rake`)
28
+ * Create a pull request
29
+
30
+ ## Releasing
31
+
32
+ * Bump the version in `lib/roast/version.rb`
33
+ * Update the `CHANGELOG.md` file
34
+ * Open a PR like and merge it to `main`
35
+ * Create a new release using the [GitHub UI](https://github.com/Shopify/roast/releases/new)
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in roast.gemspec
8
+ gemspec
9
+
10
+ gem "dotenv"
11
+ gem "guard-rspec"
12
+ gem "guard"
13
+ gem "mocha"
14
+ gem "pry"
15
+ gem "rake", require: false
16
+ gem "rspec", require: false
17
+ gem "rubocop-shopify", require: false
18
+ gem "vcr", require: false
19
+ gem "webmock", require: false
data/Gemfile.lock ADDED
@@ -0,0 +1,194 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ roast-ai (0.1.0)
5
+ activesupport (~> 8.0)
6
+ faraday-retry
7
+ json-schema
8
+ raix (= 0.8.3)
9
+ thor (~> 1.3)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ activesupport (8.0.2)
15
+ base64
16
+ benchmark (>= 0.3)
17
+ bigdecimal
18
+ concurrent-ruby (~> 1.0, >= 1.3.1)
19
+ connection_pool (>= 2.2.5)
20
+ drb
21
+ i18n (>= 1.6, < 2)
22
+ logger (>= 1.4.2)
23
+ minitest (>= 5.1)
24
+ securerandom (>= 0.3)
25
+ tzinfo (~> 2.0, >= 2.0.5)
26
+ uri (>= 0.13.1)
27
+ addressable (2.8.7)
28
+ public_suffix (>= 2.0.2, < 7.0)
29
+ ast (2.4.3)
30
+ base64 (0.2.0)
31
+ benchmark (0.4.0)
32
+ bigdecimal (3.1.9)
33
+ coderay (1.1.3)
34
+ concurrent-ruby (1.3.5)
35
+ connection_pool (2.5.1)
36
+ crack (1.0.0)
37
+ bigdecimal
38
+ rexml
39
+ diff-lcs (1.6.1)
40
+ dotenv (3.1.8)
41
+ drb (2.2.1)
42
+ event_stream_parser (1.0.0)
43
+ faraday (2.13.0)
44
+ faraday-net_http (>= 2.0, < 3.5)
45
+ json
46
+ logger
47
+ faraday-multipart (1.1.0)
48
+ multipart-post (~> 2.0)
49
+ faraday-net_http (3.4.0)
50
+ net-http (>= 0.5.0)
51
+ faraday-retry (2.3.1)
52
+ faraday (~> 2.0)
53
+ ffi (1.17.2)
54
+ ffi (1.17.2-arm64-darwin)
55
+ formatador (1.1.0)
56
+ guard (2.19.1)
57
+ formatador (>= 0.2.4)
58
+ listen (>= 2.7, < 4.0)
59
+ logger (~> 1.6)
60
+ lumberjack (>= 1.0.12, < 2.0)
61
+ nenv (~> 0.1)
62
+ notiffany (~> 0.0)
63
+ ostruct (~> 0.6)
64
+ pry (>= 0.13.0)
65
+ shellany (~> 0.0)
66
+ thor (>= 0.18.1)
67
+ guard-compat (1.2.1)
68
+ guard-rspec (4.7.3)
69
+ guard (~> 2.1)
70
+ guard-compat (~> 1.1)
71
+ rspec (>= 2.99.0, < 4.0)
72
+ hashdiff (1.1.2)
73
+ i18n (1.14.7)
74
+ concurrent-ruby (~> 1.0)
75
+ json (2.10.2)
76
+ json-schema (5.1.1)
77
+ addressable (~> 2.8)
78
+ bigdecimal (~> 3.1)
79
+ language_server-protocol (3.17.0.4)
80
+ lint_roller (1.1.0)
81
+ listen (3.9.0)
82
+ rb-fsevent (~> 0.10, >= 0.10.3)
83
+ rb-inotify (~> 0.9, >= 0.9.10)
84
+ logger (1.7.0)
85
+ lumberjack (1.2.10)
86
+ method_source (1.1.0)
87
+ minitest (5.25.5)
88
+ mocha (2.7.1)
89
+ ruby2_keywords (>= 0.0.5)
90
+ multipart-post (2.4.1)
91
+ nenv (0.3.0)
92
+ net-http (0.6.0)
93
+ uri
94
+ notiffany (0.1.3)
95
+ nenv (~> 0.1)
96
+ shellany (~> 0.0)
97
+ open_router (0.3.3)
98
+ activesupport (>= 6.0)
99
+ dotenv (>= 2)
100
+ faraday (>= 1)
101
+ faraday-multipart (>= 1)
102
+ ostruct (0.6.1)
103
+ parallel (1.27.0)
104
+ parser (3.3.8.0)
105
+ ast (~> 2.4.1)
106
+ racc
107
+ prism (1.4.0)
108
+ pry (0.15.2)
109
+ coderay (~> 1.1)
110
+ method_source (~> 1.0)
111
+ public_suffix (6.0.1)
112
+ racc (1.8.1)
113
+ rainbow (3.1.1)
114
+ raix (0.8.3)
115
+ activesupport (>= 6.0)
116
+ faraday-retry (~> 2.0)
117
+ open_router (~> 0.2)
118
+ ruby-openai (~> 7)
119
+ rake (13.2.1)
120
+ rb-fsevent (0.11.2)
121
+ rb-inotify (0.11.1)
122
+ ffi (~> 1.0)
123
+ regexp_parser (2.10.0)
124
+ rexml (3.4.1)
125
+ rspec (3.13.0)
126
+ rspec-core (~> 3.13.0)
127
+ rspec-expectations (~> 3.13.0)
128
+ rspec-mocks (~> 3.13.0)
129
+ rspec-core (3.13.3)
130
+ rspec-support (~> 3.13.0)
131
+ rspec-expectations (3.13.3)
132
+ diff-lcs (>= 1.2.0, < 2.0)
133
+ rspec-support (~> 3.13.0)
134
+ rspec-mocks (3.13.2)
135
+ diff-lcs (>= 1.2.0, < 2.0)
136
+ rspec-support (~> 3.13.0)
137
+ rspec-support (3.13.2)
138
+ rubocop (1.75.3)
139
+ json (~> 2.3)
140
+ language_server-protocol (~> 3.17.0.2)
141
+ lint_roller (~> 1.1.0)
142
+ parallel (~> 1.10)
143
+ parser (>= 3.3.0.2)
144
+ rainbow (>= 2.2.2, < 4.0)
145
+ regexp_parser (>= 2.9.3, < 3.0)
146
+ rubocop-ast (>= 1.44.0, < 2.0)
147
+ ruby-progressbar (~> 1.7)
148
+ unicode-display_width (>= 2.4.0, < 4.0)
149
+ rubocop-ast (1.44.1)
150
+ parser (>= 3.3.7.2)
151
+ prism (~> 1.4)
152
+ rubocop-shopify (2.17.0)
153
+ rubocop (~> 1.62)
154
+ ruby-openai (7.4.0)
155
+ event_stream_parser (>= 0.3.0, < 2.0.0)
156
+ faraday (>= 1)
157
+ faraday-multipart (>= 1)
158
+ ruby-progressbar (1.13.0)
159
+ ruby2_keywords (0.0.5)
160
+ securerandom (0.4.1)
161
+ shellany (0.0.1)
162
+ thor (1.3.2)
163
+ tzinfo (2.0.6)
164
+ concurrent-ruby (~> 1.0)
165
+ unicode-display_width (3.1.4)
166
+ unicode-emoji (~> 4.0, >= 4.0.4)
167
+ unicode-emoji (4.0.4)
168
+ uri (1.0.3)
169
+ vcr (6.3.1)
170
+ base64
171
+ webmock (3.25.1)
172
+ addressable (>= 2.8.0)
173
+ crack (>= 0.3.2)
174
+ hashdiff (>= 0.4.0, < 2.0.0)
175
+
176
+ PLATFORMS
177
+ arm64-darwin-23
178
+ ruby
179
+
180
+ DEPENDENCIES
181
+ dotenv
182
+ guard
183
+ guard-rspec
184
+ mocha
185
+ pry
186
+ rake
187
+ roast-ai!
188
+ rspec
189
+ rubocop-shopify
190
+ vcr
191
+ webmock
192
+
193
+ BUNDLED WITH
194
+ 2.6.8
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-present Shopify Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ ![image](https://github.com/user-attachments/assets/39589441-d15a-452b-b51c-3bf28f470308)
2
+
3
+ # Roast
4
+
5
+ A convention-oriented framework for creating structured AI workflows, maintained by the Augmented Engineering team at Shopify.
6
+
7
+ ## Why you should use Roast
8
+ TBD
9
+
10
+ ## What does it look like?
11
+ TBD
12
+
13
+ ## How to use Roast
14
+ TBD
15
+
16
+ ## Installation
17
+ ```
18
+ $ gem install roast
19
+ ```
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake` to run the tests and linter. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ ## License
26
+
27
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+ require "rubocop/rake_task"
6
+ require "rake/testtask"
7
+
8
+ RSpec::Core::RakeTask.new(:spec) do |t|
9
+ t.pattern = "spec/**/*_spec.rb"
10
+ end
11
+
12
+ Rake::TestTask.new(:minitest) do |t|
13
+ t.libs << "test"
14
+ t.libs << "lib"
15
+ t.test_files = FileList["test/**/*_test.rb"]
16
+ end
17
+
18
+ task test: [:spec, :minitest]
19
+
20
+ RuboCop::RakeTask.new do |task|
21
+ task.options = ["--autocorrect"]
22
+ end
23
+
24
+ task default: [:test, :rubocop]
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+
5
+ # Add the lib directory to the load path
6
+ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
7
+
8
+ require "roast"
9
+
10
+ require "irb"
11
+ IRB.start(__FILE__)
@@ -0,0 +1,52 @@
1
+ <coverage_results>
2
+ <%= workflow.output["run_coverage"] %>
3
+ </coverage_results>
4
+
5
+ Analyze the results and score them on a scale of 1-10 using the following rubrics:
6
+
7
+ <line_coverage>
8
+ 0-1: Critical failure (0-20% coverage) - Core functionality remains completely untested
9
+ 2-3: Poor coverage (21-40%) - Major gaps; many key functions lack any testing
10
+ 4-5: Inadequate coverage (41-60%) - Several important code paths are not executed
11
+ 6-7: Moderate coverage (61-80%) - Notable gaps remain; some important functionality lacks coverage
12
+ 8-9: Good coverage (81-95%) - Only minor or edge case code paths remain untested
13
+ 10: Excellent coverage (96-100%)
14
+ </line_coverage>
15
+
16
+ <branch_coverage>
17
+ 0-1: Critical failure (0-20% branch coverage) - Almost no conditional branches are tested
18
+ 2-3: Poor coverage (21-40%) - Most conditional logic remains untested
19
+ 4-5: Inadequate coverage (41-60%) - Many conditions are only tested for one outcome
20
+ 6-7: Moderate coverage (61-80%) - Some conditions lack testing for all outcomes
21
+ 8-9: Good coverage (81-95%) - Most conditions are tested for most outcomes
22
+ 10: Excellent coverage (96-100%)
23
+ </branch_coverage>
24
+
25
+ <method_coverage>
26
+ 0-1: Critical failure (0-20% method coverage) - Most or core functionality methods are untested
27
+ 2-3: Poor coverage (21-40%) - Several public API methods remain untested
28
+ 4-5: Inadequate coverage (41-60%) - Some important public methods lack tests
29
+ 6-7: Moderate coverage (61-80%) - Notable gaps remain; some public methods may lack comprehensive testing
30
+ 8-9: Good coverage (81-95%) - Nearly all public methods are tested; private methods are mostly covered via public method tests
31
+ 10: Excellent coverage (96-100%)
32
+ </method_coverage>
33
+
34
+ RESPONSE FORMAT
35
+ You must respond in JSON format within <json> XML tags. Example:
36
+
37
+ <json>
38
+ {
39
+ "method_coverage": {
40
+ "score": "10",
41
+ "justification": "The source file has 100% method coverage, indicating all methods are being tested."
42
+ },
43
+ "line_coverage": {
44
+ "score": 10,
45
+ "justification": "The source file has 100% line coverage, indicating all executable lines are tested."
46
+ },
47
+ "branch_coverage": {
48
+ "score": 8,
49
+ "justification": "The source file has 80% branch coverage, indicating some branches need testing."
50
+ }
51
+ }
52
+ </json>