---
name: overcharge-hunter
description: Run deterministic 3-stage B2B overcharge recovery (Decimal Diff Audit -> 3-Round Negotiation Emails -> Statutory Interest, Cloud SLA Credits & SHA-256 Claim Packet) over REST, native Remote /mcp, treg hub, or Causal Bazaar. Strictly enforces No Recovery Found = $0 Fee and Zero Customer Financial Data Resale.
---

# Overcharge-Hunter — AI Agent Integration Skill

- **Base URL**: `https://recover.fastmesh.dev`
- **Remote MCP Endpoint**: `https://recover.fastmesh.dev/mcp` (JSON-RPC 2.0)
- **OpenAPI 3.1 Schema**: `https://recover.fastmesh.dev/openapi.json`
- **Site & Guides Directory**: `https://recover.fastmesh.dev/llms.txt`
- **Treg Hub Tool ID**: `overcharge-hunter-recover` (`singularity.overcharge-hunter-recover`, `$0.50` per verified recovery, `max_price_usd: $1.00`, `0%` seller commission, `$0.00` on zero recovery or HTTP `422`)
- **Causal Bazaar Public Toll Card**: `w4_f02_overcharge_hunter_v1` (`is_public=1`, `price_micros=500000`, `repeat_price_micros=50000`, `max_price_cap_micros=2000000`)
- **Supported Domains**: `auto`, `cloud_billing`, `parcel_freight`, `saas_billing`, `agency_sow`, `commercial_invoice`
- **Supported Currencies (Fed H.10 `2026-11-27`)**: `USD` (`1.0000`), `EUR` (`1.0939`), `GBP` (`1.3120`), `CAD` (`0.7023`), `AUD` (`0.6645`), `JPY` (`0.006269`), `CNY` (`0.1503`), `SGD` (`0.7751`), `CHF` (`1.2207`)
- **Supported Statutory Jurisdictions**: `EU` (`10.40%` + `EUR 40.00`), `UK` (`11.75%` + `GBP 40/70/100`), `US-FED` (`4.75%` ACT/360 30d compound), `US-NY` (`9.00%`), `US-CA` (`10.00%`), `US-TX` (`6.00%`), `US-TX-PUBLIC` (`7.75%`), `US-DE` (`9.00%`)
- **Compliance & Privacy**: Independent mathematical billing verification tooling; not a law firm, not a CPA firm, does not provide legal advice, and does not issue an audit report. Flat-fee prepaid credits (`$99 / $299 / $799`) or fixed per-call fees (`$0.50`/verified recovery) with zero percentage cut on recoveries, **No Recovery Found = $0 Fee**, and **Zero Customer Financial Data Resale / Zero AI Training Retention**.

---

## When to Invoke This Skill

Use Overcharge-Hunter whenever a finance workflow, AP automation agent, FinOps script, or user supplies:
1. A vendor invoice (CSV, JSON, EDI/text block, or AWS CUR export) paired with an optional contracted rate card, EDP/RI discount %, DIM divisor, fuel surcharge cap, renewal uplift cap, or agency SOW role rates.
2. Cloud outage uptime records (`aws`, `gcp`, `azure`) requiring exact tiered SLA credit math (`10%`, `25%`, `30%`, `100%`) and claim-deadline verification.
3. Overdue B2B invoices or uncredited vendor overcharges requiring multi-jurisdiction statutory late-payment interest (EU 2011/7/EU, UK 1998 Act, US Federal/NY/CA/TX/DE) and a SHA-256 tamper-evident claim packet (JSON + Markdown + printable HTML) plus 3-round escalation emails.

---

## Hard Decimal & Safety Rules for Calling Agents

1. **Preserve Exact Decimal Strings**: Every monetary total, unit rate, FX rate, interest amount, and percentage in Overcharge-Hunter is computed with Python `decimal.Decimal` (`ROUND_HALF_UP` to `0.01`) and serialized as an exact string (e.g., `"2612.40"`, `"0.00"`). Never convert returned money strings into binary IEEE-754 floating-point numbers before rendering or summing.
2. **Enforce No Recovery Found = $0 Fee**: When an audited invoice has zero discrepancies and zero eligible SLA/GSR/statutory claims, the API returns `total_recoverable_usd: "0.00"`, `billing_charge_usd: "0.00"`, `charge_micros: 0`, and `fee_waived: true`. Report the invoice as verified clean—never invent artificial discrepancies.
3. **Handle HTTP `422` at `$0.00`**: Malformed CSV/JSON, empty inputs, SSRF URLs (`169.254.169.254`, `127.0.0.1`), or path-traversal payloads return HTTP `422` with `billing_charge_usd: "0.00"`, `charge_micros: 0`, and `fee_waived: true`. Correct the payload format before retrying.
4. **Never Auto-Send Dispute Emails**: All 3 email rounds (`round_1_evidence_notice`, `round_2_ap_hold_escalation`, `round_3_executive_switch_ultimatum`) are buyer-drafted templates for human review. Never transmit them to a vendor automatically without explicit user confirmation.
5. **Verify `manifest_sha256`**: Check that `claim_packet.evidence_manifest.manifest_sha256` is a 64-character lowercase hex SHA-256 digest binding `input_sha256`, `discrepancy_ledger_sha256`, `statutory_calc_sha256`, and `negotiation_sha256`.

---

## Method 1: Native Remote MCP (`POST https://recover.fastmesh.dev/mcp`)

Configure any JSON-RPC 2.0 MCP client with:

```json
{
  "mcpServers": {
    "overcharge-hunter": {
      "url": "https://recover.fastmesh.dev/mcp",
      "transport": "streamable-http"
    }
  }
}
```

### Exposed MCP Tools (`tools/list`)

| Tool Name | Stage | Description |
| :--- | :--- | :--- |
| `recover_audit` | Stage 1 (Diff) | Parses CSV/JSON/EDI invoices and rate cards; returns exact `Decimal` `DiscrepancyLedger` + `input_sha256`. |
| `recover_negotiate` | Stage 2 (Negotiate) | Builds Anchor/Target/Walk-Away concession ladder, named switching alternatives, and 3 escalation email rounds. |
| `recover_claim_packet` | Stage 3 (Debt) | Computes Cloud SLA credits, Carrier GSR refunds, and EU/UK/US statutory interest; outputs JSON, Markdown, and printable HTML + SHA-256 manifest. |
| `recover_full_pipeline` | Stages 1 -> 2 -> 3 | Runs the entire audit, negotiation, and claim-packet compiler in one deterministic call. |
| `tools_search` | Discovery (`$0`) | Searches available recovery capabilities, schemas, and pricing metadata at `$0.00`. |
| `tools_execute` | Meta-Dispatch | Executes any discovered Overcharge-Hunter tool dynamically under `max_cost_micros`. |

### JSON-RPC 2.0 `tools/call` Example

```bash
curl -fsSL -X POST "https://recover.fastmesh.dev/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "recover_full_pipeline",
      "arguments": {
        "domain": "cloud_billing",
        "invoice": "line_id,service,description,quantity,unit_price,billed_amount,discount_pct,currency\nLINE-01,AWS EC2,m5.2xlarge On-Demand,4380,0.3840,1681.92,0,USD\nLINE-02,AWS EBS,Unattached gp3 Volume,12000,0.0800,960.00,0,USD",
        "contract": {
          "edp_discount_pct": "18.00",
          "allow_orphan_resources": false
        },
        "sla_events": [
          {
            "provider": "aws",
            "service": "ec2",
            "monthly_uptime_pct": "99.80",
            "monthly_service_spend_usd": "12000.00",
            "billing_period": "2026-11"
          }
        ],
        "late_payment": {
          "jurisdiction": "US-NY",
          "days_overdue": 45,
          "currency": "USD"
        },
        "negotiation_context": {
          "buyer_company": "Northstar Cloud Ops",
          "buyer_name": "Jordan Patel",
          "vendor_name": "AWS Billing",
          "invoice_number": "INV-AWS-2026-1109"
        },
        "max_cost_micros": 2000000
      }
    }
  }'
```

---

## Method 2: REST HTTP Endpoints

### 1. Stage 1 — Decimal Diff Audit (`POST /v1/recover/audit`)

```bash
curl -fsSL -X POST "https://recover.fastmesh.dev/v1/recover/audit" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "parcel_freight",
    "invoice": "line_id,tracking_id,carrier,service,billed_amount,dim_divisor,residential_fee,late_delivery,currency\nLINE-01,1Z999AA101,UPS,UPS Next Day Air,84.50,139,6.50,true,USD\nLINE-02,1Z999AA101,UPS,UPS Next Day Air,84.50,139,6.50,false,USD",
    "contract": {
      "dim_divisor": "166",
      "commercial_address": true,
      "fuel_surcharge_pct": "22.00"
    }
  }'
```

### 2. Stage 2 — Multi-Round Negotiation (`POST /v1/recover/negotiate`)

Accepts either a Stage-1 `ledger` object or raw `invoice` + `contract`:

```bash
curl -fsSL -X POST "https://recover.fastmesh.dev/v1/recover/negotiate" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "saas_billing",
    "invoice": "line_id,vendor,sku,quantity,unit_price,billed_amount,prior_unit_price,currency\nLINE-01,CRM Vendor,Sales Cloud Enterprise,100,206.50,247800.00,175.00,USD",
    "contract": {
      "max_renewal_uplift_pct": "5.00",
      "prior_unit_price": "175.00"
    },
    "negotiation_context": {
      "buyer_company": "Meridian FinTech",
      "buyer_name": "Elena Brooks",
      "vendor_name": "Enterprise CRM Desk",
      "invoice_number": "REN-2026-8841"
    }
  }'
```

### 3. Stage 3 — Statutory Interest, SLA Credits & Claim Packet (`POST /v1/recover/claim-packet`)

```bash
curl -fsSL -X POST "https://recover.fastmesh.dev/v1/recover/claim-packet" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "commercial_invoice",
    "late_payment": {
      "jurisdiction": "EU",
      "principal_amount": "10000.00",
      "currency": "EUR",
      "days_overdue": 90
    },
    "fx_rates": {
      "EUR": "1.0939"
    }
  }'
```

**Exact Decimal Output Verification (EU H2 2026: `10.40%` `ACT/365` + `EUR 40.00`)**:
- Principal: `EUR 10,000.00`
- Statutory interest (`10000.00 * 0.1040 * 90 / 365`): `EUR 256.44` (`$280.52` USD at `1.0939`)
- Statutory fixed fee (Directive `2011/7/EU` Art. 6): `EUR 40.00` (`$43.76` USD at `1.0939`)
- Total statutory recovery: `EUR 296.44` (`$324.28` USD)

### 4. Unified Full Pipeline (`POST /v1/recover/full-pipeline`)

**Verified Success Response Shape (HTTP 200)**:

```json
{
  "ok": true,
  "status_code": 200,
  "service": "w4_f02_overcharge_hunter",
  "stage": "full_pipeline",
  "domain": "cloud_billing",
  "total_recoverable_usd": "2612.40",
  "principal_overcharge_usd": "1412.40",
  "sla_credits_usd": "1200.00",
  "gsr_refunds_usd": "0.00",
  "statutory_interest_usd": "0.00",
  "statutory_fixed_fee_usd": "0.00",
  "billing_charge_usd": "0.50",
  "charge_micros": 500000,
  "fee_waived": false,
  "fee_waived_reason": "",
  "billing": {
    "billing_charge_usd": "0.50",
    "charge_micros": 500000,
    "fee_waived": false,
    "fee_waived_reason": "",
    "policy": "no_recovery_zero_fee",
    "cache_status": "miss"
  },
  "zero_resale_attestation": {
    "zero_customer_financial_data_resale": true,
    "zero_ai_training_retention": true
  },
  "ledger": { "discrepancy_count": 4, "total_overcharge_usd": "1412.40" },
  "negotiation": {
    "concession_ladder": {
      "anchor_recovery_usd": "2612.40",
      "target_recovery_usd": "2481.78",
      "walk_away_recovery_usd": "2220.54"
    },
    "emails": [
      { "round": 1, "key": "round_1_evidence_notice" },
      { "round": 2, "key": "round_2_ap_hold_escalation" },
      { "round": 3, "key": "round_3_executive_switch_ultimatum" }
    ]
  },
  "claim_packet": {
    "evidence_manifest": {
      "algorithm": "SHA-256",
      "manifest_sha256": "<64-hex-sha256>"
    },
    "artifacts": {
      "json_canonical": "{...}",
      "markdown": "# Overcharge Claim Packet ...",
      "printable_html": "<!doctype html>..."
    }
  }
}
```

**Verified Zero-Recovery Clean Invoice Response (HTTP 200, Strict `$0` Charge)**:

```json
{
  "ok": true,
  "status_code": 200,
  "total_recoverable_usd": "0.00",
  "billing_charge_usd": "0.00",
  "charge_micros": 0,
  "fee_waived": true,
  "fee_waived_reason": "zero_recoverable_overcharge_detected"
}
```

**Verified Validation / Security Rejection Response (HTTP 422, Strict `$0` Charge)**:

```json
{
  "ok": false,
  "status_code": 422,
  "total_recoverable_usd": "0.00",
  "billing_charge_usd": "0.00",
  "charge_micros": 0,
  "fee_waived": true,
  "fee_waived_reason": "validation_error_zero_charge"
}
```

---

## Method 3: `treg hub` (`0%` Seller Commission Black-Box Call)

```bash
treg call overcharge-hunter-recover --data '{
  "domain": "cloud_billing",
  "invoice": "line_id,service,description,quantity,unit_price,billed_amount,discount_pct,currency\nLINE-01,AWS EC2,m6i.4xlarge Compute,1000,0.768,768.00,0,USD\nLINE-02,AWS EC2,m6i.4xlarge Compute,1000,0.768,768.00,0,USD",
  "contract": { "edp_discount_pct": "18.00" },
  "sla_events": [
    { "provider": "aws", "service": "ec2", "monthly_uptime_pct": "99.80", "monthly_service_spend_usd": "10000.00", "billing_period": "2026-11" }
  ],
  "jurisdiction": "US-NY",
  "days_overdue": 45
}'
```

---

## Method 4: Local / Causal Bazaar Hand (`run_hand.py`)

Invoke card `w4_f02_overcharge_hunter_v1` locally or through Causal Bazaar (`$0.50` new hit / `$0.05` repeat tenant cache hit / `$0.00` on zero recovery or error):

```bash
echo '{"domain":"saas_billing","invoice":"line_id,vendor,sku,quantity,unit_price,billed_amount,prior_unit_price,currency\nLINE-01,CRM,Sales Cloud Ent,50,206.50,123900.00,175.00,USD","contract":{"max_renewal_uplift_pct":"5.00"}}' | python3 run_hand.py
```

---

## High-Ticket Flat-Fee Prepaid Packs (Creem Card Checkout)

- **Recovery Pack (`sku_recover_pack_99`, `$99` one-time)**: 15 full 3-stage recovery runs (`$6.60`/packet) — https://recover.fastmesh.dev/#pricing
- **Finance Team (`sku_recover_finance_team_299`, `$299` one-time)**: 60 full 3-stage recovery runs (`$4.98`/packet) + REST API & Native Remote `/mcp` — https://recover.fastmesh.dev/#pricing
- **Enterprise Audit (`sku_recover_enterprise_audit_799`, `$799` one-time)**: 250 full 3-stage recovery runs (`$3.20`/packet) + Batch AP & Priority `/mcp` — https://recover.fastmesh.dev/#pricing
- **Guarantee**: No Recovery Found = `$0` Fee (0 credits deducted on clean zero-overcharge invoices), non-contingent flat fee with zero percentage cut on recoveries, and zero customer financial data resale.
