Metadata-Version: 2.5
Name: reasonledger-core
Version: 0.3.0a6
Summary: Framework-free domain logic for ReasonLedger
Project-URL: Homepage, https://github.com/Sphotalabs-Inc/ReasonLedger
Project-URL: Repository, https://github.com/Sphotalabs-Inc/ReasonLedger
Project-URL: Issues, https://github.com/Sphotalabs-Inc/ReasonLedger/issues
Author: SphotaLabs Inc.
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: numpy<3,>=2.0
Requires-Dist: pydantic-settings>=2.7
Requires-Dist: pydantic>=2.10
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: hypothesis>=6.120; extra == 'dev'
Requires-Dist: pytest-cov>=6.0; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Provides-Extra: embeddings
Requires-Dist: fastembed>=0.5; extra == 'embeddings'
Description-Content-Type: text/markdown

# reasonledger-core

Framework-free domain logic for [ReasonLedger](https://github.com/Sphotalabs-Inc/ReasonLedger) —
the audit-critical heart shared by the CLI and the MCP server.

This is a library. Most people want [`reasonledger`](https://pypi.org/project/reasonledger/)
(the CLI) instead; install this directly only if you are building your own surface on top
of the same domain model.

## What's in it

| Area | What it does |
|---|---|
| `decisions` | The Decision record format — frontmatter parse/write, round-trip, on-disk layout |
| `importer` | Bring-your-own-model extraction, propose-and-confirm staging, connection probe |
| `reasoning` | `why` resolution, conflict detection, staleness watchers, pluggable embeddings |
| `views` | `build_ledger_view` — a read-only projection of a repo's `.reasonledger/` state |
| `policy` | Policy evaluation for CI gates |
| `privacy` | The PII linter |
| `provenance` | AI-authorship signals read from commit metadata |

No web framework, no ORM session, and no I/O beyond the files it is pointed at — so the
same implementation backs every surface rather than being reimplemented per app.

## Design properties worth knowing

- **Secrets are structurally excluded.** `ExtractorConfig` has no field capable of holding
  a raw API key — only the *name* of the environment variable that supplies one.
- **Views never write.** `build_ledger_view` re-evaluates watcher conditions on read; it
  cannot modify a decision file.
- **Deterministic by default.** Embeddings resolve to a deterministic stub unless the
  local model is enabled, so tests and CI need no network and no model. Embeddings never use the
  network.

## Requirements

Python 3.12+.

```bash
# --pre: every release is a pre-release for now, and pip skips those unless told otherwise
pip install --pre reasonledger-core
pip install --pre "reasonledger-core[embeddings]"   # real embeddings via fastembed
```
