{"record":{"id":"511047dbb5a50cd0","repo":"Hmbown/CodeWhale","slug":"unsupported-permission-posture-value-expected","errorCode":null,"errorMessage":"unsupported permission posture {value:?}; expected ask, auto-review, or full-access","messagePattern":"unsupported permission posture (.+?); expected ask, auto-review, or full-access","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_policy.rs","lineNumber":72,"sourceCode":"        Self {\n            mode: parsed_mode,\n            permission,\n        }\n    }\n\n    /// Validate and normalize a new Runtime request. Legacy aliases are\n    /// accepted as one-way inputs, but only current values are persisted.\n    pub(crate) fn from_request(\n        mode: &str,\n        permission_posture: Option<&str>,\n        auto_approve: Option<bool>,\n    ) -> Result<Self> {\n        let parsed_mode = parse_runtime_mode(mode).ok_or_else(|| {\n            anyhow::anyhow!(\"unsupported Runtime mode {mode:?}; expected plan, act, or operate\")\n        })?;\n        let permission = match permission_posture {\n            Some(value) => ApprovalMode::from_config_value(value).ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"unsupported permission posture {value:?}; expected ask, auto-review, or full-access\"\n                )\n            })?,\n            None if legacy_yolo_alias(mode) || auto_approve.unwrap_or(false) => ApprovalMode::Bypass,\n            None => ApprovalMode::Suggest,\n        };\n        if permission == ApprovalMode::Never {\n            bail!(\"permission posture 'never' is not part of the Runtime product contract\");\n        }\n        Ok(Self {\n            mode: parsed_mode,\n            permission,\n        })\n    }\n\n    #[must_use]\n    pub(crate) fn mode_setting(self) -> &'static str {\n        self.mode.as_setting()","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/runtime_policy.rs#L54-L90","documentation":"from_request validates the optional permission_posture string via ApprovalMode::from_config_value; an unrecognized value raises this error listing the accepted postures (ask, auto-review, full-access). It only fires when a posture string was supplied — the None case falls back to legacy YOLO alias or Suggest instead of erroring.","triggerScenarios":"Calling RuntimePolicy::from_request with permission_posture = Some(value) where value does not map to an ApprovalMode, e.g. \"auto\" or \"yolo\" instead of the three supported postures.","commonSituations":"Clients upgrading from an older permission vocabulary, hand-written request payloads guessing at posture names, or config files exporting posture values that no longer match the ApprovalMode config keys.","solutions":["Send permission_posture as exactly one of: ask, auto-review, full-access.","Omit permission_posture entirely to use the legacy alias/auto_approve/Suggest defaults.","Check ApprovalMode::from_config_value for the accepted config spellings.","Omit permission_posture entirely to use the legacy alias/auto_approve/Suggest defaults."],"exampleFix":"// before\n{\"mode\": \"act\", \"permission_posture\": \"auto\"}\n\n// after\n{\"mode\": \"act\", \"permission_posture\": \"auto-review\"}","handlingStrategy":"validation","validationCode":"const POSTURES: [&str; 3] = [\"ask\", \"auto-review\", \"full-access\"];\nfn valid_posture(p: &str) -> bool {\n    POSTURES.contains(&p)\n}","typeGuard":"fn as_permission_posture(s: &str) -> Option<&'static str> {\n    match s {\n        \"ask\" => Some(\"ask\"),\n        \"auto-review\" => Some(\"auto-review\"),\n        \"full-access\" => Some(\"full-access\"),\n        _ => None,\n    }\n}","tryCatchPattern":"match err.to_string().contains(\"unsupported permission posture\") {\n    true => eprintln!(\"use posture: ask | auto-review | full-access, or omit it\"),\n    false => propagate(err),\n}","preventionTips":["Omit permission_posture when relying on legacy aliases/auto_approve","Keep the posture vocabulary in one shared constant between client and config","Reject unknown posture strings at request construction time"],"tags":["runtime-api","validation","enum"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}