Files
codex/codex-rs/state/src/model/mod.rs
T
ioanbudea-OAI ab541fb990 Encapsulate thread metadata construction (#60524)
## What changed

Move `ThreadMetadataBuilder` into its own module, make its fields private, and replace direct field assignments with fluent `with_*` methods. Initialize `updated_at` and `recency_at` from the creation time and default the approval mode to `OnRequest`.

Update `apply_rollout_items` to accept a boxed `ThreadMetadata` seed, keeping callers' async frames small while preserving existing database fields except for the seed rollout path. Add `build_thread_metadata` to use the state runtime's configured provider, and use `thread_id_from_rollout_path` directly for the doctor's filename fallback.

GitOrigin-RevId: a27e4c6b22832e902922dbdd60d7f5c11b4a1a83
2026-11-10 04:56:49 +00:00

61 lines
2.2 KiB
Rust

mod backfill_state;
mod graph;
mod log;
mod memories;
mod project;
mod queued_item;
mod rollout_migration_state;
mod thread_attachment;
mod thread_goal;
mod thread_metadata;
mod thread_metadata_builder;
pub use backfill_state::BackfillState;
pub use backfill_state::BackfillStatus;
pub use graph::DirectionalThreadSpawnEdgeStatus;
pub use log::LogEntry;
pub use log::LogQuery;
pub use log::LogRow;
pub use memories::Phase2JobClaimOutcome;
pub use memories::Stage1JobClaim;
pub use memories::Stage1JobClaimOutcome;
pub use memories::Stage1Output;
pub use memories::Stage1StartupClaimParams;
pub use project::CreatedProject;
pub use project::Project;
pub use project::ProjectRoot;
pub use project::ProjectSortKey;
pub use project::ProjectsPage;
pub use queued_item::QueuedUserSubmissionRecord;
pub use rollout_migration_state::RolloutMigrationCursor;
pub use rollout_migration_state::RolloutMigrationSkippedRollout;
pub use rollout_migration_state::RolloutMigrationState;
pub use thread_attachment::AddThreadAttachmentOutcome;
pub use thread_attachment::RemoveThreadAttachmentOutcome;
pub use thread_attachment::ThreadAttachment;
pub use thread_attachment::ThreadAttachmentArchiveFilter;
pub use thread_attachment::ThreadAttachmentOwner;
pub use thread_attachment::ThreadAttachmentOwnerPage;
pub use thread_attachment::ThreadAttachmentPage;
pub use thread_goal::ThreadGoal;
pub use thread_goal::ThreadGoalStatus;
pub use thread_metadata::Anchor;
pub use thread_metadata::BackfillStats;
pub use thread_metadata::ExtractionOutcome;
pub use thread_metadata::SortDirection;
pub use thread_metadata::SortKey;
pub use thread_metadata::ThreadMetadata;
pub use thread_metadata::ThreadRelationFilter;
pub use thread_metadata::ThreadSection;
pub use thread_metadata::ThreadSectionAppearance;
pub use thread_metadata::ThreadSectionsPage;
pub use thread_metadata::ThreadsPage;
pub use thread_metadata_builder::ThreadMetadataBuilder;
pub(crate) use thread_goal::ThreadGoalRow;
pub(crate) use thread_metadata::ThreadRow;
pub(crate) use thread_metadata::anchor_from_item;
pub(crate) use thread_metadata::datetime_to_epoch_millis;
pub(crate) use thread_metadata::datetime_to_epoch_seconds;
pub(crate) use thread_metadata::epoch_millis_to_datetime;