wintersolve 0.3.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.
- wintersolve-0.3.0/LICENSE +22 -0
- wintersolve-0.3.0/PKG-INFO +263 -0
- wintersolve-0.3.0/README.md +211 -0
- wintersolve-0.3.0/pyproject.toml +161 -0
- wintersolve-0.3.0/setup.cfg +4 -0
- wintersolve-0.3.0/src/wintersolve/__init__.py +13 -0
- wintersolve-0.3.0/src/wintersolve/__main__.py +6 -0
- wintersolve-0.3.0/src/wintersolve/cli.py +324 -0
- wintersolve-0.3.0/src/wintersolve/logging_config.py +59 -0
- wintersolve-0.3.0/src/wintersolve/models.py +110 -0
- wintersolve-0.3.0/src/wintersolve/modules/__init__.py +5 -0
- wintersolve-0.3.0/src/wintersolve/modules/architecture.py +79 -0
- wintersolve-0.3.0/src/wintersolve/modules/brain.py +74 -0
- wintersolve-0.3.0/src/wintersolve/modules/command_detector.py +242 -0
- wintersolve-0.3.0/src/wintersolve/modules/debugger.py +165 -0
- wintersolve-0.3.0/src/wintersolve/modules/docs_assistant.py +162 -0
- wintersolve-0.3.0/src/wintersolve/modules/explainer.py +198 -0
- wintersolve-0.3.0/src/wintersolve/modules/recommendations.py +138 -0
- wintersolve-0.3.0/src/wintersolve/modules/reviewer.py +130 -0
- wintersolve-0.3.0/src/wintersolve/modules/scanner.py +271 -0
- wintersolve-0.3.0/src/wintersolve/modules/security.py +329 -0
- wintersolve-0.3.0/src/wintersolve/project.py +289 -0
- wintersolve-0.3.0/src/wintersolve/providers/__init__.py +21 -0
- wintersolve-0.3.0/src/wintersolve/providers/base.py +31 -0
- wintersolve-0.3.0/src/wintersolve/providers/examples.py +112 -0
- wintersolve-0.3.0/src/wintersolve/py.typed +1 -0
- wintersolve-0.3.0/src/wintersolve/report.py +252 -0
- wintersolve-0.3.0/src/wintersolve/workflows/__init__.py +5 -0
- wintersolve-0.3.0/src/wintersolve/workflows/registry.py +25 -0
- wintersolve-0.3.0/src/wintersolve.egg-info/PKG-INFO +263 -0
- wintersolve-0.3.0/src/wintersolve.egg-info/SOURCES.txt +46 -0
- wintersolve-0.3.0/src/wintersolve.egg-info/dependency_links.txt +1 -0
- wintersolve-0.3.0/src/wintersolve.egg-info/entry_points.txt +2 -0
- wintersolve-0.3.0/src/wintersolve.egg-info/requires.txt +22 -0
- wintersolve-0.3.0/src/wintersolve.egg-info/top_level.txt +1 -0
- wintersolve-0.3.0/tests/test_architecture.py +40 -0
- wintersolve-0.3.0/tests/test_brain.py +123 -0
- wintersolve-0.3.0/tests/test_cli.py +214 -0
- wintersolve-0.3.0/tests/test_command_detector.py +93 -0
- wintersolve-0.3.0/tests/test_debugger.py +85 -0
- wintersolve-0.3.0/tests/test_docs_assistant.py +63 -0
- wintersolve-0.3.0/tests/test_explainer.py +90 -0
- wintersolve-0.3.0/tests/test_project.py +88 -0
- wintersolve-0.3.0/tests/test_providers.py +46 -0
- wintersolve-0.3.0/tests/test_report.py +59 -0
- wintersolve-0.3.0/tests/test_reviewer.py +63 -0
- wintersolve-0.3.0/tests/test_scanner.py +75 -0
- wintersolve-0.3.0/tests/test_security.py +175 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WinterSolve 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.
|
|
22
|
+
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wintersolve
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Offline-first repository intelligence: understand, debug, document, and review any codebase from the terminal.
|
|
5
|
+
Author: WinterSolve Contributors
|
|
6
|
+
Maintainer: Harshit Kumar (harshitkrhere)
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/harshitkrhere/WinterSolve
|
|
9
|
+
Project-URL: Repository, https://github.com/harshitkrhere/WinterSolve
|
|
10
|
+
Project-URL: Documentation, https://github.com/harshitkrhere/WinterSolve/tree/main/docs
|
|
11
|
+
Project-URL: Changelog, https://github.com/harshitkrhere/WinterSolve/blob/main/CHANGELOG.md
|
|
12
|
+
Project-URL: Issues, https://github.com/harshitkrhere/WinterSolve/issues
|
|
13
|
+
Keywords: cli,developer-tools,codebase-analysis,repository-analysis,static-analysis,security-scanning,secret-detection,onboarding,documentation,code-review,offline,repo-brain
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Topic :: Software Development
|
|
25
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
26
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
27
|
+
Classifier: Topic :: Security
|
|
28
|
+
Classifier: Topic :: Utilities
|
|
29
|
+
Classifier: Typing :: Typed
|
|
30
|
+
Requires-Python: >=3.10
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
Requires-Dist: typer>=0.12
|
|
34
|
+
Requires-Dist: rich>=13.0
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
38
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
39
|
+
Requires-Dist: ruff==0.16.8; extra == "dev"
|
|
40
|
+
Requires-Dist: bandit>=1.7; extra == "dev"
|
|
41
|
+
Requires-Dist: pre-commit>=3.7; extra == "dev"
|
|
42
|
+
Provides-Extra: security
|
|
43
|
+
Requires-Dist: bandit>=1.7; extra == "security"
|
|
44
|
+
Provides-Extra: ai
|
|
45
|
+
Requires-Dist: openai>=1.0; extra == "ai"
|
|
46
|
+
Requires-Dist: anthropic>=0.18; extra == "ai"
|
|
47
|
+
Provides-Extra: all
|
|
48
|
+
Requires-Dist: bandit>=1.7; extra == "all"
|
|
49
|
+
Requires-Dist: openai>=1.0; extra == "all"
|
|
50
|
+
Requires-Dist: anthropic>=0.18; extra == "all"
|
|
51
|
+
Dynamic: license-file
|
|
52
|
+
|
|
53
|
+
<h1 align="center">WinterSolve</h1>
|
|
54
|
+
|
|
55
|
+
<p align="center">
|
|
56
|
+
<strong>Understand any repository from the terminal. Offline, in seconds, no account.</strong>
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
<p align="center">
|
|
60
|
+
<a href="https://github.com/harshitkrhere/WinterSolve/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/harshitkrhere/WinterSolve/actions/workflows/ci.yml/badge.svg"></a>
|
|
61
|
+
<a href="https://github.com/harshitkrhere/WinterSolve/actions/workflows/codeql.yml"><img alt="CodeQL" src="https://github.com/harshitkrhere/WinterSolve/actions/workflows/codeql.yml/badge.svg"></a>
|
|
62
|
+
<a href="LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-green.svg"></a>
|
|
63
|
+
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue.svg">
|
|
64
|
+
<a href="https://github.com/astral-sh/ruff"><img alt="Ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
|
|
65
|
+
<img alt="mypy strict" src="https://img.shields.io/badge/mypy-strict-blue.svg">
|
|
66
|
+
</p>
|
|
67
|
+
|
|
68
|
+
You open a repository you have never seen. What is it, how do you run it, where
|
|
69
|
+
are the tests, is anything risky, what should you look at first?
|
|
70
|
+
|
|
71
|
+
`wintersolve brain .` answers all of that in one report: languages and stack,
|
|
72
|
+
source and test layout, the commands you need, an architecture map, a security
|
|
73
|
+
and privacy check, and a short list of risks and next actions. It reads files;
|
|
74
|
+
it never phones home. Output is plain text you can paste into an issue,
|
|
75
|
+
Markdown for a wiki, or JSON for your tooling.
|
|
76
|
+
|
|
77
|
+
## Try it
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pipx install wintersolve # or: python -m pip install wintersolve
|
|
81
|
+
cd path/to/any/project
|
|
82
|
+
wintersolve brain .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Not on PyPI yet, or want the latest commit? `pipx install git+https://github.com/harshitkrhere/WinterSolve.git`
|
|
86
|
+
|
|
87
|
+
## What you get
|
|
88
|
+
|
|
89
|
+
Real output from running WinterSolve on its own repository (lightly trimmed;
|
|
90
|
+
the [full report](examples/sample-reports/wintersolve-repo-brain.md) is in
|
|
91
|
+
`examples/`):
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
WinterSolve Repo Brain
|
|
95
|
+
======================
|
|
96
|
+
Project: WinterSolve
|
|
97
|
+
Offline mode: yes
|
|
98
|
+
|
|
99
|
+
Languages:
|
|
100
|
+
- Python: 38
|
|
101
|
+
- Markdown: 27
|
|
102
|
+
- PowerShell: 2
|
|
103
|
+
Detected stack:
|
|
104
|
+
- GitHub Actions
|
|
105
|
+
- Python package
|
|
106
|
+
- pre-commit
|
|
107
|
+
Source layout:
|
|
108
|
+
- src
|
|
109
|
+
- src/wintersolve
|
|
110
|
+
- src/wintersolve/modules
|
|
111
|
+
- src/wintersolve/providers
|
|
112
|
+
- src/wintersolve/workflows
|
|
113
|
+
Documentation health:
|
|
114
|
+
- README contains the expected core sections.
|
|
115
|
+
- Core open-source hygiene files are present.
|
|
116
|
+
Detected commands:
|
|
117
|
+
- install editable: `python -m pip install -e .` (pyproject.toml, medium)
|
|
118
|
+
- test: `python -m pytest` (pyproject.toml, medium)
|
|
119
|
+
- pipx: `pipx install wintersolve` (README.md, medium)
|
|
120
|
+
Architecture map:
|
|
121
|
+
- docs: Project documentation; notable: docs/ARCHITECTURE.md, docs/COMMANDS.md, ...
|
|
122
|
+
- src: Application or library source code; notable: src/wintersolve/cli.py, ...
|
|
123
|
+
- tests: Automated tests; notable: tests/conftest.py, tests/test_cli.py, ...
|
|
124
|
+
Security and privacy:
|
|
125
|
+
- Status: clear
|
|
126
|
+
- Files checked: 83
|
|
127
|
+
- Secret-like values are redacted before they appear in any report.
|
|
128
|
+
- Bandit ran on Python files (medium and high severity): 0 issue(s).
|
|
129
|
+
Risks:
|
|
130
|
+
- None detected
|
|
131
|
+
Next actions:
|
|
132
|
+
- Run the detected test command before making changes.
|
|
133
|
+
- Use `wintersolve explain <file>` on the most important source files.
|
|
134
|
+
- Use the architecture map as the first contributor onboarding guide.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
On a repository with problems, the same report names them: a committed AWS
|
|
138
|
+
key (redacted in the output), `eval()` on user input, SQL built from request
|
|
139
|
+
data, a missing test directory, a README with no install section.
|
|
140
|
+
|
|
141
|
+
## Commands
|
|
142
|
+
|
|
143
|
+
| Command | What it does | Formats |
|
|
144
|
+
| --- | --- | --- |
|
|
145
|
+
| `wintersolve brain .` | Full project intelligence report (everything below, composed). | text, markdown, json |
|
|
146
|
+
| `wintersolve scan .` | Quick health check from file names and marker files only. | text, markdown, json |
|
|
147
|
+
| `wintersolve explain FILE` | What one file is, what it defines, what it depends on. | text |
|
|
148
|
+
| `wintersolve debug --text "..."` | Likely causes and next steps for an error or stack trace. Also reads stdin. | text |
|
|
149
|
+
| `wintersolve docs .` | Missing README sections and hygiene files; `--draft-readme` for a skeleton. | text |
|
|
150
|
+
| `wintersolve review .` | Turns your uncommitted changes into review risks and a checklist. | text |
|
|
151
|
+
|
|
152
|
+
Every command exits `0` on success, `1` if the analysis failed, and `2` for
|
|
153
|
+
usage errors or targets that cannot be analyzed. Full reference:
|
|
154
|
+
[docs/COMMANDS.md](docs/COMMANDS.md).
|
|
155
|
+
|
|
156
|
+
A few things people do with it:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
wintersolve brain . --format markdown --output REPO_BRAIN.md # onboarding doc
|
|
160
|
+
wintersolve brain . --format json | jq '.security.findings' # feed a script
|
|
161
|
+
pytest 2>&1 | wintersolve debug # explain a failure
|
|
162
|
+
wintersolve brain ~/code/some-repo --no-bandit # fastest possible
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Why WinterSolve
|
|
166
|
+
|
|
167
|
+
- **Offline by default.** No API keys, no accounts, no telemetry, no update
|
|
168
|
+
checks. Safe to run on private code.
|
|
169
|
+
- **Fast on real repositories.** One filesystem walk that prunes `node_modules`,
|
|
170
|
+
virtual environments, and build output before descending.
|
|
171
|
+
- **Honest.** Heuristics are labelled as heuristics. The security section says
|
|
172
|
+
exactly which checks ran, and severity is earned: `high` only for unambiguous
|
|
173
|
+
token formats, never for "this line mentions a password".
|
|
174
|
+
- **Structured.** Plain text that pastes cleanly, Markdown for wikis, JSON with
|
|
175
|
+
a `schema_version` for tools. Same commit, same report, every time.
|
|
176
|
+
- **Small.** Two runtime dependencies (`typer`, `rich`), plain dataclasses,
|
|
177
|
+
strict typing, tests that run in seconds.
|
|
178
|
+
|
|
179
|
+
## Use it in CI
|
|
180
|
+
|
|
181
|
+
```yaml
|
|
182
|
+
- run: python -m pip install wintersolve
|
|
183
|
+
- run: wintersolve brain . --format markdown --output repo-brain.md
|
|
184
|
+
- run: cat repo-brain.md >> "$GITHUB_STEP_SUMMARY"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The report shows up in the Actions job summary. A drop-in workflow and the
|
|
188
|
+
recipe for failing a build on high-severity findings are in
|
|
189
|
+
[docs/INTEGRATIONS.md](docs/INTEGRATIONS.md).
|
|
190
|
+
|
|
191
|
+
## Installation
|
|
192
|
+
|
|
193
|
+
| Method | Command |
|
|
194
|
+
| --- | --- |
|
|
195
|
+
| pipx (recommended) | `pipx install wintersolve` |
|
|
196
|
+
| pip | `python -m pip install wintersolve` |
|
|
197
|
+
| latest from GitHub | `pipx install git+https://github.com/harshitkrhere/WinterSolve.git` |
|
|
198
|
+
| with Bandit for deeper Python checks | `pipx install "wintersolve[security]"` |
|
|
199
|
+
|
|
200
|
+
Python 3.10 or newer, on Linux, macOS, or Windows. Details and troubleshooting:
|
|
201
|
+
[docs/INSTALLATION.md](docs/INSTALLATION.md).
|
|
202
|
+
|
|
203
|
+
## How it works
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
cli.py -> modules/*.py (one analyzer each) -> frozen dataclasses -> report.py
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Analyzers never print and never touch the network. `brain` calls all of them
|
|
210
|
+
and composes one report. Adding an analyzer is a module, a renderer, a
|
|
211
|
+
few lines in the CLI, and a test. See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
|
212
|
+
|
|
213
|
+
## What it is not
|
|
214
|
+
|
|
215
|
+
WinterSolve is not an AI assistant and does not need one. It will not write your
|
|
216
|
+
code, and its security scan is a first pass, not an audit. There is an optional
|
|
217
|
+
provider interface for people who want to build AI features on top of redacted
|
|
218
|
+
reports; the CLI never calls it.
|
|
219
|
+
|
|
220
|
+
## Security and privacy
|
|
221
|
+
|
|
222
|
+
WinterSolve reads the directory you point it at (skipping `.git`, caches,
|
|
223
|
+
virtual environments, and dependency folders), runs `git status` for `review`,
|
|
224
|
+
and optionally runs Bandit. That is the complete list. Anything that looks like
|
|
225
|
+
a credential is redacted before it reaches a report, and `explain` refuses
|
|
226
|
+
files outside the project root. Details: [docs/SECURITY_MODEL.md](docs/SECURITY_MODEL.md).
|
|
227
|
+
Found a problem in WinterSolve itself? Please follow [SECURITY.md](SECURITY.md).
|
|
228
|
+
|
|
229
|
+
## Development and tests
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
git clone https://github.com/harshitkrhere/WinterSolve.git && cd WinterSolve
|
|
233
|
+
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
|
|
234
|
+
python -m pip install -e ".[dev]"
|
|
235
|
+
ruff check . && ruff format --check . && mypy && pytest
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
That last line is the whole quality gate, and it is exactly what CI runs on
|
|
239
|
+
Linux, macOS, and Windows across Python 3.10 to 3.14. Tests use temporary
|
|
240
|
+
fixture projects and finish in seconds.
|
|
241
|
+
|
|
242
|
+
## Contributing
|
|
243
|
+
|
|
244
|
+
Small contributions are the best ones here: a stack marker WinterSolve misses,
|
|
245
|
+
a command it should have found, an error message it does not recognise, a
|
|
246
|
+
false positive it should not raise. Each is a few lines plus a test.
|
|
247
|
+
|
|
248
|
+
Start with [CONTRIBUTING.md](CONTRIBUTING.md), or [BEGINNER.md](BEGINNER.md)
|
|
249
|
+
for a guided first week. Ideas and questions go in
|
|
250
|
+
[Discussions](https://github.com/harshitkrhere/WinterSolve/discussions);
|
|
251
|
+
bugs in [Issues](https://github.com/harshitkrhere/WinterSolve/issues).
|
|
252
|
+
|
|
253
|
+
## Status
|
|
254
|
+
|
|
255
|
+
Version 0.3.0, alpha. The command set is stable; report wording may still
|
|
256
|
+
change between minor versions, and the JSON `schema_version` is bumped for any
|
|
257
|
+
breaking change. See the [changelog](CHANGELOG.md) and the [roadmap](ROADMAP.md).
|
|
258
|
+
|
|
259
|
+
If WinterSolve saved you time, a star helps other people find it.
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
[MIT](LICENSE).
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<h1 align="center">WinterSolve</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Understand any repository from the terminal. Offline, in seconds, no account.</strong>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://github.com/harshitkrhere/WinterSolve/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/harshitkrhere/WinterSolve/actions/workflows/ci.yml/badge.svg"></a>
|
|
9
|
+
<a href="https://github.com/harshitkrhere/WinterSolve/actions/workflows/codeql.yml"><img alt="CodeQL" src="https://github.com/harshitkrhere/WinterSolve/actions/workflows/codeql.yml/badge.svg"></a>
|
|
10
|
+
<a href="LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-green.svg"></a>
|
|
11
|
+
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue.svg">
|
|
12
|
+
<a href="https://github.com/astral-sh/ruff"><img alt="Ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
|
|
13
|
+
<img alt="mypy strict" src="https://img.shields.io/badge/mypy-strict-blue.svg">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
You open a repository you have never seen. What is it, how do you run it, where
|
|
17
|
+
are the tests, is anything risky, what should you look at first?
|
|
18
|
+
|
|
19
|
+
`wintersolve brain .` answers all of that in one report: languages and stack,
|
|
20
|
+
source and test layout, the commands you need, an architecture map, a security
|
|
21
|
+
and privacy check, and a short list of risks and next actions. It reads files;
|
|
22
|
+
it never phones home. Output is plain text you can paste into an issue,
|
|
23
|
+
Markdown for a wiki, or JSON for your tooling.
|
|
24
|
+
|
|
25
|
+
## Try it
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pipx install wintersolve # or: python -m pip install wintersolve
|
|
29
|
+
cd path/to/any/project
|
|
30
|
+
wintersolve brain .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Not on PyPI yet, or want the latest commit? `pipx install git+https://github.com/harshitkrhere/WinterSolve.git`
|
|
34
|
+
|
|
35
|
+
## What you get
|
|
36
|
+
|
|
37
|
+
Real output from running WinterSolve on its own repository (lightly trimmed;
|
|
38
|
+
the [full report](examples/sample-reports/wintersolve-repo-brain.md) is in
|
|
39
|
+
`examples/`):
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
WinterSolve Repo Brain
|
|
43
|
+
======================
|
|
44
|
+
Project: WinterSolve
|
|
45
|
+
Offline mode: yes
|
|
46
|
+
|
|
47
|
+
Languages:
|
|
48
|
+
- Python: 38
|
|
49
|
+
- Markdown: 27
|
|
50
|
+
- PowerShell: 2
|
|
51
|
+
Detected stack:
|
|
52
|
+
- GitHub Actions
|
|
53
|
+
- Python package
|
|
54
|
+
- pre-commit
|
|
55
|
+
Source layout:
|
|
56
|
+
- src
|
|
57
|
+
- src/wintersolve
|
|
58
|
+
- src/wintersolve/modules
|
|
59
|
+
- src/wintersolve/providers
|
|
60
|
+
- src/wintersolve/workflows
|
|
61
|
+
Documentation health:
|
|
62
|
+
- README contains the expected core sections.
|
|
63
|
+
- Core open-source hygiene files are present.
|
|
64
|
+
Detected commands:
|
|
65
|
+
- install editable: `python -m pip install -e .` (pyproject.toml, medium)
|
|
66
|
+
- test: `python -m pytest` (pyproject.toml, medium)
|
|
67
|
+
- pipx: `pipx install wintersolve` (README.md, medium)
|
|
68
|
+
Architecture map:
|
|
69
|
+
- docs: Project documentation; notable: docs/ARCHITECTURE.md, docs/COMMANDS.md, ...
|
|
70
|
+
- src: Application or library source code; notable: src/wintersolve/cli.py, ...
|
|
71
|
+
- tests: Automated tests; notable: tests/conftest.py, tests/test_cli.py, ...
|
|
72
|
+
Security and privacy:
|
|
73
|
+
- Status: clear
|
|
74
|
+
- Files checked: 83
|
|
75
|
+
- Secret-like values are redacted before they appear in any report.
|
|
76
|
+
- Bandit ran on Python files (medium and high severity): 0 issue(s).
|
|
77
|
+
Risks:
|
|
78
|
+
- None detected
|
|
79
|
+
Next actions:
|
|
80
|
+
- Run the detected test command before making changes.
|
|
81
|
+
- Use `wintersolve explain <file>` on the most important source files.
|
|
82
|
+
- Use the architecture map as the first contributor onboarding guide.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
On a repository with problems, the same report names them: a committed AWS
|
|
86
|
+
key (redacted in the output), `eval()` on user input, SQL built from request
|
|
87
|
+
data, a missing test directory, a README with no install section.
|
|
88
|
+
|
|
89
|
+
## Commands
|
|
90
|
+
|
|
91
|
+
| Command | What it does | Formats |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| `wintersolve brain .` | Full project intelligence report (everything below, composed). | text, markdown, json |
|
|
94
|
+
| `wintersolve scan .` | Quick health check from file names and marker files only. | text, markdown, json |
|
|
95
|
+
| `wintersolve explain FILE` | What one file is, what it defines, what it depends on. | text |
|
|
96
|
+
| `wintersolve debug --text "..."` | Likely causes and next steps for an error or stack trace. Also reads stdin. | text |
|
|
97
|
+
| `wintersolve docs .` | Missing README sections and hygiene files; `--draft-readme` for a skeleton. | text |
|
|
98
|
+
| `wintersolve review .` | Turns your uncommitted changes into review risks and a checklist. | text |
|
|
99
|
+
|
|
100
|
+
Every command exits `0` on success, `1` if the analysis failed, and `2` for
|
|
101
|
+
usage errors or targets that cannot be analyzed. Full reference:
|
|
102
|
+
[docs/COMMANDS.md](docs/COMMANDS.md).
|
|
103
|
+
|
|
104
|
+
A few things people do with it:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
wintersolve brain . --format markdown --output REPO_BRAIN.md # onboarding doc
|
|
108
|
+
wintersolve brain . --format json | jq '.security.findings' # feed a script
|
|
109
|
+
pytest 2>&1 | wintersolve debug # explain a failure
|
|
110
|
+
wintersolve brain ~/code/some-repo --no-bandit # fastest possible
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Why WinterSolve
|
|
114
|
+
|
|
115
|
+
- **Offline by default.** No API keys, no accounts, no telemetry, no update
|
|
116
|
+
checks. Safe to run on private code.
|
|
117
|
+
- **Fast on real repositories.** One filesystem walk that prunes `node_modules`,
|
|
118
|
+
virtual environments, and build output before descending.
|
|
119
|
+
- **Honest.** Heuristics are labelled as heuristics. The security section says
|
|
120
|
+
exactly which checks ran, and severity is earned: `high` only for unambiguous
|
|
121
|
+
token formats, never for "this line mentions a password".
|
|
122
|
+
- **Structured.** Plain text that pastes cleanly, Markdown for wikis, JSON with
|
|
123
|
+
a `schema_version` for tools. Same commit, same report, every time.
|
|
124
|
+
- **Small.** Two runtime dependencies (`typer`, `rich`), plain dataclasses,
|
|
125
|
+
strict typing, tests that run in seconds.
|
|
126
|
+
|
|
127
|
+
## Use it in CI
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
- run: python -m pip install wintersolve
|
|
131
|
+
- run: wintersolve brain . --format markdown --output repo-brain.md
|
|
132
|
+
- run: cat repo-brain.md >> "$GITHUB_STEP_SUMMARY"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The report shows up in the Actions job summary. A drop-in workflow and the
|
|
136
|
+
recipe for failing a build on high-severity findings are in
|
|
137
|
+
[docs/INTEGRATIONS.md](docs/INTEGRATIONS.md).
|
|
138
|
+
|
|
139
|
+
## Installation
|
|
140
|
+
|
|
141
|
+
| Method | Command |
|
|
142
|
+
| --- | --- |
|
|
143
|
+
| pipx (recommended) | `pipx install wintersolve` |
|
|
144
|
+
| pip | `python -m pip install wintersolve` |
|
|
145
|
+
| latest from GitHub | `pipx install git+https://github.com/harshitkrhere/WinterSolve.git` |
|
|
146
|
+
| with Bandit for deeper Python checks | `pipx install "wintersolve[security]"` |
|
|
147
|
+
|
|
148
|
+
Python 3.10 or newer, on Linux, macOS, or Windows. Details and troubleshooting:
|
|
149
|
+
[docs/INSTALLATION.md](docs/INSTALLATION.md).
|
|
150
|
+
|
|
151
|
+
## How it works
|
|
152
|
+
|
|
153
|
+
```text
|
|
154
|
+
cli.py -> modules/*.py (one analyzer each) -> frozen dataclasses -> report.py
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Analyzers never print and never touch the network. `brain` calls all of them
|
|
158
|
+
and composes one report. Adding an analyzer is a module, a renderer, a
|
|
159
|
+
few lines in the CLI, and a test. See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
|
160
|
+
|
|
161
|
+
## What it is not
|
|
162
|
+
|
|
163
|
+
WinterSolve is not an AI assistant and does not need one. It will not write your
|
|
164
|
+
code, and its security scan is a first pass, not an audit. There is an optional
|
|
165
|
+
provider interface for people who want to build AI features on top of redacted
|
|
166
|
+
reports; the CLI never calls it.
|
|
167
|
+
|
|
168
|
+
## Security and privacy
|
|
169
|
+
|
|
170
|
+
WinterSolve reads the directory you point it at (skipping `.git`, caches,
|
|
171
|
+
virtual environments, and dependency folders), runs `git status` for `review`,
|
|
172
|
+
and optionally runs Bandit. That is the complete list. Anything that looks like
|
|
173
|
+
a credential is redacted before it reaches a report, and `explain` refuses
|
|
174
|
+
files outside the project root. Details: [docs/SECURITY_MODEL.md](docs/SECURITY_MODEL.md).
|
|
175
|
+
Found a problem in WinterSolve itself? Please follow [SECURITY.md](SECURITY.md).
|
|
176
|
+
|
|
177
|
+
## Development and tests
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
git clone https://github.com/harshitkrhere/WinterSolve.git && cd WinterSolve
|
|
181
|
+
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
|
|
182
|
+
python -m pip install -e ".[dev]"
|
|
183
|
+
ruff check . && ruff format --check . && mypy && pytest
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
That last line is the whole quality gate, and it is exactly what CI runs on
|
|
187
|
+
Linux, macOS, and Windows across Python 3.10 to 3.14. Tests use temporary
|
|
188
|
+
fixture projects and finish in seconds.
|
|
189
|
+
|
|
190
|
+
## Contributing
|
|
191
|
+
|
|
192
|
+
Small contributions are the best ones here: a stack marker WinterSolve misses,
|
|
193
|
+
a command it should have found, an error message it does not recognise, a
|
|
194
|
+
false positive it should not raise. Each is a few lines plus a test.
|
|
195
|
+
|
|
196
|
+
Start with [CONTRIBUTING.md](CONTRIBUTING.md), or [BEGINNER.md](BEGINNER.md)
|
|
197
|
+
for a guided first week. Ideas and questions go in
|
|
198
|
+
[Discussions](https://github.com/harshitkrhere/WinterSolve/discussions);
|
|
199
|
+
bugs in [Issues](https://github.com/harshitkrhere/WinterSolve/issues).
|
|
200
|
+
|
|
201
|
+
## Status
|
|
202
|
+
|
|
203
|
+
Version 0.3.0, alpha. The command set is stable; report wording may still
|
|
204
|
+
change between minor versions, and the JSON `schema_version` is bumped for any
|
|
205
|
+
breaking change. See the [changelog](CHANGELOG.md) and the [roadmap](ROADMAP.md).
|
|
206
|
+
|
|
207
|
+
If WinterSolve saved you time, a star helps other people find it.
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
[MIT](LICENSE).
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "wintersolve"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Offline-first repository intelligence: understand, debug, document, and review any codebase from the terminal."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "WinterSolve Contributors" }]
|
|
14
|
+
maintainers = [{ name = "Harshit Kumar (harshitkrhere)" }]
|
|
15
|
+
keywords = [
|
|
16
|
+
"cli",
|
|
17
|
+
"developer-tools",
|
|
18
|
+
"codebase-analysis",
|
|
19
|
+
"repository-analysis",
|
|
20
|
+
"static-analysis",
|
|
21
|
+
"security-scanning",
|
|
22
|
+
"secret-detection",
|
|
23
|
+
"onboarding",
|
|
24
|
+
"documentation",
|
|
25
|
+
"code-review",
|
|
26
|
+
"offline",
|
|
27
|
+
"repo-brain",
|
|
28
|
+
]
|
|
29
|
+
classifiers = [
|
|
30
|
+
"Development Status :: 3 - Alpha",
|
|
31
|
+
"Environment :: Console",
|
|
32
|
+
"Intended Audience :: Developers",
|
|
33
|
+
"Operating System :: OS Independent",
|
|
34
|
+
"Programming Language :: Python :: 3",
|
|
35
|
+
"Programming Language :: Python :: 3.10",
|
|
36
|
+
"Programming Language :: Python :: 3.11",
|
|
37
|
+
"Programming Language :: Python :: 3.12",
|
|
38
|
+
"Programming Language :: Python :: 3.13",
|
|
39
|
+
"Programming Language :: Python :: 3.14",
|
|
40
|
+
"Topic :: Software Development",
|
|
41
|
+
"Topic :: Software Development :: Documentation",
|
|
42
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
43
|
+
"Topic :: Security",
|
|
44
|
+
"Topic :: Utilities",
|
|
45
|
+
"Typing :: Typed",
|
|
46
|
+
]
|
|
47
|
+
dependencies = [
|
|
48
|
+
"typer>=0.12",
|
|
49
|
+
"rich>=13.0",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[project.optional-dependencies]
|
|
53
|
+
# Everything needed to run the quality gates locally (same as CI).
|
|
54
|
+
dev = [
|
|
55
|
+
"pytest>=8.0",
|
|
56
|
+
"pytest-cov>=5.0",
|
|
57
|
+
"mypy>=1.10",
|
|
58
|
+
"ruff==0.16.8", # pinned so local lint matches CI; Dependabot keeps it current
|
|
59
|
+
"bandit>=1.7",
|
|
60
|
+
"pre-commit>=3.7",
|
|
61
|
+
]
|
|
62
|
+
# Deeper Python static analysis inside `wintersolve brain`. Optional: the
|
|
63
|
+
# heuristic scanner works without it, and the report says which one ran.
|
|
64
|
+
security = ["bandit>=1.7"]
|
|
65
|
+
# Client libraries for the optional AI provider examples. Never required.
|
|
66
|
+
ai = ["openai>=1.0", "anthropic>=0.18"]
|
|
67
|
+
all = ["bandit>=1.7", "openai>=1.0", "anthropic>=0.18"]
|
|
68
|
+
|
|
69
|
+
[project.scripts]
|
|
70
|
+
wintersolve = "wintersolve.cli:main"
|
|
71
|
+
|
|
72
|
+
[project.urls]
|
|
73
|
+
Homepage = "https://github.com/harshitkrhere/WinterSolve"
|
|
74
|
+
Repository = "https://github.com/harshitkrhere/WinterSolve"
|
|
75
|
+
Documentation = "https://github.com/harshitkrhere/WinterSolve/tree/main/docs"
|
|
76
|
+
Changelog = "https://github.com/harshitkrhere/WinterSolve/blob/main/CHANGELOG.md"
|
|
77
|
+
Issues = "https://github.com/harshitkrhere/WinterSolve/issues"
|
|
78
|
+
|
|
79
|
+
[tool.setuptools.dynamic]
|
|
80
|
+
version = { attr = "wintersolve.__version__" }
|
|
81
|
+
|
|
82
|
+
[tool.setuptools.packages.find]
|
|
83
|
+
where = ["src"]
|
|
84
|
+
|
|
85
|
+
[tool.setuptools.package-data]
|
|
86
|
+
wintersolve = ["py.typed"]
|
|
87
|
+
|
|
88
|
+
# ---------------------------------------------------------------------------
|
|
89
|
+
# Quality tooling. `pip install -e ".[dev]"` gives you everything below.
|
|
90
|
+
# ---------------------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
[tool.ruff]
|
|
93
|
+
target-version = "py310"
|
|
94
|
+
line-length = 100
|
|
95
|
+
src = ["src", "tests"]
|
|
96
|
+
|
|
97
|
+
[tool.ruff.lint]
|
|
98
|
+
select = [
|
|
99
|
+
"E", # pycodestyle errors
|
|
100
|
+
"W", # pycodestyle warnings
|
|
101
|
+
"F", # pyflakes
|
|
102
|
+
"I", # isort
|
|
103
|
+
"B", # flake8-bugbear
|
|
104
|
+
"UP", # pyupgrade
|
|
105
|
+
"C4", # flake8-comprehensions
|
|
106
|
+
"DTZ", # flake8-datetimez
|
|
107
|
+
"T10", # flake8-debugger
|
|
108
|
+
"PTH", # flake8-use-pathlib
|
|
109
|
+
"ERA", # eradicate (commented-out code)
|
|
110
|
+
"PL", # pylint
|
|
111
|
+
"TRY", # tryceratops
|
|
112
|
+
"SIM", # flake8-simplify
|
|
113
|
+
"RUF", # ruff-specific rules
|
|
114
|
+
"ARG", # unused arguments
|
|
115
|
+
]
|
|
116
|
+
ignore = [
|
|
117
|
+
"TRY003", # Long messages in exceptions are fine for a CLI.
|
|
118
|
+
"PLR0913", # Analyzer functions legitimately take several inputs.
|
|
119
|
+
]
|
|
120
|
+
|
|
121
|
+
[tool.ruff.lint.per-file-ignores]
|
|
122
|
+
"tests/**" = ["PLR2004"] # Magic numbers in assertions are readable.
|
|
123
|
+
|
|
124
|
+
[tool.ruff.lint.isort]
|
|
125
|
+
known-first-party = ["wintersolve"]
|
|
126
|
+
|
|
127
|
+
[tool.ruff.format]
|
|
128
|
+
quote-style = "double"
|
|
129
|
+
indent-style = "space"
|
|
130
|
+
|
|
131
|
+
[tool.pytest.ini_options]
|
|
132
|
+
testpaths = ["tests"]
|
|
133
|
+
addopts = "--strict-markers --strict-config -ra"
|
|
134
|
+
filterwarnings = ["error::DeprecationWarning:wintersolve.*"]
|
|
135
|
+
|
|
136
|
+
# No python_version pin: CI runs mypy on every supported interpreter, and a pin
|
|
137
|
+
# makes mypy choke on third-party stubs that use newer syntax.
|
|
138
|
+
[tool.mypy]
|
|
139
|
+
strict = true
|
|
140
|
+
warn_unreachable = true
|
|
141
|
+
show_error_codes = true
|
|
142
|
+
files = ["src/wintersolve", "tests"]
|
|
143
|
+
|
|
144
|
+
# The AI SDKs are optional extras: treat them as opaque whether or not they
|
|
145
|
+
# happen to be installed, so type checking gives the same answer everywhere.
|
|
146
|
+
[[tool.mypy.overrides]]
|
|
147
|
+
module = ["openai", "openai.*", "anthropic", "anthropic.*", "numpy", "numpy.*"]
|
|
148
|
+
ignore_missing_imports = true
|
|
149
|
+
follow_imports = "skip"
|
|
150
|
+
|
|
151
|
+
[tool.coverage.run]
|
|
152
|
+
source = ["wintersolve"]
|
|
153
|
+
branch = true
|
|
154
|
+
|
|
155
|
+
[tool.coverage.report]
|
|
156
|
+
show_missing = true
|
|
157
|
+
exclude_lines = [
|
|
158
|
+
"pragma: no cover",
|
|
159
|
+
"if TYPE_CHECKING:",
|
|
160
|
+
"if __name__ == .__main__.:",
|
|
161
|
+
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""WinterSolve: offline-first repository intelligence for developers.
|
|
2
|
+
|
|
3
|
+
The public entry points are the ``wintersolve`` command (see ``wintersolve.cli``)
|
|
4
|
+
and the analyzer functions in ``wintersolve.modules``, which return plain
|
|
5
|
+
dataclasses you can render or serialise however you like.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from wintersolve.logging_config import configure_logging, get_logger, set_log_level
|
|
9
|
+
|
|
10
|
+
# Single source of truth for the version; pyproject.toml reads it at build time.
|
|
11
|
+
__version__ = "0.3.0"
|
|
12
|
+
|
|
13
|
+
__all__ = ["__version__", "configure_logging", "get_logger", "set_log_level"]
|