pub struct ContextPacket {
pub content: String,
pub included_ids: Vec<String>,
pub omitted_ids: Vec<String>,
pub raw_estimated_tokens: u32,
pub selected_estimated_tokens: u32,
pub omitted_estimated_tokens: u32,
pub requires_upstream: bool,
pub deduplicated_lines: u32,
pub deduplicated_estimated_tokens: u32,
pub token_breakdown: Option<TokenBreakdown>,
pub packet_id: Option<String>,
pub snapshot_id: Option<String>,
}Fields§
§content: String§included_ids: Vec<String>§omitted_ids: Vec<String>§raw_estimated_tokens: u32Estimated tokens of every candidate item, selected or not.
selected_estimated_tokens: u32Estimated tokens actually in ContextPacket::content.
omitted_estimated_tokens: u32Estimated tokens of the candidates left out, i.e.
raw_estimated_tokens - selected_estimated_tokens.
This is not a measure of tokens saved. It counts evidence that was assembled and then dropped to fit the budget, which says nothing about what a consumer would otherwise have sent. It is zero whenever the budget fits everything, and it grows as the budget shrinks. Treat it as an omission volume; to claim a saving you need a measured baseline of what the alternative actually cost.
requires_upstream: boolTrue when any candidate was unverified or contradictory, so the packet must not be treated as settled.
deduplicated_lines: u32Lines removed because a higher-priority item already carried them.
Unlike ContextPacket::omitted_estimated_tokens this is a
saving: the content still reaches the consumer, once instead of twice.
deduplicated_estimated_tokens: u32Estimated tokens those repeated lines would have cost.
token_breakdown: Option<TokenBreakdown>Split accounting for the counter that produced the numbers above.
packet_id: Option<String>Handle for the delivered body, selection, budget, and snapshot.
snapshot_id: Option<String>Tree the packet was compiled against, e.g. git:<commit>+dirty:<digest>.