> ## 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.

# Performance Budget Enforcement — Integration

> Feature ID: PF-92 Status: \U0001F4CB Specification -performance-budget-enforcement.md Last Updated: 2026-03-23

**Feature ID:** PF-92\
**Status:** 📋 Specification\
**Spec:** [PF-92-performance-budget-enforcement.md](../../../specs/pf/specs/PF-92-performance-budget-enforcement.md)\
**Last Updated:** 2026-03-23

***

## Overview

PF-92 adds **CI-level** enforcement for frontend bundle sizes and (Phase 2) Lighthouse scores. It integrates with the **Vite build pipeline** and **GitHub Actions** only. It does **not** introduce runtime API contracts, events, or cross-core data flows. [PF-07](./error-handling-monitoring-integration.md) remains the owner of production Core Web Vitals and error monitoring; PF-92 complements that with **gates** before merge.

***

## Integration Points (from Spec)

| Dependency                                         | Pattern        | Purpose                                                                    |
| -------------------------------------------------- | -------------- | -------------------------------------------------------------------------- |
| Vite build output                                  | Build artifact | Source of truth for chunk sizes compared to `performance-budget.json`      |
| GitHub Actions (`build.yml` or dedicated workflow) | CI             | Run budget script post-build; optional PR comments                         |
| PF-07                                              | Reference      | Production performance monitoring; no required code coupling for Phase 1–2 |

***

## Lighthouse CI (Phase 2)

* **Routes** (must match spec): `/login`, `/dashboard`, `/patients`, `/schedule`
* **Gating:** Category minimums in `thresholds` (Performance 80, Accessibility 90, Best Practices 90) are blocking hard gates. Overall score bands (\<70 block, 70–79 advisory) are advisory only and do not override category minima.

## Platform / Build Integration

* **No Platform Integration Layer export** required for Phase 1–2 — scripts live under `scripts/` and run in CI.
* **No event contracts** — no `publishEvent` or pg\_notify.
* **No API contracts** — no new REST or Edge endpoints.
* **Tenant isolation:** N/A — tooling is repository-global, not per-organization.

***

## Boundary vs PF-52 and PF-07

| Spec      | Owns                                                         |
| --------- | ------------------------------------------------------------ |
| **PF-52** | Database query performance, slow-query logging, dashboards   |
| **PF-07** | Runtime monitoring, Sentry, production Web Vitals collection |
| **PF-92** | Bundle size budgets, Lighthouse CI, PR feedback, merge gates |

***

## Security & Compliance

* PR comments and CI logs must not include secrets, tokens, or customer data.
* No PHI — build metrics only.

***

## Related Docs

* [CROSS\_CORE\_INTEGRATIONS.md](./CROSS_CORE_INTEGRATIONS.md)
* [PF-07 Error Handling & Monitoring](./error-handling-monitoring-integration.md)
* [PF-52 Query Performance Monitoring](./query-performance-monitoring-integration.md)
