Skip to content

Renew metric report interface#39

Draft
ebihara99999 wants to merge 14 commits into
mainfrom
feature/metric-snapshot-report
Draft

Renew metric report interface#39
ebihara99999 wants to merge 14 commits into
mainfrom
feature/metric-snapshot-report

Conversation

@ebihara99999

@ebihara99999 ebihara99999 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Introduce metric-native measurements and MetricReport as the default JSON output model.
  • Keep summary as derived aggregate data and measurements as the source of truth.
  • Align RuboCop-backed metric values with RuboCop calculation behavior while ignoring offense policy configuration.
  • Remove legacy metric engine behavior and legacy output aliases for the 1.0 interface.
  • Document the AI-assisted review workflow and the difference between RuboCop offense reports and CodeKeeper metric reports.
  • Review runtime dependencies and supported Ruby versions for the 1.0 cleanup.

Validation

  • bundle exec rspec
  • bundle exec rubocop -A

- Add metric-native measurements and snapshot summaries
- Keep legacy JSON and CSV output paths for existing integrations
- Document AI-assisted review workflows
- Move RuboCop calculator calls behind a standard engine adapter
- Keep metric classes focused on scope extraction and measurement shaping
- Explain how CodeKeeper uses RuboCop analysis without applying offense policy
- Document metric-native scopes and AI review usage
- Drop legacy metric engine and legacy output aliases

- Keep score compatibility views derived from metric measurements

- Remove redundant direct dependencies and align Ruby support with maintained versions
Use MetricReport for the full metrics output object while keeping summary as the derived aggregate section.
Require metric classes to receive SourceFile instances and document that RuboCop output is threshold-gated and policy-filtered.
@ebihara99999 ebihara99999 changed the title Add metric snapshot reporting Renew metric report interface Jul 3, 2026
ebihara99999 and others added 6 commits July 3, 2026 22:19
Limit each metric summary to the top five measurements by value and make tie ordering stable for repeatable reports.
Add csv as a runtime dependency and align hotspot tie-break tests with the documented ordering.
The gemspec now declares csv as a runtime dependency, which the gemspec
directive already brings into the bundle on every Ruby version, so the
conditional entry duplicated it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drop the Parser facade and the per-metric score hash interface, which
predate the metric report model. SourceFile is now the single parsing
boundary and Measurement the only metric output. Also remove RuboCop
mixins and a version fallback made unreachable by the centralized
calculator and the rubocop >= 1.88 requirement, and move file loading
coverage from the parser specs to the SourceFile specs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AbcMetric and CyclomaticComplexity intentionally share an identical
method-scope enumerator. Record that the duplication is deliberate and
that a shared enumerator should be extracted when a third method-scope
metric is added, so the decision survives beyond the current work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Measurements are the source of truth, and the CSV view flattened them
into metric/key/value rows that silently overwrote measurements sharing
a key, such as classes reopened across files. It was also the only
reason for the csv runtime dependency and the score key rules on
Measurement. Tabular views can be derived from the measurements array
downstream, so drop the csv format together with the format setting,
the Result wrapper, and the csv dependency. Scorer now dedupes
configured metrics itself, which the removed scores hash did
implicitly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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