Metadata-Version: 2.4
Name: repomind-local
Version: 0.3.3
Summary: Local repository investigations with specialist agents, a critic, and test-proven patches. Command: repomind
Author: Md Azhar
License-Expression: MIT
Project-URL: Homepage, https://github.com/Mdazar123
Project-URL: Repository, https://github.com/Mdazar123/repomind
Keywords: agents,langgraph,static-analysis,cli
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: langgraph>=0.4
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13
Requires-Dist: ruff>=0.9
Requires-Dist: pytest>=8
Provides-Extra: model
Requires-Dist: llama-cpp-python>=0.3; extra == "model"
Requires-Dist: huggingface-hub>=0.26; extra == "model"
Provides-Extra: dev

# RepoMind

RepoMind investigates a Python repository **on your machine**. A security agent and a performance agent file only what they can point at. A critic rejects a theory that does not explain the symptom. A patch counts only when a targeted test fails before the edit and passes after it.

The repository is not uploaded. The public site shows one finished case from the bundled Paystream service: https://mdazar123.github.io/repomind/

## Install

The name `repomind` on PyPI already belongs to a different project. This package is `repomind-local`. The command is still `repomind`.

```bash
pip install repomind-local
repomind demo
```

From a checkout:

```bash
pip install -e .
repomind demo
```

## Commands

```bash
repomind doctor
repomind demo
repomind explain "Fresh tokens are rejected with 401" .
repomind scan .
repomind fix 1
```

`fix` prints the diff and asks before it writes. Pass `--yes` to apply it in a script.

If a local Qwen2.5-Coder model is installed, it rewrites the case note after the critic accepts a cause. It does not choose the cause or the patch.

```bash
pip install "repomind-local[model]"
repomind model download --size 1.5b
```

## Check a project of your own

```bash
cd C:\path\to\your-python-project
repomind scan .
repomind explain "Why does login fail?" .
repomind fix 1
```

`scan` checks a Python folder for this set:

- hardcoded secrets, `shell=True`, and SQL built with string interpolation
- JWT checks that disable signature verification, and expiry compared in the wrong unit
- blocking calls inside `async` functions, awaits inside loops, queries inside loops, and HTTP calls with no timeout
- FastAPI routes with no `response_model`, blocking work in an async route, and `Depends` used incorrectly
- undefined names, bare or swallowed exceptions, external calls with no retry, and opened files or sessions that are never closed

It prepares a patch only for the patterns it can change without guessing: the clock unit, a batch call, `asyncio.gather`, `timeout=10`, `asyncio.sleep`, `Depends(fn)` instead of `Depends(fn())`, a bare `except`, and turning JWT verification back on. A patch is marked proven only when a related test fails before the edit and passes after it. The other checks are reported with a file and a line, and left for you to change.

## What `repomind demo` shows

Paystream is a small ledger with two real defects and tests that fail:

- `token_is_active` compares a unix-second expiry with `now * 1000`, so a fresh token looks expired.
- `load_user_activity` calls `transactions_for` once per account even though `transactions_for_accounts` exists.

On-call notes mention latency first. For the token case, the hypothesis agent follows that lead, the critic rejects it, and the clock-unit fix is the one that turns `tests/test_tokens.py` green.

## Optional local model

Findings do not come from a hosted model. If you want the case note rewritten locally:

```bash
pip install "repomind-local[model]"
repomind model download --size 1.5b
```

That downloads Qwen2.5-Coder 1.5B Q4 from Hugging Face into `~/.cache/repomind/models`. `--size 7b` is the larger option. No API key.

## Layout

```text
src/repomind/          CLI, LangGraph workflow, detectors, fixes, sandbox proof
src/repomind/fixtures/paystream
web/                   Next.js case file
tests/                 The token case and the latency case must prove their patches
```

## Tests

```bash
pip install -e ".[dev]"
pytest
```

## Site

```bash
cd web
npm install
npm run dev
```

The dev server listens on port 8742.
