Metadata-Version: 2.4
Name: grain-contracts
Version: 0.1.0
Summary: Grain's published workflow vocabulary — protocol, run, gate, artifact, stop_reason.
Author: Shaznay Sison
License-Expression: MIT
Project-URL: Homepage, https://github.com/Diwata-Domains/Grain
Project-URL: Repository, https://github.com/Diwata-Domains/Grain
Project-URL: Issues, https://github.com/Diwata-Domains/Grain/issues
Keywords: grain,workflow,contracts,vocabulary,types
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# grain-contracts

Grain owns the workflow capability, so Grain publishes the words for it: `protocol`, `run`, `gate`,
`artifact`, `stop_reason`.

This distribution carries **only those types**, with **zero dependencies**, so a service can speak
Grain's vocabulary without installing Grain's CLI. `grain-kit` re-exports the same types from
`grain.contracts.workflow`. Anything that wants to talk about a Grain workflow — a Postgres-backed
Missions runtime, an agent driving Grain headlessly — imports these types rather than inventing a
parallel set that drifts.

```python
from grain_contracts.workflow import Run, StepRecord, Gate, RunStatus, StopReason

run = Run.from_dict(payload)          # payload is a grain.workflow-run/v1 mapping
if run.status is RunStatus.AWAITING_GATE:
    ...
```

Types only. No reducer, no store, no I/O — contracts share types, not code. The storage-agnostic
run store and the pure `advance()` reducer are a separate promise, published as their own package.

[Source and issues](https://github.com/Diwata-Domains/Grain) · MIT
