# Resolve (/docs/resolve)

Execution-verified bug fixes: point Resolve at a public GitHub repo and an issue, get back a patch proven by tests and a public attestation. No fix, no fee.

**Resolve** turns a GitHub issue into a pull request you can trust without reading the diff first. It writes a reproduction test *before* touching your code, fixes the bug in a sandbox, proves the repro now passes and your existing suite still does, and publishes an **attestation** — the patch, the repro test, before/after test output, the runner image digest — at a URL anyone can open. You pay a flat quoted price only after that attestation exists. **Failed attempts cost nothing and open no PR.**

Base URL `https://resolve.codai.ro`. Same `codai_` key as the gateway.

<Callout type="info">
Private beta. Public `github.com` repos only; **Python (pytest)** and **JavaScript/TypeScript (vitest, jest, node:test)** are the supported verification paths.
</Callout>

## Three steps [#three-steps]

<Steps>
<Step>

### Submit a repo and an issue [#submit-a-repo-and-an-issue]

Label the issue **`codai-fix`** with the [GitHub Action](./github-action.mdx) installed, or call the API:

```bash
curl -X POST https://resolve.codai.ro/v1/resolve/jobs \
  -H "Authorization: Bearer $CODAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "repo_url": "https://github.com/owner/repo",
    "issue_url": "https://github.com/owner/repo/issues/42"
  }'
```

Triage reads the issue and answers with one of three flat quotes — **€7**, **€19** or **€49** — or **declines for free** when it does not think a verified fix is likely. Your first **3** verified fixes are free and start immediately.

```json
{
  "id": "5f0c…",
  "status": "quoted",
  "tier": "t19",
  "quote_micro_usd": 19000000,
  "triage_reason": "moderate: multi-file, needs investigation",
  "free_tier_remaining": 0
}
```

</Step>
<Step>

### Accept the quote [#accept-the-quote]

Free jobs auto-accept. For a paid quote, `POST /v1/resolve/jobs/{id}/accept` (or let the Action do it under your `max-tier`). The job moves to `accepted` and a sandboxed runner starts: repro test first, then the fix, then the full suite.

</Step>
<Step>

### Get the attestation [#get-the-attestation]

Poll `GET /v1/resolve/jobs/{id}` until `status` is `resolved` (or `failed` / `error`). A resolved job carries `attestation_url` — a public JSON document at `/v1/resolve/attestations/{id}` with the patch and every test output. Apply the patch, or let the Action open the PR for you with the attestation linked.

</Step>
</Steps>

## Why the attestation matters [#why-the-attestation-matters]

The billing row **cannot be written without a verified attestation row** — that is enforced in code, not policy. So the URL you hand to your team is the same artifact that decided whether you were charged. Nothing to take on trust: the repro fails *before* on your base commit, passes *after* with the patch, and the regression suite output is right there.

<Cards>
  <Card title="GitHub Action" href="./github-action.mdx" description="Label an issue, get a PR with proof. Inputs, outputs, permissions, example workflows." />
  <Card title="How it works" href="./how-it-works.mdx" description="Job lifecycle, what the attestation proves, what the runner will and will not touch." />
  <Card title="Pricing and limits" href="./pricing-and-limits.mdx" description="Flat tiers, the free tier, the wallet hold and refund, caps and timeouts." />
  <Card title="API reference" href="../api/resolve.mdx" description="Every route and field, with a playground." />
</Cards>
