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.

Last Updated: 2026-04-12 Architecture Decision Records (ADRs) document significant architectural choices — the context, options considered, decision made, and consequences. They are permanent records; superseded ADRs are never deleted. Template: specs/_templates/ADR_TEMPLATE.md

When to Write an ADR

Write an ADR when:
  • Choosing between multiple viable approaches with significant trade-offs
  • The decision will outlast a single sprint or affect multiple cores
  • A new dependency, pattern, or cross-core boundary is introduced
  • Reversing the decision would take more than a sprint
Skip ADRs for: obvious single-option choices, reversible single-function decisions, or purely cosmetic changes.

ADR Index

#TitleStatusDateSummary
ADR-001Form Analytics ArchitectureAccepted2025-12-05FW-27 extends PF-09 rather than replacing it; two-tier form analytics architecture
ADR-002CL–PM Cross-Core Foreign KeysAccepted2026-02-25CL tables may reference pm_encounters.id via DB FK; all other cross-core refs use UUID columns only
ADR-003MCP PF-72 Phase 4Accepted2026-03-15MCP server baseline committed to .cursor/mcp.json (shadcn, fallow); user-local plugins for Supabase, Context7
ADR-004CL–FW Event PatternsProposed2026-03-01Clinical workflow event contract patterns between CL and FW cores (pending final acceptance)
ADR-005Cross-Core FK: PM PatientsAccepted2026-03-20HR core may reference pm_patients.id via UUID column only; no DB-level FK
ADR-006Cross-Core FK: HR EmployeesAccepted2026-03-20PM/CL cores reference hr_employees.id via UUID column; no DB-level FK
ADR-007Multi-Tenant via Supabase RLSAccepted2026-04-12All tenant isolation via Postgres RLS + organization_id; no application-layer sharding
ADR-008Vite SPA vs Next.js SSRAccepted2026-04-12Vite-based SPA chosen over Next.js for this ERP platform; PWA with Workbox for offline
ADR-009Biome as Primary FormatterAccepted2026-04-12Biome replaces Prettier + ESLint for formatting and import organization; ESLint retained for custom rules
ADR-010Core–PF Dependency BoundaryAccepted2026-04-12Domain cores depend only on Platform Foundation (PF); no direct core-to-core imports
ADR-011Edge Functions on DenoAccepted2026-04-12Supabase Edge Functions use Deno runtime; _shared/ for cross-function utilities
ADR-012PF-96 Jurisdiction Profile ArchitectureAccepted2026-04-12State Medicaid rules via jurisdiction profiles (PF-96); Arizona AHCCCS is the first profile, not a global default
ADR-013PWA StrategyAccepted2026-04-12Platform is a Progressive Web App with Workbox service worker; CacheFirst for assets, NetworkFirst for REST, NetworkOnly for auth
ADR-016Workspace packages overlayAccepted2026-04-22Per-package package.json under packages/ declares dependency surface; source files stay in src/ (no physical migration in Phase 2)
ADR-017PWA scoping under MicrofrontendsProposed2026-04-22Phase 3 amendment to ADR-013: the public zone disables its SW; only the authenticated zone owns scope /. Preserves today’s PWA install base unchanged
ADR-018TypeScript 7.0 (Go compiler) Evaluation and AdoptionProposed2026-04-23Adopt @typescript/native-preview (tsgo) as opt-in typecheck:fast now (validated: cold typecheck 478s → 53s, zero diagnostic delta). Cut over CI gate in Phase 2 once TS 7.0 reaches RC/GA and typescript-eslint peer range supports TS 7.x; use npm:@typescript/typescript6 alias to keep linter/audit scripts/ts-node working.
ADR-020Two-Phase Partition Strategy for Audit and Event TablesAccepted2026-05-13High-growth PF/FW audit/event tables use non-cutover shadow partition phase first, then explicit backfill/parity/cutover with retention runbook controls.

Process

  1. Propose: Create a new ADR file (next sequential number) from the template. Set status Proposed.
  2. Review: Open a PR; relevant stakeholders review. Add as PR checklist item when introducing new patterns.
  3. Accept: Merge the PR; set status Accepted. Update this index.
  4. Supersede: If a decision changes, write a new ADR that supersedes the old one. Update the old ADR’s status to Superseded by ADR-NNN.
Tip: Each ADR should take 10–30 minutes to write. If it takes longer, the decision likely needs to be split.