{"id":50523898,"url":"https://github.com/mountain/python-harness","last_synced_at":"2026-06-03T06:31:46.479Z","repository":{"id":348281561,"uuid":"1197072969","full_name":"mountain/python-harness","owner":"mountain","description":"A harness toolkit for Python projects","archived":false,"fork":false,"pushed_at":"2026-03-31T15:23:18.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-31T15:30:42.464Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mountain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-31T09:55:15.000Z","updated_at":"2026-03-31T15:24:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mountain/python-harness","commit_stats":null,"previous_names":["mountain/python-harness"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mountain/python-harness","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountain%2Fpython-harness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountain%2Fpython-harness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountain%2Fpython-harness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountain%2Fpython-harness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mountain","download_url":"https://codeload.github.com/mountain/python-harness/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountain%2Fpython-harness/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33852289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-03T06:31:45.573Z","updated_at":"2026-06-03T06:31:46.474Z","avatar_url":"https://github.com/mountain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Harness\n\nAn agentic codebase evaluation and evolution tool for Python projects.\n\n`python-harness` is designed to be a universal standard tool—just like `pytest` or `ruff`—but instead of just checking syntax or running tests, it evaluates the **architecture, readability, and governance** of your codebase using both static analysis and LLMs (DeepSeek/OpenAI).\n\n## Features\n\n1. **Hard Evaluation (First Fence)**: Enforces strict rules using `ruff`, `mypy`, and `ty`. Evaluates Cyclomatic Complexity (CC) and Maintainability Index (MI) via `radon`.\n2. **Governance QC (Second Fence)**: Checks if the changes violate core project governance or attempt to bypass the evaluation rules themselves.\n3. **Soft Evaluation (Third Fence)**:\n   - Calculates architecture metrics like Fan-out (coupling).\n   - Generates a holistic package understanding using LLMs.\n   - Performs \"Blind QA\": Randomly samples functions/classes and tests the LLM's ability to understand them without context.\n4. **Actionable Output**: Synthesizes the evaluation into a final `Pass/Fail` verdict with exactly 3 concrete, actionable refactoring suggestions.\n\n## Installation\n\nYou can install `python-harness` using `uv` or `pip`:\n\n```bash\nuv pip install python-harness\n```\n\n## Configuration\n\n`python-harness` requires an LLM to perform its soft evaluation. Create a `.env` file in the root of your project:\n\n```env\nLLM_API_KEY=your_api_key_here\nLLM_BASE_URL=https://api.deepseek.com/v1\nLLM_MODEL_NAME=deepseek-reasoner\nLLM_MINI_MODEL_NAME=deepseek-chat\n```\n\n*(Note: If you don't provide an API key, the harness will safely run in Mock mode).*\n\n## Usage\n\n### 1. Measure\n\nTo evaluate your codebase, run the `measure` command in your project directory:\n\n```bash\nharness measure .\n```\n\nThis will run the full 3-fence evaluation and output a report with a final verdict and top 3 improvement suggestions.\n\n### 2. Refine (Evolution Loop - WIP)\n\nThe `refine` command is an Agentic Edit-Test-Improve loop. It takes the suggestions generated by `measure`, automatically creates branches (variants), applies the changes, runs the tests (`pytest`), and picks the best variant.\n\n```bash\nharness refine . --steps 1 --max-retries 3\n```\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for more details.\n\nA harness toolkit for Python projects\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmountain%2Fpython-harness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmountain%2Fpython-harness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmountain%2Fpython-harness/lists"}