Changed Line Coverage

Measure coverage only for executable added or edited lines and report uncovered line ranges per file.

Custom requests cost 0.04 USDC on Base.

Download example JSON · OpenAPI · Source and usage

Pay with a browser wallet · Open example in checkout

POST a JSON request to /changed-line-coverage/v1/check with an x402 V2 client.

Worked example

Request

{
  "minimum_coverage_bps": 7500,
  "files": [
    {
      "path": "main.py",
      "changes": [
        {
          "first": 4,
          "last": 9
        }
      ],
      "executable": [
        {
          "line": 3,
          "hits": 7
        },
        {
          "line": 4,
          "hits": 2
        },
        {
          "line": 7,
          "hits": 0
        },
        {
          "line": 8,
          "hits": 0
        }
      ]
    },
    {
      "path": "index.py",
      "changes": [
        {
          "first": 1,
          "last": 2
        }
      ],
      "executable": [
        {
          "line": 1,
          "hits": 1
        }
      ]
    }
  ]
}

Result

{
  "decision": "below_threshold",
  "changed_executable": 4,
  "changed_covered": 2,
  "coverage_bps": 5000,
  "files": [
    {
      "path": "main.py",
      "changed_executable": 3,
      "changed_covered": 1,
      "uncovered": [
        {
          "first": 7,
          "last": 8
        }
      ]
    },
    {
      "path": "index.py",
      "changed_executable": 1,
      "changed_covered": 1,
      "uncovered": []
    }
  ]
}

Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter