Skip to main content

IdiomarkD v2 - Evolution Patterns (Future Work)

Status: Planned - Not Implemented

This document outlines the planned v2 features for analyzing code evolution over time via git history.


v1 vs v2​

Featurev1 (Current)v2 (Planned)
InputStatic code filesGit history, commits, PRs
AnalysisHow you write codeHow you change code
MetricsFunction length, namingChurn, PR size, response time
Use caseBehavioral profileEvolution pattern

Planned Features​

1. Commit Pattern Detection​

How a developer structures their commits over time.

Metrics:

  • Iterative vs Big-Bang - Small incremental vs monolithic commits
  • Commit Frequency - Commits per day/week
  • Time-of-Day Patterns - When do they commit?
  • Message Style - Descriptive vs brief commit messages

Example patterns:

{
"commit_style": {
"approach": "iterative_refinement", // or "big_bang", "mixed"
"avg_commits_per_pr": 8,
"avg_files_per_commit": 2.3,
"message_length": "brief", // or "descriptive", "verbose"
}
}

2. Churn Analysis​

How frequently developers modify files.

Metrics:

  • Files Changed Per Commit - Focused vs scatter-shot
  • Revert Frequency - How often they revert
  • Same-Day Re-edit - Fix-it-later patterns
  • File Hotspots - Which files get touched most

Example patterns:

{
"churn_analysis": {
"avg_files_changed": 2.3,
"focus_score": 0.75, // 1 = always same files, 0 = random
"revert_frequency": "low", // or "medium", "high"
"hotspot_files": ["README.md", "config.ts"]
}
}

3. PR/Issue Collaboration Style​

How developers interact in code review and issue tracking.

Metrics:

  • PR Size - Lines changed per PR
  • Review Responsiveness - Time to respond to comments
  • Self-Review Ratio - How often they review their own PRs
  • Draft PR Frequency - Work-in-public vs draft-first

Example patterns:

{
"collaboration_style": {
"avg_pr_size_kb": 45,
"review_responsiveness": "fast", // or "moderate", "slow"
"self_review_ratio": 0.3,
"draft_frequency": "occasional" // or "never", "often"
}
}

4. Fix Turnaround Time​

How quickly developers address issues and bugs.

Metrics:

  • Time to First Response - Acknowledge speed
  • Time to Resolution - Complete fix speed
  • Bug Reopen Rate - Quality of fixes
  • Priority Drift - Do they tackle high-impact issues first?

Example patterns:

{
"fix_patterns": {
"avg_first_response_hours": 2.3,
"avg_resolution_hours": 18,
"reopen_rate": 0.08,
"priority_correlation": 0.65 // 1 = always tackles high priority first
}
}

5. Code Review Evolution​

How review style evolves over time.

Metrics:

  • Review Thoroughness - Comments per review over time
  • Tone Shift - Getting more or less strict?
  • Nit Picks - Common issues raised
  • Pattern Recognition - Do they catch recurring issues?

Example patterns:

{
"review_evolution": {
"thoroughness_trend": "increasing", // or "decreasing", "stable"
"tone_shift": "becoming_stricter", // or "more_lenient", "stable"
"common_nits": ["no_tests", "magic_numbers", "inconsistency"],
"pattern_detection_rate": 0.72
}
}

Technical Implementation​

Required Dependencies​

{
"dependencies": {
"isomorphic-git": "^0.25.0",
"simple-git": "^1.150.0"
}
}

New PEP: @idiomark/idiomarkd-evolution​

packages/
├── idiomarkd-api/ # v1 (static analysis)
└── idiomarkd-evolution/ # v2 (evolution patterns)

API Endpoint​

// POST /api/v2/analyze-evolution
{
"repository_url": "https://github.com/user/repo",
"timeframe_days": 90,
"include_branches": ["main", "develop"],
"include_prs": true
}

Data Sources​

SourceAccess MethodWhat It Provides
Git Loggit log --pretty=format:Commit history, timestamps
Git Diffgit showFile changes per commit
GitHub API/repos/{owner}/{repo}/pullsPR metadata, reviews
GitHub Issues/repos/{owner}/{repo}/issuesIssue activity

Privacy & Permissions​

Scope: Analyzes only public activity from public repositories.

What's NOT analyzed:

  • Private repositories (no access without auth)
  • Deleted branches/PRs (historical limitation)
  • Commit content for non-public contributors
  • Sensitive data in commit messages (emails, tokens)

Opt-out: Users can exclude specific repositories or timeframes.


Migration Path from v1​

// v1: Static analysis only
const v1Result = await analyzeDeveloperBehavior(codeSamples)

// v2: Static + evolution
const v2Result = {
behavioral: await analyzeDeveloperBehavior(codeSamples),
evolution: await analyzeEvolutionPatterns(gitHistory)
}

Timeline​

Target: After v1 is shipped and validated (Q2 2026)

Prerequisites:

  1. v1 API stable and in production
  2. User feedback on v1 behavioral accuracy
  3. GitHub API rate limiting strategy validated
  4. Storage for git history caching decisions

See Also​