Python SDK
MissionWeaveProtocol Python SDK は、MissionWeaveProtocol 0.1 の公式 Python リファレンス実装です。authoritative Core、Agent runtime、Worker Scheduler、Group gateway、ストレージアダプター、適合性テストランナー、実行可能な proof of concept を含みます。
以下の手順では、SDK リポジトリのソース checkout を使用します。
- Python 3.12 以降
uv- optional な PostgreSQL integration test 用の Docker
SDK を checkout して準備する
Section titled “SDK を checkout して準備する”git clone https://github.com/missionweaveprotocol/python-sdk.gitcd python-sdkuv sync --extra devソースパッケージは
src/missionweaveprotocol/
です。project metadata と command entry point は
pyproject.toml
で定義されています。
ソース checkout を検証する
Section titled “ソース checkout を検証する”uv run pytestuv run ruff check .uv run ruff format --check .uv run mypyuv run missionweaveprotocol-conformance --root .適合性 command は、同梱された 56 個の vector すべてを、同梱された 21 個の Draft
2020-12 schema に対して検証します。プロトコルリポジトリが引き続き規範となり、
PROTOCOL_PIN.json
には SDK が使用する正確な protocol commit と artifact
digest が記録されています。
代わりに、同じ階層へ checkout した正式なプロトコルリポジトリを検証するには、次を実行します。
git clone https://github.com/missionweaveprotocol/missionweaveprotocol.git ../missionweaveprotocoluv run missionweaveprotocol-conformance --root ../missionweaveprotocolproof of concept を実行する
Section titled “proof of concept を実行する”uv run missionweaveprotocol-demo --workdir .missionweaveprotocol/pocこの command は canonical JSON report を 1 件生成し、必要な動作が欠けている場合は nonzero status で終了します。deterministic scenario は、2 つの concurrent Mission、共有 Worker、サブタスク、Agent 間の clarification、scheduling、checkpoint-only preemption、recovery、Coordinator verification、正確な human Approval を対象とします。
PostgreSQL integration test を実行する
Section titled “PostgreSQL integration test を実行する”docker compose up -d --wait postgresMISSIONWEAVEPROTOCOL_TEST_POSTGRES_URL=postgresql://missionweaveprotocol:missionweaveprotocol@127.0.0.1:55432/missionweaveprotocol \ uv run pytest tests/test_core.py -q終了したらローカルサービスを停止します。
docker compose down --volumesdevelopment gateway を実行する
Section titled “development gateway を実行する”使い捨ての開発用 key と、Organization 署名付きの Agent Registry を作成します。
uv run python examples/create_dev_registry.pyexport MISSIONWEAVEPROTOCOL_ORGANIZATION_PUBLIC_KEY="$(uv run python -c \ 'import json; print(json.load(open(".missionweaveprotocol/dev-keys.json"))["organizationPublicKey"])')"export MISSIONWEAVEPROTOCOL_AUTHORITY_PRIVATE_KEY="$(uv run python -c \ 'import json; print(json.load(open(".missionweaveprotocol/dev-keys.json"))["authorityPrivateKey"])')"export MISSIONWEAVEPROTOCOL_SESSION_SECRET='development-only-session-secret-32-bytes'
uv run missionweaveprotocol-server \ --registry .missionweaveprotocol/dev-registry.json \ --database-url postgresql://missionweaveprotocol:missionweaveprotocol@127.0.0.1:55432/missionweaveprotocol \ --organization-public-key "$MISSIONWEAVEPROTOCOL_ORGANIZATION_PUBLIC_KEY" \ --allow-insecure--allow-insecure はループバック上での開発専用です。deployment では
--tls-certfile と --tls-keyfile
を指定する必要があります。MissionWeaveProtocol 0.1 では TLS 1.3 上の secure
WebSocket transport が必須です。
ローカル artifact を build する
Section titled “ローカル artifact を build する”uv build生成されるローカル wheel には py.typed と、runtime document
validation に使用する pin 済みの 21 個の schema が含まれます。
実装の詳細、test、現在の compatibility 情報については、正式な SDK README を参照してください。