# valentynkit/jev-commit architecture

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

- Interactive diagram: https://gitdiagram.com/valentynkit/jev-commit
- Repository: https://github.com/valentynkit/jev-commit

## Overview

jev-commit is a Git commit-message hook that compares a cleaned commit message with the staged diff, reports five risk judgments, and normally fails open. The principal flow is: Git invokes the hook; it captures the message and diff, prepares budget-sized states, checks added lines for credential patterns, asks Jev to judge the states, combines scores, then reports and applies the configured blocking policy. The README documents optional strict mode, exclusions, amend-base behavior, and local gateway configuration. Corpus recording and measurement modules are omitted as development tooling; edges reflect the documented flow and the sampled CLI references.

Main entry points: [`jev_commit/cli.py`](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/cli.py) (Hook coordinator), [`jev_commit/jev.py`](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/jev.py) (Jev HTTP client), [`jev_commit/git.py`](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/git.py) (Git capture), [`jev_commit/chunk.py`](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/chunk.py) (State chunking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Commit capture"]
  node_cli["Hook coordinator<br/>[cli.py]"]
  node_git["Git capture<br/>[git.py]"]
end

subgraph group_analysis["Diff analysis"]
  node_chunk["State chunking<br/>[chunk.py]"]
  node_belt["Credential belt<br/>[belt.py]"]
end

subgraph group_judgment["Judgment"]
  node_questions["Judgment questions<br/>[questions.py]"]
  node_jev["Jev HTTP client<br/>[jev.py]"]
  node_decision["Score and gate<br/>[cli.py]"]
end

subgraph group_surface["Hook surface"]
  node_report["Hook report<br/>[report.py]"]
end

node_git_actor(("Git commit"))
node_typesafe{{"Jev service"}}

node_git_actor -->|"invokes hook"| node_cli
node_cli -->|"captures diff"| node_git
node_cli -->|"builds states"| node_chunk
node_cli -->|"scans lines"| node_belt
node_cli -->|"selects questions"| node_questions
node_cli -->|"requests judgments"| node_jev
node_jev -->|"sends request"| node_typesafe
node_cli -->|"combines and gates"| node_decision
node_cli -->|"prints result"| node_report

click node_cli "https://github.com/valentynkit/jev-commit/blob/main/jev_commit/cli.py"
click node_git "https://github.com/valentynkit/jev-commit/blob/main/jev_commit/git.py"
click node_chunk "https://github.com/valentynkit/jev-commit/blob/main/jev_commit/chunk.py"
click node_belt "https://github.com/valentynkit/jev-commit/blob/main/jev_commit/belt.py"
click node_questions "https://github.com/valentynkit/jev-commit/blob/main/jev_commit/questions.py"
click node_jev "https://github.com/valentynkit/jev-commit/blob/main/jev_commit/jev.py"
click node_decision "https://github.com/valentynkit/jev-commit/blob/main/jev_commit/cli.py"
click node_report "https://github.com/valentynkit/jev-commit/blob/main/jev_commit/report.py"

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_cli,node_git toneBlue
class node_chunk,node_belt toneAmber
class node_questions,node_jev,node_decision toneMint
class node_report toneRose
class node_git_actor,node_typesafe toneIndigo
```

## Components

### Commit capture

- [Hook coordinator](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/cli.py): `jev_commit/cli.py`
- [Git capture](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/git.py): `jev_commit/git.py`

### Diff analysis

- [State chunking](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/chunk.py): `jev_commit/chunk.py`
- [Credential belt](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/belt.py): `jev_commit/belt.py`

### Judgment

- [Judgment questions](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/questions.py): `jev_commit/questions.py`
- [Jev HTTP client](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/jev.py): `jev_commit/jev.py`
- [Score and gate](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/cli.py): `jev_commit/cli.py`

### Hook surface

- [Hook report](https://github.com/valentynkit/jev-commit/blob/main/jev_commit/report.py): `jev_commit/report.py`

### Other components

- **Git commit**
- **Jev service**

## Connections

- Git commit → Hook coordinator: invokes hook (evidence: `README.md`)
- Hook coordinator → Git capture: captures diff (evidence: `jev_commit/cli.py`)
- Hook coordinator → State chunking: builds states (evidence: `jev_commit/cli.py`)
- Hook coordinator → Credential belt: scans lines (evidence: `jev_commit/cli.py`)
- Hook coordinator → Judgment questions: selects questions (evidence: `jev_commit/cli.py`)
- Hook coordinator → Jev HTTP client: requests judgments (evidence: `jev_commit/cli.py`)
- Jev HTTP client → Jev service: sends request (evidence: `jev_commit/jev.py`)
- Hook coordinator → Score and gate: combines and gates (evidence: `jev_commit/cli.py`)
- Hook coordinator → Hook report: prints result (evidence: `jev_commit/cli.py`)
