Skip to content

VGSF CONSTITUTIONAL TECHNICAL ARCHITECTURE — BOOK II — PART D: MODULE ARCHITECTURE
Chapter 1 of 6 in this Part

⚠ PLANNING ARTIFACT STATUS: The module architecture documented in this chapter constitutes
planning-layer artifacts (CAP-MODULE-DISCOVERY-PLAN, ERA_047) — not ratified constitutional doctrine.
Module content sits above the certified 02_DOMAIN/ constitutional layer. Promotion to constitutional
status requires Primary Steward authorization per CLAUDE.md doctrine-promotion rules.

L1 — Module Philosophy & Constitutional Boundaries

Document record
FieldValue
Constitutional SeriesL — Module Architecture
Primary Source08_MODULES/_SHARED/MODULE_CUSTOMIZATION_FRAMEWORK.md, 08_MODULES/_SHARED/UI_INVARIANTS.md, 08_MODULES/_SHARED/DOMAIN_MODULE_CROSSREF.md, 08_MODULES/_REGISTRY/MODULE_REGISTRY.md
Planning ProgramCAP-MODULE-DISCOVERY-PLAN (ERA_047)
StatusPLANNING ARTIFACT — NOT RATIFIED DOCTRINE
Applies ToAll five pillars (GOV, RES, MIS, SUP, DEV)
Position in BookPart D, Chapter 1 of 6

Part D opens with this chapter because before any pillar can be described, the constitutional laws that govern all modules must be established. The three-layer module architecture, the ten UI invariants, and the domain-module boundary are the constitutional substrate that every subsequent chapter presupposes.



§1 — The Three-Layer Module Architecture

Every module in 08_MODULES/ has three vertically-stacked layers that coexist within the same directory. They serve different purposes and live in different places.

┌─────────────────────────────────────────────────────────────────┐
│  LAYER 3 — VGSF CUSTOM LAYER                                    │
│  VGSF-specific design documents, deep customizations,           │
│  India-regulatory requirements, Sanskrit vocabulary,            │
│  custom forms/workflows that go beyond the generic spec.        │
│                                                                  │
│  Lives in: module root (if a full design doc), or custom/       │
├─────────────────────────────────────────────────────────────────┤
│  LAYER 2 — GENERIC MODULE SHELL (the scaffold)                  │
│  README.md charter; forms/ reports/ workflows/ workspaces/      │
│  diagrams/ policies/ custom/ subdirectories.                    │
│  The container — provides structure, naming, and linking.       │
│                                                                  │
│  Lives in: module root + all scaffold subdirectories            │
├─────────────────────────────────────────────────────────────────┤
│  LAYER 1 — CONSTITUTIONAL DOMAIN (lives in 02_DOMAIN/, not here)│
│  Certified, frozen, immutable REF-XXX DDL and services.         │
│  The atomic substrate that the module builds on top of.         │
│                                                                  │
│  Lives in: 02_DOMAIN/REF-XXX/03_engineering/ddl/ + services/   │
└─────────────────────────────────────────────────────────────────┘

The dynamic is vertical. Layer 2 provides the container — the slots where things go. Layer 3 provides the content — what actually goes into those slots for VGSF's context. Layer 1 is the authoritative constitutional substrate that neither Layer 2 nor Layer 3 may modify.

The scaffold's subdirectory files do not compete with a custom design document — they are dependent on it. The custom spec tells you what to put into the generic slots. The scaffold's README.md provides the directory index; the custom layer fills in the VGSF-specific forms, workflows, business rules, and vocabulary. The design document at the module root (for Level C and D modules) is the master specification; all scaffold files implement it. custom/ is always secondary to the root-level design doc when one exists.


§2 — The Four Customization Levels

Not every module has the same depth of VGSF customization. The framework accommodates a spectrum from near-standard to entirely VGSF-specific.

Level A — Light Customization (near-standard)

Example modules: MDL-003 Place & Territory, MDL-027 Office Administration

The module concept is universal. VGSF adds minor overrides (Indian geography levels, West Bengal PT slabs, registered office seed data). No root-level design doc is needed. custom/VGSF_REQUIREMENTS.md holds everything — typically 1–2 pages covering India geography levels and seed data notes.

Level B — Moderate Customization

Example modules: MDL-001 Identity & Party, MDL-RES-008 80G Donor Tax, MDL-RES-003 Payroll & Statutory Deductions

The module concept is standard but VGSF adds significant compliance rules (Aadhaar masking, 80G cash cap, PF/ESI/TDS statutory requirements), privacy constraints, or vocabulary overrides. custom/VGSF_REQUIREMENTS.md is the primary custom document — typically 3–6 pages covering privacy rules, Aadhaar/PAN handling, Sanskrit party display names, and real party seeds. No separate root-level design doc is needed.

Level C — Deep Customization (module-owned sub-system)

Example modules: MDL-002 Relationship & Org Graph, MDL-MIS-B Women's Empowerment / Shakti Jagarana

The module is standard in structure but VGSF requires an entirely new sub-system on top of the certified domain. A named design document lives at the module root as a first-class artifact. The design doc IS the spec; all subdirectory files implement it. The custom/ subdirectory is secondary — a short pointer plus a Steward decision register.

Level D — Entirely VGSF-Specific (no generic equivalent)

Example modules: MDL-MIS-E Go-Seva (cow care), MDL-MIS-D Saṅkīrtana-maṇḍalī (devotional)

No generic NGO does this. The module is 100% VGSF-invented on top of a certified domain (e.g. REF005.S2 for cows, REF004 for kirtan events). The root-level design doc IS the entire functional specification. There is no pre-existing NGO template to adapt.

Choosing the Right Level

QuestionAnswer → Level
Could any NGO use this module without VGSF-specific config?Yes → A or B
Does VGSF need a wholly new sub-system (kinship engine, cow registry, kirtan scheduler)?Yes → C or D
Are there ≥3 pending Steward decisions / registry inserts before build can start?Yes → C or D
Is the module described in the pillar research file in ≤1 page?Yes → A or B
Does the module require custom DB functions (recursive CTE, closure cache, conservation check)?Yes → C or D

§3 — The Scaffold Subdirectory Structure

Regardless of customization level, the scaffold subdirectories always serve the same purpose. Every module — from Level A to Level D — uses this structure as its container layer.

SubdirectoryAlways contains
forms/One .md file per form. Naming: FRM-{PILLAR}-{SEQ:03d}_{NAME}.md
reports/One .md file per report. Naming: RPT-{PILLAR}-{SEQ:03d}_{NAME}.md
workflows/One .md file per workflow. Naming: WFL-{PILLAR}-{SEQ:03d}_{NAME}.md
workspaces/Screen layouts, navigation, dashboards. Naming: WS-{PILLAR}-{SEQ:03d}_{NAME}.md
diagrams/ERD, state machine, data flow, screen flow (Mermaid). Standard file names.
policies/BUSINESS_RULES.md, VALIDATION_RULES.md, ACCESS_CONTROL.md
custom/VGSF_REQUIREMENTS.md at minimum. Pointer to root-level design doc if one exists.

Templates for each subdirectory type live in 08_MODULES/_SHARED/TEMPLATES/.


§4 — The Ten Constitutional UI Invariants (UI-INV-1..10)

These invariants are non-negotiable. A screen that violates any one of them is constitutionally invalid regardless of how it looks. Every form, report, and workflow in the module zone is tagged with the invariants it must honor.

#InvariantWhat it means for the UI
UI-INV-1No physical deletion, anywhereNever render "Delete" for a constitutional record. Use Archive / Withdraw / Cancel / Discard / Deprecate / Close / Expire / Supersede per the domain's lifecycle. Only true drafts may be discarded (a soft state, not a row delete).
UI-INV-2Entity isolation enforced by the DB (RLS), never by youDo NOT add entity_id filters in frontend queries (PROHIB-001). Server sets SET LOCAL <schema>.current_entity_id from the JWT. Send the JWT; render what comes back. Empty result = "not in your scope," never an error; never enumerate out-of-scope records.
UI-INV-3Bitemporal domains need an "as-of date" selector on every history viewHistory/timeline screens offer "View as of [date]" and distinguish valid-time (true in the world) from system-time (when recorded). Applies to REF001/002/003/004/005/006 and all ledger domains.
UI-INV-4Registry/enumeration values come from the DB, not hardcoded dropdownsEvery type/kind/status dropdown is the authoritative registry enum — fetch from the registry endpoint; immutable except is_active. Never invent options; never free-text where a registry exists.
UI-INV-5Read via API, write via the domain's sanctioned operationMany domains forbid direct table writes. Writes go through domain functions/endpoints (fn_issue_version, POST /donations/record, …). Never compose raw SQL or PATCH a frozen field. Identity/scope/attribution fields are immutable after creation.
UI-INV-6Lifecycle state machines are real — gray out illegal transitionsOffer only transitions the machine allows from the current state; hide actions on terminal states (ARCHIVED/CLOSED/CANCELLED/REVOKED/…). Server is final authority but the UI must not offer illegal moves.
UI-INV-7Three-level privacy where it exists (REF009/REF010)Interaction & Case data carry STANDARD / CONFIDENTIAL / RESTRICTED. Privacy escalates only, never downgrades. Confidential = participants only; restricted = explicit grant-holders only. Build privacy badges + access-grant management; never cache/display withheld content.
UI-INV-8Attribution is mandatoryEvery create/transition records who (a REF001 party) and when. Forms capture the acting party; audit/timeline views show actor + timestamp + reason on every state change.
UI-INV-9Show constitutional vocabulary, know the DB aliasUI label ≠ DB table by design: Pillar = department_groups, Program = programs = constitution's "Initiative", etc. Use human vocabulary in the UI; map to DB names in the API layer. MIS-division Sanskrit names (e.g. Bāla-vikāsa) are FOUNDATIONAL/immutable — display verbatim.
UI-INV-10No AI/automation makes a governance decision without human confirmation (PROHIB-006)Any AI-assisted suggestion (matching, classification, recommendation) is presented for explicit human approval before it becomes a governance act (approval, authorization, certification, disbursement).

Cross-Cutting UI Primitives

The following UI primitives operationalize the ten invariants. Every pillar's module set must implement all applicable primitives:

  • As-Of Date Selector (INV-3) · Privacy Badge (INV-7) · Lifecycle State Badge with greyed illegal transitions (INV-6)
  • Archive/Withdraw/Cancel controls — never Delete (INV-1) · Registry Dropdown Loader (INV-4)
  • Attribution Line actor+timestamp (INV-8) · AI-Suggestion Confirmation Panel (INV-10)
  • Vocabulary Label + DB-alias mapping (INV-9) · Entity Scope Indicator in global header (INV-2)

§5 — The Domain-Module Boundary

The following constitutional laws govern the boundary between the certified 02_DOMAIN/ layer and the 08_MODULES/ planning layer. These laws are binding on every module across all five pillars.

1. Layer 1 is immutable. Modules are consumers, not modifiers. No module may issue UPDATE or DELETE against certified domain tables. All writes to certified domains happen via sanctioned domain operations (UI-INV-5). The certified DDL in 02_DOMAIN/REF-XXX/03_engineering/ddl/ is frozen; module design documents may not propose changes to it. Changes to a certified domain require a new constitutional program under the V2.1 methodology lifecycle.

2. The Anti-Bypass Law. Budget at project level; initiatives not bypass divisions; projects not bypass initiatives. Anti-bypass is enforced at the module layer by requiring every event, expense, and service delivery to reference a REF014 initiative or CON-PROJECT container. No module may record a resource expenditure, service interaction, or governance action that floats free of the initiative hierarchy. This rule cascades: the initiative hierarchy itself may not bypass the division/pillar structure.

3. Module schema isolation. Deep-specification modules (Level C/D) own their own PostgreSQL schema (e.g. mdl_res010, mdl_rj, gif, sm). These schemas store module-specific data and reference certified domains by FK constraint — they never replicate or shadow certified domain tables. A module schema extension is not a certified domain. It requires no Phase -1 admission unless it is later proposed for promotion to a certified REF domain (which would itself require a new constitutional program).

4. PROHIB-001 and PROHIB-006. PROHIB-001: No frontend query may filter by entity_id directly (RLS enforces isolation via SET LOCAL <schema>.current_entity_id from the JWT). PROHIB-006: No AI governance decision without human confirmation. Both prohibitions apply without exception across all five pillars and all 53 modules.

5. No-Delete Doctrine. Archive / Withdraw / Cancel / Deprecate — never row delete. This applies throughout all five pillars, at every layer. The No-Delete Doctrine is not a preference; it is constitutional law established by the certified domain lifecycle definitions and enforced by the UI invariants (UI-INV-1).


§6 — The Module Registry (53 Modules)

The following registry is the flat authoritative index of all 53 modules across the five pillars. Detail lives in per-pillar chapters (L2–L6) and the Master Catalog. Canonical domain authority: 05_MEMORY/REGISTRIES/REF_DOMAIN_ROADMAP.yaml.

Base Modules (MDL-001..022) — Cross-Pillar

ModuleNamePrimary Domain(s)PillarComplexityPriority
MDL-001Identity & Party RegistryREF001RES/allHIGHP1
MDL-002Relationship & Org GraphREF002RES/GOVHIGHP1
MDL-003Place & TerritoryREF003SUP/MISMEDIUMP1
MDL-004Org Structure NavigatorOrg+REF002/008GOV/DEVMED-HIGHP1
MDL-005Authority & DelegationREF008GOVHIGHP2
MDL-006Policy & Governance InstrumentsREF006.X1/006GOVHIGHP2
MDL-007Document & RecordsREF006GOV/SUPMEDIUMP2
MDL-008Resource & Asset StewardshipREF005RES/SUPHIGHP2
MDL-009Financial StewardshipREF005.S1/007.X1RESHIGHP2
MDL-010Obligation & CommitmentREF007GOV/RESMEDIUMP2
MDL-011Event ManagementREF004MIS/SUPMEDIUMP2
MDL-012Schedule & RecurrenceREF011MIS/GOV/SUPHIGHP3
MDL-013Interaction & EngagementREF009MIS/allHIGHP2
MDL-014Case & Service JourneyREF010MISVERY HIGHP3
MDL-015Knowledge ManagementREF013MISMEDIUMP3
MDL-016Initiative & Program CoordinationREF014MIS/DEVHIGHP3
MDL-017Project WorkspaceCON-PROJECTMIS/SUPVERY HIGHP3
MDL-018Campaign ManagementCON-CAMPAIGNRES/MIS/DEVHIGHP4
MDL-019Beneficiary & TransformationREF001/010/009/014MISVERY HIGHP4
MDL-020Measurement & ImpactDRV-MEASUREMENTDEV/MIS/GOVHIGHP4
MDL-021Audit, Compliance & RiskOVL-AUDIT/COMP/RISKGOVHIGHP4
MDL-022Federation & Multi-EntityCIV-FEDERATION/SUCCESSIONGOV/DEVVERY HIGHP4 (partly gated)

New GOV Modules

ModuleNameDomain(s)Priority
MDL-GOV-ABoard & Committee ManagementREF004+REF009+REF006P2
MDL-GOV-BDirector & Trustee RegistryREF001+REF002+REF006P2
MDL-GOV-CStatutory & Regulatory Compliance (FCRA/IT/ROC/CSR)OVL-COMPLIANCE+REF006+REF007P2
MDL-GOV-DBoard Resolution RegisterREF006+REF008P2
MDL-GOV-ELegal Entity ManagementREF001+REF006P3
MDL-GOV-FSignatory & Authorization MatrixREF008+REF002P2
MDL-GOV-GExternal Auditor EngagementREF001+REF006+REF007P3
MDL-GOV-HInternal Audit ManagementOVL-AUDIT+REF006+REF007P3

New RES Modules

ModuleNameDomain(s)Priority
MDL-RES-001HR & People OperationsREF001+002+007+006P2
MDL-RES-002Volunteer ManagementREF001+002+009+005.S3P2
MDL-RES-003Payroll & Statutory DeductionsREF005.S1+007.X1+006P2
MDL-RES-004Procurement & Vendor ManagementREF001+007+007.X1+005+006P3
MDL-RES-005Bank & Payment OperationsREF005.S1+007.X1+006P2
MDL-RES-006Budget Planning & ControlREF005.S1+007+006P3
MDL-RES-007Grant & Restricted Fund ManagementREF007+005.S1+006+007.X1P3
MDL-RES-00880G Donor Tax Benefit ManagementREF006+007.X1+001P2
MDL-RES-009Donor CRMREF001+002+009+007P3

Note: MDL-RES-010 and MDL-RES-011 — see Chapter L2 (RES Pillar).

New MIS Modules

ModuleNameDomain(s)Priority
MDL-MIS-AChild DevelopmentREF001+010+009+005P3
MDL-MIS-BWomen's Empowerment / Shakti JagaranaREF001+002+014+009+005.S1P3
MDL-MIS-CVedic Education (NIKHIL/VedicSkills)REF013+004+011+006+010P3
MDL-MIS-DCultural & Devotional ProgramsREF004+011+009+005.S2P3
MDL-MIS-EGo-Seva (Cow Care)REF005.S2+004+011+009P3
MDL-MIS-FCommunity SurveyREF001+003+009+013P3
MDL-MIS-GField Officer ReportingREF009+004+001P2
MDL-MIS-HResearch & PublicationsREF013+014+006P4

Note: MDL-MIS-P and MDL-MIS-Q — see Chapter L3 (MIS Pillar).

New SUP Modules

ModuleNameDomain(s)Priority
MDL-023Inventory & Stores ManagementREF005.S2P2
MDL-024Facilities & InfrastructureREF005.S2+REF003+REF007+REF011P3
MDL-025Vehicle & Fleet ManagementREF005.S2+REF001/002+REF011+REF009P3
MDL-026IT Assets & Digital SystemsREF005.S2+REF007+REF011P3
MDL-027Office AdministrationREF005.S2+REF003+REF007P3

New DEV Modules

ModuleNameDomain(s)Priority
MDL-028Strategic Planning & Balanced ScorecardREF006+REF014+DRV-MEASUREMENTP3
MDL-029Partnerships & MOU ManagementREF001+REF006+REF002+REF014P3
MDL-030Innovation & IncubationREF013+REF014P4
MDL-031Institutional ExpansionREF007+REF006+CIV-FEDERATIONP4

Pillar Totals

PillarBase modulesNew modulesTotal
GOV5 (004,005,006,007,021)8 (GOV-A..H)13
RES5 (001,002,008,009,010)9 (RES-001..009)14
MIS9 (011–019)8 (MIS-A..H)17
SUP1 (003 shared)5 (023–027)6
DEV2 (020,022)4 (028–031)6
Total2231~53

§7 — Domain-Module Cross-Reference Summary

The domain-module crossref (08_MODULES/_SHARED/DOMAIN_MODULE_CROSSREF.md) is a bi-directional synthesis that answers two questions simultaneously: which certified domains a given module consumes, and which modules consume each certified domain. It operates at the product-planning lens on top of the constitutional substrate; the authoritative domain-to-domain interaction maps remain in their certified homes at 02_DOMAIN/REF-XXX/01_discovery/REF-XXX_CROSS_DOMAIN_INTERACTIONS.md.

Key notation. Every module's domain relationship is classified by role:

  • P (Primary) — the module directly owns or commands this domain's operations
  • S (Supporting) — the module reads or cross-references this domain
  • G (Gated) — the feature in this domain is deferred or Steward-gated

REF001 is foundational to all 53 modules. It is the universal FK target: every authenticated session is a Party; every governance actor, beneficiary, staff member, volunteer, and vendor is a REF001 Party record. "Party Never Closes" — no physical deletion, ever.

REF005.S1 is consumed by all financial modules. The conservation ledger (REF005) and its Financial specialization (REF005.S1) underpin all resource and asset stewardship across the RES pillar and beyond. Every salary disbursement, grant receipt, budget allocation, and bank payment flows through REF005.S1.

CIV-FEDERATION is gated. MDL-022 (Federation & Multi-Entity) and MDL-031 (Institutional Expansion) both depend on CIV-FEDERATION. The GPI Registry and inter-entity transfer features are DEFERRED per CAP030D. Both modules are partially gated pending Primary Steward resolution of the CIV-FEDERATION admission status.

New REF002 relationship types are Steward-gated. Several modules cannot proceed past planning without Steward rulings on new REF002 edge types:

  • PARTNERSHIP_WITH — required by MDL-029 (Partnerships & MOU Management)
  • VOLUNTEER_OF — required by MDL-RES-002 (Volunteer Management)
  • ADOPTIVE_CHILD_OF, FOSTER_CHILD_OF, GUARDIAN_OF — kinship extensions required by MDL-002 (Village Relationship Engine)

No module consuming a Steward-gated domain type may proceed past planning until the Primary Steward issues a ruling and the new type is inserted into the certified REF002 registry. The crossref makes these gates explicit so that pillar chapters (L2–L6) can state gate status clearly alongside each affected module.


Constitutional Colophon — L1
This chapter documents the module philosophy layer of the VGSF planning zone (CAP-MODULE-DISCOVERY-PLAN, ERA_047). The three-layer architecture, the ten UI invariants, the domain-module boundary, and the 53-module registry together constitute the constitutional foundation for all pillar-specific chapters that follow.
As planning artifacts, these specifications require Primary Steward ratification through Phase -1 Classification & Admission before any module may receive implementation authorization.
Readers proceeding to Chapter L2 (RES Pillar) should carry forward the key architectural principle: modules are consumers of certified domains, never modifiers. Every write to a certified domain flows through sanctioned domain operations. This principle governs every form, workflow, and design decision documented in Chapters L2–L6.


Test Dharma ERP and tell us what you find.

The trial uses sandboxed demo data across twelve core modules. Look around, try the forms, and review what works and what does not.