Millrace runtime rewrite baseline package
Project description
Millrace
A governed runtime for long-running agent work that needs durable state, staged execution, and recovery-aware operation.
Millrace is not a replacement for Codex, Claude Code, Aider, or similar raw agent harnesses. It is the runtime layer you put around them when the work is too long-running, stateful, or recovery-sensitive to trust to a single session.
Millrace is designed to be operated by a dedicated ops agent. The raw harness still does the local stage work. Millrace owns the queue, compiled plan, stage progression, runtime state, and persisted audit trail around that work.
Why Millrace Exists
Raw harnesses are excellent at bounded sessions:
- implement a feature
- fix a bug
- review a diff
- work a short plan in one sitting
Millrace starts where that model stops being enough.
Use it when the job needs to:
- survive pauses, crashes, or context loss
- move through explicit execution or planning stages
- perform a final compiler-governed parity check before declaring completion
- preserve durable queue and runtime state on disk
- route failures into recovery work instead of just exiting
- leave behind persisted run artifacts that an operator can inspect later
How Millrace Fits With Raw Harnesses
Think of the split this way:
- the raw harness reasons, edits code, and emits a stage result
- Millrace compiles the active mode and loops into a frozen plan
- Millrace decides which stage runs next, which work item is active, and what to persist after each handoff
- the ops agent chooses when work enters the runtime and how the workspace is configured
Millrace should be used in conjunction with raw harnesses, not instead of them. If a direct Codex or Claude Code session is enough, use the direct session.
When To Use Millrace
Use Millrace when:
- the work will outlast a single agent session
- you want explicit stage gates instead of "the agent said it is done"
- recovery and resumability matter
- you need run history, diagnostics, and durable state under
<workspace>/millrace-agents/ - a dedicated ops agent is available to operate the runtime intentionally
Do not use Millrace when:
- the task is small and bounded
- the work is exploratory and governance adds more overhead than value
- single-session throughput matters more than persistence and recovery
- no ops agent is available to manage intake, configuration, and runtime state
60-Second Proof
Install:
pip install millrace-ai
Then point Millrace at a workspace:
export WORKSPACE=/absolute/path/to/your/workspace
millrace compile validate --workspace "$WORKSPACE"
millrace run once --workspace "$WORKSPACE"
millrace status --workspace "$WORKSPACE"
That flow proves three important things quickly:
- Millrace can bootstrap its workspace contract under
millrace-agents/ - the selected mode and loops compile into a frozen plan
- the shipped
standard_plainmode freezes completion behavior into that plan - the runtime can execute one deterministic tick and report persisted status
What Millrace Governs
Millrace is a real runtime, not a thin wrapper script. The current shipped core includes:
- a compile step that freezes mode and loop assets into a persisted run plan
- separate execution and planning loops
- compiler-driven backlog-drain behavior that can dispatch
arbiter - typed stage terminals rather than prose-only handoff semantics
- file-backed runtime state and queue artifacts under
millrace-agents/ - persisted run artifacts for inspection and troubleshooting
- runner dispatch that invokes a raw harness through a defined adapter contract
The runtime is packaged as millrace_ai. Source lives under src/millrace_ai/
and the tests mirror those domains under tests/.
Docs And Skills
If you are an agent reading this README, load
docs/skills/millrace-ops-agent-manual/SKILL.md first before operating Millrace.
Primary docs:
docs/skills/millrace-ops-agent-manual/SKILL.mddocs/runtime/README.mddocs/runtime/millrace-arbiter-and-completion-behavior.mddocs/runtime/millrace-cli-reference.mddocs/runtime/millrace-compiler-and-frozen-plans.mddocs/runtime/millrace-modes-and-loops.mddocs/runtime/millrace-loop-authoring.mddocs/runtime/millrace-runner-architecture.mddocs/runtime/millrace-runtime-error-codes.mddocs/source-package-map.md
Use the CLI reference for the full command inventory. Use the compiler and loop docs when you need to understand or extend the runtime contract rather than just operate it.
Default Permission Posture
Millrace intentionally ships with maximum Codex permissions as the default workspace posture.
The default resolution order is:
runners.codex.permission_by_stagerunners.codex.permission_by_modelrunners.codex.permission_default
New workspaces are bootstrapped with permission_default = "maximum" explicitly
written into millrace-agents/millrace.toml.
Existing workspace configs are preserved on bootstrap/update. If an operator has already customized Codex permission settings, Millrace does not overwrite those choices when a newer runtime version is deployed.
Verification
Authoritative local verification commands:
uv run --extra dev python -m pytest -q
uv run --with ruff ruff check src/millrace_ai tests
uv run --with mypy mypy src/millrace_ai
Status
Millrace is close to the v1.0.0 baseline, but it is still stabilizing its
public documentation and some surrounding release surfaces. If you depend on a
specific behavior, pin to a patch version instead of assuming the latest build
is identical.
The formal CHANGELOG.md is staged for the v1.0.0 cut; until then, the
changelog format is being prepared outside the package repo so the eventual move
is mechanical rather than improvised.
License
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file millrace_ai-0.12.1.tar.gz.
File metadata
- Download URL: millrace_ai-0.12.1.tar.gz
- Upload date:
- Size: 147.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
341c748bf081ef6f886a506e659d28d9ac809ec2e06807031c5eca0e7b364437
|
|
| MD5 |
1b5ea1ee1d6a89c524560b42271309b2
|
|
| BLAKE2b-256 |
912fa56908e8a2cd533c277679d0bc6261ec9802951b4abbf540932b7304a3eb
|
Provenance
The following attestation bundles were made for millrace_ai-0.12.1.tar.gz:
Publisher:
publish-to-pypi.yml on tim-osterhus/millrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
millrace_ai-0.12.1.tar.gz -
Subject digest:
341c748bf081ef6f886a506e659d28d9ac809ec2e06807031c5eca0e7b364437 - Sigstore transparency entry: 1340586715
- Sigstore integration time:
-
Permalink:
tim-osterhus/millrace@1c21d5d626f468b179d3ca569ecdd019cfaf74f4 -
Branch / Tag:
refs/tags/v0.12.1 - Owner: https://github.com/tim-osterhus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1c21d5d626f468b179d3ca569ecdd019cfaf74f4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file millrace_ai-0.12.1-py3-none-any.whl.
File metadata
- Download URL: millrace_ai-0.12.1-py3-none-any.whl
- Upload date:
- Size: 207.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b440bb8a2b6a5d03f0d75bd32c314d0b6dbf622ae4605c73e0fca95b28ad8c4b
|
|
| MD5 |
9245a7ec31ac2d944e3740100c746b81
|
|
| BLAKE2b-256 |
a6a0b649fb58c68fb7315eca244b7fb9e69b99f62e55499bb71556561566967c
|
Provenance
The following attestation bundles were made for millrace_ai-0.12.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on tim-osterhus/millrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
millrace_ai-0.12.1-py3-none-any.whl -
Subject digest:
b440bb8a2b6a5d03f0d75bd32c314d0b6dbf622ae4605c73e0fca95b28ad8c4b - Sigstore transparency entry: 1340586716
- Sigstore integration time:
-
Permalink:
tim-osterhus/millrace@1c21d5d626f468b179d3ca569ecdd019cfaf74f4 -
Branch / Tag:
refs/tags/v0.12.1 - Owner: https://github.com/tim-osterhus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1c21d5d626f468b179d3ca569ecdd019cfaf74f4 -
Trigger Event:
push
-
Statement type: