# ocx_sdk

*module*

Python SDK for [OCX](https://github.com/ocx-sh/ocx).

`ocx-sdk` drives the ocx binary rather than reimplementing it: ocx owns
resolution, verification, and the identifier grammar, and this package gives
you typed, CWD-independent handles over the commands it exposes.

```python
from ocx_sdk import Ocx, bootstrap

ocx = Ocx(exe=bootstrap.ensure())
project = ocx.project("/srv/build")
project.pull()
project.exec(["task", "verify"])
```

**This module is the API.** Everything listed in `__all__` is the stable
surface; every other module is underscored and package-private, and the one
public submodule is `ocx_sdk.bootstrap`. Reaching into an underscored path
means the next release may move it without notice — pre-1.0, breaking
changes ship without shims.

Start at `Ocx` for the runtime API and `bootstrap.ensure` for provisioning.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/__init__.py#L1-L1)

## ocx_sdk.RepairOutcome

*class* · *dataclass*

```python
class RepairOutcome
```

Re-exported from: `ocx_sdk._results`

What `cascade repair` did to one rolling tag.

The wire nests a `WriteOutcome` object under `outcome`, internally
tagged on its own `outcome` key: `written` (with `digest`, `verified`,
and `dropped` when child digests were pruned), `refused` (an
unrepairable finding's `tag`/`reason`/`digest`), `raced` (`expected`,
`live`) or `failed` (`message`). First-cut depth: the discriminator is
typed and the variant's fields ride along untyped.

**Attributes**

- `tag` (`str`) — The rolling tag.
- `outcome` (`str`) — `"written"`, `"refused"`, `"raced"` or `"failed"`, raw `str` (D8).
- `detail` (`Mapping[str, Any]`) — The whole `WriteOutcome` object, `outcome` key included.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2697-L2725)

### ocx_sdk.RepairOutcome.detail

*attribute* · *instance attribute*

```python
detail: Mapping[str, Any]
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2717-L2717)

### ocx_sdk.RepairOutcome.outcome

*attribute* · *instance attribute*

```python
outcome: str
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2716-L2716)

### ocx_sdk.RepairOutcome.tag

*attribute* · *instance attribute*

```python
tag: str
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2715-L2715)

### ocx_sdk.RepairOutcome.from_dict

*method* · *classmethod*

```python
def from_dict(data: Mapping[str, Any]) -> RepairOutcome
```

Build from one decoded `outcomes` entry.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2719-L2725)
