Skip to content

feat(metrics): historical VCS metric trend (time series over N points) #333

@dekobon

Description

@dekobon

Follow-up to #328.

Add historical metric trend support: compute VCS (and optionally AST) metrics at N historical points in time, surfacing improving-vs-degrading code over the project's lifetime.

Why

A single snapshot of risk_score answers "what's risky now." A trend answers "is this getting better or worse" — which is the actionable question for technical-debt programs. The Kamei JIT survey notes that JIT models lose predictive power over time, which is a different framing of the same phenomenon: metrics decay; trends are more durable.

Scope

  • New CLI flag: bca vcs trend --points <N> --span <DURATION> (e.g., 12 points over 24 months → monthly metric snapshots).
  • For each point in time: check out the repo at that commit (or use gix to read trees without checking out), compute VCS metrics with --as-of set to that point.
  • Emit a time-series JSON: { files: { path: [{ as_of, risk_score, ... }, ...] } }.
  • Optional delta summary: which files improved / regressed the most.

Edge cases

  • Files that didn't exist at an older time point: emit null.
  • Renamed files: track via rename detection if --follow-renames.
  • Very deep histories: cap point count; document.

Acceptance criteria

  • Time-series output schema is stable and versioned.
  • Performance: 12 monthly points on a 1k-commit fixture completes in under 60 s.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions