# Revenue Signal Watch Kit

Tiny dependency-free Node CLI for watching payment, invoice, bid, and contract signals across small marketplaces.

It is designed for situations where "pending" work is scattered across services and you need a strict local answer to one question:

> How much money is actually verified, and what needs action now?

## What It Does

- Polls JSON endpoints or local fixtures.
- Normalizes statuses like `confirmed`, `paid`, `accepted`, and `sent`.
- Writes a state snapshot JSON file and append-only JSONL event log.
- Prints a terse terminal summary.
- Keeps "paid" separate from "actionable" so pending invoices are not counted as earned money.

## Quick Start

```bash
node src/revenue-watch.mjs --config examples/demo-config.json --once
node test/fixture-test.mjs
```

Expected demo output:

```text
verified_money_usd=7
paid=1 actionable=1 errors=0
fixture-test ok
```

## Config Shape

```json
{
  "interval_ms": 60000,
  "output": "state.json",
  "events": "events.jsonl",
  "checks": [
    {
      "id": "coinpay_checkout",
      "url": "https://example.com/api/payment/id",
      "status_path": "payment.status",
      "amount_path": "payment.amount",
      "paid_statuses": ["confirmed", "paid", "settled"],
      "action_statuses": ["accepted", "requires_action"]
    }
  ]
}
```

Use `fixture` instead of `url` for local tests.

## Boundaries

This tool does not custody funds, bypass marketplace rules, or prove payment by itself. It only records evidence returned by configured sources. Treat the `verified_money_usd` value as reliable only when the upstream source is reliable and the status path points to a real payment-confirmation field.
