hh-wonderfish-ai-sdk
文書概要
| 項目 | 内容 |
|---|---|
| 目的 | Product ServiceがWonderfish Control Planeと連携するためのPythonライブラリwonderfish-cp-sdkの、取得方法、ローカル検証手順、リポジトリ構成を示す |
| 対象読者 | SDKの開発者、SDKを組み込むProduct Serviceの開発者、レビュー担当者 |
| 対象範囲 | 本リポジトリのPythonソース、テスト、契約文書、設計書 |
| 対象外 | Control Plane本体の実装、各Product Service本体の実装、Azureへのデプロイ、Secret値 |
wonderfish-cp-sdkは、すべてのProduct Serviceが同じ内容を実装することになる連携処理だけを担います。Control Planeを呼び出す側と、Control Planeから呼び出される側の両方を提供します。責務の境界はProduct Service SDK仕様書3章に定めます。
ディレクトリ
src/wonderfish_cp/ SDKのPythonソース
src/wonderfish_cp/inbound/ Control Planeから呼び出されるPS-inbound router
src/wonderfish_cp/external/ Product Serviceの外部API middleware
src/wonderfish_cp/adapters/ 保存先Portの実装(インメモリ、SQLAlchemy)
tests/ テスト
contracts/ Control Planeから取り込んだOpenAPI(契約の正本の写し)
docs/DetailDesign/ SDK仕様書
docs/サンプルアプリ機能一覧.md 疎通確認用サンプルアプリの機能一覧
docs/サンプルアプリ開発手順書.md 同アプリの作成順序
docs/サンプルアプリシステム構成図.md 同アプリの配置と通信経路
docs/サンプルアプリ結合試験項目書.md 同アプリを使うDEV結合試験の入力、順序、期待結果、証跡
deployment/ DEV環境での疎通確認用サンプルProduct Serviceの構築・削除資材
deployment/は配布物に含めません。手順はサンプルProduct Serviceデプロイ手順に定めます。
主な公開インターフェースを次に示します。詳細はProduct Service SDK仕様書に定めます。
| 用途 | 入口 | 仕様書 |
|---|---|---|
| Control Planeの呼び出し(36 operation) | ControlPlaneClient |
9章 |
| Integration App、Identity、API Role Assignmentの管理 | ControlPlaneClientの9 method |
5.3、9.2 |
| 認可から消費の確定まで | ControlPlaneClient.authorize、AuthorizationSession |
10章 |
| 外部API経路の消費 | ControlPlaneClient.verify_decision、DecisionView.build_usage_fact |
10.4 |
| Usage Factの送信 | UsageFactSender |
10.3 |
| Catalog snapshotと接続先の解決 | CatalogCache |
11章 |
| Control Planeからの5 endpoint | wonderfish_cp.inbound.create_control_plane_router |
12章 |
| 通知のハンドラ | wonderfish_cp.inbound.NotificationRouter |
13章 |
| 外部APIの認証・認可 | wonderfish_cp.external.ExternalAuthorizationMiddleware |
8.4 |
| 保存先 | wonderfish_cp.portsの4 Protocol、wonderfish_cp.adapters |
14章 |
| 準備完了の報告と起動時検査 | ReadinessReporter、wonderfish_cp.conformance |
6.2、6.3 |
| 試験用のControl Plane | wonderfish_cp.testing.FakeControlPlane |
17章 |
wonderfish_cpのimportはextraを必要としません。wonderfish_cp.inbound、wonderfish_cp.external、wonderfish_cp.testingはextra inboundを、wonderfish_cp.adapters.sqlalchemyはextra sqlalchemyを必要とします。
契約の正本はcontracts/README.mdが示すControl Planeリポジトリの2つのOpenAPIです。本リポジトリのcontracts/はその写しであり、手で編集しません。
前提
開発者はPython 3.12を使用します。
導入
Product Serviceは、Public PyPIからversionを固定して取得します。範囲指定にしません。連携仕様の変更をSDKのversion更新として検知するためです。
pip install "wonderfish-cp-sdk[inbound,sqlalchemy]==4.0.1"
extraのinboundはPS-inbound routerに、sqlalchemyは保存先Portの参照実装に必要です。組み込み手順はProduct Service SDK仕様書6章に定めます。
Python 3.12以上を使用します。versionの意味はProduct Service SDK仕様書18章に定めます。
セキュリティ上の問題の連絡
脆弱性または秘密情報の露出を発見した場合は、公開のIssueへ詳細を書かず、support@happyhack.co.jpへ連絡してください。
本SDKはApache License 2.0で提供します。ライセンス本文は配布wheelに含まれます。
ローカル検証
開発者はリポジトリルートで次を実行します。
python -m pip install --require-hashes -r requirements-dev.lock
python -m ruff check src tests deployment .github/scripts
python -m compileall -q src tests deployment .github/scripts
python -m pytest
python -m pip install -e . "uvicorn[standard]"
python deployment/sample/smoke.py
テストはネットワーク、データベース、コンテナのいずれも必要としません。SQLAlchemy adapterの契約テストは一時ディレクトリのSQLiteファイルを使用します。
Control Plane側の前提
SDKをリリースする前に、Control Planeが満たしていなければならない条件はProduct Service SDK仕様書19章に定めます。
19章のOpenAPI条件は、contracts/の取得時点ですべて満たされています。契約テストは取り込んだ文書をそのまま検査し、要求・応答の差を吸収しません。
先行・追随の関係にある項目はありません。
Metadata
Release files for wonderfish-cp-sdk 4.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wonderfish_cp_sdk-4.0.1-py3-none-any.whl | Python 3 | none | any | Details for wonderfish_cp_sdk-4.0.1-py3-none-any.whl |
Release files / wonderfish_cp_sdk-4.0.1-py3-none-any.whl
| Download URL | wonderfish_cp_sdk-4.0.1-py3-none-any.whl |
|---|---|
| Size | 106.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12e679e7387ab7f7aee134a2f2b2b3f74ff8cecc69a493adb932b57f6fc18d6a
|
|
BLAKE2b-256 checksum How to use checksums |
07f9b42217313bc17f586a3d83af3178e47e4b8ee014600de07a5d54f2ac56be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logSecurity for wonderfish-cp-sdk 4.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for wonderfish_cp_sdk-4.0.1-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.