{
  "issuer": "Astera Technology",
  "resource": "ops-route-channel-capacity",
  "locale": "en",
  "contract": "This local example has two channels: email and message. Remaining slots equal the chosen channel’s limit minus used slots. Agents also need exports and active status. Used slots cannot exceed the declared limit; that would be an invalid input, not negative spare capacity. These counts are not workload hours or a waiting-time forecast.",
  "input": {
    "channel": "message",
    "required": [
      "exports"
    ],
    "agents": [
      {
        "id": "A",
        "skills": [
          "exports"
        ],
        "status": "active",
        "capacity": {
          "email": {
            "used": 2,
            "limit": 5
          },
          "message": {
            "used": 2,
            "limit": 2
          }
        }
      },
      {
        "id": "B",
        "skills": [
          "exports"
        ],
        "status": "active",
        "capacity": {
          "email": {
            "used": 5,
            "limit": 5
          },
          "message": {
            "used": 0,
            "limit": 2
          }
        }
      }
    ]
  },
  "output": {
    "ok": true,
    "state": "complete",
    "result": {
      "eligible": [
        "B"
      ],
      "unknown": []
    },
    "trace": [
      {
        "id": "A",
        "skills": true,
        "available": true,
        "spare": false,
        "remaining": 0,
        "decision": "ineligible"
      },
      {
        "id": "B",
        "skills": true,
        "available": true,
        "spare": true,
        "remaining": 2,
        "decision": "eligible"
      }
    ]
  },
  "verificationCases": [
    {
      "name": "baseline",
      "input": {
        "channel": "message",
        "required": [
          "exports"
        ],
        "agents": [
          {
            "id": "A",
            "skills": [
              "exports"
            ],
            "status": "active",
            "capacity": {
              "email": {
                "used": 2,
                "limit": 5
              },
              "message": {
                "used": 2,
                "limit": 2
              }
            }
          },
          {
            "id": "B",
            "skills": [
              "exports"
            ],
            "status": "active",
            "capacity": {
              "email": {
                "used": 5,
                "limit": 5
              },
              "message": {
                "used": 0,
                "limit": 2
              }
            }
          }
        ]
      },
      "expected": {
        "ok": true,
        "state": "complete",
        "result": {
          "eligible": [
            "B"
          ],
          "unknown": []
        }
      }
    },
    {
      "name": "material-edit",
      "input": {
        "channel": "email",
        "required": [
          "exports"
        ],
        "agents": [
          {
            "id": "A",
            "skills": [
              "exports"
            ],
            "status": "active",
            "capacity": {
              "email": {
                "used": 2,
                "limit": 5
              },
              "message": {
                "used": 2,
                "limit": 2
              }
            }
          },
          {
            "id": "B",
            "skills": [
              "exports"
            ],
            "status": "active",
            "capacity": {
              "email": {
                "used": 5,
                "limit": 5
              },
              "message": {
                "used": 0,
                "limit": 2
              }
            }
          }
        ]
      },
      "expected": {
        "ok": true,
        "state": "complete",
        "result": {
          "eligible": [
            "A"
          ],
          "unknown": []
        }
      }
    },
    {
      "name": "fresh-boundary",
      "input": {
        "channel": "message",
        "required": [
          "exports"
        ],
        "agents": [
          {
            "id": "A",
            "skills": [
              "exports"
            ],
            "status": "active",
            "capacity": {
              "email": {
                "used": 2,
                "limit": 5
              },
              "message": {
                "used": 3,
                "limit": 2
              }
            }
          },
          {
            "id": "B",
            "skills": [
              "exports"
            ],
            "status": "active",
            "capacity": {
              "email": {
                "used": 5,
                "limit": 5
              },
              "message": {
                "used": 0,
                "limit": 2
              }
            }
          }
        ]
      },
      "expected": {
        "ok": false,
        "error": "CAPACITY_INPUT"
      }
    }
  ],
  "meaningOfNull": "Unknown or no established value for the field; inspect its specific trace.",
  "businessSideEffects": false
}
