Metadata-Version: 2.4
Name: lamellar-pack-bibleome
Version: 0.3.2
Summary: Bibleome O/I/A vertical domain plate for Lamellar: Three-Layer Gateway exegesis, 5 deterministic verification gates, and 3-slot KAL recall.
Author: Lamellar Authors
License: Apache-2.0
Project-URL: Homepage, https://github.com/lamellar26/lamellar-pack-bibleome
Project-URL: Source, https://github.com/lamellar26/lamellar-pack-bibleome
Project-URL: Bibleome, https://bibleome.org
Keywords: lamellar,bibleome,bible,oia,exegesis,hebrew,greek,strongs,rag
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Religion
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: license-file

# lamellar-pack-bibleome

The **Bibleome O/I/A** vertical domain plate for [lamellar](https://github.com/lamellar26/lamellar): runs bottom-up **Observation / Interpretation / Application (O/I/A)** inductive Bible study completely offline on a consumer 16 GB GPU, enforced by **5 deterministic verification gates** before any study card is delivered.

> **Clear separation of responsibilities**:
> - **[github.com/bibleome/bibleome](https://github.com/bibleome/bibleome)** (`pip install bibleome`, [bibleome.org](https://bibleome.org)) is the independent open-source computational Bible engine, Translation Pack protocol, and public OIA JSON Schema v1.
> - **`lamellar26/lamellar-pack-bibleome`** (this repo) is a Lamellar plate dedicated strictly to running and verifying OIA study pipelines on local models.

```bash
# Install via PyPI or as a Lamellar pack
pip install lamellar-pack-bibleome
# or
lamellar pack install https://github.com/lamellar26/lamellar-pack-bibleome
```

## Three-Layer Language-Agnostic Gateway & Parallel Ensemble (`v0.3.0`)

```
Layer 1: Original Source of Truth (Hebrew WLC + Greek OpenGNT + morphology + Strong's + xrefs + allusions)
   │  Stage 1 (duet Ensemble): Deep exegetical reasoning directly from original languages (rules/en/oia_rules.md)
   ▼
Layer 2: English Gateway OIA (lang="en", 5-gate verified + isolated English KAL flywheel)
   │  Stage 2 (Parallel Host+Peer Ensemble via bibleomecore.gateway + thin locales/<lang>.json)
   │    ├─ Host & Peer localize concurrently using parallel EN <-> Target Scripture verses
   │    ├─ Deterministic 5-gate + locale script purity filter runs FIRST (single winner exits immediately)
   │    └─ Anonymized pairwise bilingual judge selects the better localization verbatim (zero rewriting)
   ▼
Layer 3: Any Target Language OIA (zh-HK, es, ar, pt, fr, id, sw, ja, ko, vi, hi ...)
```

- **Zero language hardcoding in core**: Add any new language by dropping one ~35-line declarative JSON file in `locales/<lang>.json` (ships with `zh-HK.json`, `es.json`, `ar.json` + automatic defaults for all other language codes).
- **Zero structural drift**: `bibleomecore.gateway.lock_structure_from_en` deterministically locks all `{b, c, v}` citations, Strong's IDs, original Hebrew/Greek glyphs, and enum IDs from Layers 1 + 2, with automatic missing-section backfill (`backfill_missing_sections`).

## What this plate enforces

1. **Zero-peek anti-contamination (`BibleomeClient`)** — Fetches only mechanical Observation layers (`verses`, original Hebrew/Greek `words`, Strong's `lexicon`, `cross_refs`, `allusions`) with local SQLite caching, recursively stripping any pre-existing AI fields before the model sees the prompt.
2. **5 deterministic verification gates (`before_delivery` & `duet` `ensemble_verify`)** —
   - Gate 1: Strict OIA JSON Schema v1 structure.
   - Gate 2: Every `{b, c, v}` citation verified against canonical book/chapter/verse bounds and retrieved evidence (zero fabricated verses).
   - Gate 3: Original-language glossary coverage against actual Strong's tokens in the passage.
   - Gate 4: Non-dogmatic multi-tradition tensions (minimum competing historical readings, zero sectarian verdicts).
   - Gate 5: Language purity & orthographic lint (`zh-HK` Traditional Chinese / `en` English profiles).
3. **Plugs straight into `lamellar-pack-duet`** — Registers the `ensemble_verify` hook so dual-machine local ensembles score Host vs Peer OIA drafts deterministically via the 5 gates before any pairwise judge runs.
4. **Optional Pure-CPU Hybrid RAG flywheel (`oia_kal.py`)** — When `lamellar-pack-kal` is installed, only 5-gate-verified high-juice OIA cards enter a local SQLite KAL store with strict self-exclusion guards.

## 10-Minute Local 16 GB GPU Zero-Hallucination Tutorial

### Step 1 — Start the open-source Bibleome core engine

```bash
pip install bibleome
bibleome init
bibleome serve --host 127.0.0.1 --port 8080
```

### Step 2 — Install Lamellar + plates

```bash
pip install lamellar
lamellar pack install https://github.com/lamellar26/lamellar-pack-kal
lamellar pack install https://github.com/lamellar26/lamellar-pack-duet
lamellar pack install https://github.com/lamellar26/lamellar-pack-bibleome
```

### Step 3 — Configure & run your first verified OIA study

Copy `configs/bibleome.example.json` and point `bibleome.api_base` to `http://127.0.0.1:8080` (or `https://bibleome.com`):

```bash
lamellar bibleome cache 17956
lamellar run "Generate Bibleome OIA JSON for passage_id=17956"
lamellar bibleome staging 17956
```

### Step 4 — Import the verified OIA JSON into your Bibleome core

```bash
curl -X POST http://127.0.0.1:8080/api/oia/import \
  -H "Content-Type: application/json" \
  -d '{"passage_id": 17956, "lang": "en", "model": "qwen3.8:27b", "content": ...}'
```

## Running Tests

```bash
python3 -m unittest discover -s tests -v
```

## License

Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
