Task · CXO-0029

Preserve source ordering and capture times for conversation content

Description

Conversation exports retain text but lose ordering evidence already present in the archive. The reducer splits input items and output items into separate typed slices without per-item ordering metadata. Agent Observability inputMessages explicitly emits every prompt before every tool result (generation.go:310-318), and Loki assigns one response-level timestamp to all output messages and calls (timestamps.go:29-43). Users reviewing an interleaved exchange cannot reliably establish which visible message or tool call came first.

In a targeted read of corpus/processed/2026-08-09T00.jsonl.gz (23,242 records), 29 input-message occurrences appeared after a tool-output item in the same input array. These include replayed history and are not a count of newly emitted ordering defects. Input array order and output frame timestamps/sequence are nevertheless available source evidence that the current Turn content types discard.

Scope is the observable conversation timeline. An archive capture timestamp is not the original authorship time of replayed history, and a tool-call frame timestamp is not proof of actual tool execution start.

Acceptance Criteria

Definition of Done

Implementation Plan

Wave 2: commit root-owned seams first; frozen owned lanes implement with synthetic tests; integrate, just check, one corpus confidence gate and CodeRabbit; one push; watchtower-only deploy observation and m7kni proof; reconcile acceptance by evidence layer.

Implementation Notes

Clean main e8e97fd directly descends from c567894 and equals origin/main. CI 33988760737 and release-please 33988761017 succeeded. D8 holds; traces and agento11y remain disabled.

Final Summary

Wave 2 delivered at aca5e5de0bcd4ba6f5fd72dfaa6caef3a6c7fb71. Synthetic reducer and sink tests verify exact ItemID-to-ordinal mapping, capture times, replay and supported role interleaving. Loki tie-break metadata and documented scoped query verified; disabled sink behavior source-level only. just check passed at that source SHA; CI 33993480890 success. Watchtower deployed that SHA healthy, restart count 0. Publish 33993481221 failed signing after successful manifest push; run-level publication completion remains open. The single D20 corpus gate was canceled (exit 143), so corpus confidence is not proven. Final tracker closeout is local under the one-push contract.

References

View the source file on GitHub