> For the complete documentation index, see [llms.txt](https://pharaoh.so/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pharaoh.so/docs/use-pharaoh/pr-guard.md).

# PR Guard

PR Guard checks pull requests on Pro for new dead code, breaking signature changes, exact duplicates and blast radius, and posts an advisory GitHub check.

On Pro workspaces, PR Guard analyzes pull requests for new unreachable exports, breaking signature changes with existing callers, exact function duplicates and the blast radius of changed functions. It posts a GitHub check named Pharaoh PR Guard.

Findings are advisory by default: a neutral check reports them without blocking a merge. Analysis can be limited by the detected graph and supported syntax. Read the finding and relevant code before acting.

## When it runs

PR Guard runs when a pull request opens and on each push to it. It analyzes the pull request's branch against the mapped default branch, so its findings describe the change itself. Free workspaces get no PR Guard check.

## Read the check

The check's summary line says that all checks passed, or counts failures and warnings. Each finding sits under one of four sections:

* **Reachability**: new exported functions that no entry point reaches. A function that only tests call is reported here.
* **Breaking changes**: exported functions whose signature changed and that already have callers.
* **Duplication**: new functions identical to a function that already exists.
* **Blast radius**: each changed function's production callers, with the endpoints and cron jobs they reach.

## Tune it for your repository

Add `.pharaoh.yml` to the repository root. `entry_points` marks files whose exports are entry points, such as handlers a framework loads, and `allowed_orphans` excludes exports that are unused on purpose. PR Guard reads the file from the pull request's branch. See [declare an entry the detector cannot infer](/docs/use-pharaoh/troubleshooting.md#declare-an-entry-the-detector-cannot-infer) for the syntax.

## When the check doesn't run

* **“Pharaoh PR Guard temporarily unavailable”**: the analysis stopped because of a problem on Pharaoh's side. Push a new commit to run it again.
* **A “Pharaoh: repo being remapped” section in the details**: the repository is moving to a new map, so the analysis didn't run. It runs again on your next push.

Both post a neutral result and never block a merge.

[Check that a feature is connected](/docs/use-pharaoh/check-feature-wiring.md) explains how to review reachability findings alongside source and behavioral tests.

[Scope, entry configuration and troubleshooting](/docs/use-pharaoh/troubleshooting.md)
