Metadata-Version: 2.5
Name: papeete-product
Version: 0.1.2
Summary: A small, standalone contract for naming a runnable set of actors, each by identity and a version query — papeete-product/v0.
Author-email: Papeete Consulting <yoann.remy@outlook.com>
License-Expression: MIT
Keywords: actor-model,conformance,governance
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# papeete-product

A small, standalone contract for naming a runnable set of actors — `papeete-product/v0`. Split
out of [`papeete-actor`](https://github.com/papeete-hub/papeete-actor) so an actor-identity
contract and a product contract can evolve independently
([ADR-PP-0001](./adr/ADR-PP-0001-papeete-product-is-a-standalone-package.md)); its own
orchestration and version-resolution code has since moved out again, to
[`papeete-deploy`](https://github.com/papeete-hub/papeete-deploy)
([ADR-PP-0002](./adr/ADR-PP-0002-orchestration-and-resolution-move-to-papeete-deploy.md)).

```
papeete-product lint       PRODUCT.YAML   validate against papeete-product/v0
papeete-product contracts                 which contract version this build enforces
```

No `run`, no `build` here — a product names actors by identity and a version **query**, never a
location, and never resolves that query against anything real. Turning `{name, label, version,
featureName}` into a running actor — finding the concrete build a query means, against a real
registry, then actually starting it — is [`papeete-deploy`](https://github.com/papeete-hub/papeete-deploy)'s
job entirely.

```bash
pip install papeete-product
```

## What it enforces

A **product** — `product.yaml` — names a small, deliberately scoped, runnable set of actors **by
identity and a query alone**:

```yaml
product: table-service
version: "0.1.0"
environment:
  type: local
  name: local
actors:
  - name: customer
    label: alpha
    version: latest
  - name: waiter
    label: alpha
    version: latest
```

No path, no folder, no pre-resolved tag. `label` is a ciType (`alpha`/`beta`/`prod`/`feature`,
`papeete-version`'s vocabulary); `version` is a query in that same package's `match-version`
grammar — `"latest"`, a short SHA, or an npm-range; `featureName` is required if and only if
`label` is `feature`. `environment` says where this product is meant to run — `type` is `local` or
`k8s`; `name` is the environment's own declared name (a k8s **namespace** when `type: k8s`); `k8sName`
(the kubectl **context**) is required if and only if `type: k8s`. Still a self-declaration, never a
URL or a credential — `papeete-deploy` maps it to a real registry/cluster to resolve and deploy
every actor's query against. When `environment.type` is `k8s`, each actor row also needs a
`recipe` — which `deploy/k8s/overlays/<recipe>` (in that actor's own folder,
[`papeete-actor`'s `ADR-PA-0025`](https://github.com/papeete-hub/papeete-actor)) it deploys with;
ignored for `local`. See [`ADR-PP-0003`](./adr/ADR-PP-0003-environment-is-typed-and-recipe-is-per-actor.md).

## The worked example

[`examples/`](./examples/) holds a structurally valid `product.yaml` naming a `customer` and a
`waiter` actor, each in its own folder (`actor.yaml` + `Dockerfile` + a tiny stdlib-only HTTP
server) — enough for `papeete-product lint` to exercise a real, non-trivial product. Actually
resolving and running it is `papeete-deploy`'s worked example, not this repo's.

## The contract is in this repo

[`src/papeete_product/schemas/papeete-product.schema.yaml`](./src/papeete_product/schemas/papeete-product.schema.yaml)
— ordinary committed source. **The package IS the contract**, not a gate that goes looking for
it, so a build needs no network and no credential.

```bash
uv build      # no network, no token, no fetch step
```

## Versioning

The tool version and the contract version are different things and move independently.
`papeete-product contracts` prints the mapping for any installed build:

```
papeete-product 0.1.0  —  contracts from …/site-packages/papeete_product/schemas
  ok   product            papeete-product/v0
```

## Standalone, on purpose

This package has **no dependency on `papeete-actor`, `papeete-version`, or `papeete-deploy`** —
see ADR-PP-0001 and ADR-PP-0002. A product names actors by identity and a query alone; whatever
gives that identity meaning, whatever resolves that query against reality, and whatever actually
runs anything are all out of scope here. The tiny `Report` class and schema-loading helper are
duplicated from `papeete-actor` rather than imported.

## Licence

MIT.
