Skip to content

Commit 1ac8ce6

Browse files
committed
docs: add sdk project guidance
1 parent 7a78109 commit 1ac8ce6

4 files changed

Lines changed: 181 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing
2+
3+
This SDK is the Python server SDK for the CALL-E Developer API. It is meant for
4+
trusted backend services, workers, and automation systems.
5+
6+
## Development setup
7+
8+
```bash
9+
uv sync --all-groups
10+
uv run pytest -q
11+
uv run ruff check .
12+
uv run mypy src/calle
13+
uv run python -m py_compile examples/create_and_wait.py examples/webhook_server.py
14+
uv build
15+
uvx twine check dist/*
16+
```
17+
18+
## Local examples
19+
20+
```bash
21+
export CALLE_API_KEY="calle_test_key"
22+
export CALLE_BASE_URL="https://api.example.com"
23+
export CALLE_EXAMPLE_PHONE="+14155550100"
24+
uv run python examples/create_and_wait.py
25+
26+
export CALLE_WEBHOOK_SECRET="whsec_test_key"
27+
uv run python examples/webhook_server.py
28+
```
29+
30+
The webhook example listens on `POST /calle/webhook` and verifies
31+
`CALL-E-Timestamp` plus `CALL-E-Signature` against the raw request body.
32+
33+
## Phase 1 scope
34+
35+
In scope:
36+
37+
- Create a call.
38+
- Read a call.
39+
- Poll until a terminal call result.
40+
- List call events.
41+
- Verify and unwrap signed webhook events.
42+
43+
Out of scope for Phase 1:
44+
45+
- Async client support.
46+
- Batch calls.
47+
- Cancel calls.
48+
- Recurring or scheduled calls.
49+
- Project-level webhook management.
50+
- Pydantic result schema helpers.
51+
52+
## API contract changes
53+
54+
The SDK is generated and wrapped from `openapi/calle.openapi.yaml`.
55+
56+
When the OpenAPI contract changes:
57+
58+
1. Update `openapi/calle.openapi.yaml`.
59+
2. Regenerate generated client code if the generated package is in use.
60+
3. Update wrappers and tests for any changed behavior.
61+
4. Run the full development check list above.
62+
63+
## Pull requests
64+
65+
Keep changes small and focused. Include tests for wrapper behavior, error
66+
handling, webhook signature verification, and any changed API contract surface.
67+
68+
Do not add browser examples or patterns that expose CALL-E API keys to client
69+
code.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ event = client.webhooks.unwrap(
8989
This repository publishes the Python distribution `calle-ai`. Application code
9090
imports it as `calle`.
9191

92+
See [RELEASE.md](./RELEASE.md) for the release checklist, GitHub Actions
93+
workflow, and post-publish install smoke test.
94+
9295
Prerequisites:
9396

9497
- Create a TestPyPI API token and add it as the GitHub Actions secret
@@ -114,3 +117,9 @@ python -c 'from calle import CalleClient; print(CalleClient)'
114117

115118
Use repository `pypi` only after the TestPyPI package has been installed and
116119
tested.
120+
121+
## Project Documents
122+
123+
- [CONTRIBUTING.md](./CONTRIBUTING.md)
124+
- [SECURITY.md](./SECURITY.md)
125+
- [RELEASE.md](./RELEASE.md)

RELEASE.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Release
2+
3+
This repository publishes the Python distribution `calle-ai`. Application code
4+
imports it as `calle`.
5+
6+
## Current status
7+
8+
The package source, CI, and publish workflow are ready. The first registry
9+
publish still requires one of these release identities:
10+
11+
- GitHub Actions secret `TEST_PYPI_API_TOKEN` for TestPyPI,
12+
- GitHub Actions secret `PYPI_API_TOKEN` for PyPI, or
13+
- PyPI/TestPyPI Trusted Publishing configured for this repository and workflow.
14+
15+
Until the first beta is published, use a local checkout for examples and
16+
integration testing.
17+
18+
## Release gates
19+
20+
Run these checks before publishing:
21+
22+
```bash
23+
uv sync --all-groups
24+
uv run pytest -q
25+
uv run ruff check .
26+
uv run mypy src/calle
27+
uv run python -m py_compile examples/create_and_wait.py examples/webhook_server.py
28+
uv build
29+
uvx twine check dist/*
30+
```
31+
32+
The CI workflow also installs the built wheel in a fresh virtual environment and
33+
imports `CalleClient`.
34+
35+
## TestPyPI rehearsal
36+
37+
1. Confirm `pyproject.toml` has a unique beta version, for example `0.1.0b1`.
38+
2. Confirm GitHub Actions secret `TEST_PYPI_API_TOKEN` is configured, unless the
39+
package has been moved to TestPyPI Trusted Publishing.
40+
3. Open the `Publish Python package` workflow in GitHub Actions.
41+
4. Run the workflow from `main` with repository `testpypi`.
42+
5. Confirm the workflow completes the post-publish install smoke test.
43+
44+
Manual verification:
45+
46+
```bash
47+
python -m venv .venv
48+
. .venv/bin/activate
49+
pip install --index-url https://test.pypi.org/simple/ \
50+
--extra-index-url https://pypi.org/simple \
51+
calle-ai==0.1.0b1
52+
python -c 'from calle import CalleClient; print(CalleClient)'
53+
```
54+
55+
## PyPI publish
56+
57+
Use PyPI only after the TestPyPI package has been installed and tested in at
58+
least one backend integration.
59+
60+
1. Increment the version in `pyproject.toml`. PyPI package versions are
61+
immutable.
62+
2. Confirm GitHub Actions secret `PYPI_API_TOKEN` is configured, unless the
63+
package has been moved to PyPI Trusted Publishing.
64+
3. Run the `Publish Python package` workflow from `main` with repository `pypi`.
65+
4. Confirm the workflow completes the post-publish install smoke test.
66+
67+
## Registry identity notes
68+
69+
PyPI Trusted Publishing is preferred once the repository is ready for public
70+
release. Configure a pending publisher for:
71+
72+
- Owner: `CALLE-AI`
73+
- Repository: `server-sdk-python`
74+
- Workflow filename: `publish-python.yml`
75+
- Project name: `calle-ai`

SECURITY.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Security
2+
3+
## Supported versions
4+
5+
The SDK is in Phase 1 beta preparation. Security fixes are applied to the
6+
current beta line.
7+
8+
## Reporting a vulnerability
9+
10+
Do not open a public issue for suspected vulnerabilities. Use GitHub private
11+
vulnerability reporting if it is enabled for this repository; otherwise contact
12+
the CALL-E maintainers directly.
13+
14+
Send a private report to the CALL-E maintainers with:
15+
16+
- Affected package and version.
17+
- Reproduction steps or proof of concept.
18+
- Expected impact.
19+
- Any relevant logs with secrets removed.
20+
21+
## Secret handling
22+
23+
This SDK is for trusted server environments only. Do not expose CALL-E API keys
24+
or webhook secrets in browser code, mobile apps, public logs, or client-side
25+
bundles.
26+
27+
Webhook handlers must verify `CALL-E-Timestamp` and `CALL-E-Signature` against
28+
the raw request body before parsing or trusting an event.

0 commit comments

Comments
 (0)