Feature ID: GR-15Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Version: 1.0
Status: π Planned
Created: 2026-03-07
Owner: GR (Governance & Compliance)
Based On:
specs/gr/specs/GR-15-nonprofit-governance-controls.md
Cross-Reference: See docs/architecture/integrations/CROSS_CORE_INTEGRATIONS.md for matrix entry.
Summary
GR-15 integrates the Governance Controls module with HR-01 (employee roster for COI participants), FA (related-party transaction cross-reference), PF-10 (notifications for reminders and alerts), PF-46 (document retention and legal holds), GR-01 (linked governance policies), and GR-03 (compliance tracking of annual COI completion). GR-15 uses multiple integration patterns: Platform Integration Layer for PF-10 and PF-46, shared-table lookups forpf_profiles (HR-01 employee data), explicit manual UUID cross-reference for FA related-party transactions, and intra-core references for GR-01 (policies) and GR-03 (compliance tracking). No direct core-to-core imports.
Integration Points
1. HR-01 (Employee Directory) β GR-15 COI Attestation
Pattern: Data lookup via shared PF tableDirection: GR-15 reads from HR-01 via
pf_profiles (shared PF table)Purpose: Seed COI attestation participant roster from active employees with designated roles (board_member, executive, staff) Integration Method:
pf_profiles.idβ Profile UUID for FK ingr_coi_attestations.profile_idpf_profiles.full_nameβ Display name in COI dashboardpf_profiles.emailβ Notification delivery via PF-10
organization_id. No cross-org data access.
RLS Impact: gr_coi_attestations.profile_id references pf_profiles(id) β PF table; no direct HR table FK.
2. FA (Finance & Accounting) β GR-15 COI Attestation
Pattern: UUID cross-reference (no FK)Direction: GR-15 COI disclosures cross-reference FA vendor/payee data for related-party transaction identification
Purpose: Compliance officers can identify when a disclosed COI party (vendor, contractor) matches a known FA payee for Form 990 Schedule L disclosure amounts Integration Method:
- GR-15 stores the disclosed interest description in
gr_coi_attestations.conflict_description(text field) - Compliance officer cross-references manually with FA vendor records during Form 990 preparation
- No automated FA query from GR-15 in Phase 1 (manual cross-reference; automated matching is a deferred enhancement)
- When automated matching is needed in future: use Platform Integration Layer or read-only API contract
- FA vendor name / payee name (manual matching against
conflict_descriptiontext) - FA transaction amounts (for Schedule L βAmount Involvedβ column)
3. PF-10 (Notifications) β GR-15
Pattern: Platform Integration LayerDirection: GR-15 triggers PF-10 notifications
Import:
@/platform/notifications / edge function notification utilities
Events Triggering Notifications:
| Event | Recipient | Channel | Template |
|---|---|---|---|
| COI attestation cycle launched | All invited participants | In-app + email | gr_coi_invitation |
| COI reminder (D-30, D-14, D-7, D-1) | Pending attestors | In-app + email | gr_coi_reminder |
| Whistleblower report received | Assigned compliance officer | In-app + email | gr_whistleblower_new |
| Whistleblower status changed | Assigned compliance officer | In-app | gr_whistleblower_status |
| Board minutes approved | Minutes creator (board secretary) | In-app | gr_board_minutes_approved |
| Governance document approaching retention end | Compliance officer | In-app + email | gr_document_retention_warning |
4. PF-46 (Data Retention) β GR-15
Pattern: Platform Integration LayerDirection: GR-15 registers governance document types with PF-46 retention engine
Import:
@/platform/data-retention
Retention Entity Types Registered:
| Entity Type | Min Retention | Notes |
|---|---|---|
gr_coi_attestation | 7 years | IRS 990 record-keeping; IRC Β§ 6033 |
gr_whistleblower_report | 7 years | SOX Β§802 record retention |
gr_board_minutes | Permanent | Best practice; state nonprofit law |
gr_board_resolution | Permanent | Best practice; state nonprofit law |
RETENTION_ENTITY_TYPESin PF-46 must include the above types (PF-46 team to extend if needed)- GR-15 Phase 4 creates
pf_retention_policiesrows for each entity type via admin UI + migration seed - Legal holds: GR-15 reads
pf_legal_holdsto check for active holds before flagging document for destruction - Pre-destruction notification: PF-46 cron triggers PF-10 notification; GR-15 configures warning threshold via
gr_module_settings.retention_warning_days
5. GR-01 (Policy Management) β GR-15
Pattern: Internal GR cross-reference (data lookup via shared GR module)Direction: GR-15 links COI Policy, Whistleblower Policy, Document Retention Policy to
gr_policies recordsPurpose: Compliance controls linked to governing organizational policies Integration:
- COI attestation cycle references the organizationβs COI Policy (
gr_policies.category = 'conflict_of_interest') - Whistleblower intake form references Whistleblower Policy (
gr_policies.category = 'whistleblower') - Document retention configuration references Document Retention Policy (
gr_policies.category = 'document_retention') - Links stored as optional
policy_id UUID REFERENCES gr_policies(id)ongr_module_settingsor as JSONB metadata
6. GR-03 (Compliance Tracking) β GR-15
Pattern: Internal GR event / data referenceDirection: GR-15 COI completion drives GR-03 compliance requirement status
Purpose: Annual COI attestation completion is a tracked compliance requirement in GR-03 Integration:
- GR-03 tracks βAnnual COI Attestationsβ as a compliance requirement with a due date
- GR-15 COI attestation completion percentage can be surfaced in GR-03 compliance dashboard
- Integration is read-only from GR-03 perspective; GR-15 provides completion data via shared module query
- No direct FK; compliance officer views GR-15 dashboard from GR-03 via navigation link
Event Contracts
gr_coi_cycle_launched (Planned)
Publisher: GR-15 (compliance officer action)Subscribers: PF-10 (notifications), GR-03 (compliance tracking update)
Channel: pg_notify / Supabase realtime
Status: π Planned (Phase 1)
gr_whistleblower_report_submitted (Planned)
Publisher: GR-15 (anonymous or authenticated submission)Subscribers: PF-10 (notify compliance officer)
Channel: pg_notify / edge function trigger
Status: π Planned (Phase 2)
API Contracts
Public Edge Function: gr-whistleblower-submit
Endpoint: POST /functions/v1/gr-whistleblower-submitAuth:
verify_jwt: false β Public endpoint (no authentication required for anonymous submission)Purpose: Accept anonymous whistleblower reports without requiring user authentication Request:
- Uses
service_rolekey server-side to bypass RLS created_by = NULLenforced whenisAnonymous = truereporter_profile_id = NULLenforced whenisAnonymous = true- Input validation: description length 10β10000 chars; category enum validation
- Rate limiting: max 5 reports per IP per hour (via PF-42 rate limiting)
- CORS:
getCorsHeaders(req.headers.get('origin'))from_shared/cors.ts
Internal Edge Function: gr-coi-attestation-reminders
Endpoint: Cron-triggered (no HTTP endpoint)Auth: Service role
Schedule: Daily at 08:00 UTC (configured via pg_cron or Supabase dashboard)
Purpose: Send escalating COI attestation reminders to pending attestors Cron Logic:
- Find all active COI cycles (
status != 'closed',due_date > now()) - For each cycle, find
pendingattestations - Calculate days until due date
- Send reminder if today is D-30, D-14, D-7, or D-1
- Use
createNotificationIfNew()to prevent duplicates
Platform Layer Usage
| Platform Layer | Usage | Import |
|---|---|---|
@/platform/notifications | Sending COI reminders + whistleblower alerts | import { sendNotification } from '@/platform/notifications' |
@/platform/data-retention | Checking legal holds; registration of entity types | import { useLegalHolds } from '@/platform/data-retention' |
@/platform/documents | Board minutes document attachment | import { useDocuments } from '@/platform/documents' |
@/platform/forms | COI attestation form + Tiptap rich text | import { RichTextField } from '@/platform/forms' |
@/platform/table-v2 | All list/table views | import { DataTable } from '@/platform/table-v2' |
Integration Matrix Entry
This entry should be added to docs/architecture/integrations/CROSS_CORE_INTEGRATIONS.md.
| From Core | To Core | Integration Pattern | Status | Documentation |
|---|---|---|---|---|
| GR-15 | PF-10 | Platform Layer (notifications) | π Planned | This doc |
| GR-15 | PF-46 | Platform Layer (data retention) | π Planned | This doc |
| GR-15 | HR-01 | Data lookup via pf_profiles (PF shared table) | π Planned | This doc |
| GR-15 | FA | UUID cross-reference (manual workflow) | π Planned | This doc |
| GR-15 | GR-01 | Internal GR (policy link) | π Planned | This doc |
| GR-15 | GR-03 | Internal GR (compliance completion) | π Planned | This doc |
Validation Checklist
Based ondocs/architecture/integrations/CONTRACT_VALIDATION_CHECKLIST.md:
- Integration doc created at canonical path
- All Integration Points from spec covered
- API contracts documented (gr-whistleblower-submit, gr-coi-attestation-reminders)
- Event contract stubs defined (gr_coi_cycle_launched, gr_whistleblower_report_submitted)
- Platform layer usage documented
- Tenant isolation documented for all integrations
- Auth/security documented for public edge function
- CORS pattern documented (uses
getCorsHeaders) - HR exclusion from whistleblower explicitly documented
- Integration matrix entry added to CROSS_CORE_INTEGRATIONS.md
- Event contracts added to EVENT_CONTRACTS.md (β Added in PR #1002 remediation)
- KnownEventName updated in
src/platform/events/types.ts(β Added in PR #1002 remediation)
References
- Spec:
specs/gr/specs/GR-15-nonprofit-governance-controls.md - Plan:
specs/gr/plans/GR-15-nonprofit-governance-controls-PLAN.md - PF-10:
@/platform/notifications - PF-46:
docs/architecture/integrations/PF-46-data-retention-lifecycle-INTEGRATION.md - Contract Template:
specs/_templates/INTEGRATION_CONTRACT_TEMPLATE.md - Cross-Core Matrix:
docs/architecture/integrations/CROSS_CORE_INTEGRATIONS.md - Event Contracts:
docs/architecture/integrations/EVENT_CONTRACTS.md