# 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.SweptTagReport

*class* · *dataclass*

```python
class SweptTagReport
```

Re-exported from: `ocx_sdk._results`

One tag's outcome within a `SweepReport` (C-017).

`sweep.rs:65-89`. `report`, `kind`, and `message` are all
absent-when-none (D7) —
`#[serde(skip_serializing_if = "Option::is_none")]` upstream, not
`null`.

`report` is present on a **failed** row too, when a
`--signature-format both` tag lands one leg and loses the other: hiding
the leg that landed would leave an operator re-signing what is already
published.

**Attributes**

- `tag` (`str`) — The tag this row describes.
- `status` (`str`) — `"completed"`, `"skipped"`, or `"failed"`, carried as raw `str` (D8).
- `report` (`_SweepRow | None`) — The tag's own report, when one was produced — a `SignatureReport` under a swept `sign`, an `AttestationReport` under a swept `attest`. Which one it is follows from which command called `from_dict`, not from anything in the row itself, which is why parsing it takes a row parser rather than guessing.
- `kind` (`str | None`) — The machine-branchable failure slug, when this tag failed.
- `message` (`str | None`) — Sanitized prose describing the failure, free to be reworded — the same rule `RefusedEntry.reason` follows.

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

### ocx_sdk.SweptTagReport.kind

*attribute* · *class attribute* · *instance attribute*

```python
kind: str | None = None
```

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

### ocx_sdk.SweptTagReport.message

*attribute* · *class attribute* · *instance attribute*

```python
message: str | None = None
```

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

### ocx_sdk.SweptTagReport.report

*attribute* · *class attribute* · *instance attribute*

```python
report: _SweepRow | None = None
```

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

### ocx_sdk.SweptTagReport.status

*attribute* · *instance attribute*

```python
status: str
```

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

### ocx_sdk.SweptTagReport.tag

*attribute* · *instance attribute*

```python
tag: str
```

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

### ocx_sdk.SweptTagReport.from_dict

*method* · *classmethod*

```python
def from_dict(data: Mapping[str, Any], row: Callable[[Mapping[str, Any]], _SweepRow]) -> SweptTagReport
```

Build from one decoded entry of `SweepReport.tags`.

**Parameters**

- `data` (`Mapping[str, Any]`) — The decoded row.
- `row` (`Callable[[Mapping[str, Any]], _SweepRow]`) — Parses this row's `report` object — `SignatureReport.from_dict` for a swept `sign`, `AttestationReport.from_dict` for a swept `attest`. The one place this module's "no new parsing infrastructure" rule is deliberately relaxed (C-017): one struct serves both commands rather than duplicating it.

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