Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Engineering reference: For service contracts, EventBus events, and data-layer details see src/features/auditor/auditor.md.
Auditor
Overview
Theauditor feature provides a read-only compliance review dashboard for external auditors and internal compliance reviewers. It surfaces compliance posture across five dimensions (journals, expenses, policy coverage, audit trail health, grantor compliance), supports time-boxed access grants, and allows CSV export of audit data.
The Auditor role (SystemRole.AUDITOR) is distinct from Admin — auditors cannot approve or reject items; they can only view and export. Access is controlled via AuditorAccessGrant documents that carry an explicit expiry date.
Entry point: /auditor → AuditorDashboard, AuditorReviewPanelPage
Data Model
Firestore Collections
The auditor feature does not own its own collections. It reads from compliance and audit infrastructure.| Collection (owned by) | Read purpose |
|---|---|
auditLogs (shared) | Audit trail events for the selected period |
complianceAlerts (compliance) | Active/acknowledged compliance alerts |
complianceSummaries (compliance) | Per-period compliance summary aggregates |
configurationSnapshots (compliance) | Point-in-time configuration captures |
auditorGrants (compliance) | Time-boxed auditor access grant documents |
ruleCoverageMatrix (PolicyContext) | Policy rule application coverage |
Key TypeScript Types
Key Behaviors
Period-Based Dashboard
useAuditDashboard drives the entire dashboard. It accepts a period (yyyy-MM) and fetches:
ComplianceMonitoringService.getComplianceSummary(orgId, period)— overall compliance score and domain breakdownComplianceMonitoringService.getActiveAlerts(orgId, { status: ['active', 'acknowledged'] })— top 5 alertslistConfigurationSnapshots(orgId, 5)— recent configuration snapshots for forensic review- Audit logs filtered to the period (
fetchAuditLogs)
Five Compliance Dimensions
Dimension statuses are derived from the compliance summary using pure helper functions inauditDashboardStatus.ts:
getJournalsDimensionStatus— based on journal submission rates and compliance scoresgetExpensesDimensionStatus— based on flagged/rejected expense ratiosgetCoverageDimensionStatus— based on policy rule coverage matrix completenessgetAuditTrailHealthStatus— ratio of failure events to total eventsgetGrantorComplianceStatus— based on grantor-specific compliance requirements in the coverage matrix
Time-Boxed Auditor Access
ForAUDITOR role users, the dashboard loads the active AuditorAccessGrant document via getActiveAuditorGrants(). The grant is displayed in the panel header so the auditor knows their scope and expiry. SuperAdmins bypass this check.
Data Export
createExport() triggers an asynchronous export job (createAuditExportJob) that produces a CSV including audit logs, journals, expenses, and projects (but not raw user PII) for the selected period. The AUDIT_EXPORT_JOBS_ENABLED feature flag (from features/compliance/public) gates this capability.
Review Panel
AuditorReviewPanelPage contains the full review interface with filter controls, report display, permission guards, and quick action buttons. It uses AuditorReviewPanelContext for local state.
Service Contract
The auditor feature has no service files of its own — all data access is via hooks that delegate to compliance services.| Hook | Owns | Key returns |
|---|---|---|
useAuditDashboard | Full dashboard state and data loading | complianceSummary, dimensions, topAlerts, auditLogs, snapshots, auditorGrant, auditTrailStats, createExport, refresh |
Events
Emitted
None. The auditor feature is read-only and does not emit any EventBus events.Consumed
None. The auditor feature does not subscribe to EventBus events.Dependencies
Depends on:features/compliance—ComplianceMonitoringService,auditorAccessService,AuditExportJobcontexts/PolicyContext—coverageMatrix(rule coverage data)contexts/RBACContext—hasRole,hasAuditorAccess,isAuditorhooks/useAuditLog— audit log fetching and CSV export