Metadata-Version: 2.4
Name: lattice-recall
Version: 0.1.0
Summary: Durable local outbox + opportunistic Nexus sync for Lattice consumers.
Author: CodeWarrior4Life
License: Proprietary
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: platformdirs>=4.2
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: hatch>=1.12; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: mac
Requires-Dist: pyobjc-framework-appkit>=10.0; extra == 'mac'
Requires-Dist: pyobjc-framework-corewlan>=10.0; extra == 'mac'
Provides-Extra: test
Requires-Dist: fastapi>=0.110; extra == 'test'
Requires-Dist: freezegun>=1.4; extra == 'test'
Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Requires-Dist: uvicorn>=0.29; extra == 'test'
Provides-Extra: win
Requires-Dist: pywin32>=306; extra == 'win'
Description-Content-Type: text/markdown

# lattice-recall

`lattice-recall` is the durable local outbox and opportunistic Nexus sync layer for the Lattice family. It provides a synchronous SQLite write path (WAL mode) for zero-loss local capture, paired with an asynchronous background coroutine that syncs records to the Nexus `POST /api/recall` endpoint when connectivity allows. All records are UUID-keyed for idempotent delivery, retried with exponential backoff on transient failures, and vacuumed after a configurable retention window (default 30 days).

## Quickstart

```python
pip install lattice-recall
import lattice_recall
await lattice_recall.persist(record)
```

## Local-Only Mode

By default, `lattice-recall` requires Nexus connectivity. For early consumers or offline-first workflows, disable Nexus sync:

```python
store = RecallStore(nexus_enabled=False)
await store.persist(record)
```

Local-only mode uses SQLite for all durability. Full details on the Nexus dependency and migration path: `docs/NEXUS_DEPENDENCY.md`.

## Spec

The complete design specification for v0.1.0 lives in the Lattice vault:

**`02_Projects/Lattice/lattice-recall/Specifications/2026-04-27 lattice-recall v1 - Design Spec.md`**

## Acceptance Gates

All gates covered by tests. See vault spec for full detail on each gate.

| Gate | Test Path |
|------|-----------|
| G1 sync local write durability | tests/test_store_persist.py |
| G2 async Nexus sync | tests/test_sync_worker.py |
| G3 reachability gating | tests/test_nexus_client.py |
| G4 burst on reconnect | tests/test_net_up_event.py + smoke B2 |
| G5 idempotency | tests/test_idempotency.py + tests/test_nexus_client.py |
| G6 cross-device ordering | tests/test_store_fetch_local.py |
| G7 retention | tests/test_retention.py |
| G8 multi-source | tests/test_store_fetch_local.py + smoke B4 |
| G9 multi-tenant slot | covered via Record.tenant_id |
| G10 failure visibility | tests/test_telemetry.py |
| G11 manual drain | tests/test_store_lifecycle.py |
| G12 local-only retrieval | tests/test_store_fetch_local.py |
| A1-A10 unit tests | tests/test_*.py per gate |
| B1-B5 smoke gates | tests/smoke/test_smoke_b1_to_b5.py |
| C1-C3 perf gates | tests/perf/test_perf_c1_c3.py |

## License

Proprietary. All rights reserved.

**Version:** 0.1.0 (2026-04-27)
