Files
codex/codex-rs/execpolicy-rules/src/lib.rs
T
Charlie Marsh 5bdb5e8b3c Split in-memory execution policy rules into a separate crate (#62615)
## Why

Configuration, protocol, and prompt code use in-memory policies and
previously pulled in the Starlark parser through `codex-execpolicy`.

## What changed

Move policy construction, rule validation, and evaluation into
`codex-execpolicy-rules` and use it directly from those crates. Keep
Starlark policy loading and file updates in `codex-execpolicy`, which
re-exports the shared rule types and wraps rule validation errors while
preserving their source locations.

GitOrigin-RevId: 5bc70d3cd387b43a3ad1fcc56af96ad169ac8b13
2026-11-19 22:32:56 +00:00

30 lines
793 B
Rust

//! Construction, validation, and evaluation of in-memory execution policies.
//!
//! Use `codex-execpolicy` to load rules from a Starlark policy file.
mod decision;
mod error;
mod executable_name;
mod policy;
pub mod rule;
pub use decision::Decision;
pub use error::Error;
pub use error::ErrorLocation;
pub use error::Result;
pub use error::TextPosition;
pub use error::TextRange;
pub use executable_name::executable_lookup_key;
pub use executable_name::executable_path_lookup_key;
pub use policy::Evaluation;
pub use policy::MatchOptions;
pub use policy::Policy;
pub use policy::RequirementsExecPolicy;
pub use rule::NetworkRuleProtocol;
pub use rule::PatternToken;
pub use rule::PrefixPattern;
pub use rule::PrefixRule;
pub use rule::Rule;
pub use rule::RuleMatch;
pub use rule::RuleRef;