Feature Commit Tracking

L3
ModelContextProtocolGithubClaude Code

Research development history across branches to track when specific features were introduced and create comprehensive documentation.

Created by Zijian Wu
2025-08-15
Repository AnalysisRelease Coordination

Model Ranking

Click on the dots to view the trajectory of each task run
Model
Run Results
Pass@4
Pass^4
Avg Time
Avg Turns
Input Tokens
Output Tokens
Total Tokens
DeepSeek
deepseek-v3-2-chat
1
/4
288.6s
26.0
1,440,228
4,773
1,445,001
Claude
claude-opus-4-1
0
/1
--
78.4s
4.0
243,270
492
243,762
Claude
claude-opus-4-5-high
0
/4
190.7s
14.5
1,676,553
4,638
1,681,191
Claude
claude-sonnet-4
0
/4
130.1s
7.8
810,032
979
811,011
Claude
claude-sonnet-4-5
0
/4
120.1s
11.8
1,061,087
2,612
1,063,699
Claude
claude-sonnet-4-high
0
/4
149.0s
17.8
837,996
3,259
841,255
Claude
claude-sonnet-4-low
0
/4
161.5s
15.8
867,185
3,250
870,435
DeepSeek
deepseek-chat
0
/4
160.5s
11.8
764,136
631
764,768
DeepSeek
deepseek-v3-1-terminus
0
/4
533.5s
16.5
1,213,368
1,671
1,215,039
DeepSeek
deepseek-v3-1-terminus-thinking
0
/4
777.4s
12.3
661,082
15,273
676,354
DeepSeek
deepseek-v3-2-thinking
0
/4
495.3s
30.5
1,728,174
10,062
1,738,236
Gemini
gemini-2-5-flash
0
/4
49.5s
4.5
735,746
6,354
742,099
Gemini
gemini-2-5-pro
0
/4
63.0s
2.0
13,044
5,643
18,686
Gemini
gemini-3-pro-high
0
/4
234.5s
18.0
1,138,310
6,843
1,145,153
Gemini
gemini-3-pro-low
0
/4
163.0s
16.0
826,633
7,842
834,474
Z.ai
glm-4-5
0
/4
244.9s
8.3
452,705
1,040
453,744
OpenAI
gpt-4-1
0
/4
52.4s
7.5
591,023
1,302
592,325
OpenAI
gpt-4-1-mini
0
/4
86.9s
14.3
1,027,960
1,139
1,029,099
OpenAI
gpt-4-1-nano
0
/4
56.4s
12.3
387,280
1,650
388,930
OpenAI
gpt-5-high
0
/4
1847.6s
25.5
2,462,921
53,854
2,516,775
OpenAI
gpt-5-low
0
/4
95.4s
3.5
134,738
3,572
138,311
OpenAI
gpt-5-medium
0
/4
735.8s
21.8
1,784,009
30,026
1,814,035
OpenAI
gpt-5-mini-high
0
/4
481.5s
30.0
2,503,650
31,597
2,535,246
OpenAI
gpt-5-mini-low
0
/4
108.4s
11.3
873,133
1,387
874,520
OpenAI
gpt-5-mini-medium
0
/4
262.1s
23.3
1,784,786
15,476
1,800,262
OpenAI
gpt-5-nano-high
0
/4
554.5s
32.5
4,268,522
72,817
4,341,338
OpenAI
gpt-5-nano-low
0
/4
50.8s
5.8
245,279
3,866
249,145
OpenAI
gpt-5-nano-medium
0
/4
291.5s
17.3
1,715,089
41,811
1,756,900
OpenAI
gpt-oss-120b
0
/4
10.6s
2.8
28,641
360
29,001
Grok
grok-4
0
/4
309.2s
19.5
1,917,778
2,003
1,923,360
Grok
grok-4-fast
0
/4
86.8s
18.0
658,310
5,791
664,100
Grok
grok-code-fast-1
0
/4
102.2s
26.5
1,670,140
6,860
1,676,999
MoonshotAI
kimi-k2-0711
0
/4
186.2s
7.0
262,035
388
262,423
MoonshotAI
kimi-k2-0905
0
/4
328.2s
22.5
911,090
2,599
913,689
OpenAI
o3
0
/4
106.8s
7.5
630,621
1,815
632,436
OpenAI
o4-mini
0
/4
362.2s
15.0
884,128
8,744
892,872
Qwen
qwen-3-coder-plus
0
/4
984.4s
27.5
5,692,594
2,583
5,695,177
Qwen
qwen-3-max
0
/4
256.8s
63.8
2,592,326
4,891
2,597,216

Task State


Instruction

I need you to research the development history of the repository across multiple branches and commits, then create a comprehensive feature tracking document and submit it as a new file to the repository.

Step 1: Multi-Branch Feature Investigation Research and identify the exact commit SHAs where these specific features were introduced by analyzing commits across different branches:

  1. Shell Completion Scripts: Find when shell completion functionality was first added to the repository
  2. CHANGELOG Version 1.0.65: Find when the changelog was updated to include version 1.0.65
  3. Rust Extraction Improvements: Find when workflow improvements for Rust code extraction were implemented

Step 2: Create Feature Tracking Documentation Create a file called FEATURE_COMMITS.md in the repository root with:

  • A "# Feature Development Tracking" title
  • A "## Overview" section explaining this tracks major feature additions across repository branches
  • A "## Feature Commit History" section with this exact table format:
Markdown
| Feature Name | Commit SHA | Author | Branch | Date | Files Changed | Commit Message |
|-------------|------------|---------|---------|------|---------------|----------------|

For each feature, populate the table with:

  • Exact commit SHA (full 40-character hash)
  • GitHub username of the commit author
  • Branch where the commit was made
  • Commit date in YYYY-MM-DD format
  • Number of files changed in that commit
  • First line of the commit message

Step 3: Commit Documentation to Repository Commit the FEATURE_COMMITS.md file to the main branch with:

  • Commit message: "Add feature development tracking documentation"
  • Ensure the file is properly formatted markdown
  • Verify all commit SHAs in the table are accurate and verifiable

The verification process will check that your table contains the correct commit SHAs for each specific feature, along with accurate author, branch, and date information.



Verify

*.py
Python
import sys
import os
import requests
from typing import Dict, List, Optional, Tuple
import base64
import re
from dotenv import load_dotenv


def _get_github_api(
    endpoint: str, headers: Dict[str, str], org: str, repo: str = "claude-code"
) -> Tuple[bool, Optional[Dict]]:
    """Make a GET request to GitHub API and return (success, response)."""
    url = f"https://api.github.com/repos/{org}/{repo}/{endpoint}"
    try:
        response = requests.get(url, headers=headers)
        if response.status_code == 200:
            return True, response.json()
        elif response.status_code == 404:
            return False, None
        else:
            print(f"API error for {endpoint}: {response.status_code}", file=sys.stderr)
            return False, None
    except Exception as e:
        print(f"Exception for {endpoint}: {e}", file=sys.stderr)
        return False, None


def _get_file_content(
    file_path: str,
    headers: Dict[str, str],
    org: str,
    repo: str = "claude-code",
    ref: str = "main",
) -> Optional[str]:
    """Get the content of a file from the repository."""
    success, result = _get_github_api(
        f"contents/{file_path}?ref={ref}", headers, org, repo
    )
    if not success or not result:
        return None

    try:
        content = base64.b64decode(result.get("content", "")).decode("utf-8")
        return content
    except Exception as e:
        print(f"Content decode error for {file_path}: {e}", file=sys.stderr)
        return None


def _verify_commit_exists(
    commit_sha: str, headers: Dict[str, str], org: str, repo: str = "claude-code"
) -> Tuple[bool, Optional[Dict]]:
    """Verify that a commit exists and return its details."""
    success, commit_data = _get_github_api(f"commits/{commit_sha}", headers, org, repo)
    return success, commit_data


def _parse_feature_table(content: str) -> List[Dict]:
    """Parse the feature commit table from markdown content."""
    features = []

    lines = content.split("\n")
    in_table = False

    for line in lines:
        # Look for table header
        if (
            "| Feature Name | Commit SHA | Author | Branch | Date | Files Changed | Commit Message |"
            in line
        ):
            in_table = True
            continue
        if in_table and line.startswith("|---"):
            continue

        # Parse table rows
        if in_table and line.startswith("|"):
            parts = [p.strip() for p in line.split("|")]
            if len(parts) >= 8:  # Should have 7 columns plus empty parts at start/end
                feature_name = parts[1].strip()
                commit_sha = parts[2].strip()
                author = parts[3].strip()
                branch = parts[4].strip()
                date = parts[5].strip()
                files_changed = parts[6].strip()
                commit_message = parts[7].strip()

                if feature_name and commit_sha and author and branch and date:
                    features.append(
                        {
                            "name": feature_name,
                            "sha": commit_sha,
                            "author": author,
                            "branch": branch,
                            "date": date,
                            "files_changed": files_changed,
                            "commit_message": commit_message,
                        }
                    )

        # Stop at end of table section
        if in_table and line and not line.startswith("|") and "##" in line:
            break

    return features


def verify_task() -> bool:
    """Verify the feature commit tracking task."""
    # Load environment variables from .mcp_env
    load_dotenv(".mcp_env")

    # Get GitHub token and org
    github_token = os.environ.get("MCP_GITHUB_TOKEN")
    github_org = os.environ.get("GITHUB_EVAL_ORG")

    if not github_token:
        print("Error: MCP_GITHUB_TOKEN environment variable not set", file=sys.stderr)
        return False

    if not github_org:
        print("Error: GITHUB_EVAL_ORG environment variable not set", file=sys.stderr)
        return False

    headers = {
        "Authorization": f"Bearer {github_token}",
        "Accept": "application/vnd.github.v3+json",
    }

    # Expected feature commits based on exploration
    expected_features = {
        "Shell Completion Scripts": "8a0febdd09bda32f38c351c0881784460d69997d",
        "CHANGELOG Version 1.0.65": "94dcaca5d71ad82644ae97f3a2b0c5eb8b63eae0",
        "Rust Extraction Improvements": "50e58affdf1bfc7d875202bc040ebe0dcfb7d332",
    }

    # Expected authors for each commit
    expected_authors = {
        "8a0febdd09bda32f38c351c0881784460d69997d": "gitmpr",
        "94dcaca5d71ad82644ae97f3a2b0c5eb8b63eae0": "QwertyJack",
        "50e58affdf1bfc7d875202bc040ebe0dcfb7d332": "alokdangre",
    }

    # Expected commit messages for each commit
    expected_messages = {
        "8a0febdd09bda32f38c351c0881784460d69997d": "feat: add shell completions (bash, zsh, fish)",
        "94dcaca5d71ad82644ae97f3a2b0c5eb8b63eae0": "Merge branch 'anthropics:main' into main",
        "50e58affdf1bfc7d875202bc040ebe0dcfb7d332": "Enhance Rust extraction and output handling in workflows",
    }

    # Expected dates for each commit (YYYY-MM-DD format)
    expected_dates = {
        "8a0febdd09bda32f38c351c0881784460d69997d": "2025-08-01",
        "94dcaca5d71ad82644ae97f3a2b0c5eb8b63eae0": "2025-08-02",
        "50e58affdf1bfc7d875202bc040ebe0dcfb7d332": "2025-08-09",
    }

    print("Verifying feature commit tracking task...")

    # 1. Check if FEATURE_COMMITS.md exists in main branch
    print("1. Checking if FEATURE_COMMITS.md exists...")
    content = _get_file_content("FEATURE_COMMITS.md", headers, github_org)
    if not content:
        print("Error: FEATURE_COMMITS.md not found in main branch", file=sys.stderr)
        return False
    print("✓ FEATURE_COMMITS.md found")

    # 2. Check required sections exist
    print("2. Checking required sections...")
    required_sections = [
        "# Feature Development Tracking",
        "## Overview",
        "## Feature Commit History",
    ]

    for section in required_sections:
        if section not in content:
            print(f"Error: Missing required section '{section}'", file=sys.stderr)
            return False
    print("✓ All required sections present")

    # 3. Parse and validate feature table
    print("3. Parsing and validating feature table...")
    features = _parse_feature_table(content)

    if len(features) < 3:
        print(
            f"Error: Expected at least 3 features, found {len(features)}",
            file=sys.stderr,
        )
        return False

    # 4. Verify each expected feature is present with correct commit SHA
    print("4. Verifying feature commit SHAs...")
    found_features = {}
    for feature in features:
        found_features[feature["name"]] = feature["sha"]

    for feature_name, expected_sha in expected_features.items():
        if feature_name not in found_features:
            print(
                f"Error: Feature '{feature_name}' not found in table", file=sys.stderr
            )
            return False

        actual_sha = found_features[feature_name]
        if actual_sha != expected_sha:
            print(
                f"Error: Wrong SHA for '{feature_name}'. Expected: {expected_sha}, Got: {actual_sha}",
                file=sys.stderr,
            )
            return False

    print("✓ All feature commit SHAs are correct")

    # 5. Verify each commit exists and has correct author
    print("5. Verifying commit details...")
    for feature in features:
        if feature["sha"] in expected_features.values():
            success, commit_data = _verify_commit_exists(
                feature["sha"], headers, github_org
            )
            if not success:
                print(f"Error: Commit {feature['sha']} not found", file=sys.stderr)
                return False

            # Check author
            expected_author = expected_authors.get(feature["sha"])
            if expected_author:
                actual_author = commit_data.get("author", {}).get("login", "")
                if actual_author != expected_author:
                    print(
                        f"Error: Wrong author for {feature['sha']}. Expected: {expected_author}, Got: {actual_author}",
                        file=sys.stderr,
                    )
                    return False

            # Check commit message (compare with table entry)
            expected_message = expected_messages.get(feature["sha"])
            if expected_message and "commit_message" in feature:
                if feature["commit_message"] != expected_message:
                    print(
                        f"Error: Wrong commit message in table for {feature['sha']}. Expected: '{expected_message}', Got: '{feature['commit_message']}'",
                        file=sys.stderr,
                    )
                    return False

            # Also verify against actual commit data
            if expected_message:
                actual_message = (
                    commit_data.get("commit", {}).get("message", "").split("\n")[0]
                )  # First line only
                if actual_message != expected_message:
                    print(
                        f"Error: Wrong commit message for {feature['sha']}. Expected: '{expected_message}', Got: '{actual_message}'",
                        file=sys.stderr,
                    )
                    return False

            # Check date format (YYYY-MM-DD)
            if not re.match(r"^\d{4}-\d{2}-\d{2}$", feature["date"]):
                print(
                    f"Error: Invalid date format for {feature['name']}: {feature['date']}",
                    file=sys.stderr,
                )
                return False

            # Check actual date matches expected
            expected_date = expected_dates.get(feature["sha"])
            if expected_date:
                if feature["date"] != expected_date:
                    print(
                        f"Error: Wrong date for {feature['sha']}. Expected: {expected_date}, Got: {feature['date']}",
                        file=sys.stderr,
                    )
                    return False

    print("✓ All commit details verified")

    # 6. Verify the table format is correct
    print("6. Verifying table format...")
    table_header = "| Feature Name | Commit SHA | Author | Branch | Date | Files Changed | Commit Message |"
    if table_header not in content:
        print("Error: Table header format is incorrect", file=sys.stderr)
        return False

    # Check that all features have complete information
    for feature in features:
        if not all(
            [
                feature["name"],
                feature["sha"],
                feature["author"],
                feature["branch"],
                feature["date"],
                feature.get("commit_message", ""),
            ]
        ):
            print(
                f"Error: Incomplete information for feature: {feature['name']}",
                file=sys.stderr,
            )
            return False

    print("✓ Table format is correct and complete")

    print("\n✅ All verification checks passed!")
    print("Feature commit tracking completed successfully:")
    print("  - File: FEATURE_COMMITS.md created in main branch")
    print(f"  - Features tracked: {len(features)}")
    print("  - All expected commit SHAs verified")
    print("  - All commit authors verified")
    print("  - Analysis summary complete")

    return True


if __name__ == "__main__":
    success = verify_task()
    sys.exit(0 if success else 1)