Metadata-Version: 2.4
Name: naoru
Version: 0.1.1
Summary: Naoru — generic autonomous code-repair engine (drive → judge → fix → red-first oracle gate).
Author: Unpossible Creations, Inc.
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://naoru.dev
Project-URL: Company, https://unpossiblecreations.ai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: obra-host
Requires-Dist: obra; extra == "obra-host"
Dynamic: license-file

# Naoru

**Naoru** (Japanese 治る/直る, "to be healed / to be fixed") is a generic, host-agnostic
**autonomous code-repair engine**: it drives a system-under-test, judges the result, has an
LLM worker propose a fix in an isolated worktree, and gates any autonomous commit behind a
deterministic **red-first oracle** (RED→GREEN, N-of-M, fixer-blind).

The import package is `fix_engine`, the distribution is `naoru`. **Proprietary** —
© Unpossible Creations, Inc. (see `LICENSE`).

## The three seams

The engine core imports **zero** host code. A host binds it to an environment via
`fix_engine.host.configure_host(...)`:

- **Executor** (`fix_engine.executor`) — launch the system-under-test, stream, detect
  terminal. Ships with a generic `adapters.command_executor` (run any build/test command).
- **OutcomePlugin** (`fix_engine.outcome`) — judge a run RED/GREEN via machine-checkable
  predicates (exit code, traceback signature, contract violation, output substring, non-crash).
- **HostServices** (`fix_engine.host`) — LLM dispatch, runtime paths, tooling discovery,
  provider classification, and config UI, supplied by the host.

Plus `fix_engine.oracle` (the mandatory commit gate), `fix_engine.safety` (sandboxed-by-default
profile), `fix_engine.worker` (the bounded fix worker), `fix_engine.gates` (public validation
outcome contract), and `fix_engine.worktree`.

## What's new — the autonomous test-and-improve product

Beyond the engine primitives, naoru now ships a runnable product surface so a third party can
install it, declare checks, and run autonomous missions against their own software:

- **Declarative leaves** (`fix_engine.leaves`) — author checks in `.toml`/`.json` (a command + a
  pass-predicate); `naoru leaves generate` proposes a starter set from your project's tooling.
- **Mission-driven loop** — `naoru run --mission <…>`: `test-and-fix-bugs` (red-first oracle,
  auto-commit), `improve-performance` (metric gate, auto-commit), `improve-ux` /
  `general-improvement` (propose-a-patch for review, never auto-commit). The LLM is **inherited
  from your host config** (no provider hardcoded); flags override.
- **`naoru config`** — open the host's provider/model picker. **Safe by default** (sandboxed,
  gate-required commits); `--unsafe` is explicit opt-in.

Start at **`NAORU_ONBOARDING.md`**; architecture in **`docs/architecture/harness.md`**; a runnable
demo in **`examples/`**. For turnkey local use, install `naoru[obra-host]`.

## Standalone invariant

`fix_engine` must never import a host product directly. Enforced by
`tests/test_fix_engine_boundary.py`; a fresh interpreter importing the full core pulls zero host
modules (`tests/test_fix_engine_portability.py`).

## Develop

```bash
uv venv && uv pip install -e . && python -m pytest tests/ -q
```

## Releasing

Proprietary, **wheel-only** (never an sdist). Internal maintainers use the guarded release
pipeline, which builds the wheel and runs the hard verifier before any publish step. The verifier
alone is `python scripts/verify_wheel.py [wheel]`.
