Skip to main content

nl2data-admin-service

Optional transport-neutral admin control-plane service for the nl2data-core metadata-to-Bundle lifecycle.

Overview

This package exposes a framework-neutral application service that hosts can wrap with their chosen transport (HTTP, CLI, UI, etc.). It intentionally has no HTTP, web-framework, authentication, or database-driver dependencies, keeping nl2data and nl2data_core transport-free and embeddable.

Installation

pip install -e packages/nl2data-admin-service

Usage

from nl2data_admin_service import AdminService, AdminServiceConfig
from nl2data_admin_service.auth import AuthContext, Permission

# Host provides dependencies and authentication context.
service = AdminService(dependencies, AdminServiceConfig())
context = AuthContext(
    operator_id="operator-1",
    tenant_scope_fingerprint="sha256:...",
    permissions=frozenset([Permission.SNAPSHOT_READ]),
)
snapshot = service.get_snapshot("sha256:...", auth_context=context)

Design

  • Transport-neutral: Service methods accept and return bounded Pydantic DTOs.
  • Host-owned authentication: The host supplies a trusted AuthContext; the service fails closed when it is missing.
  • Tenant/source scoped: Every read and mutation is scoped by the host-provided tenant/source fingerprint.
  • Safe projection: DTOs expose only opaque identifiers, fingerprints, versions, and bounded provenance.
  • Idempotent: Mutating commands require an idempotency key and expected fingerprints/revisions.

Assembly lifecycle

The service projects the core lifecycle without reimplementing it:

  1. create_draft(...) or create_draft_from_proposals(...) creates an AssemblyDraft in draft state. Draft DTOs expose state, assertion counts, safe payload hashes, provenance kinds, redacted deployment-reference schemes, and draft_revision, but no Bundle fingerprint.
  2. submit_draft_for_review(...) moves the draft to review. decide_draft_assertion(...) approves, rejects, or edits one assertion; each mutation requires the current revision, and payload edits invalidate review.
  3. approve_assembly_draft(...) freezes a fully reviewed draft in approved.
  4. publish_draft(...) delegates verification, publish-time fingerprinting, accepted-assertion manifest derivation, audit creation, idempotency, and supersession to core/catalog. Direct publish_bundle(...) is rejected.
  5. activate_published_fingerprint(...) and rollback_published_fingerprint(...) move the active pointer among immutable publications. list_published_versions(...) reports available, active, superseded, deprecated, and retired state with predecessor/successor and audit references.

Lifecycle mutations require both the matching Permission and a trusted host-authorized Author, Reviewer, Approver, or Publisher role. Draft revision conflicts return normalized conflict; missing roles return authorization_denied. Publish outcomes contain bounded issue codes and safe references only, never assertion payloads, resolved connections, or raw operator identities.

Verification Suite

await verify_draft(...) requires assembly:verify, an expected draft revision, and a configured policy profile. The host supplies the trusted verification executor and candidate-bound execution-context factory. Verification may use temporary fixtures and ephemeral secret resolution, but it does not mutate the draft, approval state, catalog, or active pointer.

Planned publication uses PublishDraftCommand with the selected policy and fresh VerificationSuiteEvidence. The service passes those bindings to core; it does not reinterpret skipped, unavailable, timed-out, failed, or not-run outcomes. get_verification_evidence(...) requires assembly:audit and returns only bounded suite/layer/case statuses, counts, issue codes, identities, and fingerprints. Queries, observations, expected or actual values, physical names, deployment references, credentials, and backend exceptions never enter Admin result DTOs.

Semantic authoring

validate_authoring(...) accepts AuthoringDocumentCommand, requires bundle:validate permission and authorized source scope, and returns only a bounded semantic summary or safe source-located diagnostics. It never reads or writes the draft store.

import_authoring(...) accepts ImportAuthoringCommand, requires assembly:write permission plus the trusted author lifecycle role, derives the author reference from AuthContext, and persists through create_draft. Imported assertions always begin pending in a revision-zero draft; authoring cannot review, approve, publish, or activate content.

Capabilities advertise the supported authoring API version and effective maximum input size. The built-in limit is 1 MiB and may be reduced by AdminServiceConfig.max_body_size_bytes.

Service Contract Versioning

The service exposes a versioned command/result schema via nl2data_admin_service.schema.build_schema(contract_version). Host transports can introspect this schema to bind requests and responses without hard-coding DTO shapes.

Metadata

Release files for nl2data-admin-service 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nl2data-admin-service 0.1.0
File Size Uploaded
nl2data_admin_service-0.1.0.tar.gz 43.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nl2data-admin-service 0.1.0
File Interpreter ABI Platform
nl2data_admin_service-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 79.6 kB

Release files / nl2data_admin_service-0.1.0.tar.gz

Download URL nl2data_admin_service-0.1.0.tar.gz
Size 43.5 kB
Tags Source
SHA-256 checksum
How to use checksums
196bcf04d1dd707cde987b4f31cc228152102c702e86aa85ae9c3de9c058ae46
BLAKE2b-256 checksum
How to use checksums
ea4bd6393797edd258461c9e29262276046e68d6af2b2c4e09bdbf8cdeae5bd8
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 Oct 12, 2026.

Transparency log

Release files / nl2data_admin_service-0.1.0-py3-none-any.whl

Download URL nl2data_admin_service-0.1.0-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c0468df5d946f16f0440a0ec3f1c3b6ba0e95b35e0ea4ff47113ad2a7f27f14
BLAKE2b-256 checksum
How to use checksums
d5dca4b2f66d7c9f09e718dcd8ac3ecf009402b221bbf78ff55ae22b98d59fb6
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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page