Metadata-Version: 2.4
Name: nauro-core
Version: 0.13.4
Summary: Shared pure-Python logic for Nauro: parsing, validation, context assembly, constants.
Project-URL: Homepage, https://github.com/nauro-ai/nauro
Project-URL: Repository, https://github.com/nauro-ai/nauro/tree/main/packages/nauro-core
Project-URL: Issues, https://github.com/nauro-ai/nauro/issues
Author: Thomas Thomsen
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: bm25s>=0.2
Requires-Dist: pydantic>=2.0
Requires-Dist: pystemmer>=2.2
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: import-linter; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: embeddings
Requires-Dist: model2vec>=0.3; extra == 'embeddings'
Requires-Dist: numpy>=1.24; extra == 'embeddings'
Description-Content-Type: text/markdown

# nauro-core

Shared pure-Python library for the [Nauro](https://github.com/nauro-ai/nauro) ecosystem. Provides parsing, validation, context assembly, and constants used by both the Nauro CLI and the remote MCP server.

## Installation

```bash
pip install nauro-core
```

## What's inside

- **`format`** — compiled regexes and parse/format functions for the Nauro markdown protocol (decision titles, metadata fields, section headers)
- **`constants`** — limits, thresholds, valid values, file paths shared across all Nauro surfaces
- **`parsing`** — pure `str → dict` functions: `parse_decision`, `parse_questions`, `extract_stack_summary`, `decisions_summary_lines`
- **`context`** — `build_l0`/`build_l1`/`build_l2` context assembly from pre-loaded files and parsed decisions
- **`validation`** — structural screening, hash dedup, Jaccard similarity for decision conflict detection

## Design principles

- **No I/O** — no filesystem, no network; callers inject pre-loaded data. Runtime dependencies are compute-only (BM25, parsing, validation); embeddings are an optional extra (`nauro-core[embeddings]`)
- **Function injection** — callers pass pre-loaded data (`files: dict[str, str]`, `decisions: list[dict]`); nauro-core never reads files or calls APIs
- **Import isolation** — enforced via `import-linter`: nauro-core cannot import from `nauro` or `mcp_server`

## Usage

```python
from nauro_core import parse_decision, build_l0, compute_hash

# Parse a decision markdown file
decision = parse_decision(markdown_content, "042-use-s3.md")

# Build L0 context from pre-loaded files
context = build_l0(files={"state.md": state, "stack.md": stack}, decisions=decisions)

# Check for duplicate decisions
hash_val = compute_hash(title="Use S3 for storage", rationale="...")
```

## License

Apache 2.0
