{"record":{"id":"a044637643ef073c","repo":"zeroclaw-labs/zeroclaw","slug":"cloud-ops-cost-threshold-monthly-usd-must-be-non-n","errorCode":null,"errorMessage":"cloud_ops.cost_threshold_monthly_usd must be non-negative, got {}","messagePattern":"cloud_ops\\.cost_threshold_monthly_usd must be non-negative, got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-config/src/schema.rs","lineNumber":18594,"sourceCode":"            }\n            for (i, cloud) in self.supported_clouds.iter().enumerate() {\n                if cloud.trim().is_empty() {\n                    validation_bail!(\n                        RequiredFieldEmpty,\n                        format!(\"cloud_ops.supported_clouds[{i}]\"),\n                        \"cloud_ops.supported_clouds[{i}] must not be empty\"\n                    );\n                }\n            }\n            if !self.supported_clouds.contains(&self.default_cloud) {\n                anyhow::bail!(\n                    \"cloud_ops.default_cloud '{}' is not in cloud_ops.supported_clouds {:?}\",\n                    self.default_cloud,\n                    self.supported_clouds\n                );\n            }\n            if self.cost_threshold_monthly_usd < 0.0 {\n                anyhow::bail!(\n                    \"cloud_ops.cost_threshold_monthly_usd must be non-negative, got {}\",\n                    self.cost_threshold_monthly_usd\n                );\n            }\n            if self.iac_tools.is_empty() {\n                anyhow::bail!(\"cloud_ops.iac_tools must not be empty when cloud_ops is enabled\");\n            }\n        }\n        Ok(())\n    }\n}\n\nfn default_cloud_ops_cloud() -> String {\n    \"aws\".into()\n}\n\nfn default_cloud_ops_supported_clouds() -> Vec<String> {\n    vec![\"aws\".into(), \"azure\".into(), \"gcp\".into()]","sourceCodeStart":18576,"sourceCodeEnd":18612,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-config/src/schema.rs#L18576-L18612","documentation":"`cloud_ops.cost_threshold_monthly_usd` flags cost items above a monthly USD threshold (default 100.0). A negative threshold is meaningless as a flagging bound — everything would be flagged or the comparison inverted — so validation requires it to be non-negative when the module is enabled.","triggerScenarios":"`cost_threshold_monthly_usd = -1.0` (or any negative) in an enabled `[cloud_ops]` block; arithmetic that computes a discount and subtracts past zero; a sentinel like `-1` meaning 'unlimited' carried over from another tool's convention.","commonSituations":"Porting sentinel-value conventions from other systems where -1 disables a limit; spreadsheet-derived budgets that go negative after refunds/credits; typos on the minus key.","solutions":["Set a non-negative value, e.g. the default `100.0`.","If the intent was 'no threshold', use a very large positive value rather than a negative one.","Re-check the number's source if it is computed."],"exampleFix":"# before\ncost_threshold_monthly_usd = -1.0\n\n# after\ncost_threshold_monthly_usd = 100.0","handlingStrategy":"validation","validationCode":"anyhow::ensure!(\n    !cloud_ops.enabled || cloud_ops.cost_threshold_monthly_usd >= 0.0,\n    \"cost_threshold_monthly_usd must be non-negative\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a large positive value (or omit for 100.0) to mean 'high threshold'; never a negative sentinel.","Validate computed budgets before writing them into config.","Watch for spreadsheet negatives from credits/refunds."],"tags":["cloud-ops","config","numeric-range","zeroclaw"],"backgroundTag":"out-of-range-config-value","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}