{"record":{"id":"462c54f54a0d7e75","repo":"xai-org/x-algorithm","slug":"ais-action-name-raised-deterministic-class-d","errorCode":null,"errorMessage":"AIS {action_name} raised deterministic {class}: {detail}","messagePattern":"AIS (.+?) raised deterministic (.+?): (.+?)","errorType":"error_code","errorClass":"PermanentAisFailure","httpStatus":null,"severity":"error","filePath":"abuse-enforcement-service/service-lib/src/service.rs","lineNumber":941,"sourceCode":"\npub fn classify_ais_failure(action_name: &str, message: &str, resp: &Value) -> anyhow::Error {\n    if resp.pointer(\"/success/outcome/failure\").is_some()\n        || resp.pointer(\"/outcome/failure\").is_some()\n    {\n        return anyhow::Error::new(PermanentAisFailure(format!(\n            \"AIS rejected {action_name}: {message}\"\n        )));\n    }\n    if let Some(class) = resp\n        .pointer(\"/aisException/underlyingDetails/exceptionClass\")\n        .and_then(Value::as_str)\n        && DETERMINISTIC_AIS_EXCEPTION_CLASSES.contains(&class)\n    {\n        let detail = resp\n            .pointer(\"/aisException/underlyingDetails/message\")\n            .and_then(Value::as_str)\n            .unwrap_or(\"\");\n        return anyhow::Error::new(PermanentAisFailure(format!(\n            \"AIS {action_name} raised deterministic {class}: {detail}\"\n        )));\n    }\n    anyhow::anyhow!(\"AIS failure on {action_name}: {message}\")\n}\n\npub fn parse_ais_response(user_id: i64, resp: &Value) -> UserActionResult {\n    let outcome_success = resp\n        .pointer(\"/success/outcome/success\")\n        .or_else(|| resp.pointer(\"/outcome/success\"));\n    if let Some(action_id) = outcome_success\n        .and_then(|s| s.get(\"actionId\"))\n        .and_then(|id| id.as_str())\n    {\n        UserActionResult {\n            user_id,\n            success: true,\n            message: format!(\"actionId={action_id}\"),","sourceCodeStart":923,"sourceCodeEnd":959,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/abuse-enforcement-service/service-lib/src/service.rs#L923-L959","documentation":"AIS raised an exception whose class is in DETERMINISTIC_AIS_EXCEPTION_CLASSES, meaning the same request will always fail the same way. It is wrapped in PermanentAisFailure so callers do not waste retries on it.","triggerScenarios":"AIS response contains /aisException/underlyingDetails/exceptionClass matching a known deterministic class (e.g. validation or invalid-argument style exceptions), with the detail taken from underlyingDetails/message.","commonSituations":"Schema or enum value mismatch in the enforcement request; AIS version change introducing new deterministic exception classes; bad input data (empty strings, out-of-range params).","solutions":["Read the {class} and {detail} to identify the deterministic cause","Correct the request payload that triggers the exception","If the class is legitimately transient-looking, verify it belongs in DETERMINISTIC_AIS_EXCEPTION_CLASSES and file an issue if misclassified","Suppress/requeue the affected item rather than retrying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Downcast the anyhow error to PermanentAisFailure; route to a dead-letter queue instead of retry loops.","preventionTips":["Validate request fields against deterministic exception classes observed for your action type","Add unit tests for known deterministic classes to catch regressions"],"tags":["abuse-enforcement","ais","deterministic-exception"],"backgroundTag":"api-request-rejected-permanent","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}