{"record":{"id":"33245167cfbb4ae1","repo":"openai/codex","slug":"expected-every-example-to-match-at-least-one-rule","errorCode":null,"errorMessage":"expected every example to match at least one rule. rules: {rules:?}; unmatched examples: {examples:?}","messagePattern":"expected every example to match at least one rule\\. rules: (.+?); unmatched examples: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"codex-rs/execpolicy/src/error.rs","lineNumber":34,"sourceCode":"}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\npub struct ErrorLocation {\n    pub path: String,\n    pub range: TextRange,\n}\n\n#[derive(Debug, Error)]\npub enum Error {\n    #[error(\"invalid decision: {0}\")]\n    InvalidDecision(String),\n    #[error(\"invalid pattern element: {0}\")]\n    InvalidPattern(String),\n    #[error(\"invalid example: {0}\")]\n    InvalidExample(String),\n    #[error(\"invalid rule: {0}\")]\n    InvalidRule(String),\n    #[error(\n        \"expected every example to match at least one rule. rules: {rules:?}; unmatched examples: \\\n         {examples:?}\"\n    )]\n    ExampleDidNotMatch {\n        rules: Vec<String>,\n        examples: Vec<String>,\n        location: Option<ErrorLocation>,\n    },\n    #[error(\"expected example to not match rule `{rule}`: {example}\")]\n    ExampleDidMatch {\n        rule: String,\n        example: String,\n        location: Option<ErrorLocation>,\n    },\n    #[error(\"starlark error: {0}\")]\n    Starlark(StarlarkError),\n}\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/execpolicy/src/error.rs#L16-L52","documentation":"Fired during policy self-testing: one or more examples in the policy did not match any of the declared rules, so the policy fails its own coverage check. The payload lists all rules and the unmatched examples.","triggerScenarios":"Thrown at codex-rs/execpolicy/src/error.rs:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add or broaden a rule so every listed example matches at least one rule","Fix typos in the unmatched example strings","Remove examples that are no longer relevant to the policy"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}