review-sheep 0.1.0__tar.gz

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 (55) hide show
  1. review_sheep-0.1.0/.env.example +21 -0
  2. review_sheep-0.1.0/.github/workflows/publish.yml +39 -0
  3. review_sheep-0.1.0/.github/workflows/review-pr.yml +147 -0
  4. review_sheep-0.1.0/.github/workflows/review.yml +26 -0
  5. review_sheep-0.1.0/.gitignore +226 -0
  6. review_sheep-0.1.0/ARCHITECTURE.md +329 -0
  7. review_sheep-0.1.0/CONTEXT.md +78 -0
  8. review_sheep-0.1.0/LICENSE +21 -0
  9. review_sheep-0.1.0/PKG-INFO +345 -0
  10. review_sheep-0.1.0/README.md +306 -0
  11. review_sheep-0.1.0/docs/adr/0001-two-paths-inquiry-and-review.md +19 -0
  12. review_sheep-0.1.0/docs/adr/0002-findings-are-structured-and-never-posted.md +15 -0
  13. review_sheep-0.1.0/docs/adr/0003-review-subagents-split-by-concern.md +17 -0
  14. review_sheep-0.1.0/docs/adr/0004-diffs-fetched-once-with-manifest.md +18 -0
  15. review_sheep-0.1.0/docs/adr/0005-findings-returned-unmerged.md +16 -0
  16. review_sheep-0.1.0/docs/adr/0006-python-311-floor-no-provider-extras.md +14 -0
  17. review_sheep-0.1.0/docs/adr/0007-review-reads-a-fixed-local-git-checkout.md +20 -0
  18. review_sheep-0.1.0/docs/adr/0008-chat-manifest-ci-checkout.md +17 -0
  19. review_sheep-0.1.0/pyproject.toml +59 -0
  20. review_sheep-0.1.0/scripts/review_chat.py +8 -0
  21. review_sheep-0.1.0/scripts/review_pr.py +8 -0
  22. review_sheep-0.1.0/scripts/smoke_distribution.py +213 -0
  23. review_sheep-0.1.0/skills-lock.json +215 -0
  24. review_sheep-0.1.0/src/review_sheep/__init__.py +106 -0
  25. review_sheep-0.1.0/src/review_sheep/chat.py +171 -0
  26. review_sheep-0.1.0/src/review_sheep/chat_graph.py +182 -0
  27. review_sheep-0.1.0/src/review_sheep/checkout.py +130 -0
  28. review_sheep-0.1.0/src/review_sheep/ci.py +151 -0
  29. review_sheep-0.1.0/src/review_sheep/domain.py +241 -0
  30. review_sheep-0.1.0/src/review_sheep/github.py +200 -0
  31. review_sheep-0.1.0/src/review_sheep/inquiry.py +188 -0
  32. review_sheep-0.1.0/src/review_sheep/intent.py +87 -0
  33. review_sheep-0.1.0/src/review_sheep/lenses.py +120 -0
  34. review_sheep-0.1.0/src/review_sheep/manifest.py +324 -0
  35. review_sheep-0.1.0/src/review_sheep/providers.py +139 -0
  36. review_sheep-0.1.0/src/review_sheep/report.py +54 -0
  37. review_sheep-0.1.0/src/review_sheep/review.py +275 -0
  38. review_sheep-0.1.0/src/review_sheep/runtime_logging.py +32 -0
  39. review_sheep-0.1.0/src/review_sheep/tracing.py +71 -0
  40. review_sheep-0.1.0/tests/test_chat.py +238 -0
  41. review_sheep-0.1.0/tests/test_chat_graph.py +435 -0
  42. review_sheep-0.1.0/tests/test_checkout.py +134 -0
  43. review_sheep-0.1.0/tests/test_ci.py +262 -0
  44. review_sheep-0.1.0/tests/test_github_reader.py +278 -0
  45. review_sheep-0.1.0/tests/test_inquiry.py +408 -0
  46. review_sheep-0.1.0/tests/test_intent.py +125 -0
  47. review_sheep-0.1.0/tests/test_lenses.py +35 -0
  48. review_sheep-0.1.0/tests/test_manifest.py +194 -0
  49. review_sheep-0.1.0/tests/test_providers.py +59 -0
  50. review_sheep-0.1.0/tests/test_publish_workflow.py +27 -0
  51. review_sheep-0.1.0/tests/test_readme.py +12 -0
  52. review_sheep-0.1.0/tests/test_report.py +112 -0
  53. review_sheep-0.1.0/tests/test_review.py +257 -0
  54. review_sheep-0.1.0/tests/test_tracing.py +63 -0
  55. review_sheep-0.1.0/uv.lock +2259 -0
@@ -0,0 +1,21 @@
1
+ BASE_URL=
2
+ OPENAI_API_KEY=vk-...
3
+ OPENAI_MODEL=claude-sonnet-4-6
4
+ GITHUB_TOKEN=...
5
+ GITHUB_REPO=langchain-ai/langgraph
6
+ # Used by scripts/review_pr.py; interactive Chat builds a dynamic Manifest.
7
+ REVIEW_CHECKOUT=.
8
+ REVIEW_LOG_LEVEL=INFO
9
+ # Langfuse tracing auto-enables when both keys are present.
10
+ # LANGFUSE_TRACING_ENABLED=true
11
+ LANGFUSE_PUBLIC_KEY=
12
+ LANGFUSE_SECRET_KEY=
13
+ LANGFUSE_BASE_URL=https://cloud.langfuse.com
14
+ LANGFUSE_TRACING_ENVIRONMENT=development
15
+ ANTHROPIC_AUTH_TOKEN=
16
+ ANTHROPIC_BASE_URL=
17
+ ANTHROPIC_CUSTOM_HEADERS=
18
+ ANTHROPIC_DEFAULT_HAIKU_MODEL=
19
+ ANTHROPIC_DEFAULT_OPUS_MODEL=
20
+ ANTHROPIC_DEFAULT_SONNET_MODEL=
21
+ REVIEW_MODEL_TIER=sonnet
@@ -0,0 +1,39 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ push:
7
+ tags:
8
+ - 'v*'
9
+
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+ environment:
14
+ name: pypi
15
+ url: https://pypi.org/project/review-sheep/
16
+ # Job-level permissions replace workflow-level ones for this job, so both
17
+ # scopes the job needs are listed here rather than split across levels.
18
+ permissions:
19
+ contents: read
20
+ id-token: write
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v7
24
+
25
+ - name: Install uv and Python
26
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
27
+ with:
28
+ python-version: "3.12"
29
+ enable-cache: true
30
+
31
+ - name: Build distributions
32
+ run: uv build
33
+
34
+ - name: Publish to PyPI
35
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
36
+ with:
37
+ # A release and its underlying tag push can both trigger this
38
+ # workflow; skip rather than fail if the version is already live.
39
+ skip-existing: true
@@ -0,0 +1,147 @@
1
+ name: Review Sheep reusable PR review
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ review_sheep_ref:
7
+ description: Branch, tag, or SHA used to download Review Sheep.
8
+ required: false
9
+ default: main
10
+ type: string
11
+ model_tier:
12
+ description: Anthropic model tier to use (haiku, sonnet, or opus).
13
+ required: false
14
+ default: sonnet
15
+ type: string
16
+ instructions:
17
+ description: Optional additional Review instructions.
18
+ required: false
19
+ default: ""
20
+ type: string
21
+ anthropic_base_url:
22
+ description: Non-secret Anthropic-compatible gateway endpoint.
23
+ required: false
24
+ default: ""
25
+ type: string
26
+ haiku_model:
27
+ description: Gateway model ID for the Haiku tier.
28
+ required: false
29
+ default: ""
30
+ type: string
31
+ opus_model:
32
+ description: Gateway model ID for the Opus tier.
33
+ required: false
34
+ default: ""
35
+ type: string
36
+ sonnet_model:
37
+ description: Gateway model ID for the Sonnet tier.
38
+ required: false
39
+ default: ""
40
+ type: string
41
+ secrets:
42
+ ANTHROPIC_AUTH_TOKEN:
43
+ description: Bearer token for the Anthropic-compatible gateway.
44
+ required: true
45
+ ANTHROPIC_BASE_URL:
46
+ description: Secret gateway endpoint fallback when the input is empty.
47
+ required: false
48
+ ANTHROPIC_CUSTOM_HEADERS:
49
+ description: Optional newline-separated custom request headers.
50
+ required: false
51
+ ANTHROPIC_DEFAULT_HAIKU_MODEL:
52
+ description: Gateway model ID for the Haiku tier.
53
+ required: false
54
+ ANTHROPIC_DEFAULT_OPUS_MODEL:
55
+ description: Gateway model ID for the Opus tier.
56
+ required: false
57
+ ANTHROPIC_DEFAULT_SONNET_MODEL:
58
+ description: Gateway model ID for the Sonnet tier.
59
+ required: false
60
+
61
+ permissions:
62
+ contents: read
63
+ pull-requests: write
64
+
65
+ jobs:
66
+ review:
67
+ if: github.event_name == 'pull_request'
68
+ runs-on: ubuntu-latest
69
+ steps:
70
+ - name: Checkout pull-request head with full history
71
+ uses: actions/checkout@v7
72
+ with:
73
+ repository: ${{ github.repository }}
74
+ ref: ${{ github.event.pull_request.head.sha }}
75
+ fetch-depth: 0
76
+ persist-credentials: false
77
+ path: review-target
78
+
79
+ - name: Download Review Sheep
80
+ uses: actions/checkout@v7
81
+ with:
82
+ repository: taipingeric/review_sheep
83
+ ref: ${{ inputs.review_sheep_ref }}
84
+ persist-credentials: false
85
+ path: review-sheep
86
+
87
+ - name: Install uv and Python
88
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
89
+ with:
90
+ python-version: "3.12"
91
+ enable-cache: true
92
+ working-directory: review-sheep
93
+
94
+ - name: Review pull request
95
+ shell: bash
96
+ working-directory: review-sheep
97
+ env:
98
+ ANTHROPIC_AUTH_TOKEN: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
99
+ ANTHROPIC_BASE_URL: ${{ inputs.anthropic_base_url || secrets.ANTHROPIC_BASE_URL }}
100
+ ANTHROPIC_CUSTOM_HEADERS: ${{ secrets.ANTHROPIC_CUSTOM_HEADERS }}
101
+ ANTHROPIC_DEFAULT_HAIKU_MODEL: ${{ inputs.haiku_model || secrets.ANTHROPIC_DEFAULT_HAIKU_MODEL }}
102
+ ANTHROPIC_DEFAULT_OPUS_MODEL: ${{ inputs.opus_model || secrets.ANTHROPIC_DEFAULT_OPUS_MODEL }}
103
+ ANTHROPIC_DEFAULT_SONNET_MODEL: ${{ inputs.sonnet_model || secrets.ANTHROPIC_DEFAULT_SONNET_MODEL }}
104
+ GITHUB_TOKEN: ${{ github.token }}
105
+ REVIEW_CHECKOUT: ${{ github.workspace }}/review-target
106
+ REVIEW_INSTRUCTIONS: ${{ inputs.instructions }}
107
+ REVIEW_MODEL_TIER: ${{ inputs.model_tier }}
108
+ REVIEW_PR_NUMBER: ${{ github.event.pull_request.number }}
109
+ run: |
110
+ set -o pipefail
111
+ uv run python scripts/review_pr.py \
112
+ --repo "$GITHUB_REPOSITORY" \
113
+ --pr-number "$REVIEW_PR_NUMBER" \
114
+ --checkout "$REVIEW_CHECKOUT" \
115
+ --instructions "$REVIEW_INSTRUCTIONS" \
116
+ --model-tier "$REVIEW_MODEL_TIER" \
117
+ | tee "$RUNNER_TEMP/review-sheep-report.md"
118
+ cat "$RUNNER_TEMP/review-sheep-report.md" >> "$GITHUB_STEP_SUMMARY"
119
+
120
+ - name: Publish Review Sheep PR comment
121
+ shell: bash
122
+ env:
123
+ GH_TOKEN: ${{ github.token }}
124
+ REVIEW_PR_NUMBER: ${{ github.event.pull_request.number }}
125
+ run: |
126
+ comment_file="$RUNNER_TEMP/review-sheep-comment.md"
127
+ comment_ids_file="$RUNNER_TEMP/review-sheep-comment-ids.txt"
128
+ {
129
+ echo '<!-- review-sheep-report -->'
130
+ cat "$RUNNER_TEMP/review-sheep-report.md"
131
+ } > "$comment_file"
132
+
133
+ gh api --paginate \
134
+ "repos/$GITHUB_REPOSITORY/issues/$REVIEW_PR_NUMBER/comments" \
135
+ --jq '.[] | select(.user.login == "github-actions[bot]" and (.body | startswith("<!-- review-sheep-report -->"))) | .id' \
136
+ > "$comment_ids_file"
137
+
138
+ if [[ -s "$comment_ids_file" ]]; then
139
+ comment_id="$(tail -n 1 "$comment_ids_file")"
140
+ gh api --method PATCH \
141
+ "repos/$GITHUB_REPOSITORY/issues/comments/$comment_id" \
142
+ -F "body=@$comment_file"
143
+ else
144
+ gh pr comment "$REVIEW_PR_NUMBER" \
145
+ --repo "$GITHUB_REPOSITORY" \
146
+ --body-file "$comment_file"
147
+ fi
@@ -0,0 +1,26 @@
1
+ name: Review Sheep
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, reopened]
6
+
7
+ permissions:
8
+ contents: read
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ review:
13
+ if: github.event.pull_request.head.repo.full_name == github.repository
14
+ uses: ./.github/workflows/review-pr.yml
15
+ with:
16
+ review_sheep_ref: ${{ github.event.pull_request.head.sha }}
17
+ model_tier: ${{ vars.REVIEW_MODEL_TIER || 'sonnet' }}
18
+ instructions: ${{ vars.REVIEW_INSTRUCTIONS }}
19
+ anthropic_base_url: ${{ vars.COP_KIRO_BASE_URL || vars.ANTHROPIC_BASE_URL }}
20
+ haiku_model: ${{ vars.COP_KIRO_HAIKU_MODEL || vars.ANTHROPIC_DEFAULT_HAIKU_MODEL || 'claude-haiku-4-5' }}
21
+ opus_model: ${{ vars.COP_KIRO_OPUS_MODEL || vars.ANTHROPIC_DEFAULT_OPUS_MODEL || 'claude-opus-4-6' }}
22
+ sonnet_model: ${{ vars.COP_KIRO_SONNET_MODEL || vars.ANTHROPIC_DEFAULT_SONNET_MODEL || 'claude-sonnet-4-6' }}
23
+ secrets:
24
+ ANTHROPIC_AUTH_TOKEN: ${{ secrets.COP_KIRO_AUTH_TOKEN || secrets.ANTHROPIC_AUTH_TOKEN }}
25
+ ANTHROPIC_BASE_URL: ${{ secrets.COP_KIRO_BASE_URL || secrets.ANTHROPIC_BASE_URL }}
26
+ ANTHROPIC_CUSTOM_HEADERS: ${{ secrets.COP_KIRO_CUSTOM_HEADERS || secrets.ANTHROPIC_CUSTOM_HEADERS }}
@@ -0,0 +1,226 @@
1
+ # Project-specific
2
+ # Vendored reference checkout (~514M), not part of the package
3
+ ref_repo/
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[codz]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py.cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ # Pipfile.lock
100
+
101
+ # UV
102
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ # uv.lock
106
+
107
+ # poetry
108
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
110
+ # commonly ignored for libraries.
111
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112
+ # poetry.lock
113
+ # poetry.toml
114
+
115
+ # pdm
116
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
118
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
119
+ # pdm.lock
120
+ # pdm.toml
121
+ .pdm-python
122
+ .pdm-build/
123
+
124
+ # pixi
125
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
126
+ # pixi.lock
127
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
128
+ # in the .venv directory. It is recommended not to include this directory in version control.
129
+ .pixi
130
+
131
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132
+ __pypackages__/
133
+
134
+ # Celery stuff
135
+ celerybeat-schedule
136
+ celerybeat.pid
137
+
138
+ # Redis
139
+ *.rdb
140
+ *.aof
141
+ *.pid
142
+
143
+ # RabbitMQ
144
+ mnesia/
145
+ rabbitmq/
146
+ rabbitmq-data/
147
+
148
+ # ActiveMQ
149
+ activemq-data/
150
+
151
+ # SageMath parsed files
152
+ *.sage.py
153
+
154
+ # Environments
155
+ .env
156
+ .envrc
157
+ .venv
158
+ env/
159
+ venv/
160
+ ENV/
161
+ env.bak/
162
+ venv.bak/
163
+
164
+ # Spyder project settings
165
+ .spyderproject
166
+ .spyproject
167
+
168
+ # Rope project settings
169
+ .ropeproject
170
+
171
+ # mkdocs documentation
172
+ /site
173
+
174
+ # mypy
175
+ .mypy_cache/
176
+ .dmypy.json
177
+ dmypy.json
178
+
179
+ # Pyre type checker
180
+ .pyre/
181
+
182
+ # pytype static type analyzer
183
+ .pytype/
184
+
185
+ # Cython debug symbols
186
+ cython_debug/
187
+
188
+ # PyCharm
189
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
190
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
191
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
192
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
193
+ # .idea/
194
+
195
+ # Abstra
196
+ # Abstra is an AI-powered process automation framework.
197
+ # Ignore directories containing user credentials, local state, and settings.
198
+ # Learn more at https://abstra.io/docs
199
+ .abstra/
200
+
201
+ # Visual Studio Code
202
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
203
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
204
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
205
+ # you could uncomment the following to ignore the entire vscode folder
206
+ # .vscode/
207
+ # Temporary file for partial code execution
208
+ tempCodeRunnerFile.py
209
+
210
+ # Ruff stuff:
211
+ .ruff_cache/
212
+
213
+ # PyPI configuration file
214
+ .pypirc
215
+
216
+ # Marimo
217
+ marimo/_static/
218
+ marimo/_lsp/
219
+ __marimo__/
220
+
221
+ # Streamlit
222
+ .streamlit/secrets.toml
223
+ .venv/
224
+
225
+ .DS_Store
226
+ .agents/skills/