Skip to content

feat(cli): Collapse help_* into cli_help { topic }; drop cli_info - #36

Merged
thecodedrift merged 21 commits into
feat/telemetry-auth-lifecyclefrom
feat/telemetry-cli-help
Jun 14, 2026
Merged

feat(cli): Collapse help_* into cli_help { topic }; drop cli_info#36
thecodedrift merged 21 commits into
feat/telemetry-auth-lifecyclefrom
feat/telemetry-cli-help

Conversation

@thecodedrift

@thecodedrift thecodedrift commented Jun 13, 2026

Copy link
Copy Markdown
Member

Phase 4 of the telemetry rework (stacked on the auth/lifecycle phase).

  • help.ts: replace help_index / help_<topic> / help_unknown with a single cli_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 the cli_help / cli_run sequence).
  • info.ts: drop the bespoke cli_info / cli_info_completed events (covered by cli_run) and the now-unused getTelemetry import.

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.ts asserting cli_help { topic } across served / index / unknown cases and that no legacy help_* event fires. Full suite green (259).

Part of the restructure-cli-telemetry OpenSpec change. Phase 5 (finalize + archive) is next.


Stack generated by Git Town

thecodedrift and others added 4 commits June 13, 2026 08:58
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

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

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 help command telemetry to emit only cli_help with a topic value for index/served/unknown requests.
  • Remove cli_info / cli_info_completed emissions (and the unused getTelemetry import) from info.
  • Add a new unit test validating cli_help { topic } behavior and preventing legacy help_* 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.

Comment thread packages/cli/test/help-telemetry.test.ts
Comment thread packages/cli/test/help-telemetry.test.ts Outdated
@thecodedrift
thecodedrift marked this pull request as ready for review June 13, 2026 17:25

@thecodedrift thecodedrift left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Comment thread packages/cli/test/help-telemetry.test.ts
thecodedrift and others added 15 commits June 13, 2026 13:50
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
@thecodedrift
thecodedrift merged commit 7b575d9 into feat/telemetry-auth-lifecycle Jun 14, 2026
@thecodedrift
thecodedrift deleted the feat/telemetry-cli-help branch June 14, 2026 04:55
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