Metadata-Version: 2.5
Name: industrialized-ai-example
Version: 1.1.0
Summary: A runnable example of the Industrialized AI control loop
Author: James B. Stewart
Requires-Python: >=3.12
Requires-Dist: openai<3,>=2.24
Requires-Dist: pydantic<3,>=2.12
Requires-Dist: rich<15,>=14.3
Description-Content-Type: text/markdown

# Industrialized AI runnable example

This project turns three unreliable security tickets into a reviewed and prioritized queue. AI models perform the bounded semantic work: manufacture, inspection, and repair. A deterministic Python pipeline validates their outputs, applies the acceptance decision table, retains the evidence, and controls whether the current product is repaired, released, or stopped.

The example is deliberately small, but it is not pseudocode. It makes real model calls, gives every product revision and process record a stable identity, retains failed work, and releases only the revision named by a passing inspection.

## Run it

Replay the retained Codex run first. This executes the complete pipeline without credentials, model cost, or network access. Each response is bound to the digest of the operation prompt which originally produced it, so changing the inputs stops the replay rather than returning unrelated canned data.

```console
uv run industrialized-ai --replay
```

To run the same process with a live model, install and sign in to the Codex CLI. Codex is the default live provider:

```console
uv run industrialized-ai
```

GitHub Copilot and the OpenAI API are also supported:

```console
uv run industrialized-ai --provider copilot
OPENAI_API_KEY=... OPENAI_MODEL=... uv run industrialized-ai --provider openai
```

Use `--output PATH` to choose where the retained run is written. Without it, the program creates a timestamped directory in the current working directory.

## Examine it

The package is organized around the process it implements:

- `stations.py` contains manufacture, inspection, repair, and the inspection decision table.
- `pipeline.py` owns routing, revision control, evidence retention, and release.
- `definition.py` describes source material and the acceptance basis.
- `records.py` defines model response contracts and retained process records.
- `providers.py` isolates Codex, GitHub Copilot, and OpenAI transport.
- `operations.py` runs and retains one bounded semantic operation.
- `reporting.py` turns process events and retained evidence into readable terminal output.
- `evidence.py` writes immutable, content-identified evidence safely.

Run the complete engineering checks with:

```console
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest
```

## Check the methods

Run the reference cases through manufacture, inspection and repair:

```console
uv run industrialized-ai-check --replay
uv run industrialized-ai-check
```

The first command uses retained responses; the second makes fresh model calls. The report compares inspection judgments with expected answers and presents manufactured and repaired reports alongside reference findings for review.

Save the results before changing a method, then run the same cases again to compare the effects.

## Boundary

This is a reference production line rather than a production platform. It includes a small set of reference cases to demonstrate how its methods can be assessed and improved. It leaves out queues, databases, distributed workers, retry policy, parts catalogs, factory coordination and production-order control, as well as ongoing performance monitoring and the broader testing needed to establish reliability for production use.
