Skip to content

Commit f25f70e

Browse files
committed
Initial commit: agentscore-py v1.0.0
0 parents  commit f25f70e

27 files changed

Lines changed: 1865 additions & 0 deletions

.claude/CLAUDE.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# agentscore-py
2+
3+
Python client for the AgentScore trust and reputation API.
4+
5+
## Architecture
6+
7+
Single-package Python library published to PyPI.
8+
9+
| File | Purpose |
10+
|------|---------|
11+
| `agentscore/` | Source code |
12+
| `tests/` | pytest tests |
13+
14+
## Tooling
15+
16+
- **uv** — package manager. Use `uv sync`, `uv run`.
17+
- **ruff** — linting + formatting. `uv run ruff check .` and `uv run ruff format --check .`.
18+
- **vulture** — dead code detection.
19+
- **pytest** — tests. `uv run pytest tests/`.
20+
- **Lefthook** — git hooks. Pre-commit: ruff. Pre-push: vulture.
21+
22+
## Key Commands
23+
24+
```bash
25+
uv sync --all-extras
26+
uv run ruff check .
27+
uv run ruff format .
28+
uv run pytest tests/
29+
```
30+
31+
## Workflow
32+
33+
1. Create a branch
34+
2. Make changes
35+
3. Lefthook runs ruff on commit, vulture on push
36+
4. Open a PR — CI runs automatically
37+
5. Merge (squash)
38+
39+
## Rules
40+
41+
- **No silent refactors**
42+
- **Never commit .env files or secrets**
43+
- **Use PRs** — never push directly to main
44+
45+
## Releasing
46+
47+
1. Update `version` in `pyproject.toml`
48+
2. Commit: `git commit -am "chore: bump to vX.Y.Z"`
49+
3. Tag: `git tag vX.Y.Z`
50+
4. Push: `git push && git push origin vX.Y.Z`
51+
52+
The publish workflow runs on `ubuntu-latest` (required for PyPI trusted publishing), builds, publishes to PyPI via OIDC, and creates a GitHub Release.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear description of what the bug is.
11+
12+
**To reproduce**
13+
Steps to reproduce the behavior.
14+
15+
**Expected behavior**
16+
What you expected to happen.
17+
18+
**Environment**
19+
- Package version:
20+
- Runtime (Node.js/Python version):
21+
- OS:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an improvement
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Describe the feature**
10+
A clear description of what you'd like.
11+
12+
**Use case**
13+
Why is this needed? What problem does it solve?

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Summary
2+
3+
<!-- What does this PR do? -->
4+
5+
## Test plan
6+
7+
<!-- How was this tested? -->

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "uv"
4+
directory: "/"
5+
labels: ["dependencies", "python"]
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "06:00"
10+
timezone: "America/New_York"
11+
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
labels: ["dependencies", "ci"]
15+
schedule:
16+
interval: "weekly"
17+
day: "monday"
18+
time: "06:00"
19+
timezone: "America/New_York"
20+

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
ci:
14+
runs-on: blacksmith-2vcpu-ubuntu-2404
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: astral-sh/setup-uv@v7
18+
- run: uv sync --frozen --all-extras
19+
- run: uv run ruff check .
20+
- run: uv run ruff format --check .
21+
- run: uv run vulture . vulture_whitelist.py --min-confidence 80 --exclude .venv
22+
- run: uv run pytest tests/

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: write
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- uses: astral-sh/setup-uv@v7
18+
19+
- name: Set version from tag
20+
run: sed -i "s/^version = .*/version = \"${GITHUB_REF_NAME#v}\"/" pyproject.toml
21+
22+
- run: uv build
23+
24+
- name: Publish to PyPI
25+
uses: pypa/gh-action-pypi-publish@release/v1
26+
27+
- name: Create GitHub Release
28+
run: gh release create "$GITHUB_REF_NAME" --generate-notes
29+
env:
30+
GH_TOKEN: ${{ github.token }}
31+

.github/workflows/security.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
osv-scan:
18+
name: Dependency Scan
19+
runs-on: blacksmith-2vcpu-ubuntu-2404
20+
timeout-minutes: 5
21+
steps:
22+
- uses: actions/checkout@v6
23+
24+
- name: Install osv-scanner
25+
run: |
26+
curl -fsSL https://github.com/google/osv-scanner/releases/download/v2.3.2/osv-scanner_linux_amd64 -o osv-scanner
27+
chmod +x osv-scanner
28+
29+
- name: Scan dependencies
30+
run: ./osv-scanner --lockfile=uv.lock --format=table || true
31+
32+
pip-audit:
33+
name: Python Audit
34+
runs-on: blacksmith-2vcpu-ubuntu-2404
35+
timeout-minutes: 5
36+
steps:
37+
- uses: actions/checkout@v6
38+
- uses: astral-sh/setup-uv@v7
39+
- uses: actions/setup-python@v6
40+
with:
41+
python-version: "3.13"
42+
43+
- name: Install pip-audit
44+
run: pip install pip-audit
45+
46+
- name: Audit dependencies
47+
run: |
48+
uv export --format requirements-txt --no-hashes > requirements.txt
49+
pip-audit -r requirements.txt --disable-pip --no-deps || true
50+

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__pycache__/
2+
*.pyc
3+
.venv/
4+
dist/
5+
*.egg-info/
6+
.pytest_cache/
7+
.ruff_cache/
8+
.env
9+
coverage/

CODE_OF_CONDUCT.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to a positive environment:
10+
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior:
18+
19+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
20+
- Trolling, insulting or derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Enforcement
26+
27+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team at engineering@agentscore.sh. All complaints will be reviewed and investigated promptly and fairly.
28+
29+
## Attribution
30+
31+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.

0 commit comments

Comments
 (0)