[codex] reduce module visibility (#16978)

## Summary
- reduce public module visibility across Rust crates, preferring private
or crate-private modules with explicit crate-root public exports
- update external call sites and tests to use the intended public crate
APIs instead of reaching through module trees
- add the module visibility guideline to AGENTS.md

## Validation
- `cargo check --workspace --all-targets --message-format=short` passed
before the final fix/format pass
- `just fix` completed successfully
- `just fmt` completed successfully
- `git diff --check` passed
This commit is contained in:
pakrym-oai authored and GitHub committed 2026-04-07 08:03:35 -07:00
1 parent 89f1a44afa
commit 413c1e1fdf
129 files changed
+695 -496

No files matched your search

+24 -9
View File
@@ -1,17 +1,26 @@
use crate::config::Config;
pub use codex_rollout::ARCHIVED_SESSIONS_SUBDIR;
pub use codex_rollout::Cursor;
pub use codex_rollout::EventPersistenceMode;
pub use codex_rollout::INTERACTIVE_SESSION_SOURCES;
pub use codex_rollout::RolloutRecorder;
pub use codex_rollout::RolloutRecorderParams;
pub use codex_rollout::SESSIONS_SUBDIR;
pub use codex_rollout::SessionMeta;
pub use codex_rollout::ThreadItem;
pub use codex_rollout::ThreadSortKey;
pub use codex_rollout::ThreadsPage;
pub use codex_rollout::append_thread_name;
pub use codex_rollout::find_archived_thread_path_by_id_str;
#[deprecated(note = "use find_thread_path_by_id_str")]
pub use codex_rollout::find_conversation_path_by_id_str;
pub use codex_rollout::find_thread_name_by_id;
pub use codex_rollout::find_thread_names_by_ids;
pub use codex_rollout::find_thread_path_by_id_str;
pub use codex_rollout::find_thread_path_by_name_str;
pub use codex_rollout::parse_cursor;
pub use codex_rollout::read_head_for_summary;
pub use codex_rollout::read_session_meta_line;
pub use codex_rollout::rollout_date_parts;
impl codex_rollout::RolloutConfigView for Config {
@@ -36,24 +45,30 @@ impl codex_rollout::RolloutConfigView for Config {
}
}
pub mod list {
pub use codex_rollout::list::*;
pub(crate) mod list {
pub use codex_rollout::ThreadListConfig;
pub use codex_rollout::ThreadListLayout;
pub use codex_rollout::ThreadSortKey;
pub use codex_rollout::find_thread_path_by_id_str;
pub use codex_rollout::get_threads_in_root;
}
pub(crate) mod metadata {
pub(crate) use codex_rollout::metadata::builder_from_items;
pub(crate) use codex_rollout::builder_from_items;
}
pub mod policy {
pub use codex_rollout::policy::*;
pub(crate) mod policy {
pub use codex_rollout::EventPersistenceMode;
pub use codex_rollout::should_persist_response_item_for_memories;
}
pub mod recorder {
pub use codex_rollout::recorder::*;
pub(crate) mod recorder {
pub use codex_rollout::RolloutRecorder;
}
pub mod session_index {
pub use codex_rollout::session_index::*;
pub(crate) mod session_index {
pub use codex_rollout::append_thread_name;
pub use codex_rollout::find_thread_name_by_id;
}
pub(crate) use crate::session_rollout_init_error::map_session_init_error;