Version: 1.0.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Last Updated: 2025-12-31
Constitution Reference: Section 1.2 (Architecture & Module Boundaries) This document visualizes the dependency relationships between Platform Foundation and domain cores, showing integration points and architectural boundaries.
Dependency Rules
Hard Rules (Constitution Section 1.2)
-
Platform Foundation is the only shared base layer
- All cores depend on PF
- PF depends on none of the cores
-
Cores may NOT depend on each other
- No direct imports between cores
- No shared database tables between cores
- Integration via explicit contracts only
-
CL (Clinical) is architecturally downstream
- No core may depend on CL
- CL built on top of operational/financial backbone
Dependency Graph
Core Dependencies Detail
Platform Foundation (PF)
Dependencies: None (foundation layer) Provides:- Identity & Authentication (PF-01, PF-02)
- Multi-tenancy (Organizations, Sites)
- RBAC (Role-Based Access Control)
- Audit Logging (PF-04)
- Error Handling & Monitoring (PF-07)
- Platform Integration Layers:
- Forms Integration (PF-08)
- Notifications System (PF-10)
- Document Management (PF-11)
- Reporting Engine (PF-12)
Forms & Workflow (FW)
Dependencies: PF only- PF-01: Organizations & Sites
- PF-02: RBAC
- PF-04: Audit Logging
- PF-08: Forms Integration Layer (provides integration for other cores)
- Form Builder (FW-01)
- Form Submissions (FW-02)
- Automation Engine (FW-03)
- Exposes: Forms via Platform Integration Layer (PF-08)
- Publishes Events:
fw_form_submitted(consumed by FW-03)
Workforce & HRIS (HR)
Dependencies: PF only- PF-01: Organizations & Sites
- PF-02: RBAC
- PF-06: User Profiles
- PF-10: Notifications (credential expiration alerts)
- Employee Directory (HR-01)
- Credentialing & Compliance (HR-02)
- Onboarding/Offboarding (HR-03) - Planned
- Scheduling & Capacity (HR-04) - Planned
- Time & Attendance (HR-05) - Planned
- PTO & Leave (HR-06) - Planned
- Payroll Processing (HR-07) - Planned
- Publishes Events:
employee_created→ GR (policy assignments)employee_assigned_to_site→ RH (staff notifications)
- Exposes: Employee lookup API (RLS-enforced)
Recovery Housing & Operations (RH)
Dependencies: PF only- PF-01: Organizations & Sites
- PF-02: RBAC
- PF-08: Forms Integration (resident intake forms)
- PF-10: Notifications (admission alerts)
- Census & Beds (RH-01) - Planned
- Programs & Phases (RH-02) - Planned
- Safety Events (RH-03) - Planned
- Program Participation (RH-04) - Planned
- Discharge Planning (RH-05) - Planned
- Incident Management (RH-06) - Planned
- Compliance Tracking (RH-07) - Planned
- Outcomes & Reporting (RH-08) - Planned
- Publishes Events:
resident_admitted→ FA (creates billing account)resident_discharged→ FA (finalizes billing)bed_assigned→ HR (staff assignment notifications)
- Consumes Events:
payment_received← FA (updates resident status)
- Consumes Data:
- HR: Employee lookup (staff assignments)
- FA: Billing balance queries (via API)
Finance & Revenue (FA)
Dependencies: PF only- PF-01: Organizations & Sites
- PF-02: RBAC
- PF-04: Audit Logging (financial audit trail)
- PF-12: Reporting Engine (financial reports)
- Resident Subledger (FA-01) - Planned
- Billing & Invoicing (FA-02) - Planned
- Accounts Receivable (FA-03) - Planned
- Payment Processing (FA-04) - Planned
- General Ledger Integration (FA-05) - Planned
- Financial Reporting (FA-06) - Planned
- Publishes Events:
payment_received→ RH (updates resident status)invoice_generated→ PF-10 (notifications)
- Consumes Events:
resident_admitted← RH (creates billing account)resident_discharged← RH (finalizes billing)
- Exposes APIs:
/api/v1/fa/resident-balance(for RH queries)
Governance, Compliance & Learning (GR)
Dependencies: PF only- PF-01: Organizations & Sites
- PF-02: RBAC
- PF-08: Forms Integration (policy acknowledgments)
- PF-11: Document Management (policy storage)
- Policy Management (GR-01) - Planned
- Training & CEU Tracking (GR-02) - Planned
- Compliance Auditing (GR-03) - Planned
- Learning Management (GR-04) - Planned
- Consumes Events:
employee_created← HR (assigns default policies)
- Consumes Data:
- HR: Employee records (policy assignments)
Facilities, Inventory & Vendors (FM)
Dependencies: PF only- PF-01: Organizations & Sites
- PF-02: RBAC
- HR: Employee lookup (technicians)
- Work Order Management (FM-01) - Planned
- Inventory Management (FM-02) - Planned
- Vendor Management (FM-03) - Planned
- Maintenance Scheduling (FM-04) - Planned
- Consumes Data:
- HR: Employee lookup (technician assignments)
Clinical & EHR (CL)
Dependencies: PF only- PF-01: Organizations & Sites
- PF-02: RBAC
- PF-04: Audit Logging
- PF-08: Forms Integration (clinical assessments)
- PF-11: Document Management (clinical documents)
- Clinical Documentation (CL-01) - Future
- Orders & Prescriptions (CL-02) - Future
- Outcomes Tracking (CL-03) - Future
- Clinical Reporting (CL-04) - Future
- No cores depend on CL (architecturally downstream)
- Consumes Data:
- RH: Resident records (clinical context)
- HR: Employee records (clinical staff)
Integration Pattern Usage
Pattern 1: Platform Integration Layer
Used By:- PF-08 Forms: All cores use forms via platform layer
- PF-10 Notifications: All cores send notifications via platform layer
- PF-11 Documents: All cores manage documents via platform layer
@/platform/forms to embed resident intake forms
Pattern 2: Event-Based Integration
Used By:- RH → FA:
resident_admittedevent creates billing account - FA → RH:
payment_receivedevent updates resident status - HR → GR:
employee_createdevent assigns policies - HR → RH:
employee_assigned_to_siteevent notifies staff
Pattern 3: API Contracts
Used By:- FA → RH: Billing balance queries (synchronous)
- HR → RH: Employee lookup (synchronous)
/api/v1/fa/resident-balance to get current balance
Dependency Matrix
| Core | Depends On PF | Depends On FW | Depends On HR | Depends On RH | Depends On FA | Depends On GR | Depends On FM | Depends On CL |
|---|---|---|---|---|---|---|---|---|
| PF | - | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| FW | ✅ | - | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| HR | ✅ | ❌ | - | ❌ | ❌ | ❌ | ❌ | ❌ |
| RH | ✅ | ❌ | ❌ | - | ❌ | ❌ | ❌ | ❌ |
| FA | ✅ | ❌ | ❌ | ❌ | - | ❌ | ❌ | ❌ |
| GR | ✅ | ❌ | ❌ | ❌ | ❌ | - | ❌ | ❌ |
| FM | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | - | ❌ |
| CL | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | - |
- ✅ = Allowed dependency
- ❌ = Prohibited dependency
-
- = Self (not applicable)
Critical Path Analysis
Longest Dependency Chain
Path 1: HR → GR (via events)- HR-01 creates employee
- Publishes
employee_createdevent - GR-01 subscribes and assigns policies
- Length: 2 steps (HR → GR)
- RH-01 admits resident
- Publishes
resident_admittedevent - FA-01 creates billing account
- FA-01 receives payment
- Publishes
payment_receivedevent - RH-01 updates resident status
- Length: 4 steps (RH → FA → FA → RH)
Integration Contract Summary
Events Published
| Event | Publisher | Subscribers | Status |
|---|---|---|---|
fw_form_submitted | FW | FW-03 | ✅ Implemented |
resident_admitted | RH | FA | 📝 Planned |
resident_discharged | RH | FA | 📝 Planned |
payment_received | FA | RH | 📝 Planned |
employee_created | HR | GR | 📝 Planned |
employee_assigned_to_site | HR | RH | 📝 Planned |
APIs Exposed
| API | Provider | Consumers | Status |
|---|---|---|---|
/api/v1/fa/resident-balance | FA | RH | 📝 Planned |
| Employee Lookup (RLS-enforced) | HR | RH, FM | 📝 Planned |
Platform Integration Layers
| Layer | Provider | Consumers | Status |
|---|---|---|---|
| Forms Integration (PF-08) | PF | All cores | ✅ Complete |
| Notifications (PF-10) | PF | All cores | ✅ Complete |
| Document Management (PF-11) | PF | All cores | ✅ Complete |
| Reporting Engine (PF-12) | PF | All cores | ✅ Complete |
Architectural Principles
1. Core Isolation
Each core owns its domain completely:- Own database tables (prefixed:
hr_*,rh_*,fa_*) - Own business logic
- Own UI components
- No shared ownership
2. Integration via Contracts
Cores interact only through:- Platform Integration Layer (Pattern 1)
- Domain Events (Pattern 2)
- API Contracts (Pattern 3)
3. Downstream Clinical
CL (Clinical) is built last and depends on:- Stable operational backbone (RH)
- Stable financial backbone (FA)
- Stable workforce foundation (HR)
Evolution Strategy
Adding New Cores
When adding a new core:-
Identify PF Dependencies:
- Which PF features does it need?
- Are they complete?
-
Identify Integration Points:
- What events will it publish?
- What events will it consume?
- What APIs will it expose?
- What APIs will it consume?
-
Document Contracts:
- Add to
/docs/architecture/INTEGRATION_CONTRACTS.md - Update this dependency graph
- Update ROADMAP.md
- Add to
-
Verify No Core Dependencies:
- No imports from other cores
- No shared tables
- Only PF dependencies
Last Updated: 2025-11-24
Next Review: After HR-01 implementation (Q1 2026)