refactor(analyze): split AnalyzerConfig into type/id/display_name#2376
Draft
ryan-arman wants to merge 2 commits intoryan-arman/analyze-cli-v2from
Draft
refactor(analyze): split AnalyzerConfig into type/id/display_name#2376ryan-arman wants to merge 2 commits intoryan-arman/analyze-cli-v2from
ryan-arman wants to merge 2 commits intoryan-arman/analyze-cli-v2from
Conversation
Rename `AnalyzerConfig.id` -> `type` and `AnalyzerConfig.instance_id` -> `display_name` to align with the API's `AnalyzerConfigInput` shape. The legacy `id`/`instance_id` YAML keys continue to parse as aliases so existing configs still work. Also adds an `AnalyzerType` enum for the built-in analyzers and updates the CLI, example YAML, docs, and tests to the new field names. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 tasks
Adds a stable `id` field alongside `display_name` on AnalyzerConfig so results, caches, and test metric paths key on a single canonical identity that is independent of the human-readable label. When omitted, `id` defaults to `display_name`, which defaults to `type` — preserving today's behavior exactly. The separation makes room for the API's next iteration, where user-created analyzer assets get a generated `id` and the user is free to rename `display_name` without invalidating results. Details: - AnalyzerConfig: new `id: str` field; `__post_init__` defaults it to `display_name`. Field order: `type`, `id`, `display_name`, `params`. - CLI: `analyzer.analyzer_id = cfg.id` (was `cfg.display_name`). - `_parse_analyzers`: validates uniqueness on `id`; `display_name` may repeat. Drops the legacy `id`->`type` YAML alias (pre-#2376). Keeps `instance_id`->`display_name` alias for one release with a DeprecationWarning. - `to_dict`: emits `id` alongside `type` and `display_name`. - Docs + example YAML: document the new field and relaxed display_name uniqueness rule. - Tests cover default chaining, explicit id, duplicate-id rejection, duplicate-display-name-with-distinct-ids acceptance, legacy instance_id warning, legacy id-as-type rejection, and to_dict round trip. Spec: docs/superpowers/specs/2026-04-17-analyzer-config-id-design.md Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Description
Part of the analyze v2 split of #2370 (Phase 2 of 4).
Reshapes
AnalyzerConfiginto three fields with distinct responsibilities:type— analyzer kind (required, wasidpre-refactor(analyze): split AnalyzerConfig into type/id/display_name #2376)id— stable identity; canonical key for results, caches, and test metric paths. Defaults todisplay_name.display_name— human-readable label. Defaults totype. Wasinstance_idpre-refactor(analyze): split AnalyzerConfig into type/id/display_name #2376.Today
idalways defaults todisplay_name, so YAMLs that only setdisplay_namekeep working unchanged. The split exists so that in the future the API can mint stable asset ids for analyzers whiledisplay_nameremains purely cosmetic (and need not be unique).Key behavior changes:
id, notdisplay_name. Two analyzers may share adisplay_nameas long as theiridvalues differ.id:"{id}.{field_name}". Whenidis omitted, this still equals"{display_name}.{field_name}".instance_idYAML key still maps todisplay_namewith aDeprecationWarning.idin place oftypenow fail loudly with "type is required" —idhas new semantics.Also:
AnalyzerTypeenum for the built-in analyzers (length,quality,turn_stats).instance_idalias.Design doc:
docs/superpowers/specs/2026-04-17-analyzer-config-id-design.md(onmain).Dependencies: Stacked on #2375 (Phase 1 — CLI migration). Rebase to
mainonce that lands.Related issues
Linear Issue: OPE-1868
Towards OPE-1868
Before submitting
🤖 Generated with Claude Code