weaverx 0.1.1__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.
@@ -0,0 +1,14 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .dist/
5
+ .mypy_cache/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ .coverage
9
+ .venv/
10
+ venv/
11
+ dist/
12
+ build/
13
+ site/
14
+ triage-output.json
@@ -0,0 +1,45 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.1] - 2026-05-23
11
+
12
+ ### Added
13
+
14
+ - PyPI publishing via GitHub Release workflow (trusted publishing)
15
+ - GitHub Pages documentation site at [fratresmedai.github.io/WeaveRx](https://fratresmedai.github.io/WeaveRx/)
16
+ - Governance files: CODE_OF_CONDUCT, SECURITY, SUPPORT, ETHICS
17
+ - Issue and pull request templates
18
+ - MkDocs documentation scaffold
19
+ - Pre-commit hooks, Dependabot, pip-audit in CI
20
+ - pytest coverage gate in CI
21
+ - CLI human-review disclaimer on triage output
22
+ - Configuration reference in docs
23
+ - GitHub Action dry-run screenshot in README
24
+
25
+ ### Changed
26
+
27
+ - README restructured for scanability (features, quickstart, demo first)
28
+ - Repository description and GitHub topics updated
29
+ - Badges row moved below title for first-impression polish
30
+
31
+ ## [0.1.0] - 2026-05-23
32
+
33
+ ### Added
34
+
35
+ - Medical AI issue triage CLI with eight domain categories
36
+ - LiteLLM multi-provider support (Grok, Anthropic, OpenAI-compatible)
37
+ - Local safeguard heuristics (entropy, repetition, patterns, relevance)
38
+ - Auditable `sources` and top-level `status` in JSON output
39
+ - GitHub Action for dry-run triage on issues
40
+ - Mock mode for offline demos and CI
41
+ - Human-in-the-loop defaults (`--dry-run`, `--confirm` for writes)
42
+
43
+ [Unreleased]: https://github.com/FratresMedAI/WeaveRx/compare/v0.1.1...HEAD
44
+ [0.1.1]: https://github.com/FratresMedAI/WeaveRx/releases/tag/v0.1.1
45
+ [0.1.0]: https://github.com/FratresMedAI/WeaveRx/releases/tag/v0.1.0
@@ -0,0 +1,61 @@
1
+ # Contributing to WeaveRx
2
+
3
+ Thank you for helping improve WeaveRx for the medical AI open-source community.
4
+
5
+ ## Community standards
6
+
7
+ - Read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
8
+ - Review [ETHICS.md](ETHICS.md) for responsible-use constraints in this domain.
9
+ - Report security issues privately via [SECURITY.md](SECURITY.md) — never in public issues.
10
+
11
+ ## Development setup
12
+
13
+ ```bash
14
+ git clone https://github.com/FratresMedAI/WeaveRx.git
15
+ cd WeaveRx
16
+ pip install -e ".[dev]"
17
+ pre-commit install # optional but recommended
18
+ ```
19
+
20
+ Run the quality checks before opening a pull request:
21
+
22
+ ```bash
23
+ pre-commit run --all-files # or: ruff check .
24
+ mypy src/weaverx
25
+ pytest --cov=weaverx
26
+ ```
27
+
28
+ Most tests run offline with `--mock` data. Optional live tests are marked `@pytest.mark.network`.
29
+
30
+ ## Pull request expectations
31
+
32
+ Use the [pull request template](.github/PULL_REQUEST_TEMPLATE.md). In summary:
33
+
34
+ - Keep changes focused and explain the **why** in the PR description.
35
+ - Match existing code style (type hints, ruff/mypy clean).
36
+ - Add or update tests for behavior changes.
37
+ - Do not weaken safety defaults (dry-run, confirmation gates, advisory safeguards).
38
+
39
+ ## Safety constraints
40
+
41
+ WeaveRx is **human-in-the-loop** tooling:
42
+
43
+ - Never auto-post triage comments without explicit `--post-comment` and `--confirm`.
44
+ - Safeguard checks are advisory — they warn, they do not block.
45
+ - Do not add features that encourage sharing PHI or patient identifiers in GitHub issues.
46
+
47
+ ## Reporting issues
48
+
49
+ Use the GitHub issue templates:
50
+
51
+ - [Bug report](.github/ISSUE_TEMPLATE/bug_report.yml)
52
+ - [Feature request](.github/ISSUE_TEMPLATE/feature_request.yml)
53
+ - [WeaveRx feedback](.github/ISSUE_TEMPLATE/triage_feedback.yml)
54
+
55
+ Include WeaveRx version (`weaverx --version`), the command you ran (redact tokens), and expected vs actual behavior.
56
+
57
+ See [SUPPORT.md](SUPPORT.md) for response expectations.
58
+
59
+ ## Releases
60
+
61
+ Maintainers: see [docs/releasing.md](docs/releasing.md) for tagging and GitHub Release workflow.
weaverx-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WeaveRx Contributors
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.
weaverx-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,348 @@
1
+ Metadata-Version: 2.4
2
+ Name: weaverx
3
+ Version: 0.1.1
4
+ Summary: AI-powered GitHub issue and PR triage for the medical AI community
5
+ Project-URL: Homepage, https://github.com/FratresMedAI/WeaveRx
6
+ Project-URL: Repository, https://github.com/FratresMedAI/WeaveRx
7
+ Project-URL: Issues, https://github.com/FratresMedAI/WeaveRx/issues
8
+ Project-URL: Changelog, https://github.com/FratresMedAI/WeaveRx/blob/master/CHANGELOG.md
9
+ Author: WeaveRx Contributors
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: developer-productivity,github-bot,github-triage,llm-tools,medical-ai,monai,nnunet,safety,triage
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Healthcare Industry
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Requires-Python: >=3.11
24
+ Requires-Dist: httpx>=0.27.0
25
+ Requires-Dist: litellm>=1.40.0
26
+ Requires-Dist: pydantic>=2.7.0
27
+ Requires-Dist: rich>=13.7.0
28
+ Requires-Dist: typer>=0.12.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
31
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
32
+ Requires-Dist: pytest-httpx>=0.30.0; extra == 'dev'
33
+ Requires-Dist: pytest>=8.2.0; extra == 'dev'
34
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
35
+ Provides-Extra: docs
36
+ Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
37
+ Requires-Dist: mkdocs>=1.6.0; extra == 'docs'
38
+ Description-Content-Type: text/markdown
39
+
40
+ <p align="center">
41
+ <img src="docs/weaverx-hero.png" alt="WeaveRx — medical AI GitHub issue triage" width="900" />
42
+ </p>
43
+
44
+ # WeaveRx
45
+
46
+ **Medical AI GitHub issue triage with auditable drafts, local safeguards, and human-in-the-loop defaults.**
47
+
48
+ WeaveRx helps maintainers triage issues faster — reproducibility blockers, dataset access, subgroup performance, privacy/DICOM, and clinical validation requests — with **sources** (issue excerpts that grounded the decision) and **safeguard scores** (local heuristics, no extra LLM calls).
49
+
50
+ Built for medical AI maintainers and research groups who need practical tooling — not a gatekeeper bot.
51
+
52
+ <p align="center">
53
+ <a href="https://github.com/FratresMedAI/WeaveRx/actions/workflows/ci.yml"><img src="https://github.com/FratresMedAI/WeaveRx/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
54
+ <a href="https://pypi.org/project/weaverx/"><img src="https://img.shields.io/pypi/v/weaverx?label=PyPI" alt="PyPI" /></a>
55
+ <a href="https://github.com/FratresMedAI/WeaveRx/releases"><img src="https://img.shields.io/github/v/release/FratresMedAI/WeaveRx?label=release" alt="Release" /></a>
56
+ <img src="https://img.shields.io/badge/python-3.11%20|%203.12-blue" alt="Python" />
57
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT License" /></a>
58
+ <a href="https://github.com/FratresMedAI/WeaveRx/stargazers"><img src="https://img.shields.io/github/stars/FratresMedAI/WeaveRx?style=social" alt="GitHub stars" /></a>
59
+ <a href="https://fratresmedai.github.io/WeaveRx/"><img src="https://img.shields.io/badge/docs-GitHub%20Pages-blue" alt="Docs" /></a>
60
+ </p>
61
+
62
+ **Contents:** [Features](#features) · [Quickstart](#quickstart) · [See it in action](#see-it-in-action) · [Installation](#installation) · [Safety](#safety-and-responsible-use) · [Reference](#reference) · [Docs](https://fratresmedai.github.io/WeaveRx/)
63
+
64
+ ---
65
+
66
+ ## Features
67
+
68
+ - **Domain-tuned** — eight medical AI categories (reproducibility, DICOM/privacy, clinical validation, subgroup performance, and more)
69
+ - **Safety by default** — dry-run unless you explicitly post; `--confirm` required for GitHub writes; local safeguard heuristics on every draft
70
+ - **Auditable** — `sources` cite issue excerpts; `safeguard` scores are computed locally with no LLM on that path
71
+ - **Your LLM stack** — Grok, Anthropic, or OpenAI-compatible endpoints via [LiteLLM](https://github.com/BerriAI/litellm); mock mode for offline CI and demos
72
+
73
+ Full docs: [`docs/index.md`](docs/index.md) · Configuration: [`docs/configuration.md`](docs/configuration.md)
74
+
75
+ ---
76
+
77
+ ## Quickstart
78
+
79
+ Requires Python 3.11+. Environment variables: [`docs/configuration.md`](docs/configuration.md).
80
+
81
+ ### 1. Mock (zero API keys)
82
+
83
+ ```bash
84
+ weaverx triage --repo Project-MONAI/MONAI --issue 42 --mock
85
+ ```
86
+
87
+ ### 2. Dry-run (real GitHub, offline LLM)
88
+
89
+ ```bash
90
+ weaverx triage --repo Project-MONAI/MONAI --issue 1234 --mock-llm --dry-run
91
+ ```
92
+
93
+ ### 3. Real LLM (Grok example)
94
+
95
+ ```bash
96
+ export XAI_API_KEY=xai-...
97
+ weaverx triage --repo Project-MONAI/MONAI --issue 1234 --dry-run --json
98
+ ```
99
+
100
+ More providers: [LLM providers](#llm-providers) · [`examples/llm_provider_examples.md`](examples/llm_provider_examples.md)
101
+
102
+ ### 4. JSON for automation
103
+
104
+ ```bash
105
+ weaverx triage --repo Project-MONAI/MONAI --issue 42 --mock --json
106
+ ```
107
+
108
+ ---
109
+
110
+ ## See it in action
111
+
112
+ **Command (no API keys):** `weaverx triage --repo Project-MONAI/MONAI --issue 42 --mock`
113
+
114
+ ### Clean triage
115
+
116
+ <p align="center">
117
+ <img src="docs/screenshots/triage-clean.png"
118
+ alt="WeaveRx CLI: category, status, sources, clean safeguard, draft panel"
119
+ width="820" />
120
+ </p>
121
+
122
+ Typical output: reproducibility category, `ready_for_review` status, source excerpts,
123
+ `CLEAN` safeguard (0.0/10), and a postable draft in the green panel.
124
+
125
+ <details>
126
+ <summary>Text capture (accessibility / no images)</summary>
127
+
128
+ See [`examples/captures/triage-clean.txt`](examples/captures/triage-clean.txt).
129
+
130
+ </details>
131
+
132
+ ### Safeguard warning
133
+
134
+ Safeguard checks are **advisory** — they flag drafts for review; they never auto-block posting.
135
+
136
+ <p align="center">
137
+ <img src="docs/screenshots/safeguard-warning.png"
138
+ alt="WeaveRx CLI: HIGH RISK safeguard flags and red draft panel border"
139
+ width="820" />
140
+ </p>
141
+
142
+ When heuristics fire (e.g. credential-like patterns, heavy repetition), the table shows
143
+ **Safeguard flags**, status escalates to `HIGH RISK` / `REVIEW RECOMMENDED`, and the draft
144
+ panel border turns yellow or red.
145
+
146
+ <details>
147
+ <summary>Text capture + JSON</summary>
148
+
149
+ - Text: [`examples/captures/safeguard-warning.txt`](examples/captures/safeguard-warning.txt)
150
+ - JSON: [`examples/sample_safeguard_warning.json`](examples/sample_safeguard_warning.json)
151
+
152
+ </details>
153
+
154
+ **Try it:** `weaverx triage --repo Project-MONAI/MONAI --issue 42 --mock -v`
155
+
156
+ <details>
157
+ <summary>Example JSON output</summary>
158
+
159
+ ```json
160
+ {
161
+ "repo": "Project-MONAI/MONAI",
162
+ "status": "ready_for_review",
163
+ "issue": { "number": 42, "title": "Unable to reproduce nnU-Net training results on BraTS subset" },
164
+ "analysis": { "category": "reproducibility-environment", "priority": "high" },
165
+ "sources": [{ "type": "issue_body", "snippet": "...", "reason": "..." }],
166
+ "draft_response": "Hi @researcher-dev — thank you for documenting this carefully...",
167
+ "safeguard": { "score": 0.0, "status": "clean", "triggered": [] },
168
+ "llm": { "provider": "mock", "model": "mock" },
169
+ "dry_run": true
170
+ }
171
+ ```
172
+
173
+ Full JSON: [`examples/sample_triage_output.json`](examples/sample_triage_output.json)
174
+
175
+ </details>
176
+
177
+ ---
178
+
179
+ ## Installation
180
+
181
+ ```bash
182
+ pip install weaverx
183
+ ```
184
+
185
+ Or install from GitHub:
186
+
187
+ ```bash
188
+ pip install git+https://github.com/FratresMedAI/WeaveRx.git@v0.1.1
189
+ ```
190
+
191
+ Contributors / local dev:
192
+
193
+ ```bash
194
+ git clone https://github.com/FratresMedAI/WeaveRx.git
195
+ cd WeaveRx
196
+ pip install -e ".[dev]"
197
+ ```
198
+
199
+ Documentation: [fratresmedai.github.io/WeaveRx](https://fratresmedai.github.io/WeaveRx/)
200
+
201
+ ---
202
+
203
+ ## Safety and responsible use
204
+
205
+ WeaveRx is **human-in-the-loop** by design. Drafts require maintainer review before posting.
206
+
207
+ 1. **Never paste patient data in GitHub issues.** Privacy flags are heuristic, not guaranteed.
208
+ 2. **Default is read-only.** Writes need `--post-comment`/`--apply-labels` **and** `--confirm`.
209
+ 3. **Use `--dry-run`** on repos you don't maintain.
210
+ 4. **Use `--mock`** in CI and local demos without tokens.
211
+ 5. **Review safeguard warnings** before posting flagged drafts.
212
+
213
+ **Not for clinical use** — maintainer support tooling only, not medical advice or a clinical decision system. Does not replace IRB, legal, or compliance review.
214
+
215
+ Read more: [`ETHICS.md`](ETHICS.md) · [`SECURITY.md`](SECURITY.md) · [`SUPPORT.md`](SUPPORT.md)
216
+
217
+ ---
218
+
219
+ ## GitHub Action
220
+
221
+ Dry-run triage when issues are opened:
222
+
223
+ ```yaml
224
+ - uses: FratresMedAI/WeaveRx@v0.1.1
225
+ with:
226
+ repo: ${{ github.repository }}
227
+ issue_number: ${{ github.event.issue.number }}
228
+ dry_run: "true"
229
+ llm_provider: "grok"
230
+ env:
231
+ XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
232
+ ```
233
+
234
+ <p align="center">
235
+ <img src="docs/screenshots/github-action-dry-run.png"
236
+ alt="GitHub Actions log showing WeaveRx dry-run triage output"
237
+ width="820" />
238
+ </p>
239
+
240
+ See [`action.yml`](action.yml) and [`.github/workflows/triage-on-issue.yml`](.github/workflows/triage-on-issue.yml).
241
+
242
+ ---
243
+
244
+ ## Reference
245
+
246
+ <details>
247
+ <summary><strong>LLM providers</strong></summary>
248
+
249
+ | Provider | CLI | API key env | Default model |
250
+ |---|---|---|---|
251
+ | Grok | `--llm-provider grok` | `XAI_API_KEY` | `xai/grok-2-latest` |
252
+ | Anthropic | `--llm-provider anthropic` | `ANTHROPIC_API_KEY` | `anthropic/claude-3-5-sonnet-20241022` |
253
+ | OpenAI-compatible | `--llm-provider openai` | `OPENAI_API_KEY` | `openai/gpt-4o` |
254
+
255
+ Override: `WEAVERX_LLM_MODEL`, `WEAVERX_LLM_PROVIDER`. Details: [`docs/reference/llm-providers.md`](docs/reference/llm-providers.md)
256
+
257
+ </details>
258
+
259
+ <details>
260
+ <summary><strong>Medical AI categories</strong></summary>
261
+
262
+ | Category | What we look for |
263
+ |---|---|
264
+ | **Dataset Access & Licensing** | Download links, usage terms, attribution |
265
+ | **Model Performance (Pathology/Subgroup)** | Accuracy on specific diseases or patient groups |
266
+ | **Reproducibility & Environment** | MONAI/nnU-Net versions, CUDA/PyTorch, can't reproduce results |
267
+ | **Clinical Validation Request** | External validation, reader studies, deployment |
268
+ | **Privacy/Compliance/DICOM** | PHI, de-identification, HIPAA/GDPR, DICOM metadata |
269
+ | **Bug** | Crashes, incorrect outputs |
270
+ | **Feature/Integration Request** | New capabilities, framework hooks |
271
+ | **Documentation** | Missing or unclear tutorials and API docs |
272
+
273
+ Full table: [`docs/reference/categories.md`](docs/reference/categories.md)
274
+
275
+ </details>
276
+
277
+ <details>
278
+ <summary><strong>Draft safeguards</strong></summary>
279
+
280
+ Local-only checks after every draft — **advisory**, never auto-block posting. See [Safeguard warning](#safeguard-warning) above.
281
+
282
+ | Score | Status | Meaning |
283
+ |---|---|---|
284
+ | 0.0 – 2.9 | `clean` | No meaningful red flags |
285
+ | 3.0 – 6.9 | `review_recommended` | Skim draft before posting |
286
+ | 7.0 – 10.0 | `high_risk` | Multiple or severe heuristics fired |
287
+
288
+ Full reference: [`docs/reference/safeguards.md`](docs/reference/safeguards.md)
289
+
290
+ </details>
291
+
292
+ <details>
293
+ <summary><strong>CLI reference</strong></summary>
294
+
295
+ ```
296
+ weaverx triage --repo owner/repo [--issue N | --recent N] [options]
297
+ ```
298
+
299
+ Key flags: `--mock`, `--dry-run`, `--json`, `--llm-provider`, `--confirm`, `--post-comment`, `--safeguards`
300
+
301
+ Full reference: [`docs/reference/cli.md`](docs/reference/cli.md)
302
+
303
+ </details>
304
+
305
+ ---
306
+
307
+ ## Related projects
308
+
309
+ - [MONAI](https://github.com/Project-MONAI/MONAI) — open-source medical AI framework
310
+ - [nnU-Net](https://github.com/MIC-DKFZ/nnUNet) — self-configuring segmentation
311
+ - [LiteLLM](https://github.com/BerriAI/litellm) — unified LLM API (used by WeaveRx)
312
+ - [Safire](https://github.com/FratresMedAI/Safire) — related audit tooling from the same org
313
+
314
+ ---
315
+
316
+ ## Citing WeaveRx
317
+
318
+ If you use WeaveRx in research or evaluations, cite via [`CITATION.cff`](CITATION.cff) (GitHub can generate a BibTeX entry from that file).
319
+
320
+ ---
321
+
322
+ ## Roadmap (near-term)
323
+
324
+ 1. **Embedding-based duplicate detection** — optional `weaverx[embeddings]` extra
325
+ 2. **PR triage mode** — `--pr` for pull request review drafts
326
+ 3. **Expanded provider presets** — more medical-AI-tuned prompt templates
327
+
328
+ See [CHANGELOG.md](CHANGELOG.md) for release history.
329
+
330
+ ---
331
+
332
+ ## Development and contributing
333
+
334
+ ```bash
335
+ pip install -e ".[dev]"
336
+ pre-commit install
337
+ ruff check .
338
+ mypy src/weaverx
339
+ pytest --cov=weaverx
340
+ ```
341
+
342
+ [`CONTRIBUTING.md`](CONTRIBUTING.md) · [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) · [docs/releasing.md](docs/releasing.md)
343
+
344
+ ---
345
+
346
+ ## License
347
+
348
+ MIT — see [`LICENSE`](LICENSE).