{"id":"topk-result-check","version":"1.0.0","description":"Checks a claimed exact-decimal top-k ranking with deterministic source-index ties.","supported_operations":["check top k result","validate largest selections","validate smallest selections","audit top k witnesses","check ranked claim","compare claimed top k"],"unsupported_operations":["does not approximate numeric values","does not silently fill missing ranks"],"semantics":["If the complete first-discrepancy verdict would exceed 4,096 UTF-8 JSON bytes, the tool throws limit_exceeded instead of truncating, omitting, or repairing either witness.","Values are exact decimal strings; ranking is numeric and equal numeric values tie by ascending source index.","The claim has exactly k witnesses in rank order; source values must not be null."],"limits":{"max_items":10000,"max_input_bytes":1000000,"max_output_bytes":4096},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"array","maxItems":10000,"items":{"type":"string"}},"k":{"type":"integer","minimum":0,"maximum":10000},"direction":{"type":"string","enum":["largest","smallest"]},"claimed":{"type":"array","maxItems":10000,"items":{"type":"object","additionalProperties":false,"properties":{"source_index":{"type":"integer","minimum":0,"maximum":9999},"value":{"type":"string"}},"required":["source_index","value"]}}},"required":["source","k","direction","claimed"]},"output_schema":{"type":"object","additionalProperties":false,"properties":{"valid":{"type":"boolean"},"reason":{"type":"string"},"discrepancy":{"type":"object","additionalProperties":false,"properties":{"path":{"type":"string"},"index":{"type":"integer"},"expected":{},"actual":{}},"required":["path","index","expected","actual"]},"reference_version":{"type":"string"}},"required":["valid","reference_version"]},"examples":[{"input":{"source":["2","10","10.0"],"k":2,"direction":"largest","claimed":[{"source_index":1,"value":"10"},{"source_index":2,"value":"10.0"}]},"output":{"valid":true,"reference_version":"ECMA-262-2026-Array-iteration-order+Hoare-1961-selection-invariants"}},{"input":{"source":["1"],"k":1,"direction":"smallest","claimed":[{"source_index":0,"value":"2"}]},"output":{"valid":false,"reason":"wrong_item","discrepancy":{"path":"claimed","index":0,"expected":{"source_index":0,"value":"1"},"actual":{"source_index":0,"value":"2"}},"reference_version":"ECMA-262-2026-Array-iteration-order+Hoare-1961-selection-invariants"}}],"execute_url":"/v1/tools/topk-result-check/versions/1.0.0/execute"}