---
name: debt-anything
description: Deterministic, pure-Decimal 5-domain B2B accounts-receivable calculation and claim-evidence packet engine for AI agents and finance pipelines (UK/EU/US statutory late-payment interest, cloud/SaaS SLA credit math, duplicate/zombie/hike charge scanning, freight loss/damage caps & deadlines, and courteous 7d/30d/60d B2B AR reminders). Emits tamper-evident SHA-256 receipts with strict $0 billing on HTTP 422 invalid inputs or errors.
---

# Debt-Anything Agent Skill

`Debt-Anything` (`https://debt.fastmesh.dev`) is a fixed-fee, polymorphic, pure-`Decimal` B2B accounts-receivable calculation and claim-evidence packet engine built for autonomous AI finance agents, SaaS RevOps workflows, AP/AR recovery pipelines, and logistics dispute teams.

Every calculation returns a standardized, tamper-evident **`DebtReceipt`** sealed with a deterministic **`sha256_attestation`** digest and structured **`evidence_sources`**.

> **Software Disclaimer**: Debt-Anything provides deterministic B2B accounts-receivable calculation and claim-evidence packet software tooling only. It is **not a licensed collection agency**, **not a law firm**, **not a CPA firm**, and does not provide formal legal, tax, or accounting advice. It charges flat fixed-fee software pricing with **zero percentage cut** and **zero commission** on claims.

## Hard Guarantees

1. **Pure `Decimal` Arithmetic (`ROUND_HALF_UP`, Zero Float Drift)**: Every calculation executes exclusively in Python `decimal.Decimal` and serializes monetary totals as exact strings (eliminating binary floating-point drift on leap-year interest accruals, SLA uptime percentages, and SDR freight caps).
2. **Strict `$0` Billing on HTTP `422` & Errors**: Invalid inputs (`HTTP 422`), negative or zero principal/bill amounts, `as_of_date < due_date`, invalid outage windows (`end_utc <= start_utc`), sentinel placeholders (`"N/A"`, `""`, `"null"`), or malformed CSV payloads strictly return `billed_micros: 0` with `zero_bill_reason: "invalid_input_422"`.
3. **Cross-Tenant Adaptive Archive Cache (7d-30d) & 10% Recheck Tier**: Deterministic results enter a SQLite WAL archive cache (7d initial TTL expanding 1.5x up to 30d). Same-tenant rechecks (`recheck: true`) bill **10%** of base domain pricing; new-tenant cache hits bill **100%**.
4. **Zero Customer Data Resale**: Customer invoices, corporate card CSVs, cloud outage windows, waybills, and execution traces are never sold, licensed, or reused to train third-party models.

## Supported Domains & Micro-USD Pricing

| Domain (`domain`) | Scope & Rules | Base Price | 10% Recheck | Key Input Fields |
| :--- | :--- | :---: | :---: | :--- |
| `statutory_interest` | UK Late Payment Act 1998 (BoE + 8%, £40/£70/£100 cliff, 365/366 leap-year basis), EU Directive 2011/7/EU (ECB + 8% + €40), US State Prompt Payment (`us_ny`, `us_ca`, `us_tx`, `us_fl`, `us_il`, `us_de`, `us_nj`, `us_federal_prompt_payment`) | `$0.030` (`30000`) | `$0.0030` (`3000`) | `jurisdiction`, `principal`, `currency`, `due_date`, `as_of_date`, `base_rate_pct` |
| `sla_credit` | Exact leap-year billing-month minutes (Feb 2024 = 41,760m, Feb 2025 = 40,320m), overlapping outage merge, planned maintenance exclusion, 99.9%/99.95%/99.99% cliffs, 10%/25%/100% credit tiers | `$0.035` (`35000`) | `$0.0035` (`3500`) | `monthly_bill`, `sla_tier_pct`, `billing_month`, `outages` or `outage_minutes` |
| `duplicate_charge` | Corporate card JSON/CSV stream scanner detecting exact duplicate charges within `window_days`, zombie post-cancellation SaaS charges, and stealth unit-price hikes | `$0.045` (`45000`) | `$0.0045` (`4500`) | `transactions` or `csv_text`, `window_days`, `price_hike_threshold_pct` |
| `freight_claim` | Undeclared parcel `$100` cap, Montreal Convention `26` SDR/kg cap, Carmack Amendment, declared value, filing deadline redlines (14d/15d/21d/120d/9mo), missing-document checklist | `$0.050` (`50000`) | `$0.0050` (`5000`) | `carrier_regime`, `goods_value`, `freight_cost`, `salvage_value`, `weight_kg`, `sdr_rate_usd`, `declared_value`, `waybill_number`, `claim_type`, `delivery_or_ship_date`, `claim_date`, `documents_present` |
| `ar_reminder` | Non-harassing courteous 7d / 30d / 60d B2B commercial reminder packets with embedded `statutory_interest` math and SHA-256 verification | `$0.040` (`40000`) | `$0.0040` (`4000`) | `creditor_name`, `debtor_name`, `invoice_number`, `principal`, `currency`, `due_date`, `as_of_date`, `jurisdiction`, `base_rate_pct`, `stage` |

## Quick Invocation

### 1. Native Streamable MCP (`POST https://debt.fastmesh.dev/mcp`)

Discover available flat tools (`debt_calculate`, `debt_calculate_batch`, `debt_verify_receipt`):

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}
```

Execute a live UK Late Payment Act calculation via MCP:

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "debt_calculate",
    "arguments": {
      "domain": "statutory_interest",
      "jurisdiction": "uk_late_payment",
      "principal": "12000.00",
      "currency": "GBP",
      "due_date": "2026-01-15",
      "as_of_date": "2026-04-15",
      "base_rate_pct": "4.50"
    }
  }
}
```

### 2. HTTP REST API (`POST https://debt.fastmesh.dev/calculate`)

Single SLA credit cliff calculation (Feb 2024 leap year `41,760` total minutes, `99.9%` tier):

```bash
curl -sS -X POST https://debt.fastmesh.dev/calculate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ${DEBT_API_KEY}" \
  -d '{
    "domain": "sla_credit",
    "monthly_bill": "10000.00",
    "sla_tier_pct": "99.9",
    "billing_month": "2024-02",
    "outages": [
      {"start_utc": "2024-02-10T01:00:00Z", "end_utc": "2024-02-10T02:00:00Z", "planned_maintenance": false}
    ]
  }'
```

Concurrent heterogeneous batch with hard budget lock (`POST /calculate/batch`):

```bash
curl -sS -X POST https://debt.fastmesh.dev/calculate/batch \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ${DEBT_API_KEY}" \
  -d '{
    "max_budget_micros": 250000,
    "items": [
      {"domain": "statutory_interest", "jurisdiction": "uk_late_payment", "principal": "1000.00", "currency": "GBP", "due_date": "2026-01-01", "as_of_date": "2026-03-02", "base_rate_pct": "4.50"},
      {"domain": "sla_credit", "monthly_bill": "5000.00", "sla_tier_pct": "99.9", "billing_month": "2026-03", "outage_minutes": 60},
      {"domain": "freight_claim", "carrier_regime": "montreal_convention", "goods_value": "2000.00", "freight_cost": "150.00", "weight_kg": "25", "claim_type": "damage", "delivery_or_ship_date": "2026-11-20", "claim_date": "2026-11-28", "documents_present": ["commercial_invoice", "bill_of_lading", "delivery_receipt", "damage_photos"]}
    ]
  }'
```

Retrieve a stored receipt by ID:

```bash
curl -sS https://debt.fastmesh.dev/receipt/dr_example_receipt_id
```

### 3. Via `treg hub` (0% Seller Commission, `$0` on 422/Miss)

```bash
treg call debt-anything \
  --data '{"domain":"statutory_interest","payload":"{\"jurisdiction\":\"uk_late_payment\",\"principal\":\"12000.00\",\"currency\":\"GBP\",\"due_date\":\"2026-01-15\",\"as_of_date\":\"2026-04-15\",\"base_rate_pct\":\"4.50\"}"}'
```

## Example `DebtReceipt` Response

```json
{
  "receipt_id": "dr_uk_stat_01",
  "domain": "statutory_interest",
  "target": "uk_late_payment",
  "verdict": "VERIFIED",
  "confidence": "1.0000",
  "disclaimer": "Deterministic B2B accounts-receivable calculation and claim-evidence packet software tooling only; not a licensed collection agency, not a law firm, not a CPA firm, and does not provide legal advice.",
  "evidence_sources": [
    {
      "source": "uk_late_payment_act_1998",
      "url": "https://debt.fastmesh.dev/guides/uk-late-payment-act-1998-statutory-interest-calculator",
      "status": "applied",
      "observed_at_utc": "2026-12-02T19:20:00Z",
      "summary": "UK Late Payment of Commercial Debts (Interest) Act 1998: BoE base + 8% uplift + GBP 100 fixed recovery tier"
    }
  ],
  "checks": [
    {"name": "uk_fixed_compensation_tier", "passed": true, "detail": "Principal GBP 12000.00 >= 10000.00 qualifies for GBP 100.00 fixed compensation"},
    {"name": "decimal_day_count_accrual", "passed": true, "detail": "90 days overdue at 12.50% annual statutory rate"}
  ],
  "payload_sha256": "7b2a9d4c1f8a0b2e3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b",
  "sha256_attestation": "8c3d0e5f2a9b1c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d",
  "billed_micros": 30000,
  "base_price_micros": 30000,
  "cache_hit": false,
  "cache_tier": "live",
  "confirm_dual_source": false,
  "timestamp_utc": "2026-12-02T19:20:00Z",
  "zero_bill_reason": "",
  "details": {
    "currency": "GBP",
    "principal": "12000.00",
    "statutory_rate_pct": "12.50",
    "accrued_interest": "369.86",
    "fixed_compensation": "100.00",
    "total_claimable": "12469.86"
  }
}
```

## Local Tamper-Evident Receipt Verification (Python 3 Stdlib)

Any downstream finance ops team or agent can verify offline that a `DebtReceipt` has not been altered:

```python
import hashlib
import hmac
import json

def verify_receipt(receipt: dict) -> bool:
    """Recompute deterministic SHA-256 attestation over all fields except sha256_attestation."""
    expected = str(receipt.get("sha256_attestation") or "").strip().lower()
    if len(expected) != 64:
        return False
    unsigned = {k: v for k, v in receipt.items() if k != "sha256_attestation"}
    canonical = json.dumps(
        unsigned,
        sort_keys=True,
        separators=(",", ":"),
        ensure_ascii=False,
    ).encode("utf-8")
    actual = hashlib.sha256(canonical).hexdigest()
    return hmac.compare_digest(actual, expected)
```

Or invoke the MCP tool `debt_verify_receipt` directly with the full receipt JSON object.

## Prepaid Credit Packs (Creem.io, Non-Expiring, One-Time)

- **Starter (`$19.00`)**: `sku_debt_starter_19` — `$19.00` credits (`19,000,000` micros, `0%` bonus) — `https://www.creem.io/product/prod_debt_anything_starter_19`
- **Growth (`$79.00`, Recommended)**: `sku_debt_growth_79` — `$94.80` credits (`94,800,000` micros, `+20%` bonus) — `https://www.creem.io/product/prod_debt_anything_growth_79`
- **Scale (`$199.00`)**: `sku_debt_scale_199` — `$258.70` credits (`258,700,000` micros, `+30%` bonus) — `https://www.creem.io/product/prod_debt_anything_scale_199`

## Support & Discovery

- Service URL: `https://debt.fastmesh.dev/`
- Machine Index: `https://debt.fastmesh.dev/llms.txt`
- OpenAPI 3.1.0 Spec: `https://debt.fastmesh.dev/openapi.json`
- Technical Guides (28 pages): `https://debt.fastmesh.dev/guides`
- Contact: `ops@fastmesh.dev`
