Studio Federation API

July 4, 2026 ยท View on GitHub

sc_neurocore.federation is the optional Hub-facing Studio federation surface. It is separate from the local FastAPI Studio app under sc_neurocore.studio: the federation package emits schema-A capability manifests, schema-B evidence bundles, and verifiable-honesty envelopes for SC-NeuroCore result claims.

Install the optional platform contract before importing it:

pip install "sc-neurocore[federation]"

The extra pins scpn-studio-platform>=0.9,<0.10. Environments without that platform SDK should not import this package; tests use pytest.importorskip so the base CI lane stays independent of the optional federation dependency.

Capability Manifest

Use build_manifest() to produce the schema-A manifest consumed by the Studio Hub:

from sc_neurocore.federation import build_manifest

manifest = build_manifest()
assert manifest.studio == "sc-neurocore"

The manifest advertises eight verbs:

VerbPurposeEvidence schema
encodeConvert float values into stochastic bitstreams.studio.bitstream-encoding.v1
simulateRun stochastic-computing inference.studio.sc-inference.v1
analyseExtract spike-train analysis results.studio.spike-analysis.v1
benchmarkMeasure backend throughput against the NumPy reference.studio.backend-benchmark.v1
validateCompare fixed-point reference and RTL co-simulation.studio.cosim-parity.v1
compileLower a model to synthesisable RTL.studio.rtl-compilation.v1
synthesiseRecord synthesis resource/timing evidence.studio.fpga-deployment.v1
deployRecord FPGA deployment evidence.studio.fpga-deployment.v1

The committed manifest artifact lives at docs/_generated/studio_manifest.json and is generated by:

python tools/emit_studio_manifest.py
python tools/emit_studio_manifest.py --check

The digest covers the declared verbs and evidence schemas, not the current git state, so the manifest is stable across checkouts with the same federation surface.

Evidence Bundles

sc_inference_evidence() maps a stochastic inference result into a measured software evidence bundle. It renders as reference-validated only when the accelerated backend is bit-identical to the NumPy reference for the fixed seed. Otherwise the claim is bounded and rejected by the shared platform lattice.

fpga_deployment_evidence() maps a synthesis/deployment result into a hardware-validated FPGA evidence bundle. It renders as reference-validated only when the RTL co-simulation is bit-exact; a mismatch becomes validation-gap.

from sc_neurocore.federation import (
    ScInferenceResult,
    sc_inference_evidence,
)

result = ScInferenceResult(
    active_backend="rust",
    reference_backend="numpy",
    max_abs_error=0.0,
    bitstream_length=4096,
    input_digest="sha256:" + "a" * 64,
    result_digest="sha256:" + "b" * 64,
)

bundle = sc_inference_evidence(
    result,
    operator="opaque:tenant-1",
    studio_version="3.16.0",
    started="2026-06-26T00:00:00Z",
    ended="2026-06-26T00:00:01Z",
)

Verifiable-Honesty Envelopes

The attestation helpers wrap platform seals so a rendered claim grade can be verified from signed evidence:

  • seal_sc_inference() uses recompute mode for bit-exact SC inference.
  • attest_fpga_deployment() uses attestation mode for FPGA result packs that cannot be recomputed client-side.
  • verify_envelope() recomputes the grade by schema and detects stripped, forged, or mismatched rendered claims.

FpgaArtifact entries must be content-addressed. A bit-exact FPGA claim earns the validated grade only when a cosim-transcript artifact backs it.

Reference

::: sc_neurocore.federation