Skip to content

feat(epic-view): wire epic context into 'lit show' + shared batch relations accessor (links-epic-view-n5o.3, .1.1, .4)#172

Merged
brandon-fryslie merged 5 commits into
masterfrom
links-epic-view-n5o.3
Jun 3, 2026
Merged

feat(epic-view): wire epic context into 'lit show' + shared batch relations accessor (links-epic-view-n5o.3, .1.1, .4)#172
brandon-fryslie merged 5 commits into
masterfrom
links-epic-view-n5o.3

Conversation

@brandon-fryslie

Copy link
Copy Markdown
Collaborator

Wires the epic context block into lit show as the default view, lands the shared batch relations accessor that kills the N+1 across both ready and the epic view, and adds the quickstart guidance line. Closes the last three open children of links-epic-view-n5o.

links-epic-view-n5o.3 — wire epic context into lit show

lit show text output now appends the epic plan block:

  • container (epic) → its own children in rank order, no focus marker
  • leaf under an epic → that epic's plan with the shown ticket marked ▶ … (you are here)
  • issue in no epic → unchanged, no block

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 --json contract test still passes). Container detection reuses enrichWithParentEpic's exact predicate, so "what counts as an epic parent" keeps one definition.

Integration tests through runShow cover 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)

buildEpicContext did one GetIssueDetail per child; the ready pipeline did the same per row — each call loads comments/events/related the consumers never read.

New Store.GetRelationsByIDs returns IssueRelations{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 shared bucketRelations helper is now the single definition of the blocks convention (GetIssueDetail delegates 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 with GetIssueDetail'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

  • Full go test ./... green; go vet clean; gofmt-clean on all touched files.
  • Verified live: lit show <epic> (children list), lit show <child> (you-are-here marker), lit ready (parent-epic enrichment intact), lit quickstart (new line renders).

…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.
Copilot AI review requested due to automatic review settings June 3, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-issue GetIssueDetail fetches for structural edges (parent/child/blocks/depends).
  • Wire epic context rendering into lit show (text mode only) and migrate lit 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.

Comment thread internal/cli/epic_context.go
Comment thread internal/cli/epic_context.go Outdated
…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).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread internal/store/relations.go Outdated
Comment thread internal/cli/ready_state.go
…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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@brandon-fryslie brandon-fryslie merged commit 9e72727 into master Jun 3, 2026
3 checks passed
@brandon-fryslie brandon-fryslie deleted the links-epic-view-n5o.3 branch June 3, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants