catchdev 0.1.3__tar.gz → 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.
Files changed (84) hide show
  1. catchdev-0.3.0/PKG-INFO +261 -0
  2. catchdev-0.3.0/README.md +224 -0
  3. catchdev-0.3.0/pyproject.toml +65 -0
  4. {catchdev-0.1.3 → catchdev-0.3.0}/setup.cfg +4 -4
  5. catchdev-0.3.0/src/catchdev/__init__.py +3 -0
  6. catchdev-0.3.0/src/catchdev/adapters.py +203 -0
  7. catchdev-0.3.0/src/catchdev/ai/__init__.py +1 -0
  8. catchdev-0.3.0/src/catchdev/ai/artifacts.py +15 -0
  9. catchdev-0.3.0/src/catchdev/ai/context.py +55 -0
  10. catchdev-0.3.0/src/catchdev/ai/contracts.py +38 -0
  11. catchdev-0.3.0/src/catchdev/ai/patch.py +67 -0
  12. catchdev-0.3.0/src/catchdev/ai/prompts.py +11 -0
  13. catchdev-0.3.0/src/catchdev/ai/providers/__init__.py +0 -0
  14. catchdev-0.3.0/src/catchdev/ai/providers/agent.py +7 -0
  15. catchdev-0.3.0/src/catchdev/ai/providers/anthropic.py +16 -0
  16. catchdev-0.3.0/src/catchdev/ai/providers/gemini.py +25 -0
  17. catchdev-0.3.0/src/catchdev/ai/providers/http.py +32 -0
  18. catchdev-0.3.0/src/catchdev/ai/providers/ollama.py +39 -0
  19. catchdev-0.3.0/src/catchdev/ai/providers/openai_compatible.py +19 -0
  20. catchdev-0.3.0/src/catchdev/ai/redaction.py +37 -0
  21. catchdev-0.3.0/src/catchdev/ai/registry.py +11 -0
  22. catchdev-0.3.0/src/catchdev/ai/schemas.py +13 -0
  23. catchdev-0.3.0/src/catchdev/ai/service.py +74 -0
  24. catchdev-0.3.0/src/catchdev/ai/testproof.py +21 -0
  25. catchdev-0.3.0/src/catchdev/ai/validation.py +18 -0
  26. catchdev-0.3.0/src/catchdev/cli.py +261 -0
  27. catchdev-0.3.0/src/catchdev/config.py +224 -0
  28. {catchdev-0.1.3 → catchdev-0.3.0}/src/catchdev/depcheck.py +122 -122
  29. {catchdev-0.1.3 → catchdev-0.3.0}/src/catchdev/differ.py +268 -242
  30. catchdev-0.3.0/src/catchdev/engine.py +457 -0
  31. catchdev-0.3.0/src/catchdev/environment.py +64 -0
  32. catchdev-0.3.0/src/catchdev/evidence.py +88 -0
  33. catchdev-0.3.0/src/catchdev/fingerprints.py +62 -0
  34. catchdev-0.3.0/src/catchdev/gitops.py +142 -0
  35. catchdev-0.3.0/src/catchdev/history/__init__.py +0 -0
  36. catchdev-0.3.0/src/catchdev/history/migrations/001.sql +11 -0
  37. catchdev-0.3.0/src/catchdev/history/migrations/__init__.py +0 -0
  38. catchdev-0.3.0/src/catchdev/history/sqlite_store.py +65 -0
  39. catchdev-0.3.0/src/catchdev/history/store.py +6 -0
  40. catchdev-0.3.0/src/catchdev/integrations/__init__.py +0 -0
  41. catchdev-0.3.0/src/catchdev/integrations/claude_code.py +3 -0
  42. catchdev-0.3.0/src/catchdev/integrations/generic_agent.py +7 -0
  43. catchdev-0.3.0/src/catchdev/integrations/github_action.py +3 -0
  44. {catchdev-0.1.3 → catchdev-0.3.0}/src/catchdev/mapper.py +329 -328
  45. catchdev-0.3.0/src/catchdev/models.py +152 -0
  46. catchdev-0.3.0/src/catchdev/output.py +119 -0
  47. {catchdev-0.1.3 → catchdev-0.3.0}/src/catchdev/report.py +164 -162
  48. {catchdev-0.1.3 → catchdev-0.3.0}/src/catchdev/runner.py +2 -0
  49. catchdev-0.3.0/src/catchdev/schemas/__init__.py +1 -0
  50. catchdev-0.3.0/src/catchdev/schemas/ai-artifact-v0.json +1 -0
  51. catchdev-0.3.0/src/catchdev/schemas/evidence-signature-v0.json +1 -0
  52. catchdev-0.3.0/src/catchdev/schemas/evidence-v0.json +75 -0
  53. catchdev-0.3.0/src/catchdev/schemas/policy-v0.json +1 -0
  54. catchdev-0.3.0/src/catchdev/signing/__init__.py +0 -0
  55. catchdev-0.3.0/src/catchdev/signing/dsse.py +14 -0
  56. catchdev-0.3.0/src/catchdev/signing/ed25519.py +42 -0
  57. catchdev-0.3.0/src/catchdev/signing/gate.py +20 -0
  58. catchdev-0.3.0/src/catchdev/team/__init__.py +0 -0
  59. catchdev-0.3.0/src/catchdev/team/access.py +11 -0
  60. catchdev-0.3.0/src/catchdev/team/policy.py +28 -0
  61. catchdev-0.3.0/src/catchdev/team/retention.py +4 -0
  62. catchdev-0.3.0/src/catchdev/team/server.py +49 -0
  63. catchdev-0.3.0/src/catchdev/v3cli.py +273 -0
  64. catchdev-0.3.0/src/catchdev.egg-info/PKG-INFO +261 -0
  65. catchdev-0.3.0/src/catchdev.egg-info/SOURCES.txt +74 -0
  66. catchdev-0.3.0/src/catchdev.egg-info/requires.txt +14 -0
  67. catchdev-0.3.0/tests/test_adapters.py +110 -0
  68. catchdev-0.3.0/tests/test_config.py +103 -0
  69. catchdev-0.3.0/tests/test_engine.py +356 -0
  70. catchdev-0.3.0/tests/test_evidence_cli.py +84 -0
  71. catchdev-0.3.0/tests/test_legacy_and_dependencies.py +171 -0
  72. catchdev-0.1.3/PKG-INFO +0 -144
  73. catchdev-0.1.3/README.md +0 -131
  74. catchdev-0.1.3/pyproject.toml +0 -18
  75. catchdev-0.1.3/src/catchdev/__init__.py +0 -3
  76. catchdev-0.1.3/src/catchdev/cli.py +0 -83
  77. catchdev-0.1.3/src/catchdev.egg-info/PKG-INFO +0 -144
  78. catchdev-0.1.3/src/catchdev.egg-info/SOURCES.txt +0 -17
  79. catchdev-0.1.3/src/catchdev.egg-info/requires.txt +0 -3
  80. {catchdev-0.1.3 → catchdev-0.3.0}/LICENSE +0 -0
  81. {catchdev-0.1.3 → catchdev-0.3.0}/src/catchdev.egg-info/dependency_links.txt +0 -0
  82. {catchdev-0.1.3 → catchdev-0.3.0}/src/catchdev.egg-info/entry_points.txt +0 -0
  83. {catchdev-0.1.3 → catchdev-0.3.0}/src/catchdev.egg-info/top_level.txt +0 -0
  84. {catchdev-0.1.3 → catchdev-0.3.0}/tests/test_catchdev.py +0 -0
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: catchdev
3
+ Version: 0.3.0
4
+ Summary: Run base and current, and see exactly which checks your change broke
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/soham131345/catchdev
7
+ Project-URL: Repository, https://github.com/soham131345/catchdev
8
+ Project-URL: Issues, https://github.com/soham131345/catchdev/issues
9
+ Project-URL: Security, https://github.com/soham131345/catchdev/security/policy
10
+ Keywords: regression-testing,differential-testing,ci-cd,developer-tools,verification,pytest,sarif
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: httpx>=0.24
26
+ Requires-Dist: rich>=12
27
+ Requires-Dist: click>=8
28
+ Requires-Dist: jsonschema>=4.18
29
+ Requires-Dist: tomli>=2; python_version < "3.11"
30
+ Requires-Dist: cryptography>=41
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=7; extra == "dev"
33
+ Requires-Dist: pytest-cov>=4; extra == "dev"
34
+ Requires-Dist: build>=1; extra == "dev"
35
+ Requires-Dist: twine>=5; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # CatchDev
39
+
40
+ **AI proposes. Every check decides.**
41
+
42
+ Run base and current, see exactly which checks your change broke, and give coding agents a bounded repair loop grounded in deterministic evidence.
43
+
44
+ CatchDev runs the checks your repository already uses—tests, lint, security, API contracts, migrations, builds, and arbitrary commands—against isolated base and current snapshots. It separates introduced failures from inherited ones, preserves retries, records environment comparability, and refuses to call incomplete evidence a pass.
45
+
46
+ ```text
47
+ NEW unit:demo.introduced base passed; current failed
48
+ PRE_EXISTING unit:demo.inherited identical failure fingerprint at base
49
+ NEW security:DEMO001:app.py finding exists only at current
50
+ RESULT: FAIL · exit 1
51
+ ```
52
+
53
+ **One diff. Every check. No false green.** CatchDev is deterministic: no model writes its observations or policy verdict. v0.3 adds optional agent, Gemini, Ollama, Anthropic, and OpenAI-compatible advisory workflows, scoped repair proposals, regression-test proof, SQLite history, policy bundles, exception audits, and Ed25519 evidence authentication.
54
+
55
+ ![CatchDev terminal demo: inherited and new failures, a new SARIF finding, and validated evidence](demo/demo.gif)
56
+
57
+ **Product website:** [soham131345.github.io/catchdev](https://soham131345.github.io/catchdev/) once the included GitHub Pages workflow is enabled and deployed. The website source lives in [website/](website/).
58
+
59
+ ## v0.3 advisory repair loop
60
+
61
+ ```bash
62
+ # Deterministic engine never needs AI.
63
+ catch verify --base origin/main
64
+
65
+ # Existing agent: zero CatchDev API expenditure.
66
+ catch repair --provider agent --print-request
67
+ catch repair --provider agent --accept-proposal proposal.json --approve
68
+
69
+ # Optional local or hosted explanation.
70
+ catch explain --ai --provider ollama --model qwen3:8b catch-evidence.json
71
+ catch explain --ai --provider gemini --model YOUR_AVAILABLE_MODEL --allow-external catch-evidence.json
72
+ ```
73
+
74
+ AI commands are **Preview**. Team history, policy, exceptions, and signatures are **Beta**. AI output is schema-validated, redacted, bounded, cited, and stored separately. Patches need approval and cannot touch policy, evidence, CI workflows, signing material, or tests by default. Only fresh deterministic verification can close the repair loop.
75
+
76
+ ```bash
77
+ catch history add catch-evidence.json
78
+ catch policy validate examples/catchdev.policy.json
79
+ catch evidence sign catch-evidence.json --key-file ~/safe/private.pem
80
+ catch gate catch-evidence.json --signature catch-evidence.json.sig.json --public-key ~/safe/public.pem
81
+ ```
82
+
83
+ Read [AI providers](docs/AI_PROVIDERS.md), [AI security](docs/AI_SECURITY.md), [team and policy](docs/TEAM_AND_POLICY.md), and the [v0.3 acceptance status](docs/V0.3_ACCEPTANCE.md).
84
+
85
+ ## Install and run
86
+
87
+ Requires Python 3.9+ and Git. Linux and macOS are the v0.2 support targets.
88
+
89
+ ```bash
90
+ pip install catchdev
91
+ # or, without a permanent install:
92
+ uvx catchdev verify --base origin/main
93
+ ```
94
+
95
+ Create a pytest starter in your repository:
96
+
97
+ ```bash
98
+ catch init
99
+ # Review .catchdev.toml, especially the base ref and install command.
100
+ catch verify --base origin/main
101
+ ```
102
+
103
+ Outputs:
104
+
105
+ - `catch-evidence.json` — versioned, digest-checked, unsigned execution evidence.
106
+ - `catch-report.md` — portable PR/Markdown report.
107
+ - `.catchdev/logs/<run-id>/` — raw stdout/stderr and copied structured reports, kept locally.
108
+
109
+ CatchDev does not change your source working tree. Base runs in a temporary detached worktree; current uses a snapshot that includes tracked modifications and non-ignored untracked files.
110
+
111
+ ## A complete multi-check manifest
112
+
113
+ ```toml
114
+ version = 1
115
+
116
+ [run]
117
+ base = "origin/main"
118
+ dependencies = "revision-deps" # or "same-deps" to hold declared lockfiles constant
119
+ install = "uv sync --frozen" # optional; runs independently in each snapshot
120
+ env = ["DATABASE_URL"] # values are hashed in evidence, never printed
121
+
122
+ [checks.unit]
123
+ runner = "junit"
124
+ command = "pytest -q --junitxml=catch-unit.xml"
125
+ report = "catch-unit.xml"
126
+ timeout = 600
127
+ retries = 1
128
+
129
+ [checks.security]
130
+ runner = "sarif"
131
+ command = "semgrep scan --sarif --output catch-security.sarif ."
132
+ report = "catch-security.sarif"
133
+
134
+ [checks.migrations]
135
+ runner = "process"
136
+ command = "squawk migrations/*.sql"
137
+ mode = "current-only" # honest current observation, not differential proof
138
+
139
+ [policy]
140
+ allow = ["PASS", "PRE_EXISTING", "RESOLVED", "NOT_APPLICABLE"]
141
+ ```
142
+
143
+ Run `catch list-checks` to inspect execution order and capabilities. See [examples/](examples/) for Python, Node, polyglot, generic JSON, policy exception, and Action configurations.
144
+
145
+ ## Outcome semantics
146
+
147
+ | State | Meaning |
148
+ |---|---|
149
+ | `PASS` | A named observation passed in a named environment. |
150
+ | `NEW` | Current failed and base passed or did not contain the finding. |
151
+ | `PRE_EXISTING` | Both failed with the same normalized failure fingerprint. |
152
+ | `CHANGED` | The same subject failed at both revisions, but its fingerprint changed. |
153
+ | `RESOLVED` | Base failed and current passed or no longer contains the finding. |
154
+ | `FLAKY` | A preserved earlier current attempt failed and a retry passed. |
155
+ | `INFRA` | Setup, timeout, missing command, service, or execution failure. |
156
+ | `SKIPPED` | The adapter explicitly reported a skip; skip is not silently pass. |
157
+ | `NOT_APPLICABLE` | A path-scoped check had no matching changed files. |
158
+ | `UNKNOWN` | Missing/malformed/empty evidence, unavailable comparison, or current-only failure. |
159
+
160
+ Only states in `policy.allow` pass. Environment mismatches downgrade code-level attribution to `UNKNOWN`. Current-only passes say nothing about the base; current-only failures are not mislabeled `NEW`.
161
+
162
+ ### Exit codes
163
+
164
+ | Code | Verdict | Meaning |
165
+ |---:|---|---|
166
+ | `0` | `PASS` | Every observation is allowed by policy. |
167
+ | `1` | `FAIL` | New/changed regression or another policy failure. |
168
+ | `2` | `ERROR` | Execution, setup, configuration, Git, or infrastructure error. |
169
+ | `3` | `UNKNOWN` | Unknown, skipped, or flaky evidence is insufficient. |
170
+ | `4` | `EXCEPTION_REQUIRED` | A state requiring a valid, bound exception has none. |
171
+
172
+ Infrastructure outranks unknown, which outranks exception-required, which outranks an ordinary policy failure.
173
+
174
+ ## Validate, explain, and replay offline
175
+
176
+ ```bash
177
+ catch validate catch-evidence.json
178
+ catch explain catch-evidence.json
179
+ catch replay catch-evidence.json
180
+ catch replay catch-evidence.json --policy stricter-policy.toml
181
+ ```
182
+
183
+ Validation checks the published JSON schema and content digest. Replay reevaluates policy only; it never executes commands found in evidence. A digest is accidental-tamper detection, **not** a signature or cryptographic attestation.
184
+
185
+ ## Optional features
186
+
187
+ - **Quick affected-pytest mode:** `catch verify --quick`. The AST selector is only an optimization. Non-Python changes or empty selections trigger the full configured suite; no selection is allowed to become a green run.
188
+ - **PyPI dependency plugin:** set `run.dependency_check = true` or pass `--deps`. Registry/network failures are `INFRA`, not package-risk verdicts. `--fail-on-suspicious` turns suspicious packages into policy failures.
189
+ - **Redacted logs:** `--redact-logs` replaces values of variables declared in `run.env` and check `env`. Review logs before sharing; redaction cannot detect every secret.
190
+ - **Legacy CLI:** `catch --staged`, `catch --commit HEAD~1`, `--all-tests`, `--skip-deps`, and `--output report.md` remain available. Prefer the manifest engine for enforcement.
191
+
192
+ ## GitHub Action
193
+
194
+ ```yaml
195
+ name: Differential verification
196
+ on: [pull_request]
197
+ permissions:
198
+ contents: read
199
+ pull-requests: write
200
+ statuses: write
201
+ jobs:
202
+ catchdev:
203
+ runs-on: ubuntu-latest
204
+ steps:
205
+ - uses: actions/checkout@v4
206
+ with:
207
+ fetch-depth: 0
208
+ - uses: soham131345/catchdev@v0.3.0
209
+ with:
210
+ base: origin/${{ github.base_ref }}
211
+ redact-logs: "true"
212
+ ```
213
+
214
+ The Action uploads artifacts, updates one sticky PR comment, publishes `catchdev/verify`, and preserves the engine exit code. Fork PRs normally cannot write comments/statuses; those optional publication steps warn without changing the verification result. Use `pull_request`, not secrets-bearing `pull_request_target`, for untrusted code.
215
+
216
+ ## Hooks and coding agents
217
+
218
+ ```yaml
219
+ # .pre-commit-config.yaml
220
+ repos:
221
+ - repo: https://github.com/soham131345/catchdev
222
+ rev: v0.3.0
223
+ hooks:
224
+ - id: catch
225
+ stages: [pre-push]
226
+ ```
227
+
228
+ Copy [skills/catch/SKILL.md](skills/catch/SKILL.md) to `~/.claude/skills/catch/SKILL.md`. The agent must read structured evidence and respect exits `2`, `3`, and `4`; it cannot rewrite observations or invent exceptions.
229
+
230
+ ## Compatibility and limits
231
+
232
+ | Adapter | Runs commands | Parses | Compares |
233
+ |---|---|---|---|
234
+ | `process` | Any shell command | Exit code; optional generic JSON findings | Process result or finding fingerprints |
235
+ | `junit` | Any JUnit-producing test runner | Test cases, errors, failures, skips, durations | Case + normalized failure fingerprint |
236
+ | `sarif` | Any SARIF 2.1.0 producer | Rules, messages, locations, levels, partial fingerprints | Finding fingerprints across revisions |
237
+
238
+ “Runs any command” does not mean CatchDev deeply understands every ecosystem. Add specialist tools such as Semgrep, oasdiff, Squawk, or your own scripts through configuration. CatchDev is not a CI engine, test generator, SAST rule library, auto-remediation bot, cloud flake warehouse, or proof that code is bug-free.
239
+
240
+ ## Reproducible demo and documentation
241
+
242
+ ```bash
243
+ python demo/differential_demo.py
244
+ # Keep the generated repository and artifacts:
245
+ python demo/differential_demo.py --output /tmp/catchdev-demo
246
+ ```
247
+
248
+ - [AI provider guide](docs/AI_PROVIDERS.md) · [AI security](docs/AI_SECURITY.md) · [Team, policy, and signatures](docs/TEAM_AND_POLICY.md)
249
+ - [Migration guide](docs/MIGRATION_V0.3.md) · [Benchmark status](docs/BENCHMARKS.md) · [v0.3 acceptance](docs/V0.3_ACCEPTANCE.md)
250
+ - **[Complete guide](docs/COMPLETE_GUIDE.md)** — architecture, every option, setup, deployment, troubleshooting, security, and development.
251
+ - **[Launch and company playbook](docs/LAUNCH_AND_COMPANY_PLAYBOOK.md)** — beginner-friendly ordered release, user discovery, monetization, enterprise, and company-formation steps.
252
+ - [Configuration reference](docs/CONFIGURATION.md)
253
+ - [Evidence and policy](docs/EVIDENCE_AND_POLICY.md)
254
+ - [GitHub Action guide](docs/GITHUB_ACTION.md)
255
+ - [Support matrix and limitations](docs/SUPPORT_MATRIX.md)
256
+ - [Architecture decision](docs/ADR-001-differential-execution.md)
257
+ - [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md) · [Changelog](CHANGELOG.md)
258
+
259
+ ## License
260
+
261
+ MIT
@@ -0,0 +1,224 @@
1
+ # CatchDev
2
+
3
+ **AI proposes. Every check decides.**
4
+
5
+ Run base and current, see exactly which checks your change broke, and give coding agents a bounded repair loop grounded in deterministic evidence.
6
+
7
+ CatchDev runs the checks your repository already uses—tests, lint, security, API contracts, migrations, builds, and arbitrary commands—against isolated base and current snapshots. It separates introduced failures from inherited ones, preserves retries, records environment comparability, and refuses to call incomplete evidence a pass.
8
+
9
+ ```text
10
+ NEW unit:demo.introduced base passed; current failed
11
+ PRE_EXISTING unit:demo.inherited identical failure fingerprint at base
12
+ NEW security:DEMO001:app.py finding exists only at current
13
+ RESULT: FAIL · exit 1
14
+ ```
15
+
16
+ **One diff. Every check. No false green.** CatchDev is deterministic: no model writes its observations or policy verdict. v0.3 adds optional agent, Gemini, Ollama, Anthropic, and OpenAI-compatible advisory workflows, scoped repair proposals, regression-test proof, SQLite history, policy bundles, exception audits, and Ed25519 evidence authentication.
17
+
18
+ ![CatchDev terminal demo: inherited and new failures, a new SARIF finding, and validated evidence](demo/demo.gif)
19
+
20
+ **Product website:** [soham131345.github.io/catchdev](https://soham131345.github.io/catchdev/) once the included GitHub Pages workflow is enabled and deployed. The website source lives in [website/](website/).
21
+
22
+ ## v0.3 advisory repair loop
23
+
24
+ ```bash
25
+ # Deterministic engine never needs AI.
26
+ catch verify --base origin/main
27
+
28
+ # Existing agent: zero CatchDev API expenditure.
29
+ catch repair --provider agent --print-request
30
+ catch repair --provider agent --accept-proposal proposal.json --approve
31
+
32
+ # Optional local or hosted explanation.
33
+ catch explain --ai --provider ollama --model qwen3:8b catch-evidence.json
34
+ catch explain --ai --provider gemini --model YOUR_AVAILABLE_MODEL --allow-external catch-evidence.json
35
+ ```
36
+
37
+ AI commands are **Preview**. Team history, policy, exceptions, and signatures are **Beta**. AI output is schema-validated, redacted, bounded, cited, and stored separately. Patches need approval and cannot touch policy, evidence, CI workflows, signing material, or tests by default. Only fresh deterministic verification can close the repair loop.
38
+
39
+ ```bash
40
+ catch history add catch-evidence.json
41
+ catch policy validate examples/catchdev.policy.json
42
+ catch evidence sign catch-evidence.json --key-file ~/safe/private.pem
43
+ catch gate catch-evidence.json --signature catch-evidence.json.sig.json --public-key ~/safe/public.pem
44
+ ```
45
+
46
+ Read [AI providers](docs/AI_PROVIDERS.md), [AI security](docs/AI_SECURITY.md), [team and policy](docs/TEAM_AND_POLICY.md), and the [v0.3 acceptance status](docs/V0.3_ACCEPTANCE.md).
47
+
48
+ ## Install and run
49
+
50
+ Requires Python 3.9+ and Git. Linux and macOS are the v0.2 support targets.
51
+
52
+ ```bash
53
+ pip install catchdev
54
+ # or, without a permanent install:
55
+ uvx catchdev verify --base origin/main
56
+ ```
57
+
58
+ Create a pytest starter in your repository:
59
+
60
+ ```bash
61
+ catch init
62
+ # Review .catchdev.toml, especially the base ref and install command.
63
+ catch verify --base origin/main
64
+ ```
65
+
66
+ Outputs:
67
+
68
+ - `catch-evidence.json` — versioned, digest-checked, unsigned execution evidence.
69
+ - `catch-report.md` — portable PR/Markdown report.
70
+ - `.catchdev/logs/<run-id>/` — raw stdout/stderr and copied structured reports, kept locally.
71
+
72
+ CatchDev does not change your source working tree. Base runs in a temporary detached worktree; current uses a snapshot that includes tracked modifications and non-ignored untracked files.
73
+
74
+ ## A complete multi-check manifest
75
+
76
+ ```toml
77
+ version = 1
78
+
79
+ [run]
80
+ base = "origin/main"
81
+ dependencies = "revision-deps" # or "same-deps" to hold declared lockfiles constant
82
+ install = "uv sync --frozen" # optional; runs independently in each snapshot
83
+ env = ["DATABASE_URL"] # values are hashed in evidence, never printed
84
+
85
+ [checks.unit]
86
+ runner = "junit"
87
+ command = "pytest -q --junitxml=catch-unit.xml"
88
+ report = "catch-unit.xml"
89
+ timeout = 600
90
+ retries = 1
91
+
92
+ [checks.security]
93
+ runner = "sarif"
94
+ command = "semgrep scan --sarif --output catch-security.sarif ."
95
+ report = "catch-security.sarif"
96
+
97
+ [checks.migrations]
98
+ runner = "process"
99
+ command = "squawk migrations/*.sql"
100
+ mode = "current-only" # honest current observation, not differential proof
101
+
102
+ [policy]
103
+ allow = ["PASS", "PRE_EXISTING", "RESOLVED", "NOT_APPLICABLE"]
104
+ ```
105
+
106
+ Run `catch list-checks` to inspect execution order and capabilities. See [examples/](examples/) for Python, Node, polyglot, generic JSON, policy exception, and Action configurations.
107
+
108
+ ## Outcome semantics
109
+
110
+ | State | Meaning |
111
+ |---|---|
112
+ | `PASS` | A named observation passed in a named environment. |
113
+ | `NEW` | Current failed and base passed or did not contain the finding. |
114
+ | `PRE_EXISTING` | Both failed with the same normalized failure fingerprint. |
115
+ | `CHANGED` | The same subject failed at both revisions, but its fingerprint changed. |
116
+ | `RESOLVED` | Base failed and current passed or no longer contains the finding. |
117
+ | `FLAKY` | A preserved earlier current attempt failed and a retry passed. |
118
+ | `INFRA` | Setup, timeout, missing command, service, or execution failure. |
119
+ | `SKIPPED` | The adapter explicitly reported a skip; skip is not silently pass. |
120
+ | `NOT_APPLICABLE` | A path-scoped check had no matching changed files. |
121
+ | `UNKNOWN` | Missing/malformed/empty evidence, unavailable comparison, or current-only failure. |
122
+
123
+ Only states in `policy.allow` pass. Environment mismatches downgrade code-level attribution to `UNKNOWN`. Current-only passes say nothing about the base; current-only failures are not mislabeled `NEW`.
124
+
125
+ ### Exit codes
126
+
127
+ | Code | Verdict | Meaning |
128
+ |---:|---|---|
129
+ | `0` | `PASS` | Every observation is allowed by policy. |
130
+ | `1` | `FAIL` | New/changed regression or another policy failure. |
131
+ | `2` | `ERROR` | Execution, setup, configuration, Git, or infrastructure error. |
132
+ | `3` | `UNKNOWN` | Unknown, skipped, or flaky evidence is insufficient. |
133
+ | `4` | `EXCEPTION_REQUIRED` | A state requiring a valid, bound exception has none. |
134
+
135
+ Infrastructure outranks unknown, which outranks exception-required, which outranks an ordinary policy failure.
136
+
137
+ ## Validate, explain, and replay offline
138
+
139
+ ```bash
140
+ catch validate catch-evidence.json
141
+ catch explain catch-evidence.json
142
+ catch replay catch-evidence.json
143
+ catch replay catch-evidence.json --policy stricter-policy.toml
144
+ ```
145
+
146
+ Validation checks the published JSON schema and content digest. Replay reevaluates policy only; it never executes commands found in evidence. A digest is accidental-tamper detection, **not** a signature or cryptographic attestation.
147
+
148
+ ## Optional features
149
+
150
+ - **Quick affected-pytest mode:** `catch verify --quick`. The AST selector is only an optimization. Non-Python changes or empty selections trigger the full configured suite; no selection is allowed to become a green run.
151
+ - **PyPI dependency plugin:** set `run.dependency_check = true` or pass `--deps`. Registry/network failures are `INFRA`, not package-risk verdicts. `--fail-on-suspicious` turns suspicious packages into policy failures.
152
+ - **Redacted logs:** `--redact-logs` replaces values of variables declared in `run.env` and check `env`. Review logs before sharing; redaction cannot detect every secret.
153
+ - **Legacy CLI:** `catch --staged`, `catch --commit HEAD~1`, `--all-tests`, `--skip-deps`, and `--output report.md` remain available. Prefer the manifest engine for enforcement.
154
+
155
+ ## GitHub Action
156
+
157
+ ```yaml
158
+ name: Differential verification
159
+ on: [pull_request]
160
+ permissions:
161
+ contents: read
162
+ pull-requests: write
163
+ statuses: write
164
+ jobs:
165
+ catchdev:
166
+ runs-on: ubuntu-latest
167
+ steps:
168
+ - uses: actions/checkout@v4
169
+ with:
170
+ fetch-depth: 0
171
+ - uses: soham131345/catchdev@v0.3.0
172
+ with:
173
+ base: origin/${{ github.base_ref }}
174
+ redact-logs: "true"
175
+ ```
176
+
177
+ The Action uploads artifacts, updates one sticky PR comment, publishes `catchdev/verify`, and preserves the engine exit code. Fork PRs normally cannot write comments/statuses; those optional publication steps warn without changing the verification result. Use `pull_request`, not secrets-bearing `pull_request_target`, for untrusted code.
178
+
179
+ ## Hooks and coding agents
180
+
181
+ ```yaml
182
+ # .pre-commit-config.yaml
183
+ repos:
184
+ - repo: https://github.com/soham131345/catchdev
185
+ rev: v0.3.0
186
+ hooks:
187
+ - id: catch
188
+ stages: [pre-push]
189
+ ```
190
+
191
+ Copy [skills/catch/SKILL.md](skills/catch/SKILL.md) to `~/.claude/skills/catch/SKILL.md`. The agent must read structured evidence and respect exits `2`, `3`, and `4`; it cannot rewrite observations or invent exceptions.
192
+
193
+ ## Compatibility and limits
194
+
195
+ | Adapter | Runs commands | Parses | Compares |
196
+ |---|---|---|---|
197
+ | `process` | Any shell command | Exit code; optional generic JSON findings | Process result or finding fingerprints |
198
+ | `junit` | Any JUnit-producing test runner | Test cases, errors, failures, skips, durations | Case + normalized failure fingerprint |
199
+ | `sarif` | Any SARIF 2.1.0 producer | Rules, messages, locations, levels, partial fingerprints | Finding fingerprints across revisions |
200
+
201
+ “Runs any command” does not mean CatchDev deeply understands every ecosystem. Add specialist tools such as Semgrep, oasdiff, Squawk, or your own scripts through configuration. CatchDev is not a CI engine, test generator, SAST rule library, auto-remediation bot, cloud flake warehouse, or proof that code is bug-free.
202
+
203
+ ## Reproducible demo and documentation
204
+
205
+ ```bash
206
+ python demo/differential_demo.py
207
+ # Keep the generated repository and artifacts:
208
+ python demo/differential_demo.py --output /tmp/catchdev-demo
209
+ ```
210
+
211
+ - [AI provider guide](docs/AI_PROVIDERS.md) · [AI security](docs/AI_SECURITY.md) · [Team, policy, and signatures](docs/TEAM_AND_POLICY.md)
212
+ - [Migration guide](docs/MIGRATION_V0.3.md) · [Benchmark status](docs/BENCHMARKS.md) · [v0.3 acceptance](docs/V0.3_ACCEPTANCE.md)
213
+ - **[Complete guide](docs/COMPLETE_GUIDE.md)** — architecture, every option, setup, deployment, troubleshooting, security, and development.
214
+ - **[Launch and company playbook](docs/LAUNCH_AND_COMPANY_PLAYBOOK.md)** — beginner-friendly ordered release, user discovery, monetization, enterprise, and company-formation steps.
215
+ - [Configuration reference](docs/CONFIGURATION.md)
216
+ - [Evidence and policy](docs/EVIDENCE_AND_POLICY.md)
217
+ - [GitHub Action guide](docs/GITHUB_ACTION.md)
218
+ - [Support matrix and limitations](docs/SUPPORT_MATRIX.md)
219
+ - [Architecture decision](docs/ADR-001-differential-execution.md)
220
+ - [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md) · [Changelog](CHANGELOG.md)
221
+
222
+ ## License
223
+
224
+ MIT
@@ -0,0 +1,65 @@
1
+ [project]
2
+ name = "catchdev"
3
+ version = "0.3.0"
4
+ description = "Run base and current, and see exactly which checks your change broke"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.9"
8
+ dependencies = [
9
+ "httpx>=0.24",
10
+ "rich>=12",
11
+ "click>=8",
12
+ "jsonschema>=4.18",
13
+ "tomli>=2; python_version < '3.11'",
14
+ "cryptography>=41",
15
+ ]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Environment :: Console",
19
+ "Intended Audience :: Developers",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Topic :: Software Development :: Testing",
27
+ "Topic :: Software Development :: Quality Assurance",
28
+ ]
29
+ keywords = ["regression-testing", "differential-testing", "ci-cd", "developer-tools", "verification", "pytest", "sarif"]
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/soham131345/catchdev"
33
+ Repository = "https://github.com/soham131345/catchdev"
34
+ Issues = "https://github.com/soham131345/catchdev/issues"
35
+ Security = "https://github.com/soham131345/catchdev/security/policy"
36
+
37
+ [project.scripts]
38
+ catch = "catchdev.cli:main"
39
+
40
+ [project.optional-dependencies]
41
+ dev = ["pytest>=7", "pytest-cov>=4", "build>=1", "twine>=5"]
42
+
43
+ [build-system]
44
+ requires = ["setuptools>=68"]
45
+ build-backend = "setuptools.build_meta"
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+
50
+ [tool.setuptools.package-data]
51
+ "catchdev.schemas" = ["*.json"]
52
+ "catchdev.history.migrations" = ["*.sql"]
53
+
54
+ [tool.pytest.ini_options]
55
+ testpaths = ["tests"]
56
+ addopts = "-ra"
57
+
58
+ [tool.coverage.run]
59
+ source = ["catchdev"]
60
+ branch = true
61
+
62
+ [tool.coverage.report]
63
+ show_missing = true
64
+ skip_covered = true
65
+ fail_under = 75
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """CatchDev: differential execution evidence for the checks you already use."""
2
+
3
+ __version__ = "0.3.0"