Commit Graph
2049 Commits
Author SHA1 Message Date
kevin zhao 40b8a6e311 fmt 2025-11-13 22:14:17 -05:00
kevin zhao f665b1ce08 further simplifying error cases 2025-11-13 22:14:17 -05:00
kevin zhao 84315d8234 simplify load policy 2025-11-13 22:14:17 -05:00
kevin zhao c15e1b432b remove caching of policy 2025-11-13 22:14:17 -05:00
kevin zhao 24a9b7ba28 first pass at integrating execpolicy2 into codex 2025-11-13 22:14:13 -05:00
kevin zhao bdb5210721 cleanup 2025-11-13 22:08:06 -05:00
kevin zhao cd4df53316 parser state 2025-11-13 22:08:06 -05:00
kevin zhao 43db77a97b feat: implementing parse_many 2025-11-13 22:08:06 -05:00
kevin zhao 8cbb5378f3 check_multiple 2025-11-13 22:08:06 -05:00
zhao-oai ce220f0be2 Use camelCase for policy responses 2025-11-13 22:07:46 -05:00
kevin zhao 7697a2bb81 update readme 2025-11-13 22:07:46 -05:00
kevin zhao 762881b60c remove use of parking lot 2025-11-13 22:07:46 -05:00
kevin zhao 2e14f258c3 now keeping PolicyBuilder in a RefCell, allowing add_rule to take &mut self w/o Mutex 2025-11-13 22:07:46 -05:00
kevin zhao c4fea9d99f moving default codexpolicy to example 2025-11-13 22:07:45 -05:00
kevin zhao ae17058704 directly passing starlark error 2025-11-13 22:07:45 -05:00
kevin zhao 820e26f9d2 better naming in Policy.parse() 2025-11-13 22:07:45 -05:00
kevin zhao 175e3530bc move validation logic to rule.rs 2025-11-13 22:07:45 -05:00
kevin zhao c7993e0471 conslidate validate_match_examples and validate_not_match_examples 2025-11-13 22:07:45 -05:00
kevin zhao dc76907771 refactor: rule traits 2025-11-13 22:07:45 -05:00
kevin zhao f7fa9c5c0f using expect to provide more context if unwraps fail 2025-11-13 22:07:45 -05:00
kevin zhao 556510f378 avoid matching on as_slice() when you can use is_empty() 2025-11-13 22:07:45 -05:00
kevin zhao b038bd71f9 sort deps 2025-11-13 22:07:45 -05:00
kevin zhao ffdebc2937 again, more descriptive error messages 2025-11-13 22:07:44 -05:00
kevin zhao 9b3041ffe5 print out actual type in error message 2025-11-13 22:07:44 -05:00
kevin zhao 80c67243df cleanup 2025-11-13 22:07:44 -05:00
kevin zhao 83cfac9442 delete more display() 2025-11-13 22:07:44 -05:00
kevin zhao 9bf0c066d9 more cleanup 2025-11-13 22:07:44 -05:00
kevin zhao 615a027a18 further cleanup 2025-11-13 22:07:44 -05:00
kevin zhao ceea9075ea docstrings and other cleanup 2025-11-13 22:07:44 -05:00
kevin zhao 3162a77e2a remove fragile test 2025-11-13 22:07:44 -05:00
kevin zhao 842d6adb59 refactor to test positive matches 2025-11-13 22:07:44 -05:00
kevin zhao e51178cb27 consolidate new() and parse() in PolicyParser 2025-11-13 22:07:44 -05:00
kevin zhao ff970d57fb using PathBufs in main.rs 2025-11-13 22:07:44 -05:00
kevin zhao a4cd582b49 removing decription() 2025-11-13 22:07:43 -05:00
kevin zhao ab546c69ed removing expect-test as dependency 2025-11-13 22:07:43 -05:00
kevin zhao ad55ca629c refactor: using deep assertions instead of expect tests; removed Display impls 2025-11-13 22:07:43 -05:00
kevin zhao 8a98b7afd3 reordering so that impl comes before def 2025-11-13 22:07:43 -05:00
kevin zhao 7b5916cb4b Share prefix pattern data in execpolicy2 instead of cloning 2025-11-13 22:07:43 -05:00
kevin zhao 0f51ed0baa removing len() and is_empty() 2025-11-13 22:07:43 -05:00
kevin zhao 00757b43aa remove default policy 2025-11-13 22:07:43 -05:00
kevin zhao b751be9156 cleanup and prettify 2025-11-13 22:07:43 -05:00
kevin zhao 4d0fffd387 moving up expect test dependency 2025-11-13 22:07:43 -05:00
kevin zhao fd29c3f0a1 removing rg and sed from default codexpolicy 2025-11-13 22:07:43 -05:00
kevin zhao 8c909a0084 making things more functional 2025-11-13 22:07:43 -05:00
kevin zhao 2f8d3f6b42 code cleanup 2025-11-13 22:07:42 -05:00
kevin zhao 17f86a6c86 clippy 2025-11-13 22:07:42 -05:00
kevin zhao d3aafb93f3 feat: tokenizing whole strings in match and not_match 2025-11-13 22:07:42 -05:00
zhao-oaiandMichael Bolin 814c6506d2 execpolicy2 now inherits workspace crate version
Co-authored-by: Michael Bolin <mbolin@openai.com>
2025-11-13 22:07:42 -05:00
kevin zhao 94e8d4e0ae .policy -> .codexpolicy 2025-11-13 22:07:42 -05:00
kevin zhao 66dca34c1c using camelCase 2025-11-13 22:07:42 -05:00