Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

⛔ DEPRECATED (2026-03-26): HR-31 has been consolidated into GR-01. The HR-31 tables (hr_policies, hr_policy_distributions, hr_policy_acknowledgments) have been dropped. HR-31 features (IP/UA capture, immutability trigger, document storage, acknowledgment frequency) were backported to GR-01 tables. HR policy routes redirect to /gr/policies and /gr/my-acknowledgments.
Version: 1.0.0 — DEPRECATED
Last Updated: 2026-03-26
Spec: HR-31 Employee Document & Policy Acknowledgment — Consolidated into GR-01
Constitution Reference: Section 1.2 (Core Independence), Section 1.3 (Integration Patterns)

Overview

HR-31 provides HR-owned workforce policy distribution, electronic acknowledgment, reminders, compliance reporting, and re-acknowledgment on policy updates. It is standalone from GR-01 governance policies; cross-core coordination uses events only (no shared policy tables).

Integration Points

Platform Foundation (PF)

PF CapabilityUsage
PF-01 Organizations & SitesTenant and optional site-scoped distribution
PF-02 RBAC / PF-30Permission keys (hr.policies.*, hr.distributions.*, hr.acknowledgments.*)
PF-10 NotificationsDistribution notices, reminders, overdue alerts (consume hr_policy_distribution_created or direct calls from edge)
PF-11 Documents / StoragePolicy PDF/DOCX in Supabase Storage; authenticated URLs

HR (intra-domain)

SpecPatternNotes
HR-01Data readTargeting resolves hr_employees by department, position, site, individual
HR-03Event consumeSubscribes to onboarding_completed; creates new-hire distributions idempotently via source_onboarding_instance_id
HR-12UI surface”My Policies” under self-service (/hr/self-service/policies or aligned with /hr/me hub)

GR-01 (Governance)

DirectionPatternNotes
HR-31 → GR-01EventOptional consumer of hr_policy_acknowledgment_completed for org compliance dashboards — no reuse of gr_policies

Event Contracts

Published by HR-31

hr_policy_acknowledgment_completed

Subscribers: GR-01 (optional), HR-03 (optional — onboarding step completion)
Status: 📝 Planned
Payload:
{
  event_type: 'hr_policy_acknowledgment_completed';
  acknowledgment_id: string;
  employee_id: string;
  policy_id: string;
  distribution_id: string;
  organization_id: string;
  acknowledged_at: string;
  timestamp: string;
}
Idempotency key: (organization_id, acknowledgment_id)

hr_policy_distribution_created

Subscribers: PF-10 (notification fan-out)
Status: 📝 Planned
Payload:
{
  event_type: 'hr_policy_distribution_created';
  distribution_id: string;
  policy_id: string;
  policy_title: string;
  employee_ids: string[];
  deadline_date: string;
  organization_id: string;
  timestamp: string;
}
Idempotency key: (organization_id, distribution_id)

Consumed by HR-31

onboarding_completed (HR-03)

Publisher: HR-03 — see EVENT_CONTRACTS.md § HR-03
Status: ✅ Implemented (event); HR-31 handler 📝 Planned
Payload (existing):
{
  event_type: 'onboarding_completed';
  employee_id: string;
  onboarding_instance_id: string;
  completed_at: string;
  organization_id: string;
  timestamp: string;
}
Idempotency: Unique partial index on hr_policy_distributions(organization_id, source_onboarding_instance_id) where source_onboarding_instance_id IS NOT NULL and not soft-deleted.

Edge Functions — ⛔ ARCHIVED

These edge functions were planned for HR-31 but were never deployed. HR-31 was consolidated into GR-01 (migration 20260326034722). GR-01 handles policy distribution and reminders directly.
FunctionPurposeStatus
distribute-policyResolve targets, insert acknowledgment rows, emit distribution event⛔ Never deployed — superseded by GR-01
process-policy-remindersDaily: reminders, overdue transition, annual re-ack⛔ Never deployed — superseded by GR-01