Commit Graph

54 Commits

Author SHA1 Message Date
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-oai
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
kevin zhao
1743981ee5 evaluation -> check 2025-11-13 22:07:41 -05:00
kevin zhao
0e6d965f65 updating default.policy with better not_match (or, if it is too evident, removing not_match entirely) 2025-11-13 22:07:41 -05:00
kevin zhao
b323a9248d updating basic.rs to have a less obvious not match 2025-11-13 22:07:41 -05:00
kevin zhao
7681b325fe basic.rs: using expect tests 2025-11-13 22:07:41 -05:00
kevin zhao
2217cb05ee fix lint 2025-11-13 22:07:41 -05:00
kevin zhao
c086fe35a5 adding is_match to Evaluation 2025-11-13 22:07:41 -05:00
kevin zhao
755331425e refactor: implementing rule traits, rulematch enum 2025-11-13 22:07:41 -05:00
kevin zhao
4ca1834eac update docstring 2025-11-13 22:07:41 -05:00
kevin zhao
8b4283e4ad improve phrasing 2025-11-13 22:07:41 -05:00
kevin zhao
58acf0b833 adding docstrings for PrefixPattern and PatternToken 2025-11-13 22:07:40 -05:00
kevin zhao
8834e4bbdc helper function to get PolicyBuilder + only getting one builder in prefix_rule 2025-11-13 22:07:40 -05:00
kevin zhao
8775a99e3d fallback instead of panicking 2025-11-13 22:07:40 -05:00
kevin zhao
00ff42d594 using shlex::try_join instead of " ".join() 2025-11-13 22:07:40 -05:00
kevin zhao
ff09321eb1 updated error messaging to indicate type 2025-11-13 22:07:40 -05:00
kevin zhao
a67521926a fmt 2025-11-13 22:07:40 -05:00
kevin zhao
17bb82de77 using .iter() instead of mut 2025-11-13 22:07:40 -05:00
kevin zhao
b03c3c3d1f more early return lines 2025-11-13 22:07:40 -05:00
kevin zhao
a2890e2ca7 adding a line after early return block 2025-11-13 22:07:39 -05:00
kevin zhao
230cb2e3e2 best -> strictest 2025-11-13 22:07:39 -05:00
kevin zhao
7737444356 clippy 2025-11-13 22:07:39 -05:00
kevin zhao
90411d6e90 [parser.rs] match token vector on length 2025-11-13 22:07:39 -05:00
kevin zhao
5fd2172f9f update lints 2025-11-13 22:07:39 -05:00
zhao-oai
1b09f32cd5 Update codex-rs/execpolicy2/src/parser.rs
Co-authored-by: Michael Bolin <mbolin@openai.com>
2025-11-13 22:07:39 -05:00
kevin zhao
31736f2c20 remove license 2025-11-13 22:07:39 -05:00
kevin zhao
b405a8c812 refactor parse_pattern to use iterator chain 2025-11-13 22:07:39 -05:00
kevin zhao
bc375db0ab using parking_lot mutex + AtomicU64 for auto id 2025-11-13 22:07:38 -05:00
kevin zhao
73cbf5a83e add docstrings to decision struct 2025-11-13 22:07:38 -05:00
kevin zhao
072f5c28fc using clap for execpolicy v2 cli 2025-11-13 22:07:38 -05:00
kevin zhao
2952c14719 implementing PartialOrd for Decision instead of defining custom is_stricter_than func 2025-11-13 22:07:38 -05:00
kevin zhao
270abdc0c4 use camelCase in Decision' 2025-11-13 22:07:38 -05:00
kevin zhao
aa15efd7a3 update readme 2025-11-13 22:07:38 -05:00
kevin zhao
ca9e61497d README 2025-11-13 22:07:38 -05:00
kevin zhao
687a8c38ff introduce variant typing to policy result 2025-11-13 22:07:38 -05:00
kevin zhao
0bac9939af better default policy + lint 2025-11-13 22:07:38 -05:00
kevin zhao
bf716081fc clean up test 2025-11-13 22:07:38 -05:00
kevin zhao
55e49a8016 remove extraneous test 2025-11-13 22:07:37 -05:00
kevin zhao
64e786caad simplify 2025-11-13 22:07:37 -05:00
kevin zhao
9aea52efb1 simplify logic 2025-11-13 22:07:37 -05:00
kevin zhao
7e79c4dc5b refactor rules so no more cartesian product 2025-11-13 22:07:37 -05:00