# locoloboz/jev-seatbelts architecture

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

- Interactive diagram: https://gitdiagram.com/locoloboz/jev-seatbelts
- Repository: https://github.com/locoloboz/jev-seatbelts

## Overview

jev-seatbelts is a Claude Code hook plugin that applies seven checks during an agent’s work, from planning and package installation through risky commands, commits, debugging, code quality, and completion claims. Hook input is evaluated by the relevant gate; most use deterministic checks first, with Jev reserved for selected uncertain judgments. Shared findings let later gates observe earlier results, while drift monitoring and one-time bypasses provide supporting controls. The README documents the checkpoints and integrations; source excerpts and the index support only the specific code relationships shown below.

Main entry points: [`lib/jevgate.py`](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/jevgate.py) (Jev gate plumbing), [`skills/command-safety/scripts/command_safety.py`](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/command-safety/scripts/command_safety.py) (Command safety), [`lib/findings.py`](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/findings.py) (Session findings), [`skills/commit-screening/scripts/commit_screening.py`](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/commit-screening/scripts/commit_screening.py) (Commit screening)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gates["Workflow gates"]
  node_plan["Plan check<br/>[plan_gate.py]"]
  node_package["Package check<br/>[package_check.py]"]
  node_command["Command safety<br/>[command_safety.py]"]
  node_commit["Commit screening"]
  node_debug["Debug triage"]
  node_quality["Code quality<br/>[code_quality.py]"]
  node_completion["Completion check"]
end

subgraph group_shared["Shared runtime"]
  node_jev["Jev gate plumbing<br/>[jevgate.py]"]
  node_findings[("Session findings<br/>[findings.py]")]
  node_bash["Bash parser<br/>[bashparse.py]"]
  node_powershell["PowerShell parser<br/>[psparse.py]"]
  node_bypass["One-time bypass<br/>[bypass.py]"]
end

subgraph group_ops["Monitoring controls"]
  node_drift["Drift guard<br/>[driftguard.py]"]
  node_drift_hook["Drift hook<br/>[driftcheck_hook.py]"]
  node_stall["Stall check<br/>[stall_check.py]"]
  node_gatelog[("Decision review<br/>[gatelog.py]")]
  node_calibration["Calibration math<br/>[calibration.py]"]
end

subgraph group_external["External services"]
  node_jev_service{{"Jev service"}}
end

node_agent(("Claude Code"))

node_agent -->|"hooks invoke"| node_plan
node_agent -->|"hooks invoke"| node_package
node_agent -->|"hooks invoke"| node_command
node_agent -->|"hooks invoke"| node_commit
node_agent -->|"checkpoint invokes"| node_debug
node_agent -->|"checkpoint invokes"| node_quality
node_agent -->|"hooks invoke"| node_completion
node_plan -->|"uses"| node_jev
node_package -->|"uses"| node_jev
node_command -->|"parses commands"| node_bash
node_command -->|"parses commands"| node_powershell
node_command -->|"uses"| node_jev
node_command -.->|"checks bypass"| node_bypass
node_commit -->|"parses commands"| node_bash
node_commit -->|"uses"| node_jev
node_debug -->|"uses"| node_jev
node_quality -->|"parses commands"| node_bash
node_quality -->|"uses"| node_jev
node_completion -->|"uses"| node_jev
node_plan -->|"writes findings"| node_findings
node_package -->|"writes findings"| node_findings
node_command -->|"writes findings"| node_findings
node_commit -->|"writes findings"| node_findings
node_debug -->|"writes findings"| node_findings
node_quality -->|"writes findings"| node_findings
node_completion -->|"reads findings"| node_findings
node_jev -.->|"requests judgment"| node_jev_service
node_drift_hook -->|"runs checks"| node_drift
node_drift -->|"uses"| node_jev
node_stall -->|"uses"| node_jev
node_gatelog -->|"uses utilities"| node_jev
node_bypass -->|"records use"| node_findings
node_command -.->|"consumes ticket"| node_bypass
node_commit -.->|"consumes ticket"| node_bypass
node_calibration -.->|"supports calibration"| node_gatelog

click node_plan "https://github.com/locoloboz/jev-seatbelts/blob/main/skills/plan-gate/scripts/plan_gate.py"
click node_package "https://github.com/locoloboz/jev-seatbelts/blob/main/skills/package-check/scripts/package_check.py"
click node_command "https://github.com/locoloboz/jev-seatbelts/blob/main/skills/command-safety/scripts/command_safety.py"
click node_commit "https://github.com/locoloboz/jev-seatbelts/blob/main/skills/commit-screening/scripts/commit_screening.py"
click node_debug "https://github.com/locoloboz/jev-seatbelts/blob/main/skills/debug-triage/scripts/hypothesis_ranker.py"
click node_quality "https://github.com/locoloboz/jev-seatbelts/blob/main/skills/code-quality/scripts/code_quality.py"
click node_completion "https://github.com/locoloboz/jev-seatbelts/blob/main/skills/completion-check/scripts/completion_check.py"
click node_jev "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/jevgate.py"
click node_findings "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/findings.py"
click node_bash "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/bashparse.py"
click node_powershell "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/psparse.py"
click node_bypass "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/bypass.py"
click node_drift "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/driftguard.py"
click node_drift_hook "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/driftcheck_hook.py"
click node_stall "https://github.com/locoloboz/jev-seatbelts/blob/main/skills/debug-triage/scripts/stall_check.py"
click node_gatelog "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/gatelog.py"
click node_calibration "https://github.com/locoloboz/jev-seatbelts/blob/main/lib/calibration.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_plan,node_package,node_command,node_commit,node_debug,node_quality,node_completion toneBlue
class node_jev,node_findings,node_bash,node_powershell,node_bypass toneAmber
class node_drift,node_drift_hook,node_stall,node_gatelog,node_calibration toneMint
class node_jev_service toneRose
class node_agent toneIndigo
```

## Components

### Workflow gates

- [Plan check](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/plan-gate/scripts/plan_gate.py): `skills/plan-gate/scripts/plan_gate.py`
- [Package check](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/package-check/scripts/package_check.py): `skills/package-check/scripts/package_check.py`
- [Command safety](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/command-safety/scripts/command_safety.py): `skills/command-safety/scripts/command_safety.py`
- [Commit screening](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/commit-screening/scripts/commit_screening.py): `skills/commit-screening/scripts/commit_screening.py`
- [Debug triage](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/debug-triage/scripts/hypothesis_ranker.py): `skills/debug-triage/scripts/hypothesis_ranker.py`
- [Code quality](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/code-quality/scripts/code_quality.py): `skills/code-quality/scripts/code_quality.py`
- [Completion check](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/completion-check/scripts/completion_check.py): `skills/completion-check/scripts/completion_check.py`

### Shared runtime

- [Jev gate plumbing](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/jevgate.py): `lib/jevgate.py`
- [Session findings](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/findings.py): `lib/findings.py`
- [Bash parser](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/bashparse.py): `lib/bashparse.py`
- [PowerShell parser](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/psparse.py): `lib/psparse.py`
- [One-time bypass](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/bypass.py): `lib/bypass.py`

### Monitoring controls

- [Drift guard](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/driftguard.py): `lib/driftguard.py`
- [Drift hook](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/driftcheck_hook.py): `lib/driftcheck_hook.py`
- [Stall check](https://github.com/locoloboz/jev-seatbelts/blob/main/skills/debug-triage/scripts/stall_check.py): `skills/debug-triage/scripts/stall_check.py`
- [Decision review](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/gatelog.py): `lib/gatelog.py`
- [Calibration math](https://github.com/locoloboz/jev-seatbelts/blob/main/lib/calibration.py): `lib/calibration.py`

### External services

- **Jev service**

### Other components

- **Claude Code**

## Connections

- Claude Code → Plan check: hooks invoke (evidence: `README.md`)
- Claude Code → Package check: hooks invoke (evidence: `README.md`)
- Claude Code → Command safety: hooks invoke (evidence: `README.md`)
- Claude Code → Commit screening: hooks invoke (evidence: `README.md`)
- Claude Code → Debug triage: checkpoint invokes (evidence: `README.md`)
- Claude Code → Code quality: checkpoint invokes (evidence: `README.md`)
- Claude Code → Completion check: hooks invoke (evidence: `README.md`)
- Plan check → Jev gate plumbing: uses (evidence: `skills/plan-gate/scripts/plan_gate.py`)
- Package check → Jev gate plumbing: uses (evidence: `skills/package-check/scripts/package_check.py`)
- Command safety → Bash parser: parses commands (evidence: `skills/command-safety/scripts/command_safety.py`)
- Command safety → PowerShell parser: parses commands (evidence: `skills/command-safety/scripts/command_safety.py`)
- Command safety → Jev gate plumbing: uses (evidence: `skills/command-safety/scripts/command_safety.py`)
- Command safety → One-time bypass: checks bypass (evidence: `skills/command-safety/scripts/command_safety.py`)
- Commit screening → Bash parser: parses commands (evidence: `skills/commit-screening/scripts/commit_screening.py`)
- Commit screening → Jev gate plumbing: uses (evidence: `skills/commit-screening/scripts/commit_screening.py`)
- Debug triage → Jev gate plumbing: uses (evidence: `skills/debug-triage/scripts/hypothesis_ranker.py`)
- Code quality → Bash parser: parses commands (evidence: `skills/code-quality/scripts/code_quality.py`)
- Code quality → Jev gate plumbing: uses (evidence: `skills/code-quality/scripts/code_quality.py`)
- Completion check → Jev gate plumbing: uses (evidence: `skills/completion-check/scripts/completion_check.py`)
- Plan check → Session findings: writes findings (evidence: `skills/plan-gate/scripts/plan_gate.py`)
- Package check → Session findings: writes findings (evidence: `skills/package-check/scripts/package_check.py`)
- Command safety → Session findings: writes findings (evidence: `skills/command-safety/scripts/command_safety.py`)
- Commit screening → Session findings: writes findings (evidence: `skills/commit-screening/scripts/commit_screening.py`)
- Debug triage → Session findings: writes findings (evidence: `skills/debug-triage/scripts/hypothesis_ranker.py`)
- Code quality → Session findings: writes findings (evidence: `skills/code-quality/scripts/code_quality.py`)
- Completion check → Session findings: reads findings (evidence: `skills/completion-check/scripts/completion_check.py`)
- Jev gate plumbing → Jev service: requests judgment
- Drift hook → Drift guard: runs checks (evidence: `lib/driftcheck_hook.py`)
- Drift guard → Jev gate plumbing: uses (evidence: `lib/driftguard.py`)
- Stall check → Jev gate plumbing: uses (evidence: `skills/debug-triage/scripts/stall_check.py`)
- Decision review → Jev gate plumbing: uses utilities (evidence: `lib/gatelog.py`)
- One-time bypass → Session findings: records use (evidence: `lib/bypass.py`)
- Command safety → One-time bypass: consumes ticket (evidence: `skills/command-safety/scripts/command_safety.py`)
- Commit screening → One-time bypass: consumes ticket (evidence: `skills/commit-screening/scripts/commit_screening.py`)
- Calibration math → Decision review: supports calibration
