feat(epic-view): wire epic context into 'lit show' + shared batch relations accessor (links-epic-view-n5o.3, .1.1, .4)#172
Merged
Conversation
…s-epic-view-n5o.3) Append the epic plan block to 'lit show' text output: a container shows its own children; a leaf under an epic shows that epic's plan with itself focused (▶ you are here); an issue in no epic is unchanged. The three cases are a sum type (*epicTarget, nil = no plan slice) so the show path resolves+renders on a present value rather than re-testing cases. JSON output is untouched — the block is a text-view augmentation only. Integration tests through runShow cover child-focus, epic-no-focus, parentless (no block), and in_progress-marker rendering.
…c-view (links-epic-view-n5o.1.1)
Add Store.GetRelationsByIDs returning IssueRelations{Issue,Parent,Children,
DependsOn,Blocks} — one issue's structural graph edges, hydrated, without the
comment/event/related payload GetIssueDetail loads. It resolves N subjects in a
fixed number of queries (one relations query + one issue-hydration query) via a
shared bucketRelations helper that is now the single definition of the blocks
convention (GetIssueDetail delegates to it too).
Both the ready pipeline (fetchIssueRelations) and the epic view
(buildEpicContext) adopt it, replacing per-row/per-child GetIssueDetail. One
source of truth for 'an issue's open blockers / parent epic' across consumers;
no divergent batch API in epic-view only.
Contract test pins parity with GetIssueDetail's structural fields, multi-subject
batching, and missing-subject absence.
…ic-view-n5o.4) The find-work guidance now states that 'lit show <id>' on a ticket in an epic auto-renders the epic plan — siblings in rank order with status, the you-are-here marker, and cross-epic dependencies — so agents reach for it for plan context.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the CLI’s text UX for epic work by appending an epic “plan” block to lit show output when applicable, and reduces store/query overhead by introducing a shared batch relations accessor that both the epic view and lit ready consume.
Changes:
- Add
Store.GetRelationsByIDs+ shared relation bucketing helpers to eliminate per-issueGetIssueDetailfetches for structural edges (parent/child/blocks/depends). - Wire epic context rendering into
lit show(text mode only) and migratelit ready’s pipeline to consume batch-loaded structural relations. - Update quickstart guidance and add focused integration/contract tests for the new behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/templates/defaults/quickstart.md | Updates guidance to mention epic plan auto-printing on lit show <id>. |
| internal/store/store.go | Refactors GetIssueDetail to use shared relation bucketing helpers for structural edges. |
| internal/store/relations.go | Introduces IssueRelations, bucketRelations, and GetRelationsByIDs + batch relation query helper. |
| internal/store/relations_batch_test.go | Adds contract tests ensuring batch relations match GetIssueDetail’s structural fields. |
| internal/cli/ready_state.go | Switches the ready pipeline from per-issue detail fetches to batch structural relations. |
| internal/cli/epic_context.go | Reworks epic context building around batch relations; adds show-specific epic targeting + writer integration seam. |
| internal/cli/cli.go | Appends epic context to lit show text output while keeping --json behavior unchanged; updates ready pipeline wiring. |
| internal/cli/show_epic_test.go | Adds integration tests validating epic block rendering/focus behavior for lit show. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…epic-view-n5o.3) GetRelationsByIDs omits subjects that don't exist. buildEpicContext now checks presence for the epic subject and each child, returning store.NotFoundError on absence rather than rendering a zero-value Issue row. This restores the prior GetIssueDetail NotFound contract at the seam and keeps a vanished member from silently mis-rendering the plan (no silent fallback).
…oudly on holes (links-epic-view-n5o.1.1) listRelationsForIDs now filters to structural types (blocks, parent-child) in the query, so related-to rows and their endpoints are never pulled into the batch hydration set — honoring the accessor's documented contract and the savings vs GetIssueDetail. fetchIssueRelations validates every requested issue resolved, returning NotFound on a hole rather than letting downstream index a zero-value IssueRelations — symmetric with the epic-view presence checks, restoring the prior per-issue fail-loud behavior.
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.
Wires the epic context block into
lit showas the default view, lands the shared batch relations accessor that kills the N+1 across bothreadyand the epic view, and adds the quickstart guidance line. Closes the last three open children oflinks-epic-view-n5o.links-epic-view-n5o.3 — wire epic context into
lit showlit showtext output now appends the epic plan block:▶ … (you are here)The three cases are a sum type (
*epicTarget,nil= no plan slice) so the show path resolves+renders on a present value rather than re-testing cases at the callsite. JSON output is untouched — the block is a text-view augmentation only (the existing--jsoncontract test still passes). Container detection reusesenrichWithParentEpic's exact predicate, so "what counts as an epic parent" keeps one definition.Integration tests through
runShowcover child-focus, epic-no-focus, parentless (no block), and in_progress-marker rendering.links-epic-view-n5o.1.1 — shared batch relations accessor (kill N+1)
buildEpicContextdid oneGetIssueDetailper child; thereadypipeline did the same per row — each call loads comments/events/related the consumers never read.New
Store.GetRelationsByIDsreturnsIssueRelations{Issue, Parent, Children, DependsOn, Blocks}— one issue's structural graph edges, hydrated, without the comment/event/related payload — resolving N subjects in a fixed number of queries (one relations query + one issue-hydration query). A sharedbucketRelationshelper is now the single definition of the blocks convention (GetIssueDetaildelegates to it too, so the two cannot drift).Both consumers adopt it (
fetchIssueRelations,buildEpicContext), per the one-source-of-truth requirement on the ticket — no divergent "open blockers" source in epic-view only. A store contract test pins parity withGetIssueDetail's structural fields, multi-subject batching, and missing-subject absence.links-epic-view-n5o.4 — quickstart line
The find-work guidance now states that
lit show <id>on a ticket in an epic auto-renders the epic plan.Verification
go test ./...green;go vetclean; gofmt-clean on all touched files.lit show <epic>(children list),lit show <child>(you-are-here marker),lit ready(parent-epic enrichment intact),lit quickstart(new line renders).