Repository navigation
feat: add td history command for issue timeline view - #66
Merged
Merged
Conversation
Adds a unified chronological timeline showing all events for an issue: logs, handoffs, comments, git snapshots, and status changes from the action_log. Supports --json and --limit flags. Nightshift-Task: historical-context Nightshift-Ref: https://github.com/marcus/nightshift Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rework of the nightshift timeline before merge: - Fold the log a lifecycle command writes into its status-change event (same session, closest within -2s..+10s), so approvals show their reason once instead of as a duplicate line. Only transitions and reviews pair; a note logged right after td update stays a log. - Report all timestamps in UTC in JSON and local time in text. Action rows are UTC and logs carry a local offset, so dates were shown on the wrong day. - Show real field changes (priority: P2 -> P1), ignore updated_at-only updates, and sort changed fields deterministically. - Read linked files from issue_files; the action_log rows are keyed by link ID, so file events never matched before. - Cover review records, close-after-review, delete, and restore, and synthesize a created event when no create action exists. - Collapse identical consecutive events into one with a count. - Show short comments inline and long ones once, without cutting runes. - Reuse GetHandoffs and GetLinkedFiles, check rows.Err, fix errcheck. - Use absolute times with type labels, indent every detail line, and report errors through reportFailure so --json gets an error envelope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marcus
force-pushed
the
historical-context
branch
from
October 15, 2026 23:07
2dd4dce to
2e68351
Compare
- Decode the base64-encoded handoff lists written Dec 2025-Feb 2026 in every handoff reader. td history failed on ~32% of issues in a real DB, and td show silently dropped those handoffs. - Pair narration logs by action type and log type: only commands that always write their own log take one, and only of the types they write. A blocker logged after a status update or a decision logged before a delete stays a standalone, typed log. Window tightened to -0.5s..+5s. - Diff the union of previous/new keys so clearing an omitempty field (sprint, labels, description) is shown instead of dropped. - Trim a leading "Rejected: " from narration details, give the synthesized created event the creator session, drop the unreachable review_delete mapping, flag deleted issues (header and deleted_at), and reject a negative --limit. - Tests for each, plus JSON envelope and error-path command tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A log row left with a NULL id by the Jan 2026 text-ID migration made GetLogs fail for its issue; td history errored and td show silently dropped every log. COALESCE the id. Also clarify the narration-pairing and ASCII-slicing comments from review round 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
td history <issue-id>(aliastd timeline): one chronological timeline of an issue's life, assembled from action_log, logs, handoffs, comments, git snapshots, and linked files.Approved and closedorRejected. Pairing is keyed on which commands narrate and with which log types. An agent's own--blockeror--decisionnote logged next to an update or delete stays a standalone, typed log.Updated priority: P2 → P1, labels. Updates that only touchupdated_atare skipped, and clearing anomitemptyfield shows as a change.--jsonemits all timestamps in UTC; action rows are stored in UTC while logs carry a local offset, which had put dates on the wrong day. Errors use the standard JSON error envelope.--limit Nkeeps the most recent N rows.Fixes to existing readers found along the way
td showsilently dropped them (938 rows in td's own DB), and they decode now.GetLogsfor its issue.Testing
deleted_at), and error envelopes.td history --jsonagainst all 2,336 issues in td's own project DB: all render.go test ./...and golangci-lint pass.🤖 Generated with Claude Code