Last Updated: 2026-03-07
Status: 📝 Planned
Spec Reference: GR-16-accreditation-tracer-readiness.md
Constitution Reference: Section 1.3 (Integration Patterns)
Overview
GR-16 integrates intra-core (GR) and with Platform Foundation (PF) layers. It does not integrate directly with any other non-PF core. All cross-core data is accessed via PF platform layers.Integration Summary
Platform Layer Usage
PF-11 (Documents) — Tracer Pack Export
Layer:@/platform/documentsPurpose: Creates a document bundle for tracer pack export.
API:
organization_id.
PF-27 (Platform AI) — Surveyor Question Simulator
Layer:@/platform/aiPurpose: Generates 3–5 likely surveyor questions for a given accreditation standard.
API:
PF-12 (Reporting) — Readiness Score Report
Layer:@/platform/reportsPurpose: Generates board-level readiness score report with trend data.
API:
PF-10 (Notifications) — CAP Deadline Alerts
Layer:@/platform/notificationsPurpose: Sends deadline notifications to
responsible_party_id and org admins.Trigger: Edge function
gr-cap-deadline-alerts (daily cron).
Notification payload (CAP due):
Edge Function Contract
gr-cap-deadline-alerts
Function: /supabase/functions/gr-cap-deadline-alerts/index.tsSchedule: Daily at 08:00 UTC (
0 8 * * *)Invocation: Cron (server-to-server);
verify_jwt: falseAuth: Service role key; no JWT verification (cron invocation only) Processing logic:
- Load
gr_module_settings.cap_alert_lead_daysper org - Query
gr_accreditation_caps WHERE status <> 'verified_closed' AND target_closure_date <= now() + (cap_alert_lead_days || ' days')::INTERVAL - For each CAP: send
gr.cap.deadline_approachingnotification via PF-10 - For overdue CAPs (target_closure_date < today): send
gr.cap.overduenotification - Log results; retry failed notifications up to 3 times
getCorsHeaders(req.headers.get('origin')) from _shared/cors.tsLogger:
createLogger('gr-cap-deadline-alerts') from _shared/logger.ts
Intra-Core Data Dependencies (GR-08 Tables)
GR-16 reads from GR-08 tables via direct DB queries (same core, not cross-core):
RLS: All reads use existing GR-08 RLS policies; no policy changes to GR-08 tables required.
Contract Validation Checklist
- Integration doc exists at canonical path
- All integration points from spec covered
- PF-11 document bundle creation API documented with tenant isolation note
- PF-27 AI prompt interface documented with PHI guardrail
- PF-10 notification payloads defined
- Edge function documented with
verify_jwt, CORS, logger - Integration matrix updated in
CROSS_CORE_INTEGRATIONS.md - Event types added to
KnownEventNameinsrc/platform/events/types.ts(if events published — N/A; GR-16 does not publish events)
Cross-Core Integration Matrix Entry
Add todocs/architecture/integrations/CROSS_CORE_INTEGRATIONS.md: