Skip to content

feat(quickstart): emit topic breadcrumbs in mutation-command success output (lit-c5519f81-93c728d5.2.2)#205

Merged
brandon-fryslie merged 1 commit into
masterfrom
quickstart-breadcrumbs-wt
Jun 10, 2026
Merged

feat(quickstart): emit topic breadcrumbs in mutation-command success output (lit-c5519f81-93c728d5.2.2)#205
brandon-fryslie merged 1 commit into
masterfrom
quickstart-breadcrumbs-wt

Conversation

@brandon-fryslie

Copy link
Copy Markdown
Collaborator

Closes lit-c5519f81-93c728d5.2.2 (epic: split quickstart into router + topic subcommands).

What

Mutation commands now end their text success output with a one-line breadcrumb pointing at the relevant lit quickstart <topic>, so discovery of task guidance happens at the moment of need rather than only at session start:

command breadcrumb
new, followup lit quickstart new
start lit quickstart ready
done, close lit quickstart done
update, rank, rank set, label add/rm, parent set/clear, dep add/rm lit quickstart update

Example:

$ lit new --title "Crumb demo" --topic demo --type task
crumb-demo-8xx [open/task/demo/normal] Crumb demo
deeper guidance: lit quickstart new

How

  • withQuickstartBreadcrumb(token, textFn) wraps the text printer passed to printValue. Since printValue is the existing single enforcer that routes JSON mode to writeJSON before any text printer runs, JSON output is structurally breadcrumb-free on every stream — the machine contract is preserved by construction, not by guards.
  • Tokens are validated against the quickstartTopics table at wrap time (panic on unknown token), so the topic list is never duplicated and a wiring typo dies in the first test run.
  • Transition actions map to topics via transitionBreadcrumbTopics; absence from the table encodes "no natural follow-on topic" (archive, delete, reopen, ...).
  • lit done guided preview (pre-apply) carries no breadcrumb — only the actual success output does.

Verification

  • New tests: table-derived breadcrumb text, panic on unknown token, transition-map validity, text output ends with breadcrumb (new/start/label/close), JSON purity under both --json forms.
  • rank_frame_test.go updated: it pinned "summary is the last line" (structure); now asserts the summary line describing the moved epic exists (behavior).
  • Full go test ./... green; live-verified against a scratch repo (text breadcrumbs on new/start/label/done-apply, single-JSON-doc output under local and global --json).

…output (lit-c5519f81-93c728d5.2.2)

Text success output of new/followup, start, done/close, and
update/rank/label/parent/dep now ends with a one-line pointer at the
matching quickstart topic, so discovery of task guidance happens at the
moment of need rather than only at session start.

The breadcrumb rides the text printer via withQuickstartBreadcrumb, so
printValue's existing single-enforcer routing keeps JSON mode
structurally breadcrumb-free on every stream. Tokens are validated
against the quickstartTopics table at wrap time and fail loudly on a
wiring typo; transition actions map to topics through a lookup table
where absence encodes 'no follow-on topic'.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Z.ai Coding Agent Review

No must-change items. The breadcrumb feature is cleanly structured:

  • Data-driven wiring: transitionBreadcrumbTopics is a lookup table; withQuickstartBreadcrumb is a composable wrapper over any text printer. The if ok map-lookup in runTransition is Go's standard map access, not a mode-flag branch — the data (map presence/absence) decides the behavior.
  • [LAW:one-source-of-truth]: Topic tokens derive from the canonical quickstartTopics table. quickstartBreadcrumb validates at a single point; TestTransitionBreadcrumbTopicsAreValidTokens catches wiring drift.
  • [LAW:no-silent-failure]: quickstartBreadcrumb panics loudly on unknown tokens (developer wiring error), consistent with failing hard on invalid internal state.
  • [LAW:single-enforcer]: JSON safety is structural — printValue routes JSON mode to writeJSON before any text printer runs, so breadcrumbs cannot reach the JSON contract. Tests verify both per-command --json and global JSON mode.
  • [LAW:behavior-not-structure]: Tests assert output content (breadcrumb text, JSON absence), not implementation. The rank-frame test update explicitly moves from positional assertions to content-based ones, noted inline.

Pre-existing note (unchanged code): the token type is string throughout, with runtime validation compensating for the loose type. A future tightening to named types would let the compiler catch wiring bugs that the current panic guard catches at runtime, but this diff doesn't introduce or worsen that looseness.

✅ Approved

@brandon-fryslie brandon-fryslie merged commit d3c9513 into master Jun 10, 2026
6 checks passed
@brandon-fryslie brandon-fryslie deleted the quickstart-breadcrumbs-wt branch June 10, 2026 08:40
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.

1 participant