suitable-loop 0.1.0__tar.gz → 0.1.2__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 (34) hide show
  1. suitable_loop-0.1.2/.claude/commands/release.md +13 -0
  2. suitable_loop-0.1.2/LICENSE +21 -0
  3. suitable_loop-0.1.2/PKG-INFO +180 -0
  4. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/README.md +6 -4
  5. suitable_loop-0.1.2/pyproject.toml +45 -0
  6. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/__init__.py +1 -1
  7. suitable_loop-0.1.0/PKG-INFO +0 -12
  8. suitable_loop-0.1.0/pyproject.toml +0 -24
  9. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.claude/CLAUDE.md +0 -0
  10. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.claude/commands/debug-error.md +0 -0
  11. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.claude/commands/health-check.md +0 -0
  12. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.claude/commands/impact-check.md +0 -0
  13. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.claude/commands/onboard.md +0 -0
  14. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.claude/commands/risk-report.md +0 -0
  15. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.claude/commands/trace-function.md +0 -0
  16. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.github/workflows/publish.yml +0 -0
  17. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/.gitignore +0 -0
  18. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/__main__.py +0 -0
  19. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/analyzers/__init__.py +0 -0
  20. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/analyzers/code_analyzer.py +0 -0
  21. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/analyzers/git_analyzer.py +0 -0
  22. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/analyzers/log_analyzer.py +0 -0
  23. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/config.py +0 -0
  24. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/db.py +0 -0
  25. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/graph/__init__.py +0 -0
  26. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/graph/engine.py +0 -0
  27. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/models.py +0 -0
  28. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/server.py +0 -0
  29. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/tools/__init__.py +0 -0
  30. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/tools/code_tools.py +0 -0
  31. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/tools/git_tools.py +0 -0
  32. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/tools/log_tools.py +0 -0
  33. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/suitable_loop/tools/util_tools.py +0 -0
  34. {suitable_loop-0.1.0 → suitable_loop-0.1.2}/tests/__init__.py +0 -0
@@ -0,0 +1,13 @@
1
+ Release a new version of suitable-loop to PyPI.
2
+
3
+ Steps:
4
+ 1. Read pyproject.toml to get the current version
5
+ 2. Determine the next version:
6
+ - If $ARGUMENTS is "patch", "minor", or "major", bump accordingly
7
+ - If $ARGUMENTS is a specific version like "0.2.0", use that
8
+ - If $ARGUMENTS is empty, default to a patch bump
9
+ 3. Update the version in pyproject.toml and suitable_loop/__init__.py
10
+ 4. Commit the version bump
11
+ 5. Create a git tag (v{version}) and push both the commit and tag
12
+ 6. Wait for the GitHub Actions workflow to complete and report the result
13
+ 7. Confirm the new version is live on PyPI
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Johan Valentini Jensen
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.
@@ -0,0 +1,180 @@
1
+ Metadata-Version: 2.4
2
+ Name: suitable-loop
3
+ Version: 0.1.2
4
+ Summary: Local production engineering platform — semantic code analysis, git risk scoring, and log correlation via MCP
5
+ Project-URL: Homepage, https://github.com/suitable-adventures/suitable-loop
6
+ Project-URL: Repository, https://github.com/suitable-adventures/suitable-loop
7
+ Project-URL: Bug Tracker, https://github.com/suitable-adventures/suitable-loop/issues
8
+ Author-email: Johan Valentini Jensen <johan@valentini.dk>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: code-analysis,git,mcp,production-engineering,python
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Quality Assurance
19
+ Classifier: Topic :: Software Development :: Testing
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: gitpython>=3.1
22
+ Requires-Dist: mcp>=1.0.0
23
+ Requires-Dist: networkx>=3.0
24
+ Requires-Dist: radon>=6.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
27
+ Requires-Dist: pytest>=8.0; extra == 'dev'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # Suitable Loop
31
+
32
+ Local production engineering platform — semantic code analysis, git risk scoring, and log correlation via MCP.
33
+
34
+ ## What it does
35
+
36
+ Suitable Loop indexes your Python codebase and exposes deep analysis through MCP tools that AI assistants can call:
37
+
38
+ - **Code Analysis** — AST-based parsing, function/class extraction, call graph construction, cyclomatic complexity
39
+ - **Git Risk Scoring** — Weighted risk scores per commit (complexity delta × blast radius × churn × size)
40
+ - **Log Correlation** — Parse logs, group errors by signature, map stack frames to indexed code
41
+ - **Dependency Graph** — NetworkX-powered call graphs, import trees, blast radius analysis
42
+
43
+ ## Quick Start
44
+
45
+ ### 1. Add MCP server to your project
46
+
47
+ Create `.mcp.json` in your project root:
48
+
49
+ ```json
50
+ {
51
+ "mcpServers": {
52
+ "suitable-loop": {
53
+ "command": "uvx",
54
+ "args": ["suitable-loop"]
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ That's it. `uvx` fetches the package from PyPI automatically — no manual install needed.
61
+
62
+ > **Local development?** Point to a local checkout instead:
63
+ > ```json
64
+ > "args": ["--from", "/path/to/suitable-loop", "suitable-loop"]
65
+ > ```
66
+
67
+ ### 2. Install slash commands (optional)
68
+
69
+ Clone the repo and copy the commands into your project:
70
+
71
+ ```bash
72
+ git clone https://github.com/suitable-adventures/suitable-loop.git /tmp/suitable-loop
73
+ mkdir -p .claude/commands
74
+ cp /tmp/suitable-loop/.claude/commands/* .claude/commands/
75
+ ```
76
+
77
+ ### 3. Restart Claude Code and start using it
78
+
79
+ ```
80
+ /onboard # Get a full codebase orientation
81
+ /risk-report # Analyze recent commits by risk
82
+ /impact-check models.py # Check blast radius before changing a file
83
+ /debug-error "ConnectionResetError in db/pool.py"
84
+ /health-check # Full codebase health assessment
85
+ /trace-function my_function # Map a function's callers and callees
86
+ ```
87
+
88
+ ## Slash Commands
89
+
90
+ | Command | What it does |
91
+ |---------|-------------|
92
+ | `/onboard` | Index the codebase and produce a full orientation: structure, hotspots, complexity, blast radius |
93
+ | `/risk-report` | Score recent commits by risk, find hotspots, recommend where to focus review |
94
+ | `/impact-check <file>` | Before changing a file: blast radius, who calls what, what could break |
95
+ | `/debug-error <error or log path>` | Correlate an error/traceback to source code paths |
96
+ | `/health-check` | Full assessment: complexity, coupling, churn trends, actionable recommendations |
97
+ | `/trace-function <name>` | Map a function's callers, callees, complexity, and role in the system |
98
+ | `/release [patch\|minor\|major]` | Bump version, tag, and publish a new release to PyPI |
99
+
100
+ ## MCP Tools
101
+
102
+ ### Code Analysis
103
+ | Tool | Description |
104
+ |------|-------------|
105
+ | `index_codebase` | Index a Python project — parse AST, extract entities, build call graph |
106
+ | `query_entity` | Look up a function/class/file by name with all relationships |
107
+ | `find_callers` | Find all functions that call a given function |
108
+ | `find_callees` | Find all functions called by a given function |
109
+ | `dependency_tree` | Get import dependency tree for a file |
110
+ | `search_code` | Full-text search across indexed functions and classes |
111
+ | `complexity_report` | Top N most complex functions |
112
+ | `codebase_summary` | High-level stats and most-connected modules |
113
+
114
+ ### Git Analysis
115
+ | Tool | Description |
116
+ |------|-------------|
117
+ | `analyze_recent_changes` | Score recent commits by risk |
118
+ | `analyze_commit` | Deep-dive a single commit |
119
+ | `hotspot_report` | Files with high churn × high dependency count |
120
+ | `blast_radius` | Transitive impact of changing a file |
121
+
122
+ ### Log Analysis
123
+ | Tool | Description |
124
+ |------|-------------|
125
+ | `ingest_logs` | Parse log files, extract errors, group by signature |
126
+ | `get_error_groups` | List distinct error groups by frequency |
127
+ | `error_detail` | Full detail on an error group with code links |
128
+ | `correlate_error` | Map raw error text to code paths |
129
+ | `error_timeline` | Error frequency over time |
130
+
131
+ ### Utility
132
+ | Tool | Description |
133
+ |------|-------------|
134
+ | `status` | Server status and entity counts |
135
+ | `reindex` | Incremental re-index (only changed files) |
136
+
137
+ ## Architecture
138
+
139
+ ```
140
+ suitable_loop/
141
+ ├── __init__.py # Package root
142
+ ├── __main__.py # Entry point (python -m suitable_loop)
143
+ ├── server.py # MCP server setup (FastMCP) + main() entry point
144
+ ├── config.py # Configuration dataclasses
145
+ ├── models.py # Data models (entities, edges)
146
+ ├── db.py # SQLite database layer
147
+ ├── analyzers/
148
+ │ ├── code_analyzer.py # AST parsing, call resolution
149
+ │ ├── git_analyzer.py # Commit analysis, risk scoring
150
+ │ └── log_analyzer.py # Log parsing, error grouping
151
+ ├── graph/
152
+ │ └── engine.py # NetworkX graph engine
153
+ └── tools/
154
+ ├── code_tools.py # MCP code analysis tools
155
+ ├── git_tools.py # MCP git analysis tools
156
+ ├── log_tools.py # MCP log analysis tools
157
+ └── util_tools.py # MCP utility tools
158
+ ```
159
+
160
+ ## Configuration
161
+
162
+ Environment variables:
163
+
164
+ | Variable | Default | Description |
165
+ |----------|---------|-------------|
166
+ | `SUITABLE_LOOP_DB_PATH` | `~/.suitable-loop/suitable-loop.db` | SQLite database path |
167
+ | `SUITABLE_LOOP_LOG_LEVEL` | `INFO` | Logging level |
168
+
169
+ Default exclude patterns (files skipped during indexing):
170
+ - `.venv/`, `venv/`, `node_modules/`, `__pycache__/`, `migrations/`, `.git/`
171
+
172
+ ## Development
173
+
174
+ For working on Suitable Loop itself:
175
+
176
+ ```bash
177
+ cd suitable-loop
178
+ uv venv && uv pip install -e ".[dev]"
179
+ uv run pytest
180
+ ```
@@ -22,13 +22,13 @@ Create `.mcp.json` in your project root:
22
22
  "mcpServers": {
23
23
  "suitable-loop": {
24
24
  "command": "uvx",
25
- "args": ["--from", "git+https://github.com/suitable-adventures/suitable-loop", "suitable-loop"]
25
+ "args": ["suitable-loop"]
26
26
  }
27
27
  }
28
28
  }
29
29
  ```
30
30
 
31
- That's it. `uvx` handles cloning, caching, and running automatically — no manual install needed.
31
+ That's it. `uvx` fetches the package from PyPI automatically — no manual install needed.
32
32
 
33
33
  > **Local development?** Point to a local checkout instead:
34
34
  > ```json
@@ -37,11 +37,12 @@ That's it. `uvx` handles cloning, caching, and running automatically — no manu
37
37
 
38
38
  ### 2. Install slash commands (optional)
39
39
 
40
- Copy the commands into your project for workflow shortcuts:
40
+ Clone the repo and copy the commands into your project:
41
41
 
42
42
  ```bash
43
+ git clone https://github.com/suitable-adventures/suitable-loop.git /tmp/suitable-loop
43
44
  mkdir -p .claude/commands
44
- cp -r /path/to/suitable-loop/.claude/commands/* .claude/commands/
45
+ cp /tmp/suitable-loop/.claude/commands/* .claude/commands/
45
46
  ```
46
47
 
47
48
  ### 3. Restart Claude Code and start using it
@@ -65,6 +66,7 @@ cp -r /path/to/suitable-loop/.claude/commands/* .claude/commands/
65
66
  | `/debug-error <error or log path>` | Correlate an error/traceback to source code paths |
66
67
  | `/health-check` | Full assessment: complexity, coupling, churn trends, actionable recommendations |
67
68
  | `/trace-function <name>` | Map a function's callers, callees, complexity, and role in the system |
69
+ | `/release [patch\|minor\|major]` | Bump version, tag, and publish a new release to PyPI |
68
70
 
69
71
  ## MCP Tools
70
72
 
@@ -0,0 +1,45 @@
1
+ [project]
2
+ name = "suitable-loop"
3
+ version = "0.1.2"
4
+ description = "Local production engineering platform — semantic code analysis, git risk scoring, and log correlation via MCP"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.11"
8
+ authors = [
9
+ { name = "Johan Valentini Jensen", email = "johan@valentini.dk" },
10
+ ]
11
+ keywords = ["mcp", "code-analysis", "production-engineering", "git", "python"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Intended Audience :: Developers",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Topic :: Software Development :: Quality Assurance",
20
+ "Topic :: Software Development :: Testing",
21
+ ]
22
+ dependencies = [
23
+ "mcp>=1.0.0",
24
+ "networkx>=3.0",
25
+ "gitpython>=3.1",
26
+ "radon>=6.0",
27
+ ]
28
+
29
+ [project.optional-dependencies]
30
+ dev = [
31
+ "pytest>=8.0",
32
+ "pytest-asyncio>=0.23",
33
+ ]
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/suitable-adventures/suitable-loop"
37
+ Repository = "https://github.com/suitable-adventures/suitable-loop"
38
+ "Bug Tracker" = "https://github.com/suitable-adventures/suitable-loop/issues"
39
+
40
+ [project.scripts]
41
+ suitable-loop = "suitable_loop.server:main"
42
+
43
+ [build-system]
44
+ requires = ["hatchling"]
45
+ build-backend = "hatchling.build"
@@ -1,3 +1,3 @@
1
1
  """Suitable Loop — Local Production Engineering Platform."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.1.2"
@@ -1,12 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: suitable-loop
3
- Version: 0.1.0
4
- Summary: Local production engineering platform — semantic code analysis, git risk scoring, and log correlation via MCP
5
- Requires-Python: >=3.11
6
- Requires-Dist: gitpython>=3.1
7
- Requires-Dist: mcp>=1.0.0
8
- Requires-Dist: networkx>=3.0
9
- Requires-Dist: radon>=6.0
10
- Provides-Extra: dev
11
- Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
12
- Requires-Dist: pytest>=8.0; extra == 'dev'
@@ -1,24 +0,0 @@
1
- [project]
2
- name = "suitable-loop"
3
- version = "0.1.0"
4
- description = "Local production engineering platform — semantic code analysis, git risk scoring, and log correlation via MCP"
5
- requires-python = ">=3.11"
6
- dependencies = [
7
- "mcp>=1.0.0",
8
- "networkx>=3.0",
9
- "gitpython>=3.1",
10
- "radon>=6.0",
11
- ]
12
-
13
- [project.optional-dependencies]
14
- dev = [
15
- "pytest>=8.0",
16
- "pytest-asyncio>=0.23",
17
- ]
18
-
19
- [project.scripts]
20
- suitable-loop = "suitable_loop.server:main"
21
-
22
- [build-system]
23
- requires = ["hatchling"]
24
- build-backend = "hatchling.build"
File without changes