cca-audit 0.7.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 (63) hide show
  1. cca_audit-0.7.0/LICENSE +21 -0
  2. cca_audit-0.7.0/PKG-INFO +389 -0
  3. cca_audit-0.7.0/README.md +350 -0
  4. cca_audit-0.7.0/cca_audit.egg-info/PKG-INFO +389 -0
  5. cca_audit-0.7.0/cca_audit.egg-info/SOURCES.txt +61 -0
  6. cca_audit-0.7.0/cca_audit.egg-info/dependency_links.txt +1 -0
  7. cca_audit-0.7.0/cca_audit.egg-info/entry_points.txt +2 -0
  8. cca_audit-0.7.0/cca_audit.egg-info/requires.txt +18 -0
  9. cca_audit-0.7.0/cca_audit.egg-info/top_level.txt +1 -0
  10. cca_audit-0.7.0/cca_checks/__init__.py +0 -0
  11. cca_audit-0.7.0/cca_checks/__main__.py +121 -0
  12. cca_audit-0.7.0/cca_checks/claim.py +25 -0
  13. cca_audit-0.7.0/cca_checks/clock_check.py +340 -0
  14. cca_audit-0.7.0/cca_checks/config.py +136 -0
  15. cca_audit-0.7.0/cca_checks/hypo.py +20 -0
  16. cca_audit-0.7.0/cca_checks/plugin/__init__.py +151 -0
  17. cca_audit-0.7.0/cca_checks/plugin/agents/cca-architect-reviewer.md +127 -0
  18. cca_audit-0.7.0/cca_checks/plugin/agents/cca-bug-auditor.md +118 -0
  19. cca_audit-0.7.0/cca_checks/plugin/agents/cca-code-auditor.md +116 -0
  20. cca_audit-0.7.0/cca_checks/plugin/agents/cca-dep-auditor.md +106 -0
  21. cca_audit-0.7.0/cca_checks/plugin/agents/cca-deploy-auditor.md +108 -0
  22. cca_audit-0.7.0/cca_checks/plugin/agents/cca-differential-review.md +97 -0
  23. cca_audit-0.7.0/cca_checks/plugin/agents/cca-doc-auditor.md +99 -0
  24. cca_audit-0.7.0/cca_checks/plugin/agents/cca-env-validator.md +107 -0
  25. cca_audit-0.7.0/cca_checks/plugin/agents/cca-fix-planner.md +200 -0
  26. cca_audit-0.7.0/cca_checks/plugin/agents/cca-fp-check.md +288 -0
  27. cca_audit-0.7.0/cca_checks/plugin/agents/cca-numeric-auditor.md +197 -0
  28. cca_audit-0.7.0/cca_checks/plugin/agents/cca-perf-auditor.md +114 -0
  29. cca_audit-0.7.0/cca_checks/plugin/agents/cca-security-auditor.md +172 -0
  30. cca_audit-0.7.0/cca_checks/plugin/cli.py +99 -0
  31. cca_audit-0.7.0/cca_checks/plugin/commands/audit-fix-v2.md +26 -0
  32. cca_audit-0.7.0/cca_checks/plugin/commands/audit-fix.md +565 -0
  33. cca_audit-0.7.0/cca_checks/properties.py +285 -0
  34. cca_audit-0.7.0/cca_checks/property_check.py +163 -0
  35. cca_audit-0.7.0/cca_checks/pyright_check.py +393 -0
  36. cca_audit-0.7.0/cca_checks/repro_runner.py +67 -0
  37. cca_audit-0.7.0/cca_checks/rules/python_sinks.yaml +189 -0
  38. cca_audit-0.7.0/cca_checks/rules/python_taint.yaml +80 -0
  39. cca_audit-0.7.0/cca_checks/scope.py +29 -0
  40. cca_audit-0.7.0/cca_checks/semgrep_check.py +172 -0
  41. cca_audit-0.7.0/cca_checks/substrate.py +250 -0
  42. cca_audit-0.7.0/cca_checks/toolpath.py +62 -0
  43. cca_audit-0.7.0/pyproject.toml +101 -0
  44. cca_audit-0.7.0/setup.cfg +4 -0
  45. cca_audit-0.7.0/tests/test_bench_score.py +205 -0
  46. cca_audit-0.7.0/tests/test_blindness_probe.py +160 -0
  47. cca_audit-0.7.0/tests/test_claim.py +15 -0
  48. cca_audit-0.7.0/tests/test_cli.py +240 -0
  49. cca_audit-0.7.0/tests/test_clock_check.py +273 -0
  50. cca_audit-0.7.0/tests/test_config.py +145 -0
  51. cca_audit-0.7.0/tests/test_dev_extra_completeness.py +127 -0
  52. cca_audit-0.7.0/tests/test_fixture_contract.py +55 -0
  53. cca_audit-0.7.0/tests/test_plugin_cli.py +96 -0
  54. cca_audit-0.7.0/tests/test_plugin_install.py +143 -0
  55. cca_audit-0.7.0/tests/test_properties.py +205 -0
  56. cca_audit-0.7.0/tests/test_property_check.py +244 -0
  57. cca_audit-0.7.0/tests/test_pyright_check.py +278 -0
  58. cca_audit-0.7.0/tests/test_repro_runner.py +66 -0
  59. cca_audit-0.7.0/tests/test_rules_catalog.py +71 -0
  60. cca_audit-0.7.0/tests/test_scope.py +56 -0
  61. cca_audit-0.7.0/tests/test_selfaudit_hardening.py +516 -0
  62. cca_audit-0.7.0/tests/test_semgrep_check.py +321 -0
  63. cca_audit-0.7.0/tests/test_substrate.py +312 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GiulioDER
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,389 @@
1
+ Metadata-Version: 2.4
2
+ Name: cca-audit
3
+ Version: 0.7.0
4
+ Summary: Multi-agent code audit for Claude Code in which no finding reaches your code unverified
5
+ Author: Giulio D'Erme
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/GiulioDER/cca-audit
8
+ Project-URL: Repository, https://github.com/GiulioDER/cca-audit
9
+ Project-URL: Issues, https://github.com/GiulioDER/cca-audit/issues
10
+ Keywords: static-analysis,code-review,verification,claude-code,llm,ai-code-review,code-audit
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Quality Assurance
19
+ Classifier: Topic :: Security
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Provides-Extra: numeric
24
+ Requires-Dist: hypothesis>=6.0; extra == "numeric"
25
+ Requires-Dist: pytest>=7; extra == "numeric"
26
+ Requires-Dist: mpmath>=1.3; extra == "numeric"
27
+ Provides-Extra: verify
28
+ Requires-Dist: hypothesis>=6.0; extra == "verify"
29
+ Requires-Dist: pytest>=7; extra == "verify"
30
+ Requires-Dist: pyright>=1.1.350; extra == "verify"
31
+ Requires-Dist: semgrep>=1.50; extra == "verify"
32
+ Requires-Dist: mpmath>=1.3; extra == "verify"
33
+ Provides-Extra: dev
34
+ Requires-Dist: hypothesis>=6.0; extra == "dev"
35
+ Requires-Dist: pytest>=7; extra == "dev"
36
+ Requires-Dist: ruff>=0.4; extra == "dev"
37
+ Requires-Dist: mpmath>=1.3; extra == "dev"
38
+ Dynamic: license-file
39
+
40
+ <p align="center">
41
+ <img src="docs/banner.svg" alt="CCA-Audit — multi-agent code audit for Claude Code. Pipeline: parallel auditors, consolidate, verify (L2.5), fix, regression diff (L5.5), architect gate (L6)." width="100%"/>
42
+ </p>
43
+
44
+ <p align="center">
45
+ <a href="https://github.com/GiulioDER/cca-audit/actions/workflows/ci.yml"><img src="https://github.com/GiulioDER/cca-audit/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI"/></a>
46
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue" alt="Python 3.10–3.13"/>
47
+ <img src="https://img.shields.io/badge/tests-376%20passing-brightgreen" alt="376 tests passing"/>
48
+ <img src="https://img.shields.io/badge/typed-pyright-informational" alt="Type-checked with pyright"/>
49
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-lightgrey" alt="MIT license"/></a>
50
+ </p>
51
+
52
+ # CCA-Audit
53
+
54
+ **A multi-agent code auditor for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) in which no finding reaches your code unverified.**
55
+
56
+ Ten specialised auditors read your diff in parallel. Their findings are deduplicated, then each one is
57
+ **re-derived against the real code** — mechanically, by `pyright`, `semgrep`, `pytest` or `hypothesis`
58
+ wherever a tool can settle the claim, and by adversarial review where none can. Only findings that
59
+ survive that gate are eligible to be fixed. The fix is then checked for scope creep, and the whole
60
+ change is gated on a mapping proving every confirmed finding has a fix and every edit has a finding.
61
+
62
+ The design constraint throughout: **a check that could not run must never be indistinguishable from a
63
+ check that passed.**
64
+
65
+ ---
66
+
67
+ ## Verified in the field
68
+
69
+ Two upstream results, both from [hunt mode](#hunt-mode--auditing-code-you-did-not-write), both
70
+ checkable in under a minute.
71
+
72
+ ### SciPy — merged upstream
73
+
74
+ Hunt mode was pointed at [scipy/scipy](https://github.com/scipy/scipy) (~14.8k stars) and found a
75
+ copy-paste defect in `signal.decimate`'s complex-coefficient guard:
76
+
77
+ ```python
78
+ elif (any(np.iscomplex(system.poles))
79
+ or any(np.iscomplex(system.poles)) # <- should be system.zeros
80
+ or np.iscomplex(system.gain)):
81
+ ```
82
+
83
+ > The guard exists to route complex-coefficient filters away from `zpk2sos`, which cannot represent
84
+ > them. Because it tested the poles twice and never the zeros, a `dlti` filter with **real poles and
85
+ > complex zeros** was not recognised as complex, was forced through `zpk2sos`, and raised
86
+ > `ValueError: complex value with no matching conjugate` on valid input.
87
+
88
+ | | |
89
+ |---|---|
90
+ | Submitted upstream | [PR #25654](https://github.com/scipy/scipy/pull/25654), 18 Jul 2026 |
91
+ | Merged | 23 Jul 2026 by a SciPy maintainer — approved *"LGTM"*, labelled `defect` |
92
+ | What shipped | the one-line fix **and our regression test**, `test_complex_zeros_real_poles_iir_dlti` |
93
+ | Latent for | ~3 years 3 months — introduced by [gh-17881](https://github.com/scipy/scipy/pull/17881) (Apr 2023) |
94
+
95
+ The defect is sharper than its one-line diff suggests: gh-17881 was itself titled *"Fix handling on
96
+ user-supplied filters in `signal.decimate`"* and added complex-filter support. The typo silently
97
+ defeated half of the feature that PR shipped — complex *poles* worked, complex *zeros* crashed — and
98
+ survived review, three years of releases, and the surrounding test suite, which covered the working
99
+ half only. It is still live in the current release, 1.18.0.
100
+
101
+ **To be precise about what that means:** the fix was ours and it was merged into a core scientific
102
+ library after maintainer review. What we did *not* do is submit it autonomously — SciPy's
103
+ [AI policy](https://github.com/scipy/scipy/blob/main/doc/source/dev/conduct/ai_policy.rst) requires a
104
+ human to check generated code and open the PR, and requires the PR prose to be the contributor's own
105
+ words. Both were honoured, and the AI-assistance disclosure is in the PR body.
106
+
107
+ ### Polymarket py-sdk — reported, fixed by the maintainers
108
+
109
+ Hunt mode was pointed at [Polymarket/py-sdk](https://github.com/Polymarket/py-sdk) — a third-party
110
+ SDK, ~70 stars, actively maintained — and found a client-side price-validation defect:
111
+
112
+ > `_resolve_price` and `_resolve_protected_market_price` validated prices by **decimal-place count**
113
+ > rather than **tick-grid membership**. The two agree on power-of-ten ticks and diverge on `0.005`
114
+ > and `0.0025` markets, where a price like `0.007` has three decimals, passes validation, is signed
115
+ > into the EIP-712 order, and is only then rejected by the exchange.
116
+
117
+ | | |
118
+ |---|---|
119
+ | Reported upstream | [issue #162](https://github.com/Polymarket/py-sdk/issues/162), 14 Jul 2026 |
120
+ | Fixed upstream | [PR #181](https://github.com/Polymarket/py-sdk/pull/181), merged 21 Jul 2026 — body states *"Fixes #162"* |
121
+ | Author of the fix | a Polymarket maintainer, independently |
122
+ | Issue status | closed as **completed** |
123
+
124
+ **To be precise about what that means:** here the upstream fix was written by a Polymarket
125
+ maintainer, not submitted by us — an outside bug report was specific enough that the maintainers
126
+ implemented and shipped it themselves.
127
+
128
+ How the finding survived to that point: `/audit-fix hunt` surfaced four candidates; the adversarial
129
+ 2-of-3 verifier **killed the flashiest one** (already fixed in an open upstream PR) and one
130
+ deliberate-by-design finding; the survivor was reproduced against ~23,000 exhaustive price/tick cases
131
+ before a line was written.
132
+
133
+ Neither result was cherry-picked from a benchmark: both targets were third-party repos nobody here
134
+ wrote, and in both cases the finding had to survive the same adversarial gate before it left the
135
+ machine.
136
+
137
+ ## It audits itself, and the self-audit finds things
138
+
139
+ The most recent release, `v3.5`, shipped through five task reviews and a whole-branch review. CCA was
140
+ then pointed at it. It found **two Critical defects that the entire review process had missed**:
141
+
142
+ - **CI had never executed the feature's test suite.** The workflow installed an extra that omitted
143
+ `mpmath`; both test files `importorskip` it, so ~25 tests — including the integrity gate, the
144
+ feature's central safety guarantee — skipped silently on all four Python versions. `2 skipped`
145
+ became `31 passed`.
146
+ - **One environment variable made correct code confirm as defective.** `CCA_SUBSTRATE_TOL=1e-20` drove
147
+ the deliberately-correct test fixture to raise a violation at a measured relative error of `8.3e-18`
148
+ — ordinary float64 noise. That verdict would have been binding: protected from being overturned,
149
+ exempt from the adversarial panel, and feeding an automated fix plan.
150
+
151
+ Both were confirmed by execution rather than by re-reading, and both now carry red→green regression
152
+ tests. The full round is [PR #22](https://github.com/GiulioDER/cca-audit/pull/22).
153
+
154
+ ## What is actually different
155
+
156
+ Multi-agent review is common. These parts are not:
157
+
158
+ **Mechanical verification, not a second opinion.** A finding is classified into a *claim type* and
159
+ settled by the tool that can actually decide it — `pyright` for definedness/nullability/type,
160
+ `semgrep` for taint, a `pytest` repro for crash impact, `hypothesis` for arithmetic. The verdict
161
+ carries a machine-produced artifact. An LLM may not overturn an artifact-backed verdict; it
162
+ adjudicates only what no tool could settle.
163
+
164
+ **Asymmetric verdicts, stated honestly.** Each settler can only conclude what its evidence supports.
165
+ `semgrep` can prove a sink is absent but never that an injection is real. The numeric checker can
166
+ confirm with a falsifying example but never refute, because a property holding across a bounded
167
+ search is the absence of a counterexample, not proof of correctness. A clean run is `UNCERTAIN`, not
168
+ a green pass.
169
+
170
+ **Anti-regression on the fix itself.** After fixes land, a differential pass verifies each hunk maps
171
+ to its finding and introduced no behaviour change beyond it. Scope creep and regression risk are
172
+ kicked back.
173
+
174
+ **Fix→finding mapping as a merge gate.** The architect gate emits a table proving every confirmed
175
+ finding has a fix and every edit traces to a finding. An orphan finding or a phantom edit forces
176
+ REVISE.
177
+
178
+ **Risk-tiered, not user-tiered.** Trivial diffs run cheap; money, auth, and numeric diffs are forced
179
+ to the full adversarial treatment. You do not choose the tier by asserting your change is safe.
180
+
181
+ ## Honest limits
182
+
183
+ A verification tool that cannot state where it is blind is asking for trust it has not earned. These
184
+ are enforced as **tests**, not disclaimers:
185
+
186
+ - **The numeric substrate check cannot see sign or formula errors.** It is decorrelated on
187
+ *evaluation* and correlated on *transcription*: both substrates faithfully compute whatever
188
+ structure was written down, so a flipped sign survives into both and they agree. That class belongs
189
+ to the property helpers. `test_sign_trap_does_not_violate` asserts this.
190
+ - **Its integrity gate proves the returned value, not every intermediate.** A target that delegates to
191
+ an unpatched second module can return a high-precision-typed value carrying float64 precision.
192
+ Measured: the gate passes a reference of `0.0` where the true answer is `0.5`.
193
+ `test_gate_does_not_catch_cross_module_precision_loss` asserts this.
194
+ - **A property is authored by the same agent that raised the finding**, so a wrong declared relation
195
+ produces a real counterexample to a wrong claim. A confirmation obliges you to re-read the relation,
196
+ not just the verdict.
197
+ - **Deterministic settlers are Python-only.** Other languages fall back to LLM adjudication.
198
+
199
+ ## Pipeline
200
+
201
+ ```mermaid
202
+ flowchart LR
203
+ A["Step 0\nDetect Files"] --> B["Step 0.5\nLanguage + Domain"]
204
+ B --> T["Step 0.6\nTier Select\nFAST/STANDARD/DEEP"]
205
+ T --> C["Step 1\nParallel Auditors"]
206
+ C --> D["Step 2\nConsolidate + Dedup"]
207
+ D --> V["Step 2.5\nVerify findings\n(anti-hallucination)"]
208
+ V --> E["Step 3\nFix Plan"]
209
+ E --> F["Step 4\nImplement\n(P1 red→green)"]
210
+ F --> G["Step 5\nRe-verify\n(tests + lint)"]
211
+ G --> R["Step 5.5\nRegression Diff\n(anti-regression)"]
212
+ R --> H["Step 6\nArchitect Gate\n+ fix→finding map"]
213
+ H --> I["Step 7\nCommit"]
214
+ ```
215
+
216
+ FAST runs three core auditors and skips the regression gate — but still verifies every P1 before
217
+ fixing it. **No finding is edited into your code unverified, on any tier.**
218
+
219
+ ## The auditors
220
+
221
+ Each has a **non-overlapping scope**, so findings do not duplicate and no auditor arbitrates another's
222
+ domain.
223
+
224
+ **Core** (FAST runs only the first three):
225
+
226
+ | Auditor | Scope | Does NOT check |
227
+ |---------|-------|----------------|
228
+ | **Security** *(single authority)* | OWASP Top 10, injection, auth, secrets, CVEs | Runtime bugs, code quality |
229
+ | **Bug** | Null refs, error handling, races, resource leaks | Security, style |
230
+ | **Code Quality** | Type safety, DRY, complexity, naming, dead code | Security, runtime, performance |
231
+ | **Performance** | Slow queries, hot paths, memory, pooling | Security, style |
232
+ | **Documentation** | Missing docs, stale comments contradicting new code | TODOs, debug statements |
233
+ | **Environment** | Config completeness, format validation, naming | Secrets *(Security owns those)* |
234
+
235
+ **Conditional**, dispatched only when the diff touches their concern:
236
+
237
+ | Auditor | Runs when | Checks |
238
+ |---------|-----------|--------|
239
+ | **High-Stakes / Safety** | money / auth / delete / irreversible paths | Bounds, guards, kill-switches, idempotency |
240
+ | **Numerical / Units** | non-trivial arithmetic | Sign, units, scaling, rounding, conversions |
241
+ | **Data-Integrity** | migrations / SQL / schema | Migration+grant, type assumptions, safe accessors |
242
+ | **Dependency** | a manifest or lockfile changed | Maintenance health, licences, unused deps, pin breakers |
243
+ | **Deployability** | deployable code / units / migrations | Generated files, pin/lock breakers, service↔scheduler pairing, deploy-target assumptions |
244
+
245
+ Plus the verification agents: **fp-check** (anti-hallucination), **differential-review**
246
+ (anti-regression), and the read-only **architect-reviewer** final gate.
247
+
248
+ ## Hunt mode — auditing code you did not write
249
+
250
+ `/audit-fix` reviews *your* diff. **Hunt mode** turns the same pipeline on a codebase you did not
251
+ write — a dependency, a repo you are evaluating, a legacy service — to find pre-existing defects:
252
+
253
+ ```
254
+ /audit-fix hunt src/payments # a whole subtree, no diff required
255
+ /audit-fix hunt path/to/file.py # or specific files
256
+ ```
257
+
258
+ What changes:
259
+
260
+ - **Whole-file audit.** *"Pre-existing bugs are the target"* replaces *"only audit the diff."* Age is
261
+ not evidence of correctness.
262
+ - **A target-viability pre-flight runs first**, before a single auditor is spawned: is the repo alive,
263
+ does it accept contributions, is there a test harness, is the language one this pipeline audits
264
+ well. An archived or deprecated repo is rejected up front — auditing a corpse burns the run and
265
+ produces a fix nobody can merge.
266
+ - **Forced DEEP tier**, so every finding faces the adversarial 2-of-3 verifier.
267
+ - **Upstream-duplicate check.** L2.5 searches the target's own issues and PRs; a bug someone already
268
+ reported is dropped as `DUPLICATE` rather than re-submitted.
269
+
270
+ The output is a finding you can stand behind: reproduced with a failing test, not already known
271
+ upstream, and survivable under adversarial review. That is the process that produced both
272
+ [field results](#verified-in-the-field) above — the merged SciPy fix and the Polymarket report.
273
+
274
+ ## Install
275
+
276
+ ```bash
277
+ pip install cca-audit
278
+ cca-audit install # run from the root of the project you want to audit
279
+ ```
280
+
281
+ That copies the auditor agents into `.claude/agents/` and `/audit-fix` into `.claude/commands/`, and
282
+ puts the `cca_checks` verifier (`python -m cca_checks`) on the same interpreter. Re-run
283
+ `cca-audit install` to upgrade — files you have customized are preserved as `<name>.md.bak` rather
284
+ than overwritten.
285
+
286
+ <details>
287
+ <summary>Install without pip (shell script, requires git)</summary>
288
+
289
+ ```bash
290
+ # Unix/macOS
291
+ curl -fsSL https://raw.githubusercontent.com/GiulioDER/cca-audit/master/claude-code/install.sh | bash
292
+ ```
293
+
294
+ ```powershell
295
+ # Windows PowerShell
296
+ irm https://raw.githubusercontent.com/GiulioDER/cca-audit/master/claude-code/install.ps1 | iex
297
+ ```
298
+
299
+ Same result: it clones the repo to a temp directory and copies the same files. Both paths read the
300
+ markdown from `cca_checks/plugin/`, so there is one copy on disk and they cannot drift.
301
+ </details>
302
+
303
+ **For the deterministic verification layer**, have `pyright`, `pytest` and `semgrep` on your `PATH`.
304
+ Without them the `definedness` / `nullability` / `type` / `taint` claim types fall back to LLM-only
305
+ verification — no crash, no regression.
306
+
307
+ **`numeric` is the exception: it fails closed rather than falling back.** On DEEP, a `NUM-*` P1 may
308
+ not enter the fix plan on an LLM-sourced verdict — it carries a Hypothesis artifact or it is escalated
309
+ as `UNCERTAIN`. DEEP is forced for every high-stakes or numeric diff and for all of hunt mode, so
310
+ **without the `numeric` extra, arithmetic findings on money-path code cannot be auto-fixed at all.**
311
+ That is deliberate — a sign error reads fluently, so a second LLM opinion is not evidence — but it is
312
+ a hard stop, not graceful degradation.
313
+
314
+ The extras carry it:
315
+
316
+ ```bash
317
+ pip install 'cca-audit[verify]' # the whole deterministic layer in one install
318
+ pip install 'cca-audit[numeric]' # just hypothesis + mpmath + pytest
319
+ ```
320
+
321
+ From a clone, the editable equivalents are `pip install -e ".[verify]"` / `-e ".[numeric]"`.
322
+
323
+ Worked example: [`examples/sign-trap`](examples/sign-trap/) — a real sign error, the property that
324
+ catches it, and the resulting artifact.
325
+
326
+ ## Usage
327
+
328
+ ```
329
+ /audit-fix # audit + fix uncommitted changes (tier auto-selected)
330
+ /audit-fix deferred # second pass: fix P3 items deferred by the previous round
331
+ /audit-fix no-fix # audit + verify only
332
+ /audit-fix p1-only # fix only P1 Critical findings
333
+ /audit-fix fast | deep # override the auto-selected tier
334
+ /audit-fix commit 3 # audit the last 3 commits
335
+ /audit-fix files src/app.py
336
+ /audit-fix hunt src/ # audit code you did NOT write
337
+ ```
338
+
339
+ You normally do not pick a tier — the pipeline does.
340
+
341
+ | Tier | When (auto) | Auditors | Verification gates | P1 fix style |
342
+ |------|-------------|----------|--------------------|--------------|
343
+ | **FAST** | trivial, low-stakes, non-deploy diff | 3 core | L2.5 on P1 only | direct |
344
+ | **STANDARD** | normal diff | all 6 core + conditional | L2.5 + L5.5 + mapping | red→green test |
345
+ | **DEEP** | high-stakes / numeric / hunt / forced | all of STANDARD | + adversarial 2-of-3 on high-stakes P1 | red→green test |
346
+
347
+ | Priority | Criteria | Action |
348
+ |----------|----------|--------|
349
+ | **P1 Critical** | Security, data corruption, auth bypass, injection, unsafe money/irreversible handling | Fix before deploy, with a red→green test |
350
+ | **P2 High** | DRY divergence, stale misleading comments, config inconsistencies, unit mismatches | Fix now |
351
+ | **P3** | Cosmetic, style, naming, unused params | Deferred to round 2 |
352
+
353
+ Round 2 (`/audit-fix deferred`) reads the deferred list from the previous commit, re-checks each item
354
+ is still relevant, fixes what remains and marks the rest stale — so no audit leaves a tail.
355
+
356
+ ## Engineering
357
+
358
+ | | |
359
+ |---|---|
360
+ | Tests | 376, on every push and PR |
361
+ | Python | 3.10, 3.11, 3.12, 3.13 — full matrix in CI |
362
+ | Packaging | wheel built and smoke-installed into a clean venv in CI |
363
+ | Lint | `ruff`, zero warnings |
364
+ | Types | `pyright` |
365
+ | Design of record | [`docs/v3-design.md`](docs/v3-design.md), versioned slices v3.0 → v3.5 |
366
+
367
+ Every deterministic-verification slice ships with a written spec and an implementation plan under
368
+ [`docs/superpowers/`](docs/superpowers/), including the measured dead ends — approaches that were
369
+ tried, failed, and are recorded so they are not re-attempted.
370
+
371
+ ## Documentation
372
+
373
+ - [Pipeline Diagram](docs/pipeline-diagram.md) — a walkthrough of each step
374
+ - [Auditor Scopes](docs/auditor-scopes.md) — the full non-overlapping scope matrix
375
+ - [Configuration](docs/configuration.md) — tiers, domain dispatch, project context
376
+ - [Extending](docs/extending.md) — adding a custom auditor
377
+ - [v3 Design](docs/v3-design.md) — the design of record for the deterministic verification layer
378
+ - [Security Policy](SECURITY.md) — **this tool executes code from the repository under audit**
379
+ - [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md)
380
+
381
+ **Writing**
382
+
383
+ - [Fluency isn't evidence](docs/blog-fluency-isnt-evidence.md) — why a sign error survives review, and how a counterexample settles it
384
+ - [Why AI code review hallucinates](docs/blog-why-ai-review-hallucinates.md) — and the two gates that close it
385
+ - [The benchmark memorization gap](docs/blog-benchmark-memorization-gap.md) — what a passing benchmark score actually measures
386
+
387
+ ## License
388
+
389
+ [MIT](LICENSE)