feat(ticket): entire ticket β link external tickets to branches, checkpoints & reviews#1633
Open
Mohit-Katyal wants to merge 14 commits into
Open
feat(ticket): entire ticket β link external tickets to branches, checkpoints & reviews#1633Mohit-Katyal wants to merge 14 commits into
Mohit-Katyal wants to merge 14 commits into
Conversation
Platform-agnostic command group plus the Provider interface, Task type, and Platform enum. Concrete providers implement Provider in their own files and register via one switch case, so the surface never depends on a specific tracker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: d21d54a78a7f
Choose a ticket platform + team and store the API credential in the OS keychain via tokenstore. Adds settings.TicketConfig (platform + team) with clobber-safe persistence. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: 2444000380b9
Link a ticket to the current branch (per-branch store in the git common dir, atomic temp+rename). Adds the generic provider_resolve plumbing (activeProvider) that the command layer uses through the Provider interface; no concrete provider is wired in yet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: 165966a7fa40
start links a ticket, creates/switches to a branch by default (named from the platform's suggestion or a <user>/<id>-<title> slug, prompting when interactive), and prepares a ticket-only agent prompt. Agent launch is deferred (prints the prompt); the launcher stays wired via Deps.LaunchFix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: 9f75b60d3afe
status shows the platform, credential presence, and the linked ticket's live title/state (+ --json). Folds in the snapshot model: each fetch refreshes a per-branch snapshot (update-always) and surfaces drift since the last sync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: f3e5017d4b0c
Remove the stored ticket-platform credential from the local OS keychain (rotation / cleanup). Local-only: Linear keys are revoked in Linear. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: 82efe8b0ac09
Implements the Provider interface for Linear (GraphQL) and registers it with one case in buildProvider β the single platform-specific seam. A future Jira provider slots in the same way. Also wires the now-available provider into link/start id normalization (pasted URL β canonical id). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: f84d079cba95
At condensation, the branch's linked ticket (id + snapshot) is frozen into the per-session checkpoint metadata on entire/checkpoints/v1, so the checkpoint chain becomes the ticket's timeline (versioning for free) and reviews/explain can ground against the original intent. - api/checkpoint: add optional TicketRef on WriteOptions + Metadata (plain data β no dependency on the ticket package, keeping api/checkpoint a leaf) - strategy: ticketRefForBranch reads the local link+snapshot (no network) and maps ticket.Link -> checkpoint.TicketRef at condense time; best-effort, so a checkpoint is never blocked by ticket state - ticket: add LinkForBranch to look up a specific branch's link - integration test: TestShadow_TicketProvenance proves the ticket lands in committed metadata end-to-end - docs: sessions-and-checkpoints + ticket tech spec updated Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: d28f424b65bd
Shared, dependency-free rendering for a branch's linked ticket, so each read surface (status, explain, session info, review) is a thin additive leaf on top rather than carrying its own formatter. Two input shapes collapse to one single-line display: - formatTicketLinkLine(ticket.Link) β the live link (status/session/review) - formatTicketRefLine(checkpoint.TicketRef) β the frozen per-checkpoint ref formatTicketState humanizes "in_progress" -> "in progress" and omits an empty state (vs the ticket package's displayState which renders "unknown", the wrong default for these compact lines). ticketBriefFromLink projects a link onto the shared ticketBriefJSON used by the --json outputs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 4182c78e4520
Reads the frozen Metadata.Ticket per session and renders it in the
checkpoint header (with the URL on an aligned continuation line):
ticket LIN-123 β Fix login redirect loop (in progress)
https://linear.app/acme/issue/LIN-123
--json gains a "ticket" object per session (reuses checkpoint.TicketRef,
omitted when nil). Grounds explain against the original intent the work
was captured under.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 779318bb6d45
Resolves the current branch's live link (ticket.LinkForBranch) and prints a "Ticket Β·" line under the branch line; --json gains a top-level "ticket" object. Best-effort and local only β no line when unlinked or on lookup error, so status never blocks on ticket state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 40a2302d6a91
runSessionInfo resolves the ticket for the session's recorded branch and threads it into the text and --json renderers (a "Ticket:" row + a "ticket" object). Uses the stored branch, so it works for ended sessions inspected after the fact; session current inherits it via delegation. session list stays ticket-free (branch-scoped, would repeat per row) since it renders from buildSessionInfoJSON, which is left untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: d60a6d6bbbc1
Prepends the branch's linked ticket as the first block of the reviewer's
context ("Linked ticket (original intent the change should satisfy):"),
ahead of the checkpoint/session narrative. Flows through the single
CheckpointContext choke point, so both single- and multi-agent review
paths pick it up. Best-effort: no link yields an empty section that
ComposeReviewPrompt skips.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 822668e90de0
Add a crisp, user-facing command reference for `entire ticket` modeled on docs/architecture/review-command.md β basic use, storage, behavior, and key files. Complements the heavier tech spec and EM overview without duplicating their depth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: bb2173911eb1
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.
Overview
entire ticketlinks an external tracker ticket (Linear today, Jira-ready) to a branch and session, so work stays grounded in its original intent β and freezes that ticket into checkpoint provenance so the checkpoint chain becomes the ticket's timeline, surfaced acrossstatus,session info,explain, andreview.The command group is platform-agnostic: every tracker implements one
Providerinterface and registers with a singleswitchcase, so adding Jira later never touches the command surface.What's in it
entire ticket setup(store platform + team + API token in the OS keychain),link/unlink,start(ticket β new branch + grounding prompt),status(live title/state + drift since last sync),revoke-token.Providerseam.entire/checkpoints/v1β best-effort and offline, so a checkpoint is never blocked by ticket state.entire status,session info,checkpoint explain, and prepended to the reviewer's context inentire review(grounding the review against the original intent).How to review β this is a 14-part stack
I don't have push access to
entireio/cli, so the stacked branches can't live here; this is the whole feature as one PR (14 clean commits, each an additive slice). It's split into 14 stacked PRs on my fork for per-slice review β same commits, reviewable one at a time:Each commit here maps 1:1 to a fork PR. Happy to push the branches as a real stack if a maintainer would rather review/merge that way (or grant access).
Testing
go build ./...clean;mise run lint0 issues.ticket,cli, andstrategyunit suites pass; integrationTestShadow_TicketProvenanceproves the ticket lands in committed checkpoint metadata end-to-end.mainand re-verified.Scope / notes
startis deferred (prints the grounding prompt; launcher stays wired viaDeps.LaunchFix).revoke-tokenis local-only (Linear keys are revoked in Linear).π€ Generated with Claude Code