Skip to content

Data · pinned from sggs-data

Scripture Integrity

3 min readUpdated

Page actions

ChatGPT and Claude are third-party services. The link gives them this page's public address and a short instruction. This site records nothing.

Textual fidelity is the single most important property of this project and overrides everything else. The Gurmukhi text is verbatim from the source Bir and is never edited, paraphrased, normalized, reordered, or guessed at.

The guarantee chain

The guarantee chainThe corpus is built from the source PDF, must reconcile character for character and pass the golden checks or the rebuild aborts; the database then must pass the regroup and scripture-guard checks before a commit and release.build_corpus.pyreconcile.pygolden_test.pynonoyesyesverify_regroup.pyguard_scripture.py

Source Bir PDF

corpus/sggs.jsonl

char-exactvs PDF?

structuralgolden checks?

ABORT rebuild

db/sggs.sqlite

only comp_id/line_nochanged?

pre-existing tablesbyte-identical to baseline?

commit + release

The guarantee chainThe corpus is built from the source PDF, must reconcile character for character and pass the golden checks or the rebuild aborts; the database then must pass the regroup and scripture-guard checks before a commit and release.build_corpus.pyreconcile.pygolden_test.pynonoyesyesverify_regroup.pyguard_scripture.py

Source Bir PDF

corpus/sggs.jsonl

char-exactvs PDF?

structuralgolden checks?

ABORT rebuild

db/sggs.sqlite

only comp_id/line_nochanged?

pre-existing tablesbyte-identical to baseline?

commit + release

The guarantee chain

Wide diagram — scroll sideways to see all of it.

The only sanctioned text transforms

  1. PDF visual → logical Unicode reordering of the sihari (ਿਕ੍ਰਪਾ → ਕ੍ਰਿਪਾ).
  2. Editorial Unicode-repair corrections where the source font emitted impossible sequences. The complete register is audit/editorial-ledger.jsonl — 4 rules, 11 applications: Angs 573, 586, 727 (itemised from the start) and Angs 1354, 1358, 1387, 1398, 1402, 1406, 1408, 1409 (same fix_text step-4 rules; itemised 2026-09-23, scholarly review completed and approved 2026-09-24, gate G3). Every decoding transform (timestamps, halant order, glyph restorations, vowel re-attachment, stray-character strip) is registered too.

Any new transform must be registered in the ledger and reviewed by a human. The English translations are a separate, labelled layer (Dr. Sant Singh Khalsa via BaniDB/ShabadOS) and are never blended into the Gurmukhi.

Proof tools

ToolProvesWhen
pipeline/reconcile.pycorpus == PDF, character for characterevery rebuild (gate)
pipeline/golden_test.pycanonical structural checksevery rebuild (gate)
pipeline/sggs_integrity.pythe committed DB’s content equals audit/dataset-fingerprint.json — every table (build stamps blanked), every FTS5 index (via fts5vocab), scripture_sha256 (the iOS definition) and t0_sha256; stable across SQLite versionsevery PR (CI gate); written by every rebuild
pipeline/data_quality.pythe dataset is well formed and the tracked rows are as reviewed: 60,658 lines over Angs 1–1430, no line without a comp_id and the set of comp_id gaps unchanged (ids are never reused), the heading set unchanged, no Latin in Gurmukhi columns and no Gurmukhi in the English layer, no reference to a missing line, and the 21 isolated-sign lines plus the empty-translit_norm line exactly as in audit/data-quality-baseline.jsonevery PR (CI gate); the baseline is re-recorded only in a reviewed PR
pipeline/ledger_check.pyfix_text editorial rules == the ledger; any scripture (T0) change is covered by a new, reviewed ledger entryevery PR (CI gate)
pipeline/verify_regroup.pya corpus change touched only comp_id/line_no; scripture byte-identicalany PR touching corpus/db
pipeline/timing/guard_scripture.pypre-existing tables byte-identical to the committed baselineafter any DB write
validation/reconcile-attestation.jsonthe corpus in this commit reconciled char-exact locally (the PDF never enters CI)make reconcile
/api/health60,658 lines, 1,430 Angs, FTS live, verbatim Mool Mantar, ≥560 ੴ, live verifyafter any DB change

The hash chain

MANIFEST.json carries corpus_sha256 + db_sha256; contract/_meta.json carries its own db_sha256; the iOS manifest carries db_sha256 + scripture_sha256. scripture-integrity CI asserts these agree, so a DB rebuild that forgets to regenerate the contract or the attestation fails the gate rather than silently shipping drift.

If text looks wrong

Flag it, do not change it. Open a Scripture fidelity concern issue with the Ang and the verbatim line; a Granthi/scholar reviews. Known items awaiting review: the 3 TRAILING_RUBRICS (ਜੁਮਲਾ, ਦੁਤੁਕੇ, ਏਹੁ ਸਲੋਕੁ ਆਦਿ ਅੰਤਿ ਪੜਣਾ), ~20 verse lines the source mis-tags as headings, and the source-faithful isolated-matra rows (Angs ~695–699, 1354/1358/1387).