Skip to content

Metrics framework: metrics-core + metrics Gradle plugin#7

Open
isaac-udy wants to merge 4 commits into
mainfrom
feature/metrics
Open

Metrics framework: metrics-core + metrics Gradle plugin#7
isaac-udy wants to merge 4 commits into
mainfrom
feature/metrics

Conversation

@isaac-udy

Copy link
Copy Markdown
Owner

Codebase health metrics for udytils consumers:

  • metrics-core: the record/finding/run model (the JSON contract integrations emit), a git-branch store (one JSON per run appended with git plumbing — the branch is never checked out), and a self-contained HTML report: a collapsible Gradle-notation module × metric index with group roll-ups, plus one page per metric (codebase-total trend chart, latest values, found items).
  • metrics-gradle-plugin (dev.isaacudy.udytils.metrics, root project): metrics { integrations { … } } DSL with architecture / linesOfCode / readmeHealth / buildWarnings / custom integrations and collectMetrics / publishMetrics / generateMetricsReport tasks. Collection never fails the build.
  • architecture-core: writeArchitectureMetrics run summary (rules by tag, per-Construct census per module, exceptions, audit findings) + an architectureMetrics task in the architecture plugin.

Verified end-to-end in ukpt (see the companion ukpt PR, which depends on this merging first — its submodule pointer references this branch). The report layout will likely get more polish later.

🤖 Generated with Claude Code

isaac-udy and others added 4 commits July 3, 2026 17:22
… summary

- metrics-core: the MetricRecord/MetricFinding/MetricsRun model (the
  contract every integration emits), a GitBranchStore that appends one
  JSON per run to a dedicated branch with git plumbing (never checked
  out), and a self-contained HTML report renderer with SVG trend
  charts and latest-findings tables.
- metrics-gradle-plugin (dev.isaacudy.udytils.metrics, root-project):
  metrics { integrations { … } } DSL with architecture, linesOfCode,
  readmeHealth (frontmatter + git-dated staleness), buildWarnings
  (captured-log parsing), and custom (any task emitting the contract);
  collectMetrics / publishMetrics / generateMetricsReport tasks.
  Collection never fails the build: metrics are a report, not a gate.
- architecture-core: writeArchitectureMetrics emits a machine-readable
  run summary (rules by enforcement tag, per-Construct census per
  module, every @ArchitectureException, every audit finding); the
  generated tests gain a MetricsTest hook and the architecture plugin
  an architectureMetrics task driving it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…etric

index.html is a monospace table with modules on the vertical axis and
one column per metric (latest values, dimensions summed); each column
header links to the metric's page. Each metric page shows a trend
chart of the codebase total (all subjects summed, not split by
module), the latest per-subject values, and the source's found items
from the latest run. generateMetricsReport now writes a directory
(build/metrics/report/) instead of a single file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-ups

- Modules everywhere use Gradle notation (":app:client:desktop", ":"
  for the root project): the integrations and the architecture summary
  emit it as the canonical subject format, not just a display concern.
- The index table renders the module tree: every path prefix is a row
  (:app › :client › :desktop), indented, with group rows summing every
  record in their subtree; groups collapse/expand via an inline
  vanilla-JS toggle. Column headers stack metric-name segments and the
  cell padding tightens, so columns are much narrower.
- generateMetricsReport must-run-after collect/publish so a combined
  invocation renders the fresh run, not the previous one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tables were display:block for overflow scrolling, which made width:100%
apply to the scroll box rather than the table itself, so tables sized
to content and stopped short of the page's title divider. Tables are
now real tables inside an overflow wrapper, stretched to the container,
with one designated grow column per table absorbing the slack: the
module tree on the index, the detail column on Latest values, and the
item column on Found items.

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