feat(cli): Collapse help_* into cli_help { topic }; drop cli_info - #36
Merged
thecodedrift merged 21 commits intoJun 14, 2026
Merged
Conversation
Phase 4 of the telemetry rework. Replace help_index / help_<topic> /
help_unknown with a single cli_help carrying a topic property (the served
topic, "(index)" for a no-arg invocation, or the attempted topic when
unknown) — help intent is now one event filtered by topic. Remove info's
bespoke cli_info / cli_info_completed events (covered by cli_run) and its
now-unused getTelemetry import.
detect.ts (cli_detect) is not on this branch's lineage — it lives in the
unmerged local-rule-routing stack and is reconciled when both land.
Adds test/help-telemetry.test.ts asserting cli_help { topic } across the
served / index / unknown cases and that no legacy help_* event fires.
Full suite green (259).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
All five phases of the telemetry rework are complete, so finalize on the tip of the stack: apply the analytics delta into the main spec (add the cli_run denominator requirement; rewrite the cli_ taxonomy, the wrong-topic funnel, and the standard-properties scenarios) and move the change to openspec/changes/archive/2026-06-13-restructure-cli-telemetry/. Legacy event sweep is clean (the only _completed is the intentional cli_check_completed concrete event); validate/typecheck/lint/suite green; commands smoke-tested end-to-end. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…help * feat/telemetry-auth-lifecycle: ci(openspec): Skip the archive check on non-tip stacked PRs
* feat/telemetry-cli-help: ci(openspec): Skip the archive check on non-tip stacked PRs
This was referenced Jun 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Phase 4 of the CLI telemetry rework: consolidates the help_* event family into a single cli_help { topic } signal and removes the bespoke cli_info(_completed) events now that cli_run is the invocation denominator.
Changes:
- Update
helpcommand telemetry to emit onlycli_helpwith atopicvalue for index/served/unknown requests. - Remove
cli_info/cli_info_completedemissions (and the unusedgetTelemetryimport) frominfo. - Add a new unit test validating
cli_help { topic }behavior and preventing legacyhelp_*events. - Mark Phase 4 tasks as completed in the OpenSpec change task list.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/cli/src/commands/help.ts | Replaces help_index / help_<topic> / help_unknown with cli_help { topic }. |
| packages/cli/src/commands/info.ts | Drops cli_info(_completed) telemetry and removes unused telemetry import. |
| packages/cli/test/help-telemetry.test.ts | Adds tests for cli_help across served/index/unknown flows. |
| openspec/changes/restructure-cli-telemetry/tasks.md | Updates Phase 4 checklist items to completed and clarifies detect.ts lineage note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
thecodedrift
marked this pull request as ready for review
June 13, 2026 17:25
thecodedrift
commented
Jun 13, 2026
thecodedrift
left a comment
Member
Author
There was a problem hiding this comment.
just weighing in on the same feedback as copilot. But I specifically think over-testing would be a bad design here. I'd much rather see us just confidently say after this lands there's no help_ events being emitted
PR #36 review: the served-topic and no-arg help-telemetry tests asserted cli_help was emitted but not that the implementation avoids dual-emitting a legacy help_* event. Both now map captured calls to their event names and assert none start with help_ (and specifically not help_index). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per review feedback: instead of repeating a "no help_* event" assertion
inside every behavioral help-telemetry test (over-testing), keep those
tests purely behavioral (cli_help { topic }) and add a single source-scan
test that asserts no help_* event-name literal remains anywhere under
src/. That states the contract once, confidently.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…help * feat/telemetry-auth-lifecycle: fix(cli): Resolve cli_run identity at invocation start, not end refactor(cli): Single-pass check counts; robust cli_installed assertion fix(cli): Only emit cli_rule_created/improved when rules are written fix(cli): Resolve cli_run identity fresh; tighten cli_error + drop cli_version docs(openspec): Address review on the telemetry contract # Conflicts: # openspec/changes/restructure-cli-telemetry/tasks.md
* feat/telemetry-cli-help: fix(cli): Resolve cli_run identity at invocation start, not end test(cli): Prove help_* removal once via a source scan, not per-test test(cli): Assert no legacy help_* event on served-topic and index paths refactor(cli): Single-pass check counts; robust cli_installed assertion fix(cli): Only emit cli_rule_created/improved when rules are written fix(cli): Resolve cli_run identity fresh; tighten cli_error + drop cli_version docs(openspec): Address review on the telemetry contract
…bility
The archive commit synced the pre-review delta spec, so the capability
spec carried the stale cli_check_completed{ filesScanned } and a fuzzy
cli_help index-marker description. Reconcile the synced spec (and the
archive design flow diagram) with the corrected contract: findings
replaces filesScanned, and cli_help documents the exact literal
"(index)" for the no-topic invocation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…help * feat/telemetry-auth-lifecycle: refactor(cli): Uppercase the CLI acronym in CliError/CliErrorCode
* feat/telemetry-cli-help: refactor(cli): Uppercase the CLI acronym in CliError/CliErrorCode
Match the source rename — the CLI acronym is uppercase in the CLIError class and CLIErrorCode type, so the spec prose and archived contract use the same casing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…help * feat/telemetry-auth-lifecycle: docs(openspec): Uppercase CLIError/CLIErrorCode in the change contract
* feat/telemetry-cli-help: docs(openspec): Uppercase CLIError/CLIErrorCode in the change contract
…help * feat/telemetry-auth-lifecycle: fix(cli): Carry the CLIErrorCode rename into auth.ts
* feat/telemetry-cli-help: fix(cli): Carry the CLIErrorCode rename into auth.ts
…help * feat/telemetry-auth-lifecycle: refactor(cli): Uppercase the acronym in CLIErrorEnvelope too
* feat/telemetry-cli-help: refactor(cli): Uppercase the acronym in CLIErrorEnvelope too
…help * feat/telemetry-auth-lifecycle: refactor(cli): Uppercase the acronym in CLIConfig
* feat/telemetry-cli-help: refactor(cli): Uppercase the acronym in CLIConfig
chore(openspec): Finalize + archive restructure-cli-telemetry
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.
Phase 4 of the telemetry rework (stacked on the auth/lifecycle phase).
help.ts: replacehelp_index/help_<topic>/help_unknownwith a singlecli_help { topic }— the served topic,"(index)"for a no-arg invocation, or the attempted topic when unknown. Help intent is now one event you filter by topic (the wrong-topic re-routing funnel still derives from thecli_help/cli_runsequence).info.ts: drop the bespokecli_info/cli_info_completedevents (covered bycli_run) and the now-unusedgetTelemetryimport.detect.ts(cli_detect) is not on this branch's lineage — it lives in the unmerged local-rule-routing stack, so there's nothing to change here; it'll be reconciled when both stacks land.Adds
test/help-telemetry.test.tsassertingcli_help { topic }across served / index / unknown cases and that no legacyhelp_*event fires. Full suite green (259).Part of the
restructure-cli-telemetryOpenSpec change. Phase 5 (finalize + archive) is next.Stack generated by Git Town