SHIP Protocol — AI code reliability scoring. Score, detect, and gate AI-generated code.
Project description
ship-score
SHIP Protocol — AI code reliability scoring for Python.
Score AI-generated commits, detect AI-written code, and gate commits via pre-commit hooks.
Install
pip install ship-score
CLI Usage
Score a commit
ship-score score --repo owner/repo --message "feat: add user auth" --language python
# SHIP Score: 73/100 (Grade: B) | Confidence: 0.82
Detect AI-generated code
ship-score detect --file main.py
# AI-Generated: Yes (89% confidence) | 174 features analyzed
Generate a report
ship-score report owner/repo
Check API health
ship-score health
# ✓ API reachable: https://ship-protocol.dhruvaapi.workers.dev
# Commits: 22,060
# Repos: 10,003
List AI tool rankings
ship-score tools
JSON output
Add --json to score or detect for machine-readable output:
ship-score score --repo owner/repo --message "fix: bug" --json
Library Usage
from ship_score import ShipClient
client = ShipClient()
# Score a commit
score = client.score(repo="owner/repo", message="feat: add auth", language="python")
print(score.score, score.grade) # 73, "B"
print(score.confidence) # 0.82
print(score.recommendations) # ["Add tests", ...]
# Detect AI-generated code
detection = client.detect(code=open("main.py").read(), language="python")
print(detection.is_ai, detection.confidence) # True, 0.89
# List AI tool rankings
tools = client.tools()
for tool in tools:
print(f"{tool.display_name}: {tool.grade}")
# Health check
health = client.health()
print(health.api_reachable, health.total_commits)
Custom API URL
client = ShipClient(base_url="https://your-instance.example.com")
Or set the SHIP_API_URL environment variable for the CLI.
Pre-commit Hook
Add to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/vibeatlas/ship-score-python
rev: v1.0.0
hooks:
- id: ship-score
args: ['--min-score=60']
The hook:
- Extracts the staged commit message and changed file languages
- Scores via the SHIP API
- Blocks the commit if the score is below the threshold (default: 60)
- Prints recommendations on how to improve
API Reference
The package wraps the SHIP Protocol API:
| Endpoint | Method | Description |
|---|---|---|
/v2/score |
POST | Score an AI-generated commit |
/v2/detect |
POST | Detect AI-generated code |
/v2/tools |
GET | AI tool reliability rankings |
/v2/crawler-status |
GET | Data pipeline stats |
Development
git clone https://github.com/vibeatlas/ship-score-python.git
cd ship-score-python
pip install -e ".[dev]"
pytest
mypy ship_score/
ruff check .
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ship_score-1.0.0.tar.gz.
File metadata
- Download URL: ship_score-1.0.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
556038063c7a91b593a81e5709a0d7c234e67ed34ed28c4b1dd047310f8dc9f7
|
|
| MD5 |
0a3dc171eb93950128e6b755b4b217a9
|
|
| BLAKE2b-256 |
5345936b01ebf0eb9151b336279f98e00b5420baa5c2d5a1b6bac7e66e0912fc
|
File details
Details for the file ship_score-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ship_score-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53e3e0a707134bb605c3af252059bdd727c9f2c5d362172d25c03240104965c3
|
|
| MD5 |
4bffa23254c70bb4d5f4c5370b417a70
|
|
| BLAKE2b-256 |
2b65d170547463eca1be461cde16ca1a082fc2e1b6f9ae054f0cb2e7cd796d53
|