# Nisaba — Features

## Overview

Nisaba is the Ancient Text Analysis and Cross-Tradition Scholarly Research
platform. Named after Nisaba (𒀭𒉀), the Sumerian goddess of writing, learning,
grain, and reeds — credited in ancient tradition as the inventor of cuneiform
script, the earliest writing system in human history — the domain provides the
world's most comprehensive, AI-powered scholarly workbench for ancient texts
across all world traditions. Her temple, the É-zagin ("House of Lapis Lazuli"),
was conceived as the prototype of every library and archive that would follow.
Nisaba likewise gathers every tradition's texts under a single scholarly roof.

The domain supports the complete scholarly lifecycle: reading a Sumerian
cuneiform tablet or Dead Sea Scrolls fragment in its original script;
morphological analysis; translation comparison; textual criticism; paleographic
dating; etymological and intertextual research; and finally producing
publication-ready digital critical editions compliant with international
scholarly standards. Nisaba's 22 libraries cover ancient languages spanning
cuneiform scripts (Sumerian, Akkadian, Hittite, Elamite, Ugaritic), Egyptian
scripts (hieroglyphic through Coptic), Semitic scripts (Hebrew, Aramaic, Arabic,
Ge'ez), South Asian scripts (Sanskrit, Pali, Tibetan), Greco-Roman languages
(Greek, Latin, Avestan), Classical Chinese, and Old Church Slavonic — alongside
canonical reference systems for every major scriptural tradition, textual
criticism tools, digital critical edition publication, AI scholarly assistance,
and connections to open-access digital humanities corpus platforms.

---

## Domain Libraries

The table below lists all 22 `@nisaba/*` packages and their responsibilities.
See `architecture.md` for the dependency graph and per-package internals.

| Library      | Package                | Description                                                             |
| ------------ | ---------------------- | ----------------------------------------------------------------------- |
| Core         | `@nisaba/core`         | Domain types, constants, error classes, Unicode utilities               |
| Schemas      | `@nisaba/schemas`      | Zod validation schemas for every domain entity                          |
| Database     | `@nisaba/database`     | PostgreSQL access layer, Prisma schema, seed data                       |
| Languages    | `@nisaba/languages`    | Ancient language parsers, morphology engines, lexica, transliteration   |
| Translations | `@nisaba/translations` | Parallel translation display, alignment algorithms, divergence analysis |
| Criticism    | `@nisaba/criticism`    | Textual criticism, collation, manuscript witness registry, stemma       |
| Canon        | `@nisaba/canon`        | Canonical reference systems for all world scripture traditions          |
| Paleography  | `@nisaba/paleography`  | Script classification and manuscript dating from images                 |
| Philology    | `@nisaba/philology`    | Etymology, intertextuality, stylometry, discourse analysis              |
| Comparative  | `@nisaba/comparative`  | Cross-tradition concept mapping and parallel passage detection          |
| Corpora      | `@nisaba/corpora`      | Connectors to 13+ open-access scholarly digital corpus platforms        |
| Annotations  | `@nisaba/annotations`  | W3C Web Annotation standoff annotation system                           |
| Editions     | `@nisaba/editions`     | Digital critical edition project management and multi-format export     |
| Geotemporal  | `@nisaba/geotemporal`  | Geographic and temporal mapping of manuscripts and traditions           |
| Assistant    | `@nisaba/assistant`    | AI scholarly assistant grounded in corpus evidence                      |
| Standards    | `@nisaba/standards`    | Import/export for TEI-XML, ATF, USFM, mARkdown, and more                |
| Workspace    | `@nisaba/workspace`    | Scholar's research environment: search, reading, personal library       |
| Client       | `@nisaba/client`       | Zero-dependency scholarly SDK plus React hooks                          |
| API client   | `@nisaba/api-client`   | Generated typed client for the V1 contract API (`/api/v1/nisaba`)       |
| Cross-domain | `@nisaba/cross-domain` | Cross-domain bridge to Tara, Arete, Veritas, and Nyx                    |
| Mobile       | `@nisaba/mobile`       | Mobile study surface: routes, features, reading queue, reminders        |
| Study plans  | `@nisaba/study-plans`  | Study plan model, objectives, steps, and completion forecasting         |

---

## Ancient Language Engine (`@nisaba/languages`)

### Writing System Support

Nisaba provides first-class support for reading, displaying, and analyzing texts
in their original scripts — not merely transliteration. This means rendering
cuneiform signs, polytonic Greek, right-to-left Hebrew and Arabic, Devanagari,
Chinese characters, and dozens of other writing systems with scholarly-grade
Unicode and font handling.

#### Semitic Scripts

- **Biblical Hebrew**: Full Unicode support for consonants, Tiberian vowel
  points (all nine classes: qamets, patach, tsere, segol, hiriq, holem, qibbuts,
  shureq, qamets hatuf), all cantillation marks (te'amim), dagesh lene and forte
  distinction, shin/sin dot, maqqef, sof pasuq, and ketiv/qere notation. Also
  supports the alternative Babylonian and Palestinian vocalization systems —
  scholarly traditions distinct from the dominant Tiberian text.

- **Aramaic**: Imperial Aramaic; Biblical Aramaic (using Hebrew square script
  with Aramaic-specific features); Syriac in all three script variants —
  Estrangela (the oldest, used in classical literature), Serto (West
  Syriac/Jacobite tradition), and Eastern/Madnhaya (Nestorian tradition) — each
  with their respective diacritical vowel mark systems.

- **Classical Arabic**: Full Unicode for consonants, short vowels
  (fatha/kasra/damma), tanwin (nunation endings), sukun (quiescence marker),
  shadda (gemination), and all five hamza positions. Full Quranic orthographic
  conventions including tajweed markers — idgham (assimilation), iqlab
  (transformation), ikhfa (concealment), ghunna (nasalization) — and all pause
  marks (mandatory, permissible, prohibited) and sajda indicators.

- **Ge'ez/Ethiopic**: Full syllabary (base consonants multiplied by 7 vowel
  orders), Amharic extensions, the traditional numeral system, and all standard
  punctuation including the word divider, full stop, comma, colon, preface
  colon, and question mark.

- **Phoenician, Paleo-Hebrew, Moabite, Samaritan**: Unicode block mappings and
  bidirectional transliteration for early Northwest Semitic scripts and
  inscriptions.

#### Cuneiform Scripts

- **Sumerian cuneiform**: Logographic and syllabic readings; determinative
  classification — the semantic classifiers (dingir/god, ki/place, lu2/person,
  giš/wood, etc.) that mark word type without being pronounced; full sign list
  integration with Borger's MZL (Mesopotamisches Zeichenlexikon), aBZL
  (Assyrisches Zeichenlexikon), and CDLI sign values; sign variant tracking;
  composite sign decomposition.

- **ATF (ASCII Transliteration Format)**: Full parser and generator for the CDLI
  and ORACC standard. ATF is the scholarly format for representing cuneiform in
  ASCII — it encodes sign names, sign values, determinatives, glosses, damage
  notation (broken, effaced, illegible), editorial marks, and line numbering.
  Round-trip fidelity between ATF and Unicode cuneiform is guaranteed.

- **Akkadian**: Old Babylonian, Standard Babylonian, and Neo-Assyrian dialect
  conventions, with syllabic value disambiguation and logogram-to-Akkadian
  reading resolution using context heuristics.

- **Hittite and Elamite**: Language-specific sign value tables and determinative
  conventions for two of the most important ancient Near Eastern languages
  preserved on clay tablets.

- **Ugaritic alphabetic cuneiform**: The 30-letter alphabet written in cuneiform
  — one of the world's earliest alphabets — with word divider and
  transliteration support.

#### Egyptian Scripts

- **Hieroglyphic**: Gardiner sign list integration (all categories A–Z and Aa),
  Manuel de Codage (MdC) encoding for scholarly input, JSesh-compatible
  rendering output, cartouche boundaries, direction indicators
  (left-facing/right-facing), and support for Middle Egyptian, Late Egyptian,
  and Ptolemaic sign extensions.

- **Hieratic**: The cursive script derived from hieroglyphics used for
  administrative and literary texts on papyrus; period-specific paleographic
  conventions and hieratic-to-hieroglyphic conversion tables.

- **Demotic**: Unicode support and transliteration following standard
  conventions for this highly cursive late-period Egyptian script.

- **Coptic**: Full support for all five major dialects — Sahidic (the primary
  literary dialect), Bohairic (the liturgical dialect of the Coptic Orthodox
  Church), Akhmimic, Fayyumic, and Lycopolitan — including dialect-specific
  letters and supralinear strokes.

#### South Asian Scripts

- **Sanskrit/Devanagari**: Full Unicode for consonants, vowels, conjunct
  consonants (ligatures), virama (consonant killer), anusvara, visarga,
  chandrabindu, avagraha, and all Vedic accent marks (udatta, anudatta,
  svarita). Multiple transliteration schemes: IAST (primary scholarly standard),
  Harvard-Kyoto (ASCII-only), SLP1 (compact computational format), Velthuis
  (legacy TeX), and ISO 15919.

- **Pali multi-script**: Devanagari, Roman (PTS transliteration conventions),
  Sinhala, Thai, Burmese, and Khmer script representations, all interconvertible
  while preserving semantic identity.

- **Prakrit**: Ardhamagadhi (the Jain canonical language), Shauraseni, and
  Maharashtri Prakrit with dialect-specific phonological rules.

- **Tibetan**: Wylie transliteration support, proper consonant cluster stack
  construction, tsheg (syllable separator), and shad (phrase/sentence
  delimiter).

- **Indic inscriptional scripts**: Tamil Brahmi, Grantha, and Kharoshthi for
  early South Asian epigraphy and manuscript traditions.

#### Greco-Roman and Other Ancient Scripts

- **Ancient Greek**: Full polytonic accentuation — acute, grave, circumflex,
  rough/smooth breathing marks, iota subscript/adscript, diaeresis, coronis —
  along with dialectal orthographic variants (Attic, Ionic, Doric, Aeolic,
  Koine) and both Attic and Ionic/Milesian numeral systems.

- **Latin**: Classical orthographic conventions (including inscriptional
  conventions without U/V and I/J distinction), Medieval Latin extensions,
  Ecclesiastical Latin conventions, and abbreviation expansion for the most
  common medieval scribal abbreviations.

- **Avestan and Old Persian cuneiform**: The language of the Zoroastrian Gathas
  and the later Avestan corpus; the cuneiform syllabic script of the Achaemenid
  Persian inscriptions.

- **Old Church Slavonic**: Both Glagolitic (the oldest Slavic alphabet) and
  Early Cyrillic; runic scripts for Elder Futhark, Younger Futhark, and
  Anglo-Saxon Futhorc; Linear B syllabic script for Mycenaean Greek.

- **Classical Chinese**: Traditional characters (not simplified), ML-assisted
  word segmentation for Literary Chinese texts that have no word boundary
  markers, punctuation insertion heuristics for unpunctuated classical texts,
  and variant character tracking (異體字).

---

### Morphological Analysis

Morphological analysis — breaking a word down into its grammatical components
(root, stem, inflectional ending, pronominal suffix, etc.) — is the foundation
of reading ancient texts. Nisaba includes paradigm-based parsers, not mere
lookup tables, meaning it can analyze forms that don't appear in any dictionary.

- **Hebrew**: All seven major verb stems (Qal, Niphal, Piel, Pual, Hiphil,
  Hophal, Hithpael) plus less common derived stems; all conjugations (perfect,
  imperfect, imperative, infinitive construct, infinitive absolute, participle);
  weak root detection for all major root types (I-Nun, I-Yod, I-Aleph,
  II-Waw/Yod, III-He, Geminate); complete pronominal suffix decomposition (both
  subject and object suffixes); construct chain analysis; waw-consecutive
  identification; prefix stripping for inseparable prepositions, conjunctive
  waw, definite article, and relative pronoun.

- **Greek**: Full nominal paradigm (all three declensions, all cases including
  dual); complete verbal paradigm (all six tenses: present, imperfect, future,
  aorist, perfect, pluperfect; all four moods: indicative, subjunctive,
  optative, imperative; plus infinitive and all participle forms; all three
  voices); augment detection (syllabic and temporal); contract verb resolution
  for alpha, epsilon, and omicron contracts; participle agreement parsing;
  enclitic and proclitic handling.

- **Latin**: All five nominal declensions including irregulars; four
  conjugations plus all irregular verbs (sum, eo, fero, volo, possum, etc.);
  deponent and semi-deponent detection; ablative absolute identification;
  gerund/gerundive distinction; supine recognition.

- **Sanskrit** (Rust/WASM implementation for performance): External sandhi
  decomposition — sandhi is the phonological fusion that makes Sanskrit text
  appear as a continuous stream without word breaks; all vowel sandhi, consonant
  sandhi, and visarga sandhi rules; internal sandhi; compound analysis with
  classification of all five compound types (tatpurusha, dvandva, bahuvrihi,
  avyayibhava, dvigu); vibhakti (case) parsing for 8 cases × 3 numbers; verb
  conjugation for all 10 present classes and all tenses and moods; secondary
  derivation identification.

- **Arabic**: Root-pattern morphology — extracting the trilateral or
  quadrilateral root from any derived nominal or verbal form; Form I–X (and
  uncommon) verb form identification with semantic description per form; broken
  plural detection and classification; idafa (construct state / annexation
  chain) analysis; dual number support; passive voice detection.

- **Akkadian**: G-stem (basic), D-stem (intensive), Š-stem (causative), N-stem
  (reflexive/passive), plus Gt, Dt, Št, and Ntn iterative forms; stative
  conjugation; ventive suffix detection; subordination marker handling.

- **Sumerian**: Verbal chain analysis covering dimensional prefixes, modal
  prefixes, conjugation prefixes, pronominal elements, stem, and pronominal
  suffixes; nominal chain parsing (noun + possessive + case marker);
  finite/non-finite verb distinction.

- **Pali**: Sandhi decomposition; nominal declension (six groups); verb
  conjugation (present, aorist, future, imperative, optative, conditional,
  gerund, infinitive, participle); compound analysis.

- **Coptic**: Tripartite conjugation system (First Present, Second Present,
  Circumstantial, and other patterns); prenominal/prepronominal state handling;
  bound group analysis.

- **Configurable token granularity**: Tokenize at morpheme, word, phrase, or
  clause level depending on the analytical task.

- **Position-preserving tokenization**: Byte offsets are preserved so every
  token can be precisely anchored to the source text for standoff annotation
  alignment.

- **Dictionary-form lemmatization**: Returns the canonical dictionary form
  (lemma) of any analyzed word, with contextual disambiguation when multiple
  lemmas are possible.

---

### Lexicon Integration

Rather than directing scholars to external websites, Nisaba embeds direct access
to the major scholarly lexica within the platform through a unified
`LexiconService` API that provides a single `lookup(word, language, options)`
interface returning structured entries from all available lexica for that
language.

- **Biblical Hebrew/Aramaic**: Brown-Driver-Briggs (BDB), the standard scholarly
  reference; lexicon extension API supports licensed resources such as HALOT
  (Koehler-Baumgartner) via a plugin interface.
- **Classical Greek**: Liddell-Scott-Jones (LSJ), the comprehensive Greek
  lexicon (via Perseus, public domain); BDAG for New Testament Greek
  (license-aware plugin interface).
- **Latin**: Lewis & Short (via Perseus, public domain); principal parts
  cross-referencing.
- **Sanskrit**: Monier-Williams Sanskrit-English Dictionary (public domain);
  Devanagari/IAST dual lookup; Vedic/Classical usage distinction.
- **Akkadian**: Chicago Assyrian Dictionary (CAD), all 21 volumes (public domain
  / open access).
- **Sumerian**: Pennsylvania Sumerian Dictionary (PSD) and ePSD2 (the updated
  electronic edition).
- **Arabic**: Lane's Arabic-English Lexicon (public domain), the most
  comprehensive classical Arabic reference.
- **Pali**: PTS Pali-English Dictionary (Pali Text Society, public domain).
- **Cross-language features**: Semantic domain grouping following the Louw-Nida
  model; cross-language cognate linking via Proto-Semitic and
  Proto-Indo-European root reconstruction; frequency data per corpus showing how
  common or rare a word is within its tradition.

---

### Transliteration Engine

Transliteration converts a text from one writing system to another — typically
from a non-Latin script to a romanized academic representation. Nisaba supports
bidirectional transliteration with no data loss, using whichever scholarly
convention is standard for each language.

- **Hebrew**: SBL academic, simplified (no diacritics), general-purpose with
  full vowel representation, and Library of Congress (ALA-LC) romanization.
- **Greek**: Round-trip with proper handling of rough/smooth breathing and
  polytonic accents; both scholarly (accent-preserving) and simplified ASCII
  modes.
- **Sanskrit**: IAST, Harvard-Kyoto, SLP1, Velthuis, and ISO 15919 bidirectional
  conversion.
- **Arabic**: DIN 31635 (primary scholarly standard), ALA-LC (Library of
  Congress), and Buckwalter (computational format used in NLP pipelines).
- **Cuneiform**: ATF conventions for sign values, determinatives (superscript
  notation), and damage notation.
- **Round-trip fidelity**: A text can be transliterated and then
  reverse-transliterated back to the original without data loss — validated for
  every language and scheme.

---

## Translation Comparison Engine (`@nisaba/translations`)

Ancient texts have been translated many times over centuries, and comparing
those translations is central to scholarly work. Nisaba provides multiple
display modes and automated analysis of translation differences.

### Display Modes

- **Side-by-side**: Parallel columns showing two or more translations
  simultaneously, synchronized by verse, line, or paragraph anchors.
  Configurable number of columns (2–6); independent scrolling with sync-lock
  toggle; visual alignment indicators for corresponding segments.

- **Synoptic view**: Horizontal layout showing all versions of a passage
  simultaneously with color-coded alignment markers and expandable/collapsible
  segment groups — the standard format for synoptic Gospel study, generalized to
  any multi-witness comparison.

- **Interlinear**: The source language text is presented word by word, with a
  morphological parsing line (part of speech, stem, grammatical form), a lexical
  gloss line (word-by-word translation), and one or more smooth translation
  lines beneath each source word. Supports right-to-left source texts with
  left-to-right glosses — the most information-dense format for students
  learning to read ancient languages.

- **Reverse interlinear**: The translation text is the primary display; source
  language words and morphological data appear above each translated word —
  allowing readers to follow a translation while maintaining connection to the
  original.

- **Parallel text**: Sentence-aligned original and translation in flowing,
  readable format.

### Alignment Algorithms

- **Statistical methods**: Gale-Church sentence alignment; IBM Model 1–5 word
  alignment; Hidden Markov alignment models; phrase-level bilingual concordance
  alignment.
- **Neural methods**: Transformer-based cross-lingual alignment models
  fine-tuned for ancient language pairs; attention-based word alignment
  extraction from pre-trained multilingual models.
- **Manual alignment**: Scholar-driven alignment interface with accept/reject
  controls; exportable as a parallel corpus for computational use.

### Divergence Detection

The places where translations genuinely differ from each other — or from the
source — are often where the most important scholarly questions live. Nisaba
surfaces these divergences automatically.

- **Semantic divergence scoring**: Quantifying how different translations are at
  word, phrase, clause, and sentence levels.
- **Theological divergence flagging**: Detecting translation choices that appear
  to reflect doctrinal presuppositions rather than purely philological judgment
  — for example, "virgin" vs. "young woman" at Isaiah 7:14, or "peace" vs.
  "sword" at Matthew 10:34.
- **Omission and addition detection**: Material present in one translation but
  absent from another, which may reflect different source text traditions.
- **Formal vs. dynamic equivalence scoring**: Locating a translation on Eugene
  Nida's spectrum between word-for-word (formal equivalence) and
  meaning-for-meaning (dynamic equivalence) rendering.

### Translation History Timeline

- **Chronological tracking**: How a passage has been rendered across history —
  from the earliest translations (the Septuagint for the Hebrew Bible, the Vetus
  Latina for the New Testament, the Targumic tradition) through medieval and
  modern translations.
- **Influence mapping**: Detecting where later translations borrowed specific
  phrasing from earlier ones, building a genealogy of translation language.
- **Cultural context annotations**: Explaining the historical, theological, and
  political circumstances that shaped major translation decisions.

---

## Textual Criticism Engine (`@nisaba/criticism`)

Textual criticism is the discipline of establishing the most accurate possible
text of an ancient work by comparing all surviving manuscript witnesses. It is
the foundation of all serious scholarly editions.

### Manuscript Witness Registry

- **Full witness metadata**: Siglum (the scholar's abbreviation), date range
  with confidence level, provenance (origin and custody history), script type,
  writing material (papyrus, parchment, paper, clay, stone, ostraca), physical
  dimensions, current repository and catalog number, digitization status and
  IIIF manifest URL.
- **Witness classification**: Majuscule (uncial, capital-letter manuscripts) vs.
  minuscule (cursive manuscripts); scroll vs. codex format; text family
  classification (for New Testament: Alexandrian, Byzantine, Western, and
  Caesarean traditions).
- **Family group support**: Manuscript families such as f1 (the Lake Group) and
  f13 (the Ferrar Group) in NT criticism, allowing family-level analysis rather
  than only individual manuscript work.
- **Versional witnesses**: Ancient translations (LXX, Vulgate, Peshitta, Coptic
  versions, Old Latin) treated as witnesses to their source text.
- **Patristic citation tracking**: Quotations in early church fathers, rabbis,
  and ancient commentators treated as indirect witnesses to the text they knew.
- **IIIF manifest linking**: Each manuscript record can link to its IIIF
  manifest, enabling side-by-side viewing of transcription and manuscript image
  from any compatible viewer.

### Collation

Collation is the systematic comparison of manuscript texts to identify every
point of difference — called a variant unit.

- **Automatic collation**: a CollateX-compatible engine that performs
  Needleman-Wunsch token alignment, then constructs a directed acyclic variant
  graph of all witnesses to identify agreements and disagreements.
- **Fuzzy matching**: Handles orthographic variation common in manuscripts —
  itacism (confusion of similar-sounding vowels in Greek), matres lectionis
  inconsistencies in Hebrew — with language-specific normalization rules.
- **Transposition detection**: Identifying when the same words appear in
  different orders across witnesses.
- **Block alignment**: Handling large-scale structural variants where entire
  sections are in different positions.
- **Manual collation interface**: Accept/reject controls for cases where
  automatic collation needs refinement; custom variant unit boundary adjustment;
  uncertain reading markers.
- **Output formats**: Variant graph (JSON), alignment table (TSV/Excel), TEI-XML
  critical apparatus, and JSON interchange.

### Variant Classification

- **Automatic ML-assisted classification** into: orthographic, morphological,
  lexical, syntactic, semantic, substantial, or nonsense variant categories.
- **Scribal error taxonomy**: Haplography (accidental omission of a repeated
  sequence); dittography (accidental doubling); homoioteleuton and homoioarcton
  (eye-skip between similar endings or beginnings); metathesis (letter
  reversal); itacism; harmonization (assimilating to a parallel passage); lectio
  difficilior preference (the classical principle that the more difficult
  reading is usually original); deliberate theological alteration detection.

### Stemmatic Analysis

Stemmatics constructs a family tree (stemma codicum) showing how manuscripts are
descended from each other, ultimately pointing toward the original.

- **Phylogenetic methods**: Maximum parsimony (Fitch algorithm); maximum
  likelihood estimation; Bayesian phylogenetics; NeighborNet for cases with
  conflicting signals suggesting manuscript contamination.
- **Contamination detection**: Consistency index analysis, split decomposition,
  and CBGM (Coherence-Based Genealogical Method) compatibility analysis for
  manuscripts copied from multiple exemplars.
- **Lachmannian reconstruction**: The classical method — identifying conjunctive
  errors (shared mistakes proving relationship) and separative errors (unique
  mistakes ruling out direct copying); archetype reconstruction.
- **Interactive stemma visualization**: Clickable stemma diagrams with
  confidence indicators; ability to propose alternative stemmata; export to
  Newick/Nexus format for phylogenetics software.

### Critical Apparatus

The critical apparatus is the system of footnotes documenting all significant
textual variants and their manuscript support — the defining feature of a
scholarly edition.

- **Positive, negative, and mixed apparatus formats**: Positive lists all
  witnesses supporting each reading; negative lists only witnesses diverging
  from the lemma; mixed uses both where appropriate (following Nestle-Aland
  conventions for NT criticism).
- **Leiden conventions**: The standardized notation system for epigraphic and
  papyrological texts.
- **Siglum and abbreviation management**: Complete management of manuscript
  abbreviations, versions, and scholarly sigla — with witness grouping for
  apparatus compactness.
- **Automatic apparatus generation** from collation data, with manual refinement
  for scholarly judgment calls.

### Lacuna Tracking

A lacuna is a physical gap in a manuscript — a hole, torn section, or area of
damage — where text is lost.

- **Lacuna registry**: Extent of each lacuna, probable cause, and partial
  legibility notes.
- **Proposed restorations**: Scholarly conjectures about missing text, with
  confidence levels (certain, probable, possible, speculative) and supporting
  evidence.
- **Lacuna visualization**: Overlay of proposed readings on manuscript images.

---

## Canonical Reference Management (`@nisaba/canon`)

Canonical reference systems are the standardized ways of citing locations within
sacred texts — systems that must be precisely understood for interoperability
between databases, commentaries, and scholarly tools.

### Biblical Canon Systems

- **Protestant canon** (66 books), **Catholic** (73 books including
  deuterocanonicals: Judith, Tobit, 1–2 Maccabees, Wisdom, Sirach, Baruch),
  **Greek Orthodox** (additional: 1 Esdras, 3 Maccabees, Prayer of Manasseh),
  and **Ethiopian Orthodox** (including 1 Enoch, Jubilees, and additional
  books).
- **Hebrew Bible (Tanakh)** with traditional Torah/Nevi'im/Ketuvim ordering,
  which differs from Christian Old Testament ordering.
- **Septuagint (LXX)** with Rahlfs numbering, plus full versification mapping to
  the Masoretic Text — essential because chapter and verse numbers often differ
  (most famously in the Psalms, where LXX Psalm 9 = MT Psalms 9–10, producing a
  persistent off-by-one throughout the Psalter).
- **Versification conversion engine**: Automated conversion between MT, LXX, and
  standard English versification systems.

### Quranic Reference

- **Surah/ayah numbering** for all 114 surahs.
- **Juz, hizb, rub**: The traditional divisions of the Quran into 30 equal parts
  (juz') used for Ramadan recitation, and their subdivisions (hizb = half juz';
  rub = quarter hizb).
- **Qira'at variant tracking**: The ten canonical readings of the Quran —
  systems of pronunciation and occasional textual variations representing
  different chains of oral transmission. The most common are Hafs (dominant in
  most Muslim-majority countries) and Warsh (dominant in North and West Africa).
  All ten are supported.
- **Asbab al-nuzul**: Linking verses to the traditional "occasions of
  revelation" — the historical contexts in which each verse was reportedly
  revealed.

### Buddhist Canon Systems

- **Pali Canon**: PTS (Pali Text Society) page numbering; Thai, Burmese, and
  Sinhalese edition numbering; standard sutta reference system (e.g., DN 22 =
  Digha Nikaya, Sutta 22).
- **Chinese Buddhist Canon**: Taishō Tripiṭaka with volume/page/column/line
  reference (the universal standard for Chinese Buddhist scholarship); CBETA
  reference system; Dunhuang manuscript numbering.
- **Tibetan Buddhist Canon**: Kangyur (the words of the Buddha) and Tengyur
  (Indian commentaries) classification; Derge edition numbering; Peking,
  Narthang, and Cone edition cross-referencing; Tohoku catalog numbers.

### Hindu Scripture Systems

- **Vedic corpus**: Rigveda mandala/sukta/mantra; Samaveda, Yajurveda (Black and
  White), Atharvaveda; Brahmanas, Aranyakas, and the major Upanishads.
- **Epics and Bhagavad Gita**: Mahabharata with both Critical Edition
  (Pune/Bori) and Vulgate numbering; Ramayana; Bhagavad Gita by chapter and
  verse.
- **Sutras and Puranas**: Yoga Sutras of Patanjali, Brahma Sutras, all 18 major
  Puranas, Dharmasutras.

### Jewish Textual Systems

- **Talmud**: Both Babylonian (Bavli) and Jerusalem (Yerushalmi) Talmuds with
  tractate/folio/amud (side: a = recto, b = verso) reference (e.g., Berakhot
  2a).
- **Mishnah and Tosefta**: Tractate/chapter/paragraph.
- **Midrash collections**: Midrash Rabbah, Tanhuma, Pesikta de-Rav Kahana, and
  others.
- **Kabbalah**: Zohar with parasha/daf reference.

### Classical Text Systems

- **Greek**: Stephanus pages for Plato (the 16th-century pagination still used
  as the universal reference after 450 years); Bekker numbering for Aristotle;
  Diels-Kranz numbering for the Pre-Socratics; standard line numbering for
  Homer, Aeschylus, Sophocles, Euripides, Aristophanes.
- **Other traditions**: Avesta (yasna/ha/paragraph); Confucian Analects
  (book/chapter); Daodejing (chapter); I Ching (hexagram/line).

### Cross-System Reference Resolution

A core challenge in multi-tradition scholarship is that every tradition has its
own citation conventions, and the same passage can be expressed in a dozen
incompatible ways. Nisaba solves this with a canonical URI scheme that gives any
passage a single stable identifier regardless of which convention was used to
look it up.

- **Canonical URI scheme**: `nisaba://tradition/work/reference` (e.g.,
  `nisaba://bible/gen/1:1`, `nisaba://quran/2:255`,
  `nisaba://buddhist/pali/dn/22`). A single stable identifier for any passage in
  any tradition.
- **CTS/CITE protocol compatibility**: Interoperability with the Perseus Digital
  Library and other digital humanities infrastructure.
- **Bidirectional mapping**: Convert any reference to any other reference system
  for the same passage (e.g., MT psalm numbering to LXX psalm numbering).

---

## Philological Analysis (`@nisaba/philology`)

Philology is the study of language in historical written sources — combining
linguistics, literary criticism, and history to understand texts in their full
depth.

### Etymology and Semantic Analysis

- **Cross-language cognate chain tracking**: Following word families across
  language boundaries — Proto-Semitic roots through Hebrew, Aramaic, Arabic,
  Akkadian, Ugaritic, and Ge'ez; Proto-Indo-European roots through Sanskrit,
  Greek, Latin, Avestan, and Old Persian; Sino-Tibetan root relationships;
  Egyptian-Coptic etymological continuity.

- **Semantic drift visualization**: Showing how word meanings changed across
  languages and centuries. For example, Hebrew _ruach_ (wind/breath/spirit) →
  Greek _pneuma_ → Latin _spiritus_ → English "spirit" — with attestation
  timeline and usage context examples for each stage.

- **Loanword detection**: Identifying borrowed words across language boundaries
  — Sumerian loanwords in Akkadian; Persian loanwords in Biblical Hebrew; Greek
  loanwords in Rabbinic Hebrew; Sanskrit loanwords in Pali; Arabic loanwords in
  Persian, Turkish, and Urdu — using phonological correspondence rules and
  chronological filtering.

- **Semantic domain mapping**: Following the Louw-Nida semantic domain framework
  for NT Greek and the Semantic Dictionary of Biblical Hebrew approach;
  cross-linguistic semantic field comparison (e.g., the different conceptual
  ranges of Hebrew _chesed_, Greek _agape/philia/eros_, and Sanskrit
  _prema/bhakti/karuna_).

- **Collocational analysis**: Identifying statistically significant word
  co-occurrences and fixed phrases within each corpus; metaphor mapping
  following Lakoff-Johnson conceptual metaphor theory applied to ancient texts.

### Hapax Legomena and Statistical Linguistics

A hapax legomenon is a word that appears only once in the entire corpus — often
the most challenging and disputed term to translate, since no other occurrences
provide context.

- **Hapax legomena detection**: Automatic flagging of words occurring only once
  (hapax) or twice (dis legomena) in a corpus, with cross-corpus checking to
  determine whether a NT hapax appears in the LXX or Pseudepigrapha.

- **Word frequency analysis**: Type-token ratios, vocabulary richness metrics
  (Yule's K, Simpson's D, hapax percentage), and corpus comparison statistics.

- **Stylometric authorship attribution**: Using function word frequencies,
  sentence length distributions, vocabulary overlap, and other statistical
  features to analyze disputed authorship questions (e.g., Pauline epistles,
  Isaianic unity, the Documentary Hypothesis for the Pentateuch).

- **Register analysis**: Distinguishing prose from poetry, narrative from
  discourse, legal from prophetic — based on statistical profiles of syntactic
  patterns, vocabulary, and discourse markers.

### Discourse Analysis

- **Chiastic structure detection**: Automatic identification of chiasmus
  (A-B-C-B'-A' patterns) — a pervasive structural device in ancient Near Eastern
  and biblical literature — with configurable detection parameters and
  confidence scoring.

- **Ring composition detection**: Identifying Homeric ring structure (where a
  narrative opens and closes with the same theme) and inclusio (simpler framing
  where a passage begins and ends with identical or near-identical words).

- **Discourse boundary detection**: Using discourse markers, topic shifts,
  participant changes, temporal indicators, and formulaic expressions to
  automatically segment texts into discourse units.

- **Narrative analysis**: Character tracking across a narrative;
  speech/narration distinction; reported speech nesting; narrative perspective
  identification.

### Intertextuality Detection

- **Quotation detection**: Identifying explicit quotations of earlier texts in
  later ones (OT quotations in NT, Vedic citations in Upanishads, Quranic
  references to Biblical narratives) with source identification and citation
  format analysis.

- **Allusion detection**: Identifying probable but inexact references using
  shared vocabulary clusters, thematic parallels, and structural similarities
  with configurable sensitivity thresholds.

- **Echo detection**: For faint thematic or verbal resonances that may or may
  not represent conscious literary dependence — producing scored results with
  supporting evidence.

- **Influence scoring**: Quantifying probability and strength of intertextual
  connections; dependency direction analysis determining which text is source
  and which is dependent.

---

## Paleographic Analysis (`@nisaba/paleography`)

Paleography is the study of ancient handwriting — used to date manuscripts,
identify scribal hands, and authenticate documents.

- **Script classification from images**: ML classifier identifying writing
  systems from manuscript images, even for partially damaged manuscripts.
- **Period classification**: Estimating a manuscript's date range from
  letterform shapes, ductus (the order and direction of strokes), and
  comparative paleographic databases.
- **Regional classification**: Identifying scribal schools by regional
  letterform characteristics — distinguishing Palestinian from Babylonian Hebrew
  scripts, or Alexandrian from Byzantine Greek hands.
- **Letterform analysis**: Quantitative measurement of stroke angle, aspect
  ratio, serif presence, baseline consistency, and ductus for systematic
  comparative work.
- **Scribal hand identification**: ML models trained on manuscript images for
  writer identification across documents — determining whether two manuscripts
  share a scribe.
- **Collaborative vs. single-scribe detection**: Identifying hand changes within
  a single manuscript, which may indicate different scribes, different copying
  sessions, or later additions.
- **Multispectral imaging integration**: Processing infrared, UV, XRF, and RTI
  (Reflectance Transformation Imaging) data to read faded, erased, or
  overwritten text — including palimpsests, manuscripts where the original text
  was scraped off and reused.
- **AI-assisted letter reading**: For damaged or partially legible characters,
  providing ranked candidate readings with confidence scores.

---

## Cross-Tradition Comparative Analysis (`@nisaba/comparative`)

### Concept Equivalence Registry

The concept equivalence registry is a curated scholarly database of analogous
concepts across religious and philosophical traditions — carefully mapping where
they converge, diverge, and resist comparison, without assuming equivalence.

- **Curated cross-tradition concept mappings** with similarity taxonomy
  (genetic, typological, analogical, contested) and evidence grading. Examples:
  - _Ineffability_: Tao ~ Brahman ~ Sunyata ~ Ein Sof ~ Theologia Negativa ~
    Fana
  - _Liberation_: Moksha ~ Nirvana ~ Theosis ~ Salvation ~ Fana ~ Wu Wei
  - _Universal ethics_: The Golden Rule across Confucius, Hillel, Jesus,
    Muhammad, and Buddhist precepts
  - _Cosmic order_: Logos ~ Rta/Dharma ~ Ma'at ~ Tao ~ Torah
  - _Self-transcendence_: Anatta ~ Fana ~ Kenosis ~ Bittul HaYesh ~ Wu Wei

- **Evidence requirements**: Every mapping must cite primary sources, scholarly
  literature, and specify the level of scholarly consensus — preventing
  superficial syncretism.

- **Version history**: Tracking how concept mappings evolve as scholarship
  progresses.

### Parallel Passage Detection

- **Semantic similarity algorithms**: Detecting parallel passages across
  traditions using vector similarity of cross-lingual embeddings.
- **Motif matching**: Identifying shared narrative or thematic motifs (flood
  narratives, dying-and-rising deity figures, creation from chaos) across the
  Aarne-Thompson-Uther universal motif catalog.
- **Structural analysis**: Detecting structural parallelism in text organization
  (three-part narratives, wisdom instruction forms, lament patterns).

### Influence Network

- **Directed influence graph** with evidence-graded edges showing probable
  textual dependencies — mapping, for example, how Second Temple Jewish
  apocalyptic literature influenced early Christian texts, or how Stoic
  philosophy influenced Philo of Alexandria.

---

## Open-Source Corpora Integration (`@nisaba/corpora`)

### Format Parsers

The major digital humanities repositories use different text encoding formats.
Nisaba provides parsers for all of them, converting each into a unified internal
representation.

- **TEI-XML (Text Encoding Initiative)**: Full TEI P5 support including
  teiHeader metadata, structural elements (div, p, l, lg, sp, stage), critical
  apparatus elements (app, lem, rdg, wit), named entities (persName, placeName,
  orgName), linguistic annotations, manuscript descriptions, and bibliographic
  data. Streaming parser for large files. Also TEI P5 generator with EpiDoc
  variant for epigraphic and papyrological texts.

- **ATF (ASCII Transliteration Format)**: Full parser and generator for the
  CDLI/ORACC cuneiform standard.

- **USFM/USX**: United Bible Societies standard format for Bible software; OSIS
  XML (Open Scripture Information Standard); SWORD module format.

- **OpenITI mARkdown**: The format used by the Open Islamicate Texts Initiative
  for Arabic and Persian texts.

### Corpus Connectors (13+ platforms)

The connectors below bring external digital humanities corpora into the Nisaba
ingestion pipeline, making their texts searchable and analyzable alongside all
other connected materials. Each connector handles metadata ingestion, text
retrieval, and mapping of the corpus's native citation scheme to Nisaba
canonical URIs.

- **Perseus Digital Library**: Greek and Latin texts with morphological data,
  translations, and commentary.
- **ETCSL** (Electronic Text Corpus of Sumerian Literature): Complete Sumerian
  literary corpus with transliteration and translation.
- **CDLI** (Cuneiform Digital Library Initiative): Cuneiform tablet catalog with
  ATF transliterations.
- **ORACC** (Open Richly Annotated Cuneiform Corpus): Annotated cuneiform texts
  across specialized sub-projects.
- **SuttaCentral**: Pali, Chinese, Sanskrit, and Tibetan Buddhist texts with
  translations and parallel identifications.
- **CBETA** (Chinese Buddhist Electronic Text Association): Complete Chinese
  Buddhist canon (Taishō Tripiṭaka).
- **Sefaria**: Jewish texts (Tanakh, Talmud, Midrash, Halakha, Kabbalah,
  Liturgy, Philosophy) with Hebrew/Aramaic originals and translations.
- **OpenITI**: Arabic and Persian texts in mARkdown format.
- **SARIT** and **GRETIL**: Sanskrit and Prakrit texts in TEI-XML.
- **CTP** (Chinese Text Project): Pre-modern Chinese texts (Confucian, Taoist,
  Legalist, etc.).
- **Dead Sea Scrolls Digital Library**: Transcriptions and image references.
- **ETCBC** (Eep Talstra Centre for Bible and Computer): Morphologically
  analyzed Hebrew Bible.
- **SWORD modules**: Bible translations, original language texts, lexica, and
  commentaries.

### Ingestion Pipeline

The ingestion pipeline converts corpus content into Nisaba's internal
representation. Chunking strategy is chosen based on text genre, because
inappropriate chunk boundaries would break verse references, narrative
pericopes, or synoptic alignments.

- **Verse-aware chunking** for poetry and scripture, respecting verse
  boundaries.
- **Pericope-aware chunking** for narrative texts, using discourse boundary
  detection.
- **Section-aware chunking** for prose treatises, following the author's
  structural divisions.
- **Parallel-preserving chunking**: Keeping synoptic parallels aligned across
  chunk boundaries for cross-tradition vector search.
- **Corpus synchronization scheduler**: Periodic re-ingestion of updated corpora
  with incremental update detection and conflict resolution.

---

## Annotation and Commentary System (`@nisaba/annotations`)

Standoff annotation stores annotations separately from the base text, referenced
by character positions — rather than embedding markup within the text. This
allows multiple annotation layers to overlap without conflict and prevents
annotations from corrupting source text.

- **W3C Web Annotation Data Model (WADM)** storage with TextPositionSelector
  (character offset ranges) for multiple overlapping layers.

- **Annotation type system**: Textual notes (commentary, explanation,
  cross-reference); linguistic annotations (morphological, syntactic, semantic);
  translation annotations (gloss, paraphrase, formal translation); critical
  annotations (variant readings, emendation proposals); comparative annotations
  (cross-tradition parallel markers); structural annotations (discourse markers,
  chiastic boundaries); pedagogical annotations (difficulty level, prerequisite
  knowledge).

- **Talmudic-style layered commentary model**: Base text layer → first
  commentary layer (direct commentary on the base text) → second commentary
  layer (commentary on the commentary, as in the Talmud's Mishnah + Gemara +
  medieval commentators structure). Essential for corpora where the tradition of
  commentary is as important as the text itself.

- **Annotation body formats**: TEI-XML, Markdown, and plain HTML — scholars are
  not locked into a single format.

- **Batch annotation operations**: Create, update, or delete annotations across
  a passage range in a single operation.

- **Export**: W3C JSON-LD format and TEI-XML for use in publication and data
  interchange.

---

## Digital Critical Edition Tools (`@nisaba/editions`)

A digital critical edition is a scholarly publication combining a carefully
established text, a critical apparatus, translations, and commentary — produced
and distributed digitally.

- **Edition project management**: Full lifecycle management (draft → review →
  published); collaborator roles (editor-in-chief, contributing editor,
  translator, reviewer); milestone tracking.
- **Apparatus attachment**: Attaching and managing the critical apparatus per
  edition, with automated generation from collation data and manual refinement.
- **Translation management**: Managing multiple translations within a
  multi-lingual edition.
- **Multi-format export**: TEI-XML (the international standard for digital
  editions), EPUB, PDF, LaTeX (for print-quality publication), DOCX.
- **Publication workflow**: Scholarly review stages, revision tracking, and
  publication approval.

---

## Temporal-Geographic Mapping (`@nisaba/geotemporal`)

- **Geographic timeline**: Visualizing where manuscripts originated, where they
  traveled, and where they are held now — mapping transmission history
  cartographically.
- **Cartographic visualization**: Map-based display of manuscript origins,
  transmission routes, and scribal centers (Alexandria, Qumran, Constantinople,
  Nalanda, Babylon, Nineveh, etc.).
- **Fuzzy date support**: BCE/CE dates with approximate confidence ranges for
  undated manuscripts (earliest, latest, probable center, confidence level).
- **Provenance chain documentation**: Recording the ownership and custody
  history of manuscripts — essential for both scholarly research and
  repatriation and legal questions.

---

## AI Scholarly Assistant (`@nisaba/assistant`)

The AI assistant grounds all responses in the Nisaba corpus, providing
citation-backed scholarly support rather than hallucinated generalizations.

- **Translation commentary generation**: AI-generated scholarly commentary on
  translation choices, citing parallel passages, manuscript variants, and
  lexical evidence.
- **Textual variant evaluation**: Reasoning through which variant reading is
  more likely original, applying standard text-critical criteria (lectio
  difficilior, intrinsic probability, transcriptional probability).
- **Research question answering**: Grounded in corpus evidence with explicit
  citations to source texts.
- **Translation alternative generation**: Offering alternative renderings of a
  passage with philological justification for each option.

---

## Import/Export Standards (`@nisaba/standards`)

- **Full TEI-XML round-trip**: Import and export in TEI P5 and EpiDoc.
- **ATF**: Import and export for cuneiform corpora.
- **USFM/USX**: For Bible software integration.
- **OpenITI mARkdown**: For Arabic/Persian text ecosystems.
- **Citation export**: Zotero RDF, BibTeX, and Endnote XML for bibliographic
  management.

---

## Scholarly Workspace (`@nisaba/workspace`)

The workspace is the scholar's primary interface — a configurable research
environment bringing together all of Nisaba's capabilities.

- **Unified cross-corpus search**: Lemma-aware (search for a word and find all
  its morphological forms); morphology-aware (search for all nouns in the
  genitive case); Boolean; proximity; field-restricted (search only in
  manuscripts from a given century) — searching across all connected corpora
  simultaneously.
- **Configurable split-pane reading environment**: Multiple panes showing texts,
  translations, manuscript images, or annotations simultaneously; synchronized
  scrolling; font selection; light and dark themes.
- **Personal library**: Reading lists, bookmarks, highlights, and notes;
  citation manager export to Zotero, Endnote, and BibTeX.
- **Research project management**: Project lifecycle management; collaborator
  roles; shared resources; milestone tracking.
- **Keybinding configuration**: Power-user keyboard shortcuts for common
  scholarly operations.

---

## Client SDK (`@nisaba/client`)

- **Zero-dependency TypeScript SDK** (`NisabaClient`, built via
  `NisabaClientBuilder`) using native fetch.
- **Typed resource operations** covering manuscripts and witnesses, collation
  and stemma, annotations, editions, canonical references, corpus search,
  comparative concept maps, and the AI assistant.
- **Automatic retry with exponential backoff** for transient network failures.
- **Request/response interceptor pipeline** for authentication, logging, and
  transformation.
- **In-memory response cache** with configurable TTL for frequently-accessed
  reference data.
- **Pagination support**: Both offset-based and cursor-based pagination.
- **Batch requests and WebSocket channels**: `batchRequests` runs multiple
  operations together; `connectWebSocket` opens collaboration channels.
- **React bindings**: `@nisaba/client` also ships a `reactHooks` module with
  CRDT collaboration primitives (vector clocks, LWW sets, operational
  transforms).

A separate `@nisaba/api-client` package provides the generated typed client for
the canonical V1 contract API (`/api/v1/nisaba`).

---

## Infrastructure (`@nisaba/schemas`, `@nisaba/database`)

### Validation Schemas (`@nisaba/schemas`)

Zod schemas for the domain entities that cross trust boundaries — request
bodies, corpus ingestion payloads, and data arriving from external APIs. Each
module exports schemas, inferred TypeScript types, and `Create*` (and most an
`Update*`) variants.

- **Manuscript schemas** (`manuscript.ts`): `ManuscriptSchema` with siglum,
  material, script type, dimensions, provenance fields, dating
  (`dateEarliest`/`dateLatest`/`dateConfidence`), `iiifManifestUrl`;
  `ManuscriptDimensionsSchema`, `WitnessClassificationSchema`,
  `ManuscriptQuerySchema`.
- **Variant and collation schemas** (`variant.ts`): `VariantReadingSchema`,
  `VariantUnitSchema`, `CollationConfigSchema`, `CollationResultSchema`,
  `CollationProjectSchema`.
- **Critical apparatus schemas** (`apparatus.ts`): `ApparatusEntrySchema`,
  `ApparatusReadingSchema`, `ApparatusConfigSchema`, `CriticalEditionSchema`.
- **Annotation schemas** (`annotation.ts`): `AnnotationSchema`,
  `AnnotationLayerSchema`, `AnnotationExportSchema`, and the W3C selector
  schemas (`TextPositionSelectorSchema`, `TextQuoteSelectorSchema`, etc.).
- **Canonical reference schemas** (`reference.ts`): `CanonicalReferenceSchema`
  with tradition, canon, `bookId`/`bookName`, structure, versification;
  `VersificationMappingSchema`, `ReferenceRangeSchema`, `ReferenceQuerySchema`.
- **Cross-tradition schemas** (`tradition.ts`): `ConceptMappingSchema`,
  `MotifSchema`, `InfluenceEdgeSchema` with similarity taxonomy and evidence
  grading.
- **Corpus and paleography schemas** (`corpus.ts`): `CorpusMetadataSchema`,
  `PaleographicAnalysisSchema`, `PaleographicFeatureSchema`,
  `DateEstimationSchema`, `ScribalHandSchema`.
- **Geotemporal schemas** (`geotemporal.ts`): `FuzzyDateSchema`,
  `ProvenanceEventSchema`, `ProvenanceChainSchema`, `HistoricalLocationSchema`,
  `TimelineEventSchema`, `GeospatialQuerySchema`.

### Database (`@nisaba/database`)

- **PostgreSQL via Prisma**: typed schema for all domain entities, generated to
  `database/src/generated/client`; the datasource URL is `NISABA_DATABASE_URL`.
- **16 models**: `Manuscript`, `CollationProject`, `VariantUnit`,
  `CriticalEdition`, `Annotation`, `AnnotationLayer`, `ConceptMapping`,
  `MotifAttestation`, `InfluenceEdge`, `CanonicalReference`, `Passage`,
  `PaleographicAnalysis`, `ScribalHand`, `ResearchProject`,
  `PersonalLibraryItem`, `Bookmark`.
- **Seed data**: `database/prisma/seed.ts`.
- **Migration management**: Prisma migration workflow; the Prisma client is
  re-exported via `getNisabaClient()` / `createNisabaClient()` /
  `disconnectNisabaClient()`.

---

## Cross-Domain Boundaries (`@nisaba/cross-domain`)

Nisaba owns all manuscript, corpus, and textual-scholarship capabilities. Other
Oshun domains consume Nisaba research outputs through a well-defined bridge
rather than duplicating these concerns. The boundary exists so that the
scholarly text layer stays independent of UI frameworks, meditation content, or
productivity workflows — each domain can evolve at its own pace without
coupling.

The data that crosses the boundary:

- **Tara** (contemplative practice): Nisaba supplies passage companions for
  meditation sessions — a scripture passage, its variants, and its translation
  history. Tara owns the practice flow; Nisaba owns the text objects.
- **Arete** (virtue and growth): Nisaba supplies structured study plans and
  canonical references for Arete's goal-setting and learning-path features.
  Arete owns the user's growth narrative; Nisaba owns the text curriculum.
- **Veritas** (truth and epistemology): Nisaba supplies source-depth signals —
  grounding claims in primary textual evidence with citations. Veritas owns the
  epistemic evaluation; Nisaba owns the corpus evidence.
- **Nyx** (cosmology and symbol): Nisaba supplies cosmology overlays — linking
  symbolic concepts to their textual attestations. Nyx owns the symbolic
  representation; Nisaba owns the primary sources.
- **Shared concept graph**: Nisaba maintains the authoritative concept graph
  nodes and edges; other domains read-link to them without duplicating the
  scholarly validation logic.

The bridge is implemented in
`libs/nisaba/cross-domain/src/nisaba-cross-domain.ts` and verified by
`verifyNisabaCrossDomainCoverage`. See `specifications.md` §8 for the complete
signal interfaces and capability enum.

---

## Scope

This feature document is scoped to the 22 `@nisaba/*` packages under
`libs/nisaba/` plus the canonical V1 contracts in `libs/contracts/src/nisaba/`.
It covers ancient text analysis, corpora, canon management, editions,
annotations, languages, paleography, philology, criticism, comparative research,
geotemporal analysis, translations, standards, the workspace and client
surfaces, the cross-domain bridge, the mobile and study-plan surfaces, and
assistant integration. Nisaba ships as libraries and generated API contracts;
there is no `apps/nisaba` or `services/nisaba`.

Other domains may consume Nisaba research outputs, but Nisaba's manuscript,
corpus, and textual-scholarship features stay here.

## Autonomous Research Contribution (Phase 178)

Nisaba is a co-owner of the autonomous research / agentic-scientist substrate
(Phase 178, centered in Nous). Nisaba's side is scholarly authoring and
philological grounding: the agentic scientist uses Nisaba's critical-edition,
citation, and cross-tradition analysis surfaces when a research task touches
ancient or primary-source texts, and Nisaba consumes the shared literature and
novelty graph. Nous owns the agent loop and experiment ledger; Nisaba owns
text-critical correctness.
