Skip to Content

lacuna.bundle

Portable, verifiable reproducibility bundles.

Generated from Lacuna 0.14.3. For what these do and when to use them, read the guide.

Classes

BundleArtifact

class BundleArtifact(path: str, role: str, media_type: str, sha256: str, size: int)

One checksummed member declared by a bundle manifest.

FieldTypeDefault
pathstrrequired
rolestrrequired
media_typestrrequired
sha256strrequired
sizeintrequired

BundleArtifact.to_dict

def to_dict() -> dict[str, object]

BundleManifest

class BundleManifest(
    producer_version: str,
    report_schema_version: str,
    report_method: str,
    report_method_version: int,
    report_input_fingerprint: str | None,
    artifact_set_sha256: str,
    artifacts: tuple[BundleArtifact, ...],
    format: str = 'lacuna.reproducibility-bundle',
    bundle_version: int = 1,
    reproducibility_level: str = 'identifiable',
)

Parsed version-1 manifest for a Lacuna reproducibility bundle.

FieldTypeDefault
producer_versionstrrequired
report_schema_versionstrrequired
report_methodstrrequired
report_method_versionintrequired
report_input_fingerprintstr | Nonerequired
artifact_set_sha256strrequired
artifactstuple[BundleArtifact, ...]required
formatstr'lacuna.reproducibility-bundle'
bundle_versionint1
reproducibility_levelstr'identifiable'

BundleManifest.to_dict

def to_dict() -> dict[str, object]

BundleManifest.from_dict

@classmethod
def from_dict(cls, value: Mapping[str, object]) -> BundleManifest

Parse a strict standalone bundle-v1 manifest without reading archive members.

BundleManifest.from_json

@classmethod
def from_json(cls, value: str) -> BundleManifest

Parse finite bundle-v1 manifest JSON while rejecting duplicate keys.

BundleVerification

class BundleVerification(
    path: Path,
    manifest: BundleManifest,
    archive_sha256: str,
    total_size: int,
)

Successful structural and digest verification of a local bundle.

FieldTypeDefault
pathPathrequired
manifestBundleManifestrequired
archive_sha256strrequired
total_sizeintrequired

BundleVerification.artifact_count

artifact_count: int

BundleVerification.to_dict

def to_dict() -> dict[str, object]

Functions

create_bundle

def create_bundle(
    report: AuditReport,
    path: str | os.PathLike[str],
    *,
    configuration: Mapping[str, object] | None = None,
    evidence: Mapping[str, AnalysisResult] | None = None,
    provenance: Mapping[str, object] | None = None,
    invocation: Mapping[str, object] | None = None,
    overwrite: bool = False,
) -> Path

Create a deterministic version-1 evidence bundle without source data or code.

verify_bundle

def verify_bundle(path: str | os.PathLike[str]) -> BundleVerification

Verify bundle structure and SHA-256 integrity without extracting or executing content.

Types and constants

BUNDLE_FORMAT

BUNDLE_FORMAT = 'lacuna.reproducibility-bundle'

BUNDLE_VERSION

BUNDLE_VERSION = 1