Metadata-Version: 2.4
Name: astraform-remote-domain-conformance
Version: 0.1.3
Summary: Schema-backed conformance runner for Astraform remote-domain.v1 services
License-Expression: Apache-2.0
Project-URL: Documentation, https://github.com/astraform/remote-domain-sdk-python/tree/main/remote-domain-conformance-python#readme
Project-URL: Source, https://github.com/astraform/remote-domain-sdk-python
Project-URL: Publishing, https://github.com/astraform/remote-domain-sdk-python#readme
Keywords: astraform,remote-domain,simulation,conformance
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: httpx<1.0,>=0.28
Requires-Dist: jsonschema<5.0,>=4.23
Provides-Extra: test
Requires-Dist: fastapi<1.0,>=0.115; extra == "test"
Requires-Dist: pytest<9.0,>=8.3; extra == "test"

# astraform-remote-domain-conformance

This is the reusable Python conformance harness for `remote-domain.v1`.

Brutal truth: if every partner team needs a platform engineer on Zoom to prove
their service is valid, you do not have a platform. You have consultancy with a
protocol document attached.

This package exercises the real lifecycle:

- `manifest`
- `prepare`
- `status`
- `execute-work`
- `inspection`
- `shutdown`

And it validates payloads against the versioned schema from the pinned
`remote-domain.v1` release bundle, not just happy-path demo assertions.

It also includes a lightweight remote Policy Wind Tunnel provider conformance
path for `/policy-wind-tunnel/...` routes. That path checks pack metadata,
domain/report labels, `outcomeSchema`, CEL-compatible `policyExpressions`,
presets, run creation, status, lifecycle control, the generic
`policy_wind_tunnel_bundle.v1` envelope, artifact, and evidence-pack
availability. A weak bundle that only returns `schemaVersion` and `runId` is
not conformant; it must expose the
domain, pack, preset, branches, metrics, segments, timeline, decision gates,
artifacts, and domain payload that the dashboard and outcome report can render
without custom frontend code.

## Install

Current status: the published PyPI baseline is
`astraform-remote-domain-conformance==0.1.3`. The workspace release target is
`0.1.3`, which includes the current Population Builder catalog conformance
path.

```bash
pip install astraform-remote-domain-conformance==0.1.3
```

For repo-local conformance changes beyond the published `0.1.3` baseline, use
a repo-local editable install or a private pre-release wheel.

Repo-local development:

```bash
pip install -e './remote-domain-conformance-python[test]'
```

## Run Against A Live Service

```bash
remote-domain-conformance \
  --base-url http://localhost:8092 \
  --domain-id my-domain
```

Require Population Builder catalog conformance:

```bash
remote-domain-conformance \
  --base-url http://localhost:8092 \
  --domain-id my-domain \
  --population-catalog
```

Validate a catalog file before the provider serves it:

```bash
remote-domain-conformance \
  --domain-id my-domain \
  --population-catalog-file ./population_catalog.json
```

## Run Against A Local ASGI App

```bash
remote-domain-conformance \
  --app my_remote_domain.main:app \
  --domain-id my-domain
```

## Run Policy Wind Tunnel Provider Conformance

```bash
remote-domain-conformance \
  --wind-tunnel \
  --base-url http://localhost:8092 \
  --pack-id my-domain-policy-pack \
  --preset-id conformance-proof
```

## Python Usage

```python
import asyncio

from astraform.remote_domain.conformance.runner import ConformanceScenario
from astraform.remote_domain.conformance.runner import PolicyWindTunnelConformanceScenario
from astraform.remote_domain.conformance.runner import run_conformance
from astraform.remote_domain.conformance.runner import run_policy_wind_tunnel_conformance


report = asyncio.run(
    run_conformance(
        base_url="http://localhost:8092",
        scenario=ConformanceScenario(domain_id="my-domain"),
    )
)

print(report.to_dict())

wind_tunnel_report = asyncio.run(
    run_policy_wind_tunnel_conformance(
        base_url="http://localhost:8092",
        scenario=PolicyWindTunnelConformanceScenario(
            pack_id="my-domain-policy-pack",
            preset_id="conformance-proof",
        ),
    )
)

print(wind_tunnel_report.to_dict())
```

## Publishing Status

Release validation starts with the standalone package tests:

```bash
pytest remote-domain-author-kit-python/tests remote-domain-conformance-python/tests
```

PyPI artifacts are immutable. Do not rerun a publish for an already published
version; run smoke-only verification or bump the SDK version.

Public package note: PyPI distributions expose this SDK implementation. Keep
host runtime internals and domain-private logic out of this package.
