# LaunchCheck release monitoring

Download `/monitor.mjs`, `/compare_reports.mjs` and `/x402_client.mjs` into the same directory. Use Node 22+ and install `@x402/core`, `@x402/evm` and `viem` in your project. Pin tested versions in your own lockfile.

Set BUYER_PRIVATE_KEY through your runner's secret manager. Use a dedicated buyer wallet with a limited balance. Do not put keys in source, logs or commands committed to Git. LaunchCheck never receives that key.

Run after a deployment:

```sh
node monitor.mjs https://your-site.com --authorized --pay --run release-123 --dir /persistent/private/launchcheck/my-site
```

Only use `--authorized` for a site you own or have permission to check. `--pay` authorizes one 0.25 USDC purchase for each NEW run ID. A daily run costs up to 7.75 USDC per 31-day month for one URL; 100 deployments cost 25 USDC. Hosting/runner costs are separate. This is a buyer expense, not a merchant promise of revenue.

## Durable recovery

Use one persistent, private directory per URL. A run ID identifies a purchase; NEVER change it to recover a timeout. Reuse the same ID, directory and URL. The signed authorization is saved BEFORE transmission. A completed report is reused without another payment. Do not upload the state directory to a public artifact or cache. Do not run two instances against the same state directory concurrently.

The first completed run establishes `baseline.json`. Subsequent runs write `<run>.report.json` and `<run>.diff.json` without advancing the baseline. Review changes and explicitly replace the baseline only when the new behavior is intended. Keep old snapshots if you need history.

Exit codes: 0 = baseline created or no newly failed checks; 1 = regression; 2 = request/comparison failed or unresolved. A result of 0 does NOT certify site safety, accessibility or SEO. Existing baseline failures remain failures even if there are no new regressions.

## Scheduling on your existing runner

No VPS is needed if you already have a persistent CI runner or a machine you keep on. Add the command after deployment, using the immutable deployment ID as `--run`. A self-hosted GitHub Actions example is available at `/launchcheck-monitor.yml`; merge it into your own repository only after configuring its secrets and private state directory. It is manual by default; no recurring spending is enabled automatically. Ephemeral runners need a private persistence mechanism before using this client.

## Offline comparison (free)

```sh
node compare_reports.mjs old.report.json new.report.json
```

Comparison requires two full 32-check paid snapshots of the same final URL. It reports pass-to-fail regressions, improvements, and evidence changes separately. Missing/duplicate checks or a different final URL fail rather than produce a misleading green result.

New reports contain 32 checks. Saved older 16-check reports remain accessible. Cross-version comparison is refused; review and establish a new baseline after an upgrade.
