AHJ Intelligence

How SunrAI builds a profile per AHJ — pass rates, contacts, interconnection timelines — and how Pip uses it to flag risky inspections before install day.

Updated4 min readbuddies

Pip's AHJ Intelligence skill watches every AHJ you work with, scores their pass rate, and flags risky inspections automatically. The data is also editable — your team's experience adds to the global picture.

What you'll learn

  • What an AHJ profile contains and where it comes from
  • How team-specific overrides layer on top of the global catalog
  • Pip's flagging behavior (autopilot — no approval needed)
  • What to do when Pip flags an AHJ on a project

AHJ profiles — global + team overrides

Every authority having jurisdiction (AHJ) lives in two tables:

LayerSourceWhat it holds
Global (ahj_profiles_global)Canonical catalog, seeded from a national dataset and updated centrallyName, state, jurisdiction type, default contact info, baseline pass-rate metrics
Team override (ahj_profiles)Your team's experience with this AHJField-level overrides that win over the global row

When the app reads an AHJ for one of your projects, it calls the ahj_effective() SQL function, which merges your overrides on top of the global row. The result: you see your team's truth without losing the rest of the global data.

This means your edits don't pollute other teams' data, and other teams' edits don't pollute yours.

What's in an AHJ profile

Open any permit and click the AHJ name to see the full profile:

  • Pass rate — aggregated from your team's permit + inspection history. The 80% threshold is derived, not stored; it's recomputed any time someone queries an AHJ's recent performance.
  • Typical interconnection window — based on a rolling 14-day median; surfaced as "expected timeline" on the permit detail
  • Utility contacts — primary contact, escalation contact, after-hours line if known
  • Common fail reasons — top 3 reasons inspections fail at this AHJ, ranked by frequency in your team's history
  • Playbook checklist — your team-specific notes on what passes here (this is where you add hard-won wisdom)
  • Permit status history — every permit your team has filed with this AHJ, with outcomes and timelines

Owners and Admins can edit any field; the override layer means edits are scoped to your team.

Pip's flagging behavior (autopilot)

Pip's AHJ Intelligence skill is an Autopilot — it flags risky AHJs without asking.

For every project with a target install date in the next 14 days, Pip checks the AHJ's recent inspection pass rate. If it's under 80% (with at least 3 historical inspections to be statistically meaningful), the project gets a "watch this AHJ" flag with the top fail reasons attached.

Where you see the flag

  • Project detail → Permits tab → AHJ block at the top shows the warning
  • Buddies activity feed → entries titled "Pip flagged AHJ ___ for [project]"
  • Buddies inbox → no. This is autopilot. It doesn't ask for approval.

Why no approval

The output is informational, not action. Pip doesn't change project state, doesn't send anything to anyone, doesn't reschedule. Crews and Quality Surveyors use the flag to over-prepare.

What to do when you see a flag

  1. Open the AHJ profile (link from the flag) for the fail-reason breakdown
  2. Review the playbook checklist for that AHJ's most common failures
  3. Brief the install crew at standup so they over-prep the documentation
  4. If the situation is already covered (e.g. customer hired a private inspector, or you've already added a redundant ground), mute the flag for this project so it doesn't sit on the dashboard

Adding to the AHJ knowledge base

When your team learns something — a specific inspector's quirk, a documentation requirement that isn't in the global guide, a contact who actually answers the phone — write it into the playbook checklist on the AHJ profile. This is your team's institutional memory for permits.

Other teams can't see it. But every PM and crew member on your team picks it up automatically the next time they touch a permit with that AHJ.

Verify it worked

  • Open a project with a permit at an AHJ that has > 3 historical inspections in your team
  • The AHJ block at the top of the Permits tab shows the pass rate and (if under 80%) the warning banner
  • The Buddies activity feed has a "Pip flagged AHJ ___" entry within minutes of an install being scheduled inside the 14-day window

Troubleshooting

"I see no flags at all." — Your team probably doesn't have 3+ inspections at any AHJ yet. The threshold filters out small-sample noise. Once you have history, flags will appear.

"The pass rate looks wrong." — Pull up the permit status history on the AHJ profile and check whether inspections are being logged correctly. The pass rate is derived from those rows; if they're missing or mis-tagged, the rate is wrong. Fix the underlying records and the rate recomputes on next read.

"I edited a field but the change didn't show up for my teammates." — The override saved successfully but your teammates may still have a cached profile in their session. Reload the page.