Metadata-Version: 2.4
Name: meridian-plugin-config-artifact
Version: 1.0.0
Summary: Meridian V1 configuration and artifact publication and consumption plugin
Project-URL: Documentation, https://github.com/zephytiju/meridian-plugin-config-artifact#readme
Project-URL: Issues, https://github.com/zephytiju/meridian-plugin-config-artifact/issues
Project-URL: Repository, https://github.com/zephytiju/meridian-plugin-config-artifact
Author: Meridian contributors
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: artifact,configuration,meridian,metadata,object-storage
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: <3.15,>=3.12
Requires-Dist: meridian-storage-core==1.0.0
Requires-Dist: meridian-storage-object-common==1.0.0
Requires-Dist: meridian-storage-query==1.0.0
Requires-Dist: meridian-storage-semantics==1.0.0
Provides-Extra: oci
Requires-Dist: meridian-storage-oci==1.0.0; extra == 'oci'
Provides-Extra: s3
Requires-Dist: meridian-storage-s3==1.0.0; extra == 's3'
Provides-Extra: test
Requires-Dist: bandit[toml]==1.8.6; extra == 'test'
Requires-Dist: build==1.3.0; extra == 'test'
Requires-Dist: hatchling==1.27.0; extra == 'test'
Requires-Dist: hypothesis==6.138.15; extra == 'test'
Requires-Dist: jsonschema==4.25.1; extra == 'test'
Requires-Dist: meridian-storage-oci==1.0.0; extra == 'test'
Requires-Dist: meridian-storage-s3==1.0.0; extra == 'test'
Requires-Dist: mypy==1.17.1; extra == 'test'
Requires-Dist: pip-audit==2.9.0; extra == 'test'
Requires-Dist: pytest-cov==6.2.1; extra == 'test'
Requires-Dist: pytest==9.0.3; extra == 'test'
Requires-Dist: ruff==0.12.10; extra == 'test'
Requires-Dist: twine==6.1.0; extra == 'test'
Description-Content-Type: text/markdown

# Meridian Configuration and Artifact Plugin

`meridian-plugin-config-artifact` is the Apache-2.0 licensed Meridian V1 library for publishing
and consuming versioned configuration and built runtime artifacts. It is an embeddable plugin,
never a service or a Catalog.

Configuration payloads remain queryable and mutable through structured database semantics until
publication. A published version stores its validated JSON inline and is immutable. Artifact bytes
are written as immutable Objects; only their logical metadata, provenance, lifecycle state, and
channel pointers are structured records.

## Install

```console
python -m pip install meridian-plugin-config-artifact
```

Python 3.12–3.14 and the exact Meridian 1.0.0 Core, Semantics, Query, and Object Common releases
are supported. Add `meridian-plugin-config-artifact[s3]` or `[oci]` only to co-install a released
provider; this library never imports either provider or its SDK.

## Compose

The Artifact publisher and Object Adapter must share the same process-local payload registry. Use
the package registry before constructing the runtime:

```python
from meridian_storage.adapters.s3 import S3AdapterFactory
from meridian_storage.plugins.config_artifact import (
    ResourceStore,
    default_payload_registry,
)

payloads = default_payload_registry()
adapter_factory = S3AdapterFactory(payloads=payloads)

# Construct and start Meridian with Platform-IaC-rendered bindings, the released
# structured/object Catalog providers, ConfigArtifactSchemaProvider, and adapter_factory.
store = ResourceStore(meridian, payload_registry=payloads)
```

`default_payload_registry()` is deliberately truthy even while empty so released V1 Adapter
factory constructors preserve the injected object. Applications may instead inject their own
already-shared `PayloadRegistry`.

The schema entry point contributes these logical Resources by default:

- `structured:resources.metadata`
- `structured:resources.channels`
- `structured:resources.provenance`
- `structured:resources.orphan-candidates`
- `object:resources.objects`

Platform IaC owns their physical provisioning, binding, identity/ACL, migrations, recovery, and
lifecycle. Constructor arguments accept alternate logical Resource refs; no physical locator is
accepted.

## Publish configuration

```python
receipt = store.publisher.publish_configuration(
    namespace="checkout",
    kind="service",
    name="runtime",
    version="2026.08.26",
    payload={"endpoint": "https://api.example", "replicas": 3},
    schema="application.service-config@1.0.0",
    actor="release-bot",
    version_order=20260826,
    channel="production",
    expected_pointer_version=4,
)
```

The profile-specific surface from the locked LLD is also available directly. Publication receipts
expose their immutable `ref` for a later compare-and-set promotion:

```python
revision = store.configurations.publish(
    namespace="checkout",
    kind="service",
    name="runtime",
    version="2026.08.27",
    payload={"endpoint": "https://api.example", "replicas": 3},
    schema="application.service-config@1.0.0",
    actor="release-bot",
)
store.configurations.promote(
    revision.ref,
    "production",
    expected_pointer_version=5,
    actor="release-bot",
)
```

The exact Schema is resolved through Core and applied locally with Meridian Semantics before any
write. A retry with the same immutable content is idempotent; a different digest or immutable
metadata at the same logical identity raises `IdentityConflict`.

## Publish and consume an artifact

```python
receipt = store.publisher.publish_artifact(
    namespace="recommendations",
    kind="model",
    name="ranker",
    version="v42",
    payload=model_bytes,
    media_type_value="application/vnd.example.model",
    actor="model-builder",
)

resolved = store.consumer.artifacts.exact(receipt.resource.identity)
with store.consumer.artifacts.open(resolved) as stream:
    deploy(stream)
```

Bytes, streams, `PayloadSource` objects, factories, and pre-registered `PayloadReference` values
are supported. Streaming inputs must declare SHA-256 digest and byte length. Full reads are checked
again at the consumer boundary; range reads use the released Object Catalog verification contract.

Artifact publication commits the Object first, then structured metadata and provenance. If the
second phase fails, `IncompletePublication` is raised and an idempotently addressed orphan
candidate is recorded. `discover_orphans()` scans only bounded logical Object prefixes and never
deletes bytes.

## Resolution and lifecycle

Configuration and Artifact consumers each support:

- `exact(ResourceIdentity(...))`
- `latest(namespace, kind, name)` using `version_order`, then creation time
- `channel(namespace, kind, name, channel)`

Channel promotion requires `expected_pointer_version`; concurrent writers cannot silently win.
Published versions may be deprecated but the library forbids deletion. It contains no bootstrap
configuration, provider credentials, Adapter/Engine selection, NativeQuery, endpoint, or physical
storage name.

See [architecture](docs/architecture.md), [operations](docs/operations.md), and the checked-in
[public contract](contracts/public-api/meridian-config-artifact.v1.json).
