Metadata-Version: 2.4
Name: ai-eng-audit
Version: 0.3.0
Summary: Local CLI plotting AI spend against engineering throughput
Author-email: 0error-ob <22552513+0error-ob@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2026 AI Eng Audit Contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/0error-ob/ai-eng-audit
Project-URL: Repository, https://github.com/0error-ob/ai-eng-audit
Project-URL: Issues, https://github.com/0error-ob/ai-eng-audit/issues
Project-URL: Documentation, https://github.com/0error-ob/ai-eng-audit/blob/main/docs/methodology.en.md
Keywords: engineering-effectiveness,ai-spend,github,metrics,audit,dora
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# AI Eng Audit

Plot AI tool spend against engineering throughput on a shared chart. Local, open-source, one command.

## What it is

Over the last year a lot of teams burned real money on Claude, Cursor, Copilot, and the rest. The invoices are clear; the output is not.

The tool reads your local git history, PR data, and (optionally) the billing CSV you export from your AI vendor, putting spend and shipped output on the same timeline. You see:

- total AI spend over the window, broken out by month
- PRs merged to the default branch and the L1 ship rate
- PRs opened and then closed, merged and then reverted, or open for too long

## How to use it

```bash
export GITHUB_TOKEN=ghp_xxxxx
pip install ai-eng-audit
ai-eng-audit scan --repo /path/to/your/repo --window 90d \
    --billing ~/Downloads/anthropic_cost.csv \
    --billing ~/Downloads/openrouter_activity.csv
```

Python 3.11+. Generate a `GITHUB_TOKEN` PAT at https://github.com/settings/tokens with `repo` scope.

Add `--lang zh` for Chinese narrative; section labels, metric names, and technical terms (PR, L1, `scope_alignment`, etc.) stay English in both locales.

`--billing` can be repeated. Currently supports the Anthropic Console **cost** export and the OpenRouter Activity export (auto-detected by header). Omit `--billing` to get the git + PR report only.

Add `--format json` for JSON output. Metric definitions, supported vendors, and scope-alignment rules are in [docs/methodology.en.md](docs/methodology.en.md).

## What the report looks like

A run looks roughly like this (numbers are synthetic):

```
ai-eng-audit / your-repo / 2026-02-26 → 2026-05-27 (90d)

10 authors opened 187 PRs over 90d. 142 reached `main` (75.9% of scanned, 84.0%
of resolved). 27 closed without merging. 18 still in flight — 4 open > 30d.
Explicit revert <14d: 2. Org-level AI spend $4,231.50 (anthropic, openrouter);
throughput is repo-level (scope mismatch).

spend:
  2026-03:                    $1,124.00
  2026-04:                    $1,572.30
  2026-05:                    $1,535.20
  total:                      $4,231.50  (anthropic $1,387.10; openrouter $2,844.40)
  scope_alignment:            mismatch
  sources:                    anthropic_cost.csv, openrouter_activity.csv

throughput:
  PRs opened:                 187
  PRs merged (L1 proxy):      142  (75.9% scanned / 84.0% resolved)
  PRs closed w/o merge:       27
  PRs in flight:              18
  commits to main:            312
  unique authors:             10
  top-5 commit share:         72.3% (names withheld by design)

friction:
  abandoned:                  27  (14.4% of opened)
  long-lived open > 30d:      4
  explicit revert < 14d:      2

commits by ISO week:
  2026-W09  18
  2026-W10  25
  2026-W11  32
  2026-W12  29
  2026-W13  21
  2026-W14  18
  2026-W15  24
  2026-W16  31
  2026-W17  28
  2026-W18  35
  2026-W19  26
  2026-W20  19
  2026-W21  6

—
methodology v0.2-draft. definitions in docs/methodology.md.
workflow signals only; not personnel evaluation. Tier 2 per-PR AI attribution arrives in later versions.
```
