(snapshot memcontract.TranscriptSnapshot)
| 704 | } |
| 705 | |
| 706 | func renderMemoryTranscript(snapshot memcontract.TranscriptSnapshot) string { |
| 707 | var buf strings.Builder |
| 708 | for _, message := range snapshot.Messages { |
| 709 | role := strings.TrimSpace(message.Role) |
| 710 | if role == "" { |
| 711 | role = "unknown" |
| 712 | } |
| 713 | if _, err := fmt.Fprintf( |
| 714 | &buf, |
| 715 | "- sequence=%d role=%s at=%s\n%s\n", |
| 716 | message.Sequence, |
| 717 | role, |
| 718 | message.At.UTC().Format(time.RFC3339Nano), |
| 719 | strings.TrimSpace(message.Content), |
| 720 | ); err != nil { |
| 721 | return buf.String() |
| 722 | } |
| 723 | } |
| 724 | return buf.String() |
| 725 | } |
| 726 | |
| 727 | func memoryExtractorOverlay() string { |
| 728 | return strings.TrimSpace(` |
no test coverage detected