Skip to content

Regulatory data on disk (data/regulatory and cousins) ​

Status: October 2026 (slices 30–34).

Locus keeps legal text and evidence in three places that must not be confused:

LocationOwnerPurpose
data/regulatory/fixtures/ (repo root)Engineering / CITiny synthetic PDFs + manifest.json to exercise the platform legal vault pipeline without shipping official gazettes
Postgres + R2 (or local vault dir)Platform ops (locus-ops)Production instrument / edition / provision / artifact system of record — real PDFs after human review
locus-web/data/regulatory/Dev / analysis enginesLegacy parsed JSON / SQLite corpus used by catalog.ts and retrieval until vault provisions are legal_reviewed

Tenant deal-room PDFs (term sheets, SYSCOHADA packs) live under the tenant document vault (R2), not under data/regulatory/.


1. data/regulatory/fixtures/ (what the PDFs are for) ​

Purpose ​

These PDFs are CI and local-dev stand-ins for foundational CEMAC instruments that LegalVaultBootstrap creates as stub editions (e.g. cosumaf-rg-2014__edition_bootstrap). They exist so that:

  1. Artifact register / SHA-256 / PdfPig extract / review → publish can be tested without copyrighted full gazettes in the repo.
  2. scripts/attach-vault-fixtures.sh can attach each file to its bootstrap edition via
    POST /api/admin/regulatory/editions/{editionId}/artifact (PLATFORM_OPERATOR session).
  3. Contract tests (locus-ops/tests/legal_vault_amendments_applicability_fixtures.test.ts) can assert unique SHA-256 values and a complete instrument list.

They are not the production legal corpus. Digests in manifest.json must never be presented as official source fingerprints.

Contents ​

FileBootstrap editionAuthority
syscohada-audcif-2017.pdfsyscohada-audcif-2017__edition_bootstrapOHADA
ohada-aus-2010.pdfohada-aus-2010__edition_bootstrapOHADA
cosumaf-rg-2014.pdfcosumaf-rg-2014__edition_bootstrapCOSUMAF
cosumaf-inst-ape-2019.pdfcosumaf-inst-ape-2019__edition_bootstrapCOSUMAF
beac-reg-changes-2018.pdfbeac-reg-changes-2018__edition_bootstrapBEAC
cobac-r-2016-01.pdfcobac-r-2016-01__edition_bootstrapCOBAC
manifest.json—Maps instrument → edition → fixture → SHA-256

Regenerate deterministically:

bash
python3 scripts/generate-regulatory-fixtures.py

How the PDFs are used (pipeline) ​

text
generate-regulatory-fixtures.py
        │
        ▼
data/regulatory/fixtures/*.pdf  +  manifest.json
        │
        │  attach-vault-fixtures.sh  (or locus-ops "Upload PDF")
        ▼
SoR LegalSourceArtifacts  (storageKey = local:<abs path> or R2 key)
        │
        ├── LegalVaultDocumentExtractor (pages, preview, candidate articles)
        ├── LegalReviewItem → human APPROVE
        └── LegalVaultPublisher → edition legal_reviewed / in_force
                │
                ▼
Tenant analyzeDealWithVault → resolve edition/provision/artifact
        → open-statute BFF streams PDF (hash-verified)
        → DossierRegulatoryFindings stores vault IDs

Staging / production: attach official PDFs in locus-ops Legal Vault (Upload PDF per edition), then approve in the Review Queue. Do not rely on fixture digests in production.

Local attach (dev):

bash
export LOCUS_SESSION_TOKEN=…   # PLATFORM_OPERATOR session
export LOCUS_ORG_ID=…          # that session's org id
# optional: DRY_RUN=1
./scripts/attach-vault-fixtures.sh

The SoR must be able to read local: paths (same machine as the API). For R2-backed deploys, use the ops UI upload instead.


2. locus-web/data/regulatory/ (engine corpus, not vault) ​

PathRole
parsed/JSON article chunks for retrieval / curation stats
regulations/, manifests/, checklists/Supporting regulatory engine assets
cosumaf_legal_kb.sqliteLocal COSUMAF knowledge base used by some auditor paths
sample_drafts/, approved_precedents/Sample texts for tooling — not tenant data

catalog.ts still holds stable instrument IDs and evaluation predicates; article bodies gradually move to SoR provisions after ops legal review. Bank UI analyzeDeal can run without vault PDFs; analyzeDealWithVault overlays vault IDs when the session can resolve them.


3. What is not in data/regulatory ​

  • Tenant deal-room uploads (R2 + Documents table)
  • Market bulletins (market ingest → MarketBulletins / observations)
  • Live Watchtower downloads (stored under LEGAL_VAULT_STORAGE_PATH or R2 as LegalSourceArtifacts)

Source of trust for Locus. If this conflicts with code, code + IMPLEMENTATION_TRACKER.md win.