# hosseinkshvrz/apachejit architecture

> Architecture diagram of the GitHub repository hosseinkshvrz/apachejit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hosseinkshvrz/apachejit
- Repository: https://github.com/hosseinkshvrz/apachejit

## Overview

ApacheJIT is both a released just-in-time defect-prediction dataset and its replication workflow. The workflow searches GitHub for issue-fixing commits, mines bug-inducing links and clean commits, links and filters candidates, then assembles labeled commit-metric datasets. The README documents notebook stages and their order, but notebook source was not sampled; those relationships are shown as documented rather than inferred from code. The graph also includes token management and GumTree-based filtering as internal capabilities.

Main entry points: [`src/collector.py`](https://github.com/hosseinkshvrz/apachejit/blob/master/src/collector.py) (Issue search), [`src/gitminer.py`](https://github.com/hosseinkshvrz/apachejit/blob/master/src/gitminer.py) (Commit miner), [`src/gumtree.py`](https://github.com/hosseinkshvrz/apachejit/blob/master/src/gumtree.py) (Change filter), [`notebooks`](https://github.com/hosseinkshvrz/apachejit/tree/master/notebooks) (Candidate filtering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Commit Collection"]
  node_collector["Issue search<br/>[collector.py]"]
  node_tokens["API token manager<br/>[git_token.py]"]
end

subgraph group_mining["Defect Mining"]
  node_gitminer["Commit miner<br/>[gitminer.py]"]
  node_linking["Issue-commit linking"]
  node_intermediate["Intermediate data"]
end

subgraph group_filtering["Candidate Filtering"]
  node_gumtree["Change filter<br/>[gumtree.py]"]
  node_candidate_filtering["Candidate filtering"]
end

subgraph group_dataset["Dataset Outputs"]
  node_construction["Dataset construction"]
  node_datasets["JIT datasets"]
end

node_researcher(("Dataset researcher"))
node_github{{"GitHub API"}}
node_repositories{{"Apache repositories"}}
node_gumtree_tool{{"GumTree executable"}}

node_researcher -->|"starts search"| node_collector
node_collector -->|"manages limits"| node_tokens
node_collector -->|"searches commits"| node_github
node_collector -->|"writes matches"| node_intermediate
node_researcher -->|"runs mining"| node_gitminer
node_gitminer -->|"mines commits"| node_repositories
node_gitminer -->|"writes links and clean commits"| node_intermediate
node_researcher -->|"links reports"| node_linking
node_linking -->|"filters candidates"| node_candidate_filtering
node_candidate_filtering -->|"applies change filters"| node_gumtree
node_gumtree -->|"reads commit changes"| node_repositories
node_gumtree -->|"runs differencing"| node_gumtree_tool
node_candidate_filtering -->|"passes remaining candidates"| node_construction
node_construction -->|"combines clean commits"| node_intermediate
node_construction -->|"builds labeled metrics"| node_datasets
node_researcher -->|"uses for prediction"| node_datasets

click node_collector "https://github.com/hosseinkshvrz/apachejit/blob/master/src/collector.py"
click node_tokens "https://github.com/hosseinkshvrz/apachejit/blob/master/src/git_token.py"
click node_gitminer "https://github.com/hosseinkshvrz/apachejit/blob/master/src/gitminer.py"
click node_linking "https://github.com/hosseinkshvrz/apachejit/tree/master/notebooks"
click node_gumtree "https://github.com/hosseinkshvrz/apachejit/blob/master/src/gumtree.py"
click node_candidate_filtering "https://github.com/hosseinkshvrz/apachejit/tree/master/notebooks"
click node_construction "https://github.com/hosseinkshvrz/apachejit/tree/master/notebooks"
click node_intermediate "https://github.com/hosseinkshvrz/apachejit/tree/master/data"
click node_datasets "https://github.com/hosseinkshvrz/apachejit/tree/master/dataset"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_collector,node_tokens toneBlue
class node_gitminer,node_linking,node_intermediate toneAmber
class node_gumtree,node_candidate_filtering,node_github toneMint
class node_construction,node_datasets toneRose
class node_researcher,node_repositories,node_gumtree_tool toneIndigo
```

## Components

### Commit Collection

- [Issue search](https://github.com/hosseinkshvrz/apachejit/blob/master/src/collector.py): `src/collector.py`
- [API token manager](https://github.com/hosseinkshvrz/apachejit/blob/master/src/git_token.py): `src/git_token.py`

### Defect Mining

- [Commit miner](https://github.com/hosseinkshvrz/apachejit/blob/master/src/gitminer.py): `src/gitminer.py`
- [Issue-commit linking](https://github.com/hosseinkshvrz/apachejit/tree/master/notebooks): `notebooks`
- [Intermediate data](https://github.com/hosseinkshvrz/apachejit/tree/master/data): `data`

### Candidate Filtering

- [Change filter](https://github.com/hosseinkshvrz/apachejit/blob/master/src/gumtree.py): `src/gumtree.py`
- [Candidate filtering](https://github.com/hosseinkshvrz/apachejit/tree/master/notebooks): `notebooks`

### Dataset Outputs

- [Dataset construction](https://github.com/hosseinkshvrz/apachejit/tree/master/notebooks): `notebooks`
- [JIT datasets](https://github.com/hosseinkshvrz/apachejit/tree/master/dataset): `dataset`

### Other components

- **Dataset researcher**
- **GitHub API**
- **Apache repositories**
- **GumTree executable**

## Connections

- Dataset researcher → Issue search: starts search (evidence: `readme.md`)
- Issue search → API token manager: manages limits (evidence: `src/collector.py`)
- Issue search → GitHub API: searches commits (evidence: `src/collector.py`)
- Issue search → Intermediate data: writes matches (evidence: `src/collector.py`)
- Dataset researcher → Commit miner: runs mining (evidence: `readme.md`)
- Commit miner → Apache repositories: mines commits (evidence: `src/gitminer.py`)
- Commit miner → Intermediate data: writes links and clean commits (evidence: `src/gitminer.py`)
- Dataset researcher → Issue-commit linking: links reports (evidence: `readme.md`)
- Issue-commit linking → Candidate filtering: filters candidates (evidence: `readme.md`)
- Candidate filtering → Change filter: applies change filters (evidence: `readme.md`)
- Change filter → Apache repositories: reads commit changes (evidence: `src/gumtree.py`)
- Change filter → GumTree executable: runs differencing (evidence: `src/gumtree.py`)
- Candidate filtering → Dataset construction: passes remaining candidates (evidence: `readme.md`)
- Dataset construction → Intermediate data: combines clean commits (evidence: `readme.md`)
- Dataset construction → JIT datasets: builds labeled metrics (evidence: `readme.md`)
- Dataset researcher → JIT datasets: uses for prediction (evidence: `readme.md`)
