Description
The compacted record carries window_number and the previous window id, so a long session’s context lineage is reconstructable. ContextCompaction items are among the most expensive things that happen, at p50 62s and p95 167s, and are invisible today.
Acceptance Criteria
- #1 compacted and context_compacted produce compaction items with window lineage
- #2 ContextCompaction item durations are recorded
- #3 Context window id and window number reach the record fields
- #4 Replacement history is not emitted as content unless the prompt record type is enabled
Definition of Done
- #1 just check passes: fmt-check, lint, build, test-short, probe-ci, dashboard-check and docs-links all clean
Implementation Plan
Wave 1 lane 6: write focused tests first, implement Codex limits/agents/compaction only in the assigned files, and return any shared-helper requirement to root; root integrates and runs the final gate.
Final Summary
Codex compaction records carry typed duration, window id/number, lineage, and gated replacement history; tests passed.