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 certified02_DOMAIN/constitutional layer. Promotion to constitutional
status requires Primary Steward authorization per CLAUDE.md doctrine-promotion rules.
L1 — Module Philosophy & Constitutional Boundaries
Document record
| Field | Value |
|---|---|
| Constitutional Series | L — Module Architecture |
| Primary Source | 08_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 Program | CAP-MODULE-DISCOVERY-PLAN (ERA_047) |
| Status | PLANNING ARTIFACT — NOT RATIFIED DOCTRINE |
| Applies To | All five pillars (GOV, RES, MIS, SUP, DEV) |
| Position in Book | Part 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
| Question | Answer → 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.
| Subdirectory | Always 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.
| # | Invariant | What it means for the UI |
|---|---|---|
| UI-INV-1 | No physical deletion, anywhere | Never 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-2 | Entity isolation enforced by the DB (RLS), never by you | Do 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-3 | Bitemporal domains need an "as-of date" selector on every history view | History/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-4 | Registry/enumeration values come from the DB, not hardcoded dropdowns | Every 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-5 | Read via API, write via the domain's sanctioned operation | Many 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-6 | Lifecycle state machines are real — gray out illegal transitions | Offer 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-7 | Three-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-8 | Attribution is mandatory | Every 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-9 | Show constitutional vocabulary, know the DB alias | UI 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-10 | No 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
| Module | Name | Primary Domain(s) | Pillar | Complexity | Priority |
|---|---|---|---|---|---|
| MDL-001 | Identity & Party Registry | REF001 | RES/all | HIGH | P1 |
| MDL-002 | Relationship & Org Graph | REF002 | RES/GOV | HIGH | P1 |
| MDL-003 | Place & Territory | REF003 | SUP/MIS | MEDIUM | P1 |
| MDL-004 | Org Structure Navigator | Org+REF002/008 | GOV/DEV | MED-HIGH | P1 |
| MDL-005 | Authority & Delegation | REF008 | GOV | HIGH | P2 |
| MDL-006 | Policy & Governance Instruments | REF006.X1/006 | GOV | HIGH | P2 |
| MDL-007 | Document & Records | REF006 | GOV/SUP | MEDIUM | P2 |
| MDL-008 | Resource & Asset Stewardship | REF005 | RES/SUP | HIGH | P2 |
| MDL-009 | Financial Stewardship | REF005.S1/007.X1 | RES | HIGH | P2 |
| MDL-010 | Obligation & Commitment | REF007 | GOV/RES | MEDIUM | P2 |
| MDL-011 | Event Management | REF004 | MIS/SUP | MEDIUM | P2 |
| MDL-012 | Schedule & Recurrence | REF011 | MIS/GOV/SUP | HIGH | P3 |
| MDL-013 | Interaction & Engagement | REF009 | MIS/all | HIGH | P2 |
| MDL-014 | Case & Service Journey | REF010 | MIS | VERY HIGH | P3 |
| MDL-015 | Knowledge Management | REF013 | MIS | MEDIUM | P3 |
| MDL-016 | Initiative & Program Coordination | REF014 | MIS/DEV | HIGH | P3 |
| MDL-017 | Project Workspace | CON-PROJECT | MIS/SUP | VERY HIGH | P3 |
| MDL-018 | Campaign Management | CON-CAMPAIGN | RES/MIS/DEV | HIGH | P4 |
| MDL-019 | Beneficiary & Transformation | REF001/010/009/014 | MIS | VERY HIGH | P4 |
| MDL-020 | Measurement & Impact | DRV-MEASUREMENT | DEV/MIS/GOV | HIGH | P4 |
| MDL-021 | Audit, Compliance & Risk | OVL-AUDIT/COMP/RISK | GOV | HIGH | P4 |
| MDL-022 | Federation & Multi-Entity | CIV-FEDERATION/SUCCESSION | GOV/DEV | VERY HIGH | P4 (partly gated) |
New GOV Modules
| Module | Name | Domain(s) | Priority |
|---|---|---|---|
| MDL-GOV-A | Board & Committee Management | REF004+REF009+REF006 | P2 |
| MDL-GOV-B | Director & Trustee Registry | REF001+REF002+REF006 | P2 |
| MDL-GOV-C | Statutory & Regulatory Compliance (FCRA/IT/ROC/CSR) | OVL-COMPLIANCE+REF006+REF007 | P2 |
| MDL-GOV-D | Board Resolution Register | REF006+REF008 | P2 |
| MDL-GOV-E | Legal Entity Management | REF001+REF006 | P3 |
| MDL-GOV-F | Signatory & Authorization Matrix | REF008+REF002 | P2 |
| MDL-GOV-G | External Auditor Engagement | REF001+REF006+REF007 | P3 |
| MDL-GOV-H | Internal Audit Management | OVL-AUDIT+REF006+REF007 | P3 |
New RES Modules
| Module | Name | Domain(s) | Priority |
|---|---|---|---|
| MDL-RES-001 | HR & People Operations | REF001+002+007+006 | P2 |
| MDL-RES-002 | Volunteer Management | REF001+002+009+005.S3 | P2 |
| MDL-RES-003 | Payroll & Statutory Deductions | REF005.S1+007.X1+006 | P2 |
| MDL-RES-004 | Procurement & Vendor Management | REF001+007+007.X1+005+006 | P3 |
| MDL-RES-005 | Bank & Payment Operations | REF005.S1+007.X1+006 | P2 |
| MDL-RES-006 | Budget Planning & Control | REF005.S1+007+006 | P3 |
| MDL-RES-007 | Grant & Restricted Fund Management | REF007+005.S1+006+007.X1 | P3 |
| MDL-RES-008 | 80G Donor Tax Benefit Management | REF006+007.X1+001 | P2 |
| MDL-RES-009 | Donor CRM | REF001+002+009+007 | P3 |
Note: MDL-RES-010 and MDL-RES-011 — see Chapter L2 (RES Pillar).
New MIS Modules
| Module | Name | Domain(s) | Priority |
|---|---|---|---|
| MDL-MIS-A | Child Development | REF001+010+009+005 | P3 |
| MDL-MIS-B | Women's Empowerment / Shakti Jagarana | REF001+002+014+009+005.S1 | P3 |
| MDL-MIS-C | Vedic Education (NIKHIL/VedicSkills) | REF013+004+011+006+010 | P3 |
| MDL-MIS-D | Cultural & Devotional Programs | REF004+011+009+005.S2 | P3 |
| MDL-MIS-E | Go-Seva (Cow Care) | REF005.S2+004+011+009 | P3 |
| MDL-MIS-F | Community Survey | REF001+003+009+013 | P3 |
| MDL-MIS-G | Field Officer Reporting | REF009+004+001 | P2 |
| MDL-MIS-H | Research & Publications | REF013+014+006 | P4 |
Note: MDL-MIS-P and MDL-MIS-Q — see Chapter L3 (MIS Pillar).
New SUP Modules
| Module | Name | Domain(s) | Priority |
|---|---|---|---|
| MDL-023 | Inventory & Stores Management | REF005.S2 | P2 |
| MDL-024 | Facilities & Infrastructure | REF005.S2+REF003+REF007+REF011 | P3 |
| MDL-025 | Vehicle & Fleet Management | REF005.S2+REF001/002+REF011+REF009 | P3 |
| MDL-026 | IT Assets & Digital Systems | REF005.S2+REF007+REF011 | P3 |
| MDL-027 | Office Administration | REF005.S2+REF003+REF007 | P3 |
New DEV Modules
| Module | Name | Domain(s) | Priority |
|---|---|---|---|
| MDL-028 | Strategic Planning & Balanced Scorecard | REF006+REF014+DRV-MEASUREMENT | P3 |
| MDL-029 | Partnerships & MOU Management | REF001+REF006+REF002+REF014 | P3 |
| MDL-030 | Innovation & Incubation | REF013+REF014 | P4 |
| MDL-031 | Institutional Expansion | REF007+REF006+CIV-FEDERATION | P4 |
Pillar Totals
| Pillar | Base modules | New modules | Total |
|---|---|---|---|
| GOV | 5 (004,005,006,007,021) | 8 (GOV-A..H) | 13 |
| RES | 5 (001,002,008,009,010) | 9 (RES-001..009) | 14 |
| MIS | 9 (011–019) | 8 (MIS-A..H) | 17 |
| SUP | 1 (003 shared) | 5 (023–027) | 6 |
| DEV | 2 (020,022) | 4 (028–031) | 6 |
| Total | 22 | 31 | ~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.
