{"uid":"cap_eHHHUJZTN4TzHu7D0uGI-","slug":"fahce-diagnose-claim-evidence-verification-with-repair-plan-a3d391cb","name":"FAHCE Diagnose — Claim & Evidence Verification with Repair Plan","description":"Review claims against evidence, resolve contradictions, and get a bounded repair plan with FAHCE.","url":"https://fahce.kinganlogic.com/api/v1/diagnose?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["schema","evidence","candidate_output"],"properties":{"schema":{"type":"string"},"evidence":{"type":"array"},"expected_output":{"type":"string","description":"Optional response-contract and repair-target context for all operations, including Diagnose. Supported response-format directives (for example, Return JSON) and implemented explicit constraints can affect the diagnosis. Ordinary matching or mismatching factual text is not compared for string equality and is not a trusted answer oracle or supporting evidence; supply independent evidence for factual claims."},"candidate_output":{"type":"string","description":"The exact candidate output to diagnose or verify. Never use payment evidence as semantic evidence."}}},"responseSchema":{"type":"object","required":["schema","operation","request_id","input_hash","diagnosis","repair","verification","billing","receipt","next_safe_action"],"properties":{"repair":{"anyOf":[{"type":"object","required":["plan","treatment","proposed_output","status"],"properties":{"plan":{"type":"object","required":["required","bounded_steps","authority_note"],"properties":{"required":{"type":"boolean"},"validated_ir":{"type":"object"},"bounded_steps":{"type":"array","items":{"type":"object","required":["step","boundary"],"properties":{"step":{"type":"string"},"boundary":{"type":"string"}},"additionalProperties":false}},"authority_note":{"type":"string"},"claim_corrections":{"type":"array","items":{"type":"object"}}}},"status":{"const":"PROPOSED_NOT_EXECUTED"},"treatment":{"type":["object","null"]},"proposed_output":{"type":["string","null"]}},"additionalProperties":false},{"type":"null"}]},"schema":{"const":"FAHCE_MACHINE_RESPONSE_V1"},"billing":{"type":"object","required":["billable","free_retry","reason","determination_status"],"properties":{"reason":{"type":["string","null"]},"billable":{"type":"boolean"},"free_retry":{"type":"boolean"},"determination_status":{"enum":["DETERMINATION_COMPLETE","DETERMINATION_COMPLETE_NEGATIVE","DETERMINATION_NOT_PRODUCED"]}}},"binding":{"type":"object","required":["actor_id","tenant_id","nonce","idempotency_key"],"properties":{"nonce":{"type":"string"},"actor_id":{"type":"string"},"tenant_id":{"type":"string"},"tenant_model":{"enum":["PILOT_USER_ISOLATION","PAYMENT_CONTEXT_ISOLATION"],"description":"Cloudflare wallet-only purchases use PAYMENT_CONTEXT_ISOLATION: one authorization-bound principal, no human account privileges. Legacy key calls use PILOT_USER_ISOLATION."},"credential_id":{"type":["string","null"],"description":"Null for wallet-only Cloudflare machine purchases. A credential exists only for legacy key-backed calls; it is never a prerequisite for an ordinary paid buyer."},"idempotency_key":{"type":"string"},"operation_scope":{"enum":["machine:diagnose","machine:repair","machine:verify","machine:repair-bundle"],"type":"string"},"payment_context_hash":{"type":["string","null"]}}},"receipt":{"type":"object","required":["case_id","run_id","input_hash","result_hash","hash_scheme","provider","model","engine_version","created_at","response_hash_scheme","response_hash","payment_status","payment_receipt","settled_price_atomic_units"],"properties":{"model":{"type":"string"},"run_id":{"type":"string","format":"uuid"},"case_id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"input_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"hash_scheme":{"enum":["SHA256_CANONICAL_JSON_RESULT_WITH_EMPTY_RESULT_HASH_V1","SHA256_SORTED_JSON_RESULT_WITH_EMPTY_RESULT_HASH_V2"]},"result_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"response_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"engine_version":{"type":"string"},"payment_status":{"enum":["PILOT_KEY_NO_PAYMENT","AUTHORIZED_PENDING_GATEWAY_SETTLEMENT"]},"payment_receipt":{"type":"null","description":"Immutable origin receipt; separate gateway PAYMENT-RESPONSE is retained by the buyer."},"response_hash_scheme":{"enum":["SHA256_JSON_RESPONSE_WITH_EMPTY_RESPONSE_HASH_V1","SHA256_SORTED_JSON_RESPONSE_WITH_EMPTY_RESPONSE_HASH_V2"]},"settled_price_atomic_units":{"type":"null","description":"Origin has no confirmed gateway settlement amount. Financial confirmation is recorded separately; the original response remains immutable and settlement is never inferred."}},"additionalProperties":false},"authority":{"type":"object","properties":{"payment_approval":{"type":"string"},"integrity_support":{"type":"string"},"external_verification":{"const":"NOT_ESTABLISHED"},"permission_to_execute":{"const":"NOT_GRANTED"}}},"diagnosis":{"type":"object","required":["state","claims","contradictions","missing_evidence","missing_evidence_details","claim_ceiling"],"properties":{"state":{"enum":["HOLD","BLOCK","QUARANTINE","REPAIR_REQUIRED","CLEAR_WITH_CEILING"]},"claims":{"type":"array","items":{"type":"object","required":["id","claim","source","support","evidence_refs"],"properties":{"id":{"type":"string"},"claim":{"type":"string"},"review":{"type":"object"},"source":{"type":"string"},"support":{"enum":["SUPPORTED","UNSUPPORTED","CONTRADICTED","UNVERIFIED"]},"evidence_refs":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"hold_reason":{"type":"object"},"claim_ceiling":{"type":"string"},"contradictions":{"type":"array","items":{"type":"object","required":["id","claim_id","reason","evidence_refs"],"properties":{"id":{"type":"string"},"reason":{"type":"string"},"claim_id":{"type":"string"},"evidence_refs":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"missing_evidence":{"type":"array","items":{"type":"string"}},"evidence_coverage":{"type":"array","items":{"type":"object","required":["item_id","status","available_characters","inspected_characters","reasons"],"properties":{"status":{"enum":["INSPECTED","PARTIAL","OMITTED"]},"item_id":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"byte_inspection":{"enum":["INSPECTED","OMITTED"],"description":"Source bytes inspected; this does not establish semantic interpretation of every field."},"semantic_fields":{"type":"array","items":{"type":"object","required":["ref","source_location","subject","context","field","value","semantic_status","reason","relevant_to_claim"],"properties":{"ref":{"type":"string"},"field":{"type":"string"},"value":{},"reason":{"type":["string","null"]},"context":{"type":"object","additionalProperties":{"type":"string"}},"subject":{"type":"string"},"semantic_status":{"enum":["INTERPRETED","UNINTERPRETED"]},"source_location":{"type":"object","properties":{"line":{"type":["integer","null"]},"json_pointer":{"type":"string"}}},"relevant_to_claim":{"type":"boolean"}}}},"available_characters":{"type":"integer","minimum":0},"inspected_characters":{"type":"integer","minimum":0}}}},"missing_evidence_details":{"type":"array","items":{"type":"object","required":["scope","family","requirement"],"properties":{"scope":{"enum":["CLAIM","CASE"]},"family":{"type":"string"},"claim_id":{"type":"string"},"requirement":{"type":"string"}},"additionalProperties":false}}},"additionalProperties":false},"operation":{"enum":["diagnose","repair","verify","repair-bundle"]},"input_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"request_id":{"type":"string","format":"uuid","description":"Determination UUID, identical to receipt.case_id and receipt.run_id. Use this UUID as receipt_id in GET /api/v1/receipts/{receipt_id}. Error-envelope request_id is a separate HTTP trace; use its receipt_id when present."},"verification":{"type":"object","required":["verified","scope","external_execution_verified"],"properties":{"scope":{"type":"string"},"verified":{"type":"boolean"},"external_execution_verified":{"const":false}},"additionalProperties":false},"execution_state":{"type":"object","properties":{"notes":{"type":"string"},"action_details":{"type":"array","items":{"type":"object"}},"claimed_execution":{"enum":["ASSERTED","NOT_ASSERTED"]},"provable_execution":{"enum":["NOT_PROVEN","PARTIALLY_PROVEN"]},"action_classification":{"type":"array","items":{"enum":["PERMISSION","APPROVAL","INTENT","REQUESTED_ACTION","QUEUED_ACTION","ATTEMPTED_ACTION","FAILED_ACTION","NONEXECUTION","REVERSED_ACTION","CLAIMED_COMPLETED_ACTION"]}}}},"next_safe_action":{"type":"object","required":["action","reason"],"properties":{"action":{"type":"string"},"reason":{"type":"string"}},"additionalProperties":false},"evidence_provenance":{"type":"array","items":{"type":"object","required":["id","item_id","sha256","source_label","trust"],"properties":{"id":{"type":"string"},"trust":{"const":"CALLER_SUPPLIED_NOT_AUTHENTICATED_SOURCE"},"sha256":{"type":"string"},"item_id":{"type":"string"},"source_label":{"type":"string"}}}}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.15","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.15/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.15","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.15","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7Kl9a05makifx6o_zsQNH","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.15","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates a candidate output against a schema and evidence set, resolves contradictions, and returns a bounded repair plan if issues are found.","exampleAgentPrompt":"I need you to diagnose this candidate output against the following schema and evidence array — check for unsupported claims or contradictions, and if repairs are needed give me a bounded repair plan with the proposed corrected output.","exampleUseCases":[{"title":"Hallucination check for agent-generated answer","prompt":"I have an AI-generated answer to a customer question and a set of source documents as evidence. Can you run it through FAHCE to diagnose whether any claims in the answer are contradicted or unsupported by the sources, and if so give me a repair plan?"},{"title":"Validate RAG pipeline output before delivery","prompt":"Before I send this RAG-generated response to the user, I want to verify it against the retrieved passages. Use FAHCE to diagnose any contradictions and tell me the bounded steps needed to fix it, along with a proposed corrected output."},{"title":"Evidence-grounding audit for structured report","prompt":"Here's a structured report my agent produced and a JSON schema it should conform to — plus the evidence chunks it was based on. Run a FAHCE diagnosis to flag any schema violations or unsupported claims, and return a repair plan if anything needs fixing."}],"resultDescription":"Returns a structured FAHCE_MACHINE_RESPONSE_V1 object containing: a diagnosis of the candidate output against the evidence, a repair object with a bounded step-by-step plan and a proposed corrected output (if repair is needed), a billing determination with billable status and free-retry eligibility, a cryptographic receipt, and a next_safe_action recommendation. The repair is proposed but not automatically executed.","failureModes":["Missing required fields (schema, evidence, candidate_output) returns a validation error","Evidence array is empty or malformed — diagnosis may be indeterminate","Candidate output is too long or malformed — may result in DETERMINATION_NOT_PRODUCED billing status","Payment not received or x402 flow fails — endpoint returns 402 before processing","Contradictions cannot be resolved with supplied evidence — repair plan may be empty or flagged as not required","Idempotency key collision with different inputs — may return cached prior result"],"whenToPreferThis":"Choose FAHCE Diagnose when you need a structured, bounded, evidence-grounded verification of a candidate AI output — especially when you need not just a pass/fail verdict but a concrete, step-by-step repair plan and a proposed corrected output. Prefer this over generic LLM self-critique when you need a machine-readable, schema-validated response with billing receipts and cryptographic traceability, or when operating in a pipeline that requires a formal next_safe_action signal before proceeding.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-15T12:32:44.156Z","isFirstParty":false,"canonicalSlug":"fahce-diagnose-claim-evidence-verification-with-repair-plan-a3d391cb"}