{"record":{"id":"a4882f49bce747d1","repo":"Hmbown/CodeWhale","slug":"permission-posture-never-is-not-part-of-the-runt","errorCode":null,"errorMessage":"permission posture 'never' is not part of the Runtime product contract","messagePattern":"permission posture 'never' is not part of the Runtime product contract","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_policy.rs","lineNumber":80,"sourceCode":"    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()\n    }\n\n    #[must_use]\n    pub(crate) fn permission_wire(self) -> &'static str {\n        approval_wire(self.permission)\n    }\n\n    #[must_use]","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/runtime_policy.rs#L62-L98","documentation":"The Runtime policy parser rejects `ApprovalMode::Never` explicitly: the 'never' permission posture is not part of the Runtime product contract, so a request asking for it fails at parse time in `from_request`. The runtime only supports Suggest, Bypass (via legacy yolo/auto-approve aliases), and the explicitly parsed modes.","triggerScenarios":"Constructing runtime policy from a request whose `permission` field is `never`, or whose config resolves to the Never approval mode.","commonSituations":"Porting a desktop/CLI config that permits `permission = \"never\"` into the Runtime; a stale settings file still carrying the removed posture.","solutions":["Change the permission posture to a supported value (e.g. `suggest` or `bypass`).","Remove the legacy `yolo`/auto-approve flag if the intent was never-ask, and pick the supported equivalent.","Migrate the stale config file to the Runtime-supported schema."],"exampleFix":"// before\npermission = \"never\"\n// after\npermission = \"suggest\"","handlingStrategy":"validation","validationCode":"const SUPPORTED_POSTURES: [&str; 2] = [\"suggest\", \"bypass\"];\nif !SUPPORTED_POSTURES.contains(&permission.as_str()) { return Err(format!(\"unsupported permission posture: {permission}\")); }","typeGuard":null,"tryCatchPattern":"match RuntimePolicy::from_request(&req) { Err(e) if e.contains(\"never\") => { eprintln!(\"{e}; falling back to 'suggest'\"); RuntimePolicy::suggest() }, Err(e) => return Err(e), Ok(p) => use(p) }","preventionTips":["Validate permission config against the runtime's supported values at startup","Do not copy desktop/CLI approval settings into runtime config unchanged","Remove legacy 'never'/'yolo' entries when migrating config files"],"tags":["config","policy","approval-mode"],"backgroundTag":"unsupported-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"}