Juntai Fuse API
Juntai Fuse API is the production API framework for registering one application handler surface and projecting it through supported protocol adapters.
The package contains:
- endpoint and entity-endpoint registration;
- the shared invocation and lifecycle kernel;
- HTTP and generated-gRPC production adapters;
- deterministic OpenAPI and service-owned Protobuf artifact generation;
- versioned, transport-neutral descriptor models; and
- exact dependency profiles for each supported adapter.
It does not provide application-specific contracts, identity, readiness, descriptor storage, entity storage, or simulated platform providers. Applications must supply their own resolver backed by their production data adapter.
Runtime setup
Install the package with the adapter extra used by the service:
uv add 'juntai-fuse-api[http]>=1,<2'
uv add 'juntai-fuse-api[grpc-generated]>=1,<2'
Select the versioned runtime profile and build a server. The shorthand is resolved against the package-owned compatibility matrix and still fails closed when an optional dependency is absent or outside its supported window:
from juntai.sdk.fuse_api import EndpointGroup, FuseServer, select_profile
profile = select_profile("juntai.fuse.profile.http/v1")
items = EndpointGroup("items", prefix="/items")
@items.endpoint(method="GET", path="/{item_id}", protocols=["http"])
async def get_item(item_id: str) -> dict[str, str]:
return {"item_id": item_id}
server = FuseServer(profile=profile)
server.register(items)
server.enable_http()
The framework exposes stable implementation namespaces under decorators/,
invocation/, models/, middleware/, protocols/, generation/, and
testing/. The legacy top-level imports remain aliases to those same objects;
there is no second invocation path or adapter implementation.
Service-owned OpenAPI artifacts
Generate release artifacts from the service composition root. The service supplies its own stable identity, version, source commit, endpoint groups, and output root; FuseAPI supplies only deterministic generation mechanics.
from juntai.sdk.fuse_api import OpenAPIArtifactGenerator, ServiceArtifactIdentity
bundle = OpenAPIArtifactGenerator().generate(
[items],
identity=ServiceArtifactIdentity(
service="inventory-service",
version="1.4.0",
source_commit="0123456789abcdef0123456789abcdef01234567",
),
title="Inventory Service",
)
bundle.write_to(".")
This writes contracts/openapi/inventory-service.v1.json, its .sha256 file,
and contracts/openapi/generation-manifest.json. Serialization is canonical,
the manifest contains no wall-clock timestamp, and compatibility checks are
available through compare_openapi and assert_openapi_compatible. These files
belong to the service repository and are not copied into FuseAPI.
Service-owned Protobuf and generated-gRPC artifacts
Internal gRPC services own their versioned .proto source files. FuseAPI does
not derive published messages, fields, field numbers, RPC names, packages, or
status semantics from endpoint decorators. Compile the owning service's exact
source set with the sole production profile
juntai.fuse.profile.grpc-generated:
from pathlib import Path
from juntai.sdk.fuse_api import (
ProtobufArtifactGenerator,
ProtobufArtifactIdentity,
)
source_path = "example/capability/v1/capability.proto"
bundle = ProtobufArtifactGenerator().generate(
{source_path: Path(source_path).read_text(encoding="utf-8")},
identity=ProtobufArtifactIdentity(
service="capability-service",
version="1.4.0",
source_repository="example/capability-service",
source_commit="0123456789abcdef0123456789abcdef01234567",
),
)
bundle.write_to(".")
bundle.assert_matches(".")
The output under contracts/protobuf/ contains the normalized source set,
Python message bindings, a generated module containing both server bindings and
Python client stubs, an import-complete descriptor set, SHA-256 checksums, and a
canonical generation manifest. The manifest pins the service/release identity,
source repository and commit, FuseAPI version, exact profile and profile
version, grpcio-tools and protobuf versions, every artifact digest, and the
aggregate bundle digest. It contains no timestamp or workspace path.
CI must regenerate in a clean temporary directory with the exact locked
toolchain and call assert_matches against the checked-in artifact tree. A
published contract is immutable; correcting it requires a new service release.
Registry services must not use RPCAdapter.export_spec() or
ProtobufSpecGenerator to create their contracts. They must not emit or expose
a REST/JSON adapter, OpenAPI artifact, browser transport, gateway transcode,
TypeScript generator, or runtime service-registration surface.
Generated Python clients create secure gRPC channels with injected TLS/mTLS or workload-identity credentials, set explicit deadlines, propagate correlation metadata, and preserve cancellation. Service implementations own canonical gRPC status semantics and health behavior; the generated bindings preserve those statuses over the real Python gRPC transport.
Corrected downstream client handoff
The high-level client repositories and standard Python dependencies are:
| Repository | Distribution dependency | Stable import | Generated module root |
|---|---|---|---|
zephytiju/JuntaiConfigurationClient |
juntai-configuration-client>=1,<2 |
juntai.configuration |
juntai.configuration.generated.juntai.registry.configuration.v1 |
JuntaiArtifactClient |
juntai-artifact-client |
juntai.artifact |
juntai.artifact.generated.juntai.registry.artifact.v1 |
Those distribution and import names are packaging metadata only. They are not
written into Registry .proto sources or descriptor sets, and they do not
change the service-owned Protobuf packages or services. Downstream clean
regeneration is pinned by
tests/conformance/fixtures/grpc_generated_downstream.json: FuseAPI 1.1.0,
profile juntai.fuse.profile.grpc-generated version 1.0.0,
grpcio-tools==1.81.1, and protobuf==6.33.6. The immutable FuseAPI release
source repository is exactly zephytiju/JuntaiFuseAPI; downstream provenance
must use that name and must not rely on a repository redirect.
For entity endpoints, implement EntityResolver or wrap an application-owned
production lookup with CallableEntityResolver.
Development
uv sync --all-groups --all-extras
uv run pytest
uv run ruff check src tests scripts
uv build
scripts/verify_profile_packaging.py verifies that packaged extras match the
versioned profile matrix. scripts/verify_artifacts.py validates wheel and source
distribution contents and checksum provenance.
The exact CI workspace is locked by ci/uv.lock.
scripts/bootstrap_ci_workspace.py copies that committed lock into the generated
workspace before Jumbo runs. The released wheel declares the canonical public
juntai-observability>=2.0.1,<3.0.0 distribution so clean service environments
resolve every runtime dependency from PyPI without a local checkout or private
package source.
Releases
The canonical version lives in pyproject.toml. A reviewed version change on
main runs .github/workflows/publish-python.yml, builds the wheel and source
distribution once, publishes those exact files through PyPI Trusted Publishing,
and creates the matching immutable v<version> GitHub release. Publication uses
the protected pypi GitHub environment and short-lived OIDC credentials; no PyPI
API token is stored in GitHub.
Production boundary
Run the repository-wide fail-closed check before dependency setup:
python scripts/check_production_boundary.py
The command scans every path in the Git index. It has no file allowlist or baseline exemption, so source, tests, conformance, integration, examples, documentation commands, container definitions, CI, and acceptance artifacts are all covered whenever present. The test suite includes negative cases proving that every delivery surface is rejected consistently and that an incomplete scan fails closed.
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 juntai_fuse_api-1.1.0.tar.gz.
File metadata
- Download URL: juntai_fuse_api-1.1.0.tar.gz
- Upload date:
- Size: 207.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbcfc73d679033cee3d45bbf0bbbe24d50e83fc2961d8c37adf4c821c7b7b829
|
|
| MD5 |
258b2e0d1389b618bd259e9a914fa61c
|
|
| BLAKE2b-256 |
86b0f6c50cfc15efd9b5248061df369754b593633731669df6f8eb3dbd874fb7
|
Provenance
The following attestation bundles were made for juntai_fuse_api-1.1.0.tar.gz:
Publisher:
publish-python.yml on zephytiju/JuntaiFuseAPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juntai_fuse_api-1.1.0.tar.gz -
Subject digest:
cbcfc73d679033cee3d45bbf0bbbe24d50e83fc2961d8c37adf4c821c7b7b829 - Sigstore transparency entry: 2459878938
- Sigstore integration time:
-
Permalink:
zephytiju/JuntaiFuseAPI@5b43d0ce3d944e6fa20d4ebb5b14b976dca0045e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zephytiju
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@5b43d0ce3d944e6fa20d4ebb5b14b976dca0045e -
Trigger Event:
push
-
Statement type:
File details
Details for the file juntai_fuse_api-1.1.0-py3-none-any.whl.
File metadata
- Download URL: juntai_fuse_api-1.1.0-py3-none-any.whl
- Upload date:
- Size: 80.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a10771b20227518cdbf45e8f513ccd31724d44e39c9aa63c5b51e89e66522565
|
|
| MD5 |
99c2ad36250edba0f13b63b931a958be
|
|
| BLAKE2b-256 |
e6dff51c87ea329996da3cb6039ed4b97b740131837a916ea6a543f46266bd7b
|
Provenance
The following attestation bundles were made for juntai_fuse_api-1.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on zephytiju/JuntaiFuseAPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juntai_fuse_api-1.1.0-py3-none-any.whl -
Subject digest:
a10771b20227518cdbf45e8f513ccd31724d44e39c9aa63c5b51e89e66522565 - Sigstore transparency entry: 2459878965
- Sigstore integration time:
-
Permalink:
zephytiju/JuntaiFuseAPI@5b43d0ce3d944e6fa20d4ebb5b14b976dca0045e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zephytiju
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@5b43d0ce3d944e6fa20d4ebb5b14b976dca0045e -
Trigger Event:
push
-
Statement type: