feat(rig-ytn.2): Dolt-backed Workflow Timeline Export#72
feat(rig-ytn.2): Dolt-backed Workflow Timeline Export#72thoreinstein merged 12 commits intorig-v1from
Conversation
…rying - Update cmd/timeline to reuse DatabaseManager and handle errors gracefully - Harden pkg/events/reader with SQL LIKE escaping and iterate error checks - Add robustness to pkg/events/database backfill (idempotency) - Refactor history/template for modular rendering - Expand test coverage for edge cases (idempotency, null metadata, missing commits)
…erminism - Initialize event logger ticket in Resume to ensure post-resume events are correctly tagged - Sort correlation IDs in generateDiffSummary for deterministic output ordering
Update removeExistingTimeline to detect and remove ## Workflow Checkpoint Diffs headers. This prevents duplicate or stale diff summaries from accumulating in ticket notes when the timeline is regenerated with --show-diffs.
…anup - Add TicketMetadataSetter interface to events package - Update merge engine to use interface-based tagging - Add TestResume_DoltTicketTagging to verify tagging on resume - Add TestRemoveExistingTimeline_OnlyDiffSection to verify diff section cleanup
There was a problem hiding this comment.
Pull request overview
Enhances the rig timeline command to produce a unified, chronological markdown timeline combining local shell command history with Dolt-backed workflow/system events, including optional checkpoint diff summaries and ticket-based event tagging.
Changes:
- Add ticket metadata tagging/backfill support to the Dolt event logger and wire it into workflow Run/Resume.
- Introduce unified timeline data types + markdown formatter to interleave commands and workflow events.
- Extend
rig timelineto query Dolt events, optionally render checkpoint diffs, and cleanly remove old timeline/diff sections from notes.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
cmd/timeline.go |
Builds unified entries from commands + Dolt events; adds --show-diffs; removes existing workflow timeline/diff sections; generates diff summaries. |
cmd/timeline_test.go |
Updates flag expectations and expands note-cleanup cases for workflow timeline + diff sections. |
pkg/history/types.go |
Adds unified timeline model (UnifiedEntry, EntryKind, simplified Event). |
pkg/history/template.go |
Refactors command formatting helpers and adds FormatUnifiedTimeline for mixed command/event output. |
pkg/history/template_test.go |
Adds coverage for unified timeline rendering and chronological ordering. |
pkg/workflow/merge.go |
Sets ticket on the event logger after gather; backfills metadata for earlier events; initializes ticket on resume. |
pkg/workflow/workflow_test.go |
Adds resume test ensuring ticket is set on the event logger before resuming steps. |
pkg/events/logger.go |
Adds TicketMetadataSetter, ticket storage with mutex, metadata JSON injection, and BackfillTicket forwarding. |
pkg/events/logger_test.go |
Adds integration tests verifying metadata ticket write and NULL metadata when no ticket is set. |
pkg/events/database.go |
Adds BackfillTicket helper to retro-tag events with ticket metadata. |
pkg/events/database_test.go |
Adds integration tests for backfill behavior and idempotency (no overwrite of existing metadata). |
pkg/events/reader.go |
Adds queries for events by ticket and Dolt diff entries for a workflow correlation ID. |
pkg/events/reader_test.go |
Adds integration tests for querying events by ticket and correlation diffs, including missing-commit behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Improve SQL LIKE escaping logic in reader - Use SliceStable for deterministic timeline sorting - Refine JSON_EXTRACT fallback condition
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix logical error in JSON_EXTRACT fallback condition - Ensure deterministic completion commit selection with ORDER BY - Scope checkpoint diffs by correlation_id for better accuracy - Use fmt.Fprintf for more idiomatic markdown generation - Final DRY refactor of ticket tagging logic in merge engine
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Enhance event query determinism with id tie-breaker - Improve timeline rendering with stable sorting and event precedence - Fix JSON_EXTRACT fallback logic to be more specific - Refine checkpoint diff queries with ordering and correlation scoping - Minor idiomatic string formatting improvements
Overview
This PR enhances the
rig timelinecommand to provide a unified chronological view of manual shell commands (SQLite) and internal system/workflow events (Dolt). It introduces ticket-based event tagging, checkpoint diffing, and a flexible markdown formatter.Key Changes
TicketMetadataSetterinterface for retroactive and proactive event tagging in the Dolt store.--show-diffsflag utilizing Dolt system tables (dolt_diff_workflow_events).Verification Results
cmd,pkg/workflow,pkg/history,pkg/events).golangci-lintclean.