mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
## What changed Represent collected fragments with `RetainedInstructionItem`, preserving their content, semantic kind, and source. Assign retention policy when composing context: user instructions, host notices, and framing remain required, while assistant context remains optional at commentary priority. GitOrigin-RevId: 0080f3abd0d763bd402e78da0ac1b0fa0cd7678d
34 lines
1.4 KiB
Rust
34 lines
1.4 KiB
Rust
//! Section identities survive consumer-specific transcript selection and rendering.
|
|
|
|
use crate::ConversationTranscriptEntry;
|
|
use crate::PlannedAction;
|
|
use crate::PreviousReviews;
|
|
use crate::RenderedNodeReplEvidence;
|
|
use crate::RetainedInstructionItem;
|
|
use crate::TranscriptImages;
|
|
use crate::TrustedSkills;
|
|
use crate::TrustedTool;
|
|
|
|
/// Ordered evidence with a stable section identity and source-specific content.
|
|
///
|
|
/// Variants preserve provenance: transcript entries carry their original roles,
|
|
/// root messages remain line-role-labeled, and answers are host-verified fragments.
|
|
/// Conversation, authorization and action evidence retain user-role delivery.
|
|
/// Host-attested reviews and tool identities use separate developer messages.
|
|
/// Review actions/rationales and remote tool descriptions remain untrusted.
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
pub enum ContextSection<T = ConversationTranscriptEntry> {
|
|
ConversationTranscript { items: Vec<T> },
|
|
RootConversation { items: Vec<String> },
|
|
TrustedUserAnswers { items: Vec<String> },
|
|
RetainedUserInstructions { items: Vec<RetainedInstructionItem> },
|
|
SenderUserMessages { items: Vec<String> },
|
|
PlannedAction(PlannedAction),
|
|
PreviousReviews(PreviousReviews),
|
|
TrustedTool(TrustedTool),
|
|
TrustedSkills(TrustedSkills),
|
|
TranscriptImages(TranscriptImages),
|
|
NodeReplEvidence(RenderedNodeReplEvidence),
|
|
PermissionContext { items: Vec<String> },
|
|
}
|