{
  "serviceId": "pine-script-lint-v1",
  "displayName": "Pine Script Lint",
  "description": "Static checks for TradingView Pine Script v5/v6. POST /v1/integrity finds what makes a backtest look better than live: future data via lookahead, unconfirmed higher-timeframe values, signals drawn on past bars, realtime-only state, strategy fill assumptions. POST /v1/lint adds syntax and version checks. Each finding has line, code and severity. Never claims the script compiles.",
  "category": "finance",
  "resourceUrl": "https://agent.pocket.network/v1/pine-script-lint-v1",
  "priceUsd": "0.005000",
  "priceVersion": 1,
  "rails": [
    {
      "id": "base",
      "network": "eip155:8453",
      "chainId": 8453,
      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "tokenDecimals": 6,
      "payToAddress": "0xF732ea490c5766071785a2310523f7fA2CEbB829"
    }
  ],
  "paymentNetworks": [
    "eip155:8453",
    "eip155:4217"
  ],
  "paymentProtocols": [
    "x402",
    "mpp"
  ],
  "protocols": [
    "rest"
  ],
  "inputSchema": {
    "type": "object",
    "description": "The body of POST /v1/lint and POST /v1/integrity (integrity ignores conventions). GET /v1/rules lists every finding code with its severity.",
    "properties": {
      "source": {
        "type": "string",
        "maxLength": 204800,
        "description": "The Pine Script source, up to 200 KiB."
      },
      "conventions": {
        "type": "boolean",
        "description": "Lint only. Also report style conventions; default false."
      }
    },
    "required": [
      "source"
    ]
  },
  "outputSchema": {
    "type": "object",
    "description": "POST /v1/lint answers pine-lint-result/v1 (verdict CLEAN, WARN or FAIL, counts, findings with code, severity, line and message, stats); POST /v1/integrity answers pine-integrity-result/v1 (verdict, counts, findings, checks). Every response is a JSON object."
  },
  "methods": {
    "GET /v1/health": "read",
    "GET /v1/rules": "read",
    "GET /v1/version": "read",
    "POST /v1/integrity": "read",
    "POST /v1/lint": "read"
  },
  "example": {
    "method": "POST",
    "path": "/v1/integrity",
    "request": {
      "source": "//@version=6\nindicator(\"y\")\nd = request.security(syminfo.tickerid, \"D\", close, lookahead=barmerge.lookahead_on)\nplot(d)\n"
    },
    "response": {
      "portal": {
        "provenance": "third-party-supplier",
        "serviceId": "pine-script-lint-v1",
        "schemaCheck": "unchecked"
      },
      "data": {
        "schema": "pine-integrity-result/v1",
        "service": "pine-script-lint-v1",
        "linter_version": "0.2.1",
        "pine_version": 6,
        "declaration": {
          "kind": "indicator",
          "line": 2
        },
        "verdict": "FAIL",
        "counts": {
          "error": 1,
          "warning": 1,
          "info": 0
        },
        "findings": [
          {
            "code": "P007",
            "severity": "warning",
            "line": 3,
            "message": "request.security with lookahead_on repaints on historical bars"
          },
          {
            "code": "P201",
            "severity": "error",
            "line": 3,
            "message": "request.security(..., lookahead_on) without a [1]-style offset reads the future on historical bars"
          }
        ],
        "checks": [
          "future data (lookahead_on without offset)",
          "unconfirmed higher-timeframe values",
          "signals drawn in the past"
        ],
        "stats": {
          "lines": 5,
          "non_empty_lines": 4,
          "functions": 0,
          "inputs": 0,
          "plots": 1,
          "securities": 1,
          "alertconditions": 0
        },
        "scope": "static heuristics; it does not run the script and cannot prove the absence of repainting",
        "request_id": "r_38f123612775"
      }
    },
    "capturedAt": "2026-11-09T19:45:22.596Z"
  },
  "firstParty": true,
  "networks": [
    "eip155:8453",
    "eip155:4217"
  ],
  "serving": true,
  "page": "https://agent.pocket.network/services/pine-script-lint-v1",
  "descriptor": "https://agent.pocket.network/services/pine-script-lint-v1/descriptor.json"
}