Skip to main content

Millrace runtime rewrite baseline package

Project description

Millrace

Millrace is a thin-core autonomous runtime packaged as millrace_ai.

The runtime bootstraps all operational files under <workspace>/millrace-agents/ and keeps canonical source code in the package itself.

Source Layout

  • importable code lives under src/millrace_ai/
  • tests mirror package ownership under tests/assets/, tests/cli/, tests/config/, tests/runners/, tests/runtime/, tests/workspace/, and tests/integration/
  • preserved compatibility facades remain at the package root for legacy imports such as millrace_ai.control, millrace_ai.run_inspection, millrace_ai.runner, millrace_ai.entrypoints, and workspace support modules

Use docs/source-package-map.md for the old-to-new module map and the intentionally preserved facade list.

Quick Start

WORKSPACE=/absolute/path/to/workspace

uv run --extra dev python -m millrace_ai compile validate --workspace "$WORKSPACE"
uv run --extra dev python -m millrace_ai run once --workspace "$WORKSPACE"
uv run --extra dev python -m millrace_ai status --workspace "$WORKSPACE"

Equivalent installed CLI:

millrace compile validate --workspace "$WORKSPACE"
millrace run once --workspace "$WORKSPACE"
millrace status --workspace "$WORKSPACE"

Core Commands

  • millrace run once
  • millrace run daemon --max-ticks N
  • millrace status show
  • millrace status watch --workspace <PATH> [--workspace <PATH> ...]
  • millrace runs ls
  • millrace runs show <RUN_ID>
  • millrace runs tail <RUN_ID>
  • millrace queue ls
  • millrace queue show <WORK_ITEM_ID>
  • millrace queue add-task <path-to-task.md|path-to-task.json>
  • millrace queue add-spec <path-to-spec.md|path-to-spec.json>
  • millrace queue add-idea <path-to-idea.md>
  • millrace planning retry-active [--reason "..."]
  • millrace config show
  • millrace config validate [--mode MODE_ID]
  • millrace config reload
  • millrace control retry-active [--reason "..."]
  • millrace control pause
  • millrace control resume
  • millrace control stop
  • millrace control clear-stale-state
  • millrace control reload-config
  • millrace doctor
  • millrace modes list
  • millrace modes show --mode MODE_ID
  • millrace compile validate [--mode MODE_ID]
  • millrace compile show [--mode MODE_ID]

Compatibility aliases for common operator flows remain available at top level: millrace add-task, millrace add-spec, millrace pause, millrace resume, millrace stop, millrace retry-active, millrace clear-stale-state, and millrace reload-config.

Work Artifacts

Canonical queue artifacts are lightweight headed markdown work documents (.md) under:

  • millrace-agents/tasks/{queue,active,done,blocked}/
  • millrace-agents/specs/{queue,active,done,blocked}/
  • millrace-agents/incidents/{incoming,active,resolved,blocked}/

Task/spec/incident files use a human-facing shape with an H1 title plus plain field headings such as:

# Add run inspection CLI

Task-ID: example-task-001
Title: Add run inspection CLI

Target-Paths:
- src/millrace_ai/cli/commands/runs.py

Acceptance:
- `millrace runs ls` reports persisted run summaries.

JSON remains runtime-internal for snapshot, diagnostics, mailbox archives, and event/log surfaces.

Stage Runner Resolution

Runtime stage execution now routes through a configurable runner dispatcher.

Resolution order per stage request:

  1. request.runner_name (compiled from mode/stage bindings)
  2. runners.default_runner from runtime config
  3. fallback literal codex_cli

Default adapter is Codex CLI. Add runner settings in <workspace>/millrace-agents/millrace.toml:

[runners]
default_runner = "codex_cli"

[runners.codex]
command = "codex"
args = ["exec"]
permission_default = "basic"
# permission_by_stage = { builder = "elevated" }
# permission_by_model = { "gpt-5.4" = "maximum" }
skip_git_repo_check = true

Permission levels map to Codex CLI flags:

  • basic: --full-auto
  • elevated: -c approval_policy="never" --sandbox danger-full-access
  • maximum: --dangerously-bypass-approvals-and-sandbox

Runtime Docs

  • docs/runtime/millrace-runtime-architecture.md
  • docs/runtime/millrace-cli-reference.md
  • docs/runtime/millrace-entrypoint-mapping.md
  • docs/runtime/millrace-runner-architecture.md
  • docs/source-package-map.md

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

Operational source + wheel checks (minimum functionality workspace):

WORKSPACE=/absolute/path/to/minimum-functionality-workspace

rm -rf "$WORKSPACE/millrace-agents"

uv run --extra dev python -m millrace_ai compile validate --workspace "$WORKSPACE"
uv run --extra dev python -m millrace_ai run once --workspace "$WORKSPACE"
uv run --extra dev python -m millrace_ai status --workspace "$WORKSPACE"

rm -rf "$WORKSPACE/millrace-agents"

uv build --wheel
python3 -m venv /tmp/millrace-wheel-test
source /tmp/millrace-wheel-test/bin/activate
pip install dist/*.whl
millrace compile validate --workspace "$WORKSPACE"
millrace run once --workspace "$WORKSPACE"
millrace status --workspace "$WORKSPACE"

For clean proof runs, refresh only "$WORKSPACE/millrace-agents/" in place. Do not mutate operator-authored files elsewhere in the workspace root.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

millrace_ai-0.11.0.tar.gz (112.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

millrace_ai-0.11.0-py3-none-any.whl (161.7 kB view details)

Uploaded Python 3

File details

Details for the file millrace_ai-0.11.0.tar.gz.

File metadata

  • Download URL: millrace_ai-0.11.0.tar.gz
  • Upload date:
  • Size: 112.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for millrace_ai-0.11.0.tar.gz
Algorithm Hash digest
SHA256 fcbf1a2890f0d52e88320247693f8a52027cb4a37f2468b8714083fe68e815ea
MD5 084bf94852da4f9e898766dc1cd10f26
BLAKE2b-256 83beba517f3c2aa0da27668168b8ecee2c53c5eeaf552080236200da0da5aad0

See more details on using hashes here.

Provenance

The following attestation bundles were made for millrace_ai-0.11.0.tar.gz:

Publisher: publish-to-pypi.yml on tim-osterhus/millrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file millrace_ai-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: millrace_ai-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 161.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for millrace_ai-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63ff61a0803fce66e50526b204f1b2a82619bc32860c6d37d8e6fa7e55fd777c
MD5 2fff5c5616665e729471d442911e0119
BLAKE2b-256 760deb0b9fec26fe96a39007f640b5e71cf1fed6eb865e3b0e10b1042a1744f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for millrace_ai-0.11.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on tim-osterhus/millrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page